Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/BoldSign/Api/DocumentClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2536,9 +2536,14 @@ private static void ValidateSendProperties(SendForSign sendRequest)
}

// verify the required parameter 'title' is set
if (sendRequest.Title == null)
if (string.IsNullOrEmpty(sendRequest.Title) && (sendRequest.DocumentInfo == null || !sendRequest.DocumentInfo.Any()))
{
throw new ApiException(400, ApiValidationMessages.TitleIsSet);
throw new ApiException(422, ApiValidationMessages.TitleOrDocumentInfoIsRequired);
}

if (!string.IsNullOrEmpty(sendRequest.Title) && sendRequest.DocumentInfo != null && sendRequest.DocumentInfo.Any())
{
throw new ApiException(422, ApiValidationMessages.SameProperty);
}

// verify the required parameter 'signers' is set
Expand Down
5 changes: 5 additions & 0 deletions src/BoldSign/Api/FromRequestHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ public static Dictionary<string, string> ConvertToFormRequest(SendForSign signRe
localVarFormParams = ToFormParameter(localVarFormParams, signRequestDetails.CC.ToList(), nameof(signRequestDetails.CC));
}

if (signRequestDetails.DocumentInfo != null)
{
localVarFormParams = ToFormParameter(localVarFormParams, signRequestDetails.DocumentInfo.ToList(), nameof(signRequestDetails.DocumentInfo));
}

