Skip to content

Commit 3907398

Browse files
Merge pull request #12 from boldsign/v-3.1.0
v3.1.0 is released
2 parents 7524d54 + 42cc97c commit 3907398

16 files changed

+473
-11
lines changed

src/BoldSign/Api/DocumentClient.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2563,6 +2563,11 @@ private static void ValidateSendProperties(SendForSign sendRequest)
25632563
{
25642564
throw new ApiException(422, ApiValidationMessages.InvalidBrandId);
25652565
}
2566+
2567+
if (sendRequest.TextTagDefinitions != null && sendRequest.TextTagDefinitions.Any(x => (x.Size != null && (x.Size.Width <= 0 || x.Size.Height <= 0))))
2568+
{
2569+
throw new ApiException(422, ApiValidationMessages.InvalidTextTagSize);
2570+
}
25662571
}
25672572

25682573
private static bool ValidateUri(string uri)

src/BoldSign/Api/FromRequestHelper.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ public static Dictionary<string, string> ConvertToFormRequest(SendForSign signRe
3434
localVarFormParams = ToFormParameter(localVarFormParams, signRequestDetails.CC.ToList(), nameof(signRequestDetails.CC));
3535
}
3636

37+
if (signRequestDetails.TextTagDefinitions != null)
38+
{
39+
localVarFormParams = ToFormParameter(localVarFormParams, signRequestDetails.TextTagDefinitions.ToList(), nameof(signRequestDetails.TextTagDefinitions));
40+
}
41+
3742
if (signRequestDetails.Labels != null)
3843
{
3944
var i = -1;
@@ -55,7 +60,28 @@ public static Dictionary<string, string> ConvertToFormRequest(SendForSign signRe
5560
localVarFormParams.Add($"{nameof(signRequestDetails.ReminderSettings)}.{nameof(signRequestDetails.ReminderSettings.ReminderCount)}", signRequestDetails.ReminderSettings.ReminderCount.ToString());
5661
}
5762

63+
if (signRequestDetails is IEmbeddedRequest embeddedRequest)
64+
{
65+
if (embeddedRequest.RedirectUrl != null)
66+
{
67+
localVarFormParams.Add(nameof(embeddedRequest.RedirectUrl), embeddedRequest.RedirectUrl.ToString());
68+
}
69+
70+
localVarFormParams.Add(nameof(embeddedRequest.ShowToolbar), embeddedRequest.ShowToolbar ? "true" : "false");
71+
localVarFormParams.Add(nameof(embeddedRequest.ShowSaveButton), embeddedRequest.ShowSaveButton ? "true" : "false");
72+
localVarFormParams.Add(nameof(embeddedRequest.ShowSendButton), embeddedRequest.ShowSendButton ? "true" : "false");
73+
localVarFormParams.Add(nameof(embeddedRequest.ShowPreviewButton), embeddedRequest.ShowPreviewButton ? "true" : "false");
74+
localVarFormParams.Add(nameof(embeddedRequest.ShowNavigationButtons), embeddedRequest.ShowNavigationButtons ? "true" : "false");
75+
localVarFormParams.Add(nameof(embeddedRequest.SendViewOption), embeddedRequest.SendViewOption.ToString());
76+
77+
if (embeddedRequest.SendLinkValidTill.HasValue)
78+
{
79+
localVarFormParams.Add(nameof(embeddedRequest.SendLinkValidTill), embeddedRequest.SendLinkValidTill.ToString());
80+
}
81+
}
82+
5883
localVarFormParams.Add(nameof(signRequestDetails.EnableSigningOrder), signRequestDetails.EnableSigningOrder ? "true" : "false");
84+
localVarFormParams.Add(nameof(signRequestDetails.UseTextTags), signRequestDetails.UseTextTags ? "true" : "false");
5985

6086
#pragma warning disable CS0618 // Type or member is obsolete
6187
localVarFormParams.Add(

src/BoldSign/Api/IDocumentClient.cs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,38 @@ public interface IDocumentClient : IApiAccessor
489489
/// <returns>Task of ApiResponse (DocumentCreated)</returns>
490490
Task<ApiResponse<DocumentCreated>> SendDocumentAsyncWithHttpInfo(SendForSign signRequestDetails);
491491

492+
/// <summary>
493+
/// Embedded sends the document and generates a URL to embedded that document into iframe.
494+
/// </summary>
495+
/// <exception cref="ApiException">Thrown when fails to make API call.</exception>
496+
/// <param name="sendRequest">The signRequestDetails.</param>
497+
/// <returns>EmbeddedSendCreated.</returns>
498+
EmbeddedSendCreated CreateEmbeddedRequestUrl(EmbeddedDocumentRequest sendRequest);
499+
500+
/// <summary>
501+
/// Embedded sends the document and generates a URL to embedded that document into iframe.
502+
/// </summary>
503+
/// <param name="sendRequest">The signRequestDetails.</param>
504+
/// <exception cref="ApiException">Thrown when fails to make API call.</exception>
505+
/// <returns>ApiResponse of EmbeddedSendCreated.</returns>
506+
ApiResponse<EmbeddedSendCreated> CreateEmbeddedRequestUrlWithHttpInfo(EmbeddedDocumentRequest sendRequest);
507+
508+
/// <summary>
509+
/// Generates a send URL which embeds document sending process into your application.
510+
/// </summary>
511+
/// <param name="sendRequest">The signRequestDetails.</param>
512+
/// <exception cref="ApiException">Thrown when fails to make API call.</exception>
513+
/// <returns>Task of EmbeddedSendCreated.</returns>
514+
Task<EmbeddedSendCreated> CreateEmbeddedRequestUrlAsync(EmbeddedDocumentRequest sendRequest);
515+
516+
/// <summary>
517+
/// Embedded sends the document and generates a URL to embedded that document into iframe.
518+
/// </summary>
519+
/// <param name="sendRequest">The signRequestDetails.</param>
520+
/// <exception cref="ApiException">Thrown when fails to make API call.</exception>
521+
/// <returns>Task of ApiResponse (EmbeddedSendCreated).</returns>
522+
Task<ApiResponse<EmbeddedSendCreated>> CreateEmbeddedRequestUrlAsyncWithHttpInfo(EmbeddedDocumentRequest sendRequest);
523+
492524
#endregion Asynchronous Operations
493525
}
494526
}

src/BoldSign/Api/ITemplateClient.cs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,38 @@ public interface ITemplateClient : IApiAccessor
138138
/// <returns>Task of ApiResponse (DocumentCreated)</returns>
139139
Task<ApiResponse<DocumentCreated>> SendUsingTemplateAsyncWithHttpInfo(SendForSignFromTemplate sendForSignFromTemplate = default);
140140

141+
/// <summary>
142+
/// Embedded send a document for signature using a template.
143+
/// </summary>
144+
/// <exception cref="ApiException">Thrown when fails to make API call.</exception>
145+
/// <param name="send">It contains page,page size and status details.</param>
146+
/// <returns>An ApiResponse (DocumentCreated).</returns>
147+
EmbeddedSendCreated CreateEmbeddedRequestUrl(EmbeddedTemplateRequest send = default);
148+
149+
/// <summary>
150+
/// Embedded send a document for signature using a template.
151+
/// </summary>
152+
/// <exception cref="ApiException">Thrown when fails to make API call.</exception>
153+
/// <param name="send">It contains page,page size and status details.</param>
154+
/// <returns>An ApiResponse (DocumentCreated).</returns>
155+
ApiResponse<EmbeddedSendCreated> CreateEmbeddedRequestUrlWithHttpInfo(EmbeddedTemplateRequest send = default);
156+
157+
/// <summary>
158+
/// Embedded send a document for signature using a template.
159+
/// </summary>
160+
/// <exception cref="ApiException">Thrown when fails to make API call.</exception>
161+
/// <param name="send">It contains page,page size and status details.</param>
162+
/// <returns>Task of ApiResponse (DocumentCreated).</returns>
163+
Task<EmbeddedSendCreated> CreateEmbeddedRequestUrlAsync(EmbeddedTemplateRequest send = default);
164+
165+
/// <summary>
166+
/// Generates a send URL using a template which embeds document sending process into your application.
167+
/// </summary>
168+
/// <exception cref="ApiException">Thrown when fails to make API call.</exception>
169+
/// <param name="send">It contains page,page size and status details.</param>
170+
/// <returns>Task of ApiResponse (DocumentCreated).</returns>
171+
Task<ApiResponse<EmbeddedSendCreated>> CreateEmbeddedRequestUrlAsyncWithHttpInfo(EmbeddedTemplateRequest send = default);
172+
141173
#endregion Asynchronous Operations
142174
}
143175
}

src/BoldSign/BoldSign.Api.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFrameworks>netstandard2.0;net452</TargetFrameworks>
4-
<FileVersion>3.0.0</FileVersion>
5-
<ProductVersion>3.0.0</ProductVersion>
4+
<FileVersion>3.1.0</FileVersion>
5+
<ProductVersion>3.1.0</ProductVersion>
66
<Copyright>Copyright 2001-2022 Syncfusion Inc</Copyright>
77
<AssemblyName>BoldSign.Api</AssemblyName>
88
<RootNamespace>BoldSign.Api</RootNamespace>