if (signRequestDetails.TextTagDefinitions != null)
{
localVarFormParams = ToFormParameter(localVarFormParams, signRequestDetails.TextTagDefinitions.ToList(), nameof(signRequestDetails.TextTagDefinitions));
Expand Down
65 changes: 65 additions & 0 deletions src/BoldSign/Model/DocumentInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// <copyright file="DocumentInfo.cs" company="Syncfusion Inc">
// Copyright (c) Syncfusion Inc. All rights reserved.
// </copyright>

/*
* BoldSign API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1
*
* Generated by: https://github.com/openapitools/openapi-generator.git
*/

namespace BoldSign.Model
{
using System.Runtime.Serialization;
using Newtonsoft.Json;

/// <summary>
/// The document information include the language, document title and document description.
/// </summary>
[DataContract]
public class DocumentInfo
{
/// <summary>
/// Initializes a new instance of the <see cref="DocumentInfo" /> class.
/// </summary>
/// <param name="language">Gets or sets the language. (required).</param>
/// <param name="title">Gets or sets the title.</param>
/// <param name="description">Gets or sets the descriptiondescription.</param>
public DocumentInfo(Languages language = Languages.English, string title = default, string description = default)
{
this.Language = language;
this.Title = title;
this.Description = description;
}

/// <summary>
/// Gets or sets the language of the document.
/// </summary>
[DataMember(Name = "language", EmitDefaultValue = true)]
public Languages Language { get; set; }

/// <summary>
/// Gets or sets the title.
/// </summary>
/// <value>Gets or sets the Title.</value>
[DataMember(Name = "title", EmitDefaultValue = false)]
public string Title { get; set; }

/// <summary>
/// Gets or sets the description.
/// </summary>
/// <value>Gets or sets the Description.</value>
[DataMember(Name = "description", EmitDefaultValue = false)]
public string Description { get; set; }

/// <summary>
/// Returns the JSON string presentation of the object.
/// </summary>
/// <returns>JSON string presentation of the object.</returns>
public virtual string ToJson() => JsonConvert.SerializeObject(this, Formatting.Indented);
}
}
11 changes: 10 additions & 1 deletion src/BoldSign/Model/DocumentSigner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ public class DocumentSigner
/// <param name="signerType">signerType.</param>
/// <param name="signerRole">Gets or sets the signer role..</param>
/// <param name="formFields">Gets or sets the formFields..</param>
public DocumentSigner(string name, string emailAddress, string privateMessage = default, string authenticationCode = default, int signerOrder = default, bool enableEmailOTP = default, SignerType signerType = BoldSign.Model.SignerType.Signer, List<FormField> formFields = default(List<FormField>))
/// <param name="language">Gets or sets the Language.</param>
public DocumentSigner(string name, string emailAddress, string privateMessage = default, string authenticationCode = default, int signerOrder = default, bool enableEmailOTP = default, SignerType signerType = BoldSign.Model.SignerType.Signer, List<FormField> formFields = default(List<FormField>), Languages language = Languages.English)
{
// to ensure "name" is required (not null)
if (string.IsNullOrEmpty(name))
Expand All @@ -61,6 +62,7 @@ public class DocumentSigner
this.EnableEmailOTP = enableEmailOTP;
this.SignerType = signerType;
this.FormFields = formFields;
this.Language = language;
}

/// <summary>
Expand Down Expand Up @@ -118,6 +120,13 @@ public class DocumentSigner
[DataMember(Name = "formFields", EmitDefaultValue = false)]
public List<FormField> FormFields { get; set; }

/// <summary>
/// Gets or sets the signer language.
/// </summary>
/// <value>Gets or sets the language of the signer.</value>
[DataMember(Name = "language", EmitDefaultValue = true)]
public Languages Language { get; set; }

/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
Expand Down
5 changes: 4 additions & 1 deletion src/BoldSign/Model/EmbeddedTemplateRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ public class EmbeddedTemplateRequest : SendForSignFromTemplate, IEmbeddedRequest
/// <param name="brandId">Gets or sets the brandId..</param>
/// <param name="labels">Gets or sets the labels.</param>
/// <param name="sendLinkValidTill">Gets or sets the sendLinkValidTill.</param>
/// <param name="documentInfo">Gets or sets the send documentInfo.</param>
public EmbeddedTemplateRequest(
string templateId = default,
string title = default,
string message = default,
List<Roles> roles = default,
string brandId = default,
List<string> labels = default,
DateTime? sendLinkValidTill = default)
DateTime? sendLinkValidTill = default,
IEnumerable<DocumentInfo> documentInfo = default)
{
this.TemplateId = templateId;
this.Title = title;
Expand All @@ -46,6 +48,7 @@ public EmbeddedTemplateRequest(
this.BrandId = brandId;
this.Labels = labels;
this.SendLinkValidTill = sendLinkValidTill;
this.DocumentInfo = documentInfo;
}

/// <summary>
Expand Down
27 changes: 27 additions & 0 deletions src/BoldSign/Model/Languages.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// <copyright file="Languages.cs" company="Syncfusion Inc">
// Copyright (c) Syncfusion Inc. All rights reserved.
// </copyright>

namespace BoldSign.Model
{
/// <summary>
/// Multiple Language enum.
/// </summary>
public enum Languages
{
/// <summary>
/// English.
/// </summary>
English = 1,

/// <summary>
/// Spanish.
/// </summary>
Spanish = 2,

/// <summary>
/// German.
/// </summary>
German = 3,
}
}
11 changes: 10 additions & 1 deletion src/BoldSign/Model/Roles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ public class Roles
/// <param name="signerType">signerType.</param>
/// <param name="formFields">Gets or sets document Form fields such as Sign, Checkbox, Radio buttons etc..</param>
/// <param name="existingFormFields">Gets or sets value for the existing Form fields..</param>
public Roles(int roleIndex = default, string signerName = default, string signerEmail = default, int signerOrder = default(int), string signerRole = default, string privateMessage = default, string authenticationCode = default, SignerType? signerType = default, bool enableEmailOTP = default, List<FormField> formFields = default(List<FormField>), List<ExistingFormField> existingFormFields = default(List<ExistingFormField>))
/// <param name="language">Gets or sets the Language.</param>
public Roles(int roleIndex = default, string signerName = default, string signerEmail = default, int signerOrder = default(int), string signerRole = default, string privateMessage = default, string authenticationCode = default, SignerType? signerType = default, bool enableEmailOTP = default, List<FormField> formFields = default(List<FormField>), List<ExistingFormField> existingFormFields = default(List<ExistingFormField>), Languages language = Languages.English)
{
this.SignerName = signerName;
this.SignerEmail = signerEmail;
Expand All @@ -52,6 +53,7 @@ public class Roles
this.SignerType = signerType;
this.FormFields = formFields;
this.ExistingFormFields = existingFormFields;
this.Language = language;
}

/// <summary>
Expand Down Expand Up @@ -131,6 +133,13 @@ public class Roles
[DataMember(Name = "existingFormFields", EmitDefaultValue = false)]
public List<ExistingFormField> ExistingFormFields { get; set; }

/// <summary>
/// Gets or sets the signer language.
/// </summary>
/// <value>Gets or sets the language of the signer.</value>
[DataMember(Name = "language", EmitDefaultValue = true)]
public Languages Language { get; set; }

/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
Expand Down
7 changes: 6 additions & 1 deletion src/BoldSign/Model/SendForSign.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public class SendForSign
/// <summary>
/// Gets or sets title for the signature request.
/// </summary>
[Required]
[JsonProperty("title")]
public string Title { get; set; }

Expand Down Expand Up @@ -123,5 +122,11 @@ public class SendForSign
/// </summary>
[JsonProperty("textTagDefinitions")]
public List<TextTagDefinition> TextTagDefinitions { get; set; }

/// <summary>
/// Gets or sets a documentInfo.
/// </summary>
[JsonProperty("documentInfo")]
public IEnumerable<DocumentInfo> DocumentInfo { get; set; }
}
}
11 changes: 10 additions & 1 deletion src/BoldSign/Model/SendForSignFromTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class SendForSignFromTemplate
/// <param name="reminderSettings">Gets or sets the reminderSettings.</param>
/// <param name="cc">Gets or sets the cc.</param>
/// <param name="expiryDays">Gets or sets the expiryDays.</param>
/// <param name="documentInfo">Gets or sets the documentInfo.</param>
public SendForSignFromTemplate(
string templateId = default,
string title = default,
Expand All @@ -49,7 +50,8 @@ public SendForSignFromTemplate(
bool hideDocumentId = default,
ReminderSettings reminderSettings = default,
IEnumerable<DocumentCC> cc = default,
int expiryDays = 60)
int expiryDays = 60,
IEnumerable<DocumentInfo> documentInfo = default)
{
this.TemplateId = templateId;
this.Title = title;
Expand All @@ -66,6 +68,7 @@ public SendForSignFromTemplate(
this.ReminderSettings = reminderSettings;
this.CC = cc;
this.ExpiryDays = expiryDays;
this.DocumentInfo = documentInfo;
}

/// <summary>
Expand Down Expand Up @@ -139,6 +142,12 @@ public SendForSignFromTemplate(
[DataMember(Name = "expiryDays", EmitDefaultValue = true)]
public int ExpiryDays { get; set; } = 60;

/// <summary>
/// Gets or sets a documentInfo.
/// </summary>
[JsonProperty("documentInfo")]
public IEnumerable<DocumentInfo> DocumentInfo { get; set; }

/// <summary>
/// Returns the JSON string presentation of the object.
/// </summary>
Expand Down
21 changes: 15 additions & 6 deletions src/BoldSign/Resources/ApiValidationMessages.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions src/BoldSign/Resources/ApiValidationMessages.resx
Original file line number Diff line number Diff line change
Expand Up @@ -141,18 +141,21 @@
<data name="PageNumberRquired" xml:space="preserve">
<value>pageNumber is a required property for FormField and cannot be null</value>
</data>
<data name="SameProperty" xml:space="preserve">
<value>Both title and the document information cannot be present for a single document.</value>
</data>
<data name="SignersIsSet" xml:space="preserve">
<value>Missing required parameter 'signers' when calling DocumentApi-&gt;SendDocument</value>
</data>
<data name="TemplateIdNull" xml:space="preserve">
<value>Parameter {nameof(sendForSignFromTemplate.TemplateId)} should be null or empty</value>
</data>
<data name="TitleIsSet" xml:space="preserve">
<value>Missing required parameter 'title' when calling DocumentApi-&gt;SendDocument</value>
</data>
<data name="TitleLengthExceeds" xml:space="preserve">
<value>The title exceeds the limit of 256 characters</value>
</data>
<data name="TitleOrDocumentInfoIsRequired" xml:space="preserve">
<value>Title or Document Information of the document is required.</value>
</data>
<data name="ValidUrl" xml:space="preserve">
<value>Please provide valid file URL</value>
</data>
Expand Down