src/BoldSign/Model/DocumentSigner.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,6 @@ namespace BoldSign.Model
2525
[DataContract]
2626
public class DocumentSigner
2727
{
28-
/// <summary>
29-
/// Initializes a new instance of the <see cref="DocumentSigner" /> class.
30-
/// </summary>
31-
[JsonConstructor]
32-
protected DocumentSigner()
33-
{
34-
}
35-
3628
/// <summary>
3729
/// Initializes a new instance of the <see cref="DocumentSigner" /> class.
3830
/// </summary>

src/BoldSign/Model/EmbeddedDocumentRequest.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ public class EmbeddedDocumentRequest : SendForSign, IEmbeddedRequest
7070
[JsonProperty("showNavigationButtons")]
7171
public bool ShowNavigationButtons { get; set; } = true;
7272

73+
/// <summary>
74+
/// Gets or sets a value send link valid till.
75+
/// Maximum valid till is 180 days.
76+
/// Default is 30 days.
77+
/// </summary>
78+
[JsonProperty("sendLinkValidTill")]
79+
public DateTime? SendLinkValidTill { get; set; }
80+
7381
/// <summary>
7482
/// Returns the JSON string presentation of the object.
7583
/// </summary>

src/BoldSign/Model/EmbeddedTemplateRequest.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@ public class EmbeddedTemplateRequest : SendForSignFromTemplate, IEmbeddedRequest
2525
/// <param name="roles">Gets or sets the roles..</param>
2626
/// <param name="brandId">Gets or sets the brandId..</param>
2727
/// <param name="labels">Gets or sets the labels.</param>
28+
/// <param name="sendLinkValidTill">Gets or sets the sendLinkValidTill.</param>
2829
public EmbeddedTemplateRequest(
2930
string templateId = default,
3031
string title = default,
3132
string message = default,
3233
List<Roles> roles = default,
3334
string brandId = default,
34-
List<string> labels = default)
35+
List<string> labels = default,
36+
DateTime? sendLinkValidTill = default)
3537
{
3638
this.TemplateId = templateId;
3739
this.Title = title;
@@ -43,6 +45,7 @@ public EmbeddedTemplateRequest(
4345
this.Roles = roles;
4446
this.BrandId = brandId;
4547
this.Labels = labels;
48+
this.SendLinkValidTill = sendLinkValidTill;
4649
}
4750

4851
/// <summary>
@@ -87,6 +90,14 @@ public EmbeddedTemplateRequest(
8790
[JsonProperty("showNavigationButtons")]
8891
public bool ShowNavigationButtons { get; set; } = true;
8992

93+
/// <summary>
94+
/// Gets or sets a value send link valid till.
95+
/// Maximum valid till is 180 days.
96+
/// Default is 30 days.
97+
/// </summary>
98+
[JsonProperty("sendLinkValidTill")]
99+
public DateTime? SendLinkValidTill { get; set; }
100+
90101
/// <summary>
91102
/// Returns the JSON string presentation of the object.
92103
/// </summary>

src/BoldSign/Model/IEmbeddedRequest.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,12 @@ public interface IEmbeddedRequest
4545
/// Gets or sets a value indicating whether to show navigation buttons.
4646
/// </summary>
4747
public bool ShowNavigationButtons { get; set; }
48+
49+
/// <summary>
50+
/// Gets or sets a value send link valid till.
51+
/// Maximum valid till is 180 days.
52+
/// Default is 30 days.
53+
/// </summary>
54+
public DateTime? SendLinkValidTill { get; set; }
4855
}
4956
}

src/BoldSign/Model/SendForSign.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ namespace BoldSign.Model
1414
using System.Collections.Generic;
1515
using System.ComponentModel.DataAnnotations;
1616
using System.Runtime.Serialization;
17+
using BoldSign.Api.Model;
1718
using Newtonsoft.Json;
1819

1920
/// <summary>
@@ -110,5 +111,17 @@ public class SendForSign
110111
/// </summary>
111112
[JsonProperty("hideDocumentId")]
112113
public bool HideDocumentId { get; set; }
114+
115+
/// <summary>
116+
/// Gets or sets a value indicating whether to convert the text tags to form fields.
117+
/// </summary>
118+
[JsonProperty("useTextTags")]
119+
public bool UseTextTags { get; set; }
120+
121+
/// <summary>
122+
/// Gets or sets the text tags definitions declared in the list can be used in the document by using the definition ID.
123+
/// </summary>
124+
[JsonProperty("textTagDefinitions")]
125+
public List<TextTagDefinition> TextTagDefinitions { get; set; }
113126
}
114127
}

0 commit comments

Comments
 (0)