Skip to content

Commit 4f9b3de

Browse files
v4.7.0 is released
1 parent fe19eb6 commit 4f9b3de

13 files changed

+1039
-32
lines changed

src/BoldSign/Api/DocumentClient.cs

Lines changed: 561 additions & 0 deletions
Large diffs are not rendered by default.

src/BoldSign/Api/IDocumentClient.cs

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,53 @@ public interface IDocumentClient : IApiAccessor
449449
/// <returns>Task of ApiResponse</returns>
450450
Task<ApiResponse<object>> RemindDocumentAsyncWithHttpInfo(string documentId, List<string> receiverEmails, ReminderMessage reminderMessage = default);
451451

452+
/// <summary>
453+
/// Add Authentication to user.
454+
/// </summary>
455+
/// <exception cref="ApiException">Thrown when fails to make API call.</exception>
456+
/// <param name="documentId">DocumentId.</param>
457+
/// <param name="emailId">EmailID.</param>
458+
/// <param name="authenticationType">AuthenticationType.</param>
459+
/// <param name="signerOrder">SignerOrder.</param>
460+
/// <param name="newAccessCode">NewAccesscode.</param>
461+
void AddAuthentication(string documentId, string emailId, AuthenticationType authenticationType, int? signerOrder = default, string newAccessCode = "");
462+
463+
/// <summary>
464+
/// Add Authentication to user.
465+
/// </summary>
466+
/// <exception cref="ApiException">Thrown when fails to make API call.</exception>
467+
/// <param name="documentId">DocumentId.</param>
468+
/// <param name="emailId">EmailID.</param>
469+
/// <param name="authenticationType">AuthenticationType.</param>
470+
/// <param name="signerOrder">SignerOrder.</param>
471+
/// <param name="newAccessCode">NewAccesscode.</param>
472+
/// <returns>ApiResponse of Object(void).</returns>
473+
ApiResponse<object> AddAuthenticationWithHttpInfo(string documentId, string emailId, AuthenticationType authenticationType, int? signerOrder = default, string newAccessCode = "");
474+
475+
/// <summary>
476+
/// Add Authentication to user.
477+
/// </summary>
478+
/// <exception cref="ApiException">Thrown when fails to make API call.</exception>
479+
/// <param name="documentId">DocumentId.</param>
480+
/// <param name="emailId">EmailID.</param>
481+
/// <param name="authenticationType">AuthenticationType.</param>
482+
/// <param name="signerOrder">SignerOrder.</param>
483+
/// <param name="newAccessCode">NewAccesscode.</param>
484+
/// <returns>AddAuthentication.</returns>
485+
Task AddAuthenticationAsync(string documentId, string emailId, AuthenticationType authenticationType, int? signerOrder = default, string newAccessCode = "");
486+
487+
/// <summary>
488+
/// Add Authentication to user.
489+
/// </summary>
490+
/// <exception cref="ApiException">Thrown when fails to make API call.</exception>
491+
/// <param name="documentId">DocumentId.</param>
492+
/// <param name="emailId">EmailID.</param>
493+
/// <param name="authenticationType">AuthenticationType.</param>
494+
/// <param name="signerOrder">SignerOrder.</param>
495+
/// <param name="newAccessCode">NewAccesscode.</param>
496+
/// <returns>ApiResponse of Object(AddAuthentication).</returns>
497+
Task<ApiResponse<object>> AddAuthenticationAsyncWithHttpInfo(string documentId, string emailId, AuthenticationType authenticationType, int? signerOrder = default, string newAccessCode = "");
498+
452499
/// <summary>
453500
/// Revoke the document with the given document ID.
454501
/// </summary>
@@ -521,6 +568,60 @@ public interface IDocumentClient : IApiAccessor
521568
/// <returns>Task of ApiResponse (EmbeddedSendCreated).</returns>
522569
Task<ApiResponse<EmbeddedSendCreated>> CreateEmbeddedRequestUrlAsyncWithHttpInfo(EmbeddedDocumentRequest sendRequest);
523570

571+
/// <summary>
572+
/// Remove Authentication to user.
573+
/// </summary>
574+
/// <exception cref="ApiException">Thrown when fails to make API call.</exception>
575+
/// <param name="documentId">DocumentId.</param>
576+
/// <param name="emailId">EmailID.</param>
577+
/// <param name="signerOrder">SignerOrder.</param>
578+
void RemoveAuthentication(string documentId, string emailId, int? signerOrder = default);
579+
580+
/// <summary>
581+
/// Remove Authentication to user.
582+
/// </summary>
583+
/// <remarks>
584+
/// </remarks>
585+
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
586+
/// <param name="documentId">Gets or sets the document id.</param>
587+
/// <param name="emailId">Gets or sets the signer email.</param>
588+
/// <param name="zOrder">
589+
/// Gets or sets the signer&#39;s order. When signer order is enabled for a document, this order is
590+
/// used to target that particular order with given signer email. (optional)
591+
/// </param>
592+
/// <returns>ApiResponse of Object(void)</returns>
593+
ApiResponse<object> RemoveAuthenticationWithHttpInfo(string documentId, string emailId, int? signerOrder = default);
594+
595+
/// <summary>
596+
/// Remove Authentication to user.
597+
///</summary>
598+
/// <remarks>
599+
/// </remarks>
600+
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
601+
/// <param name="documentId">Gets or sets the document id.</param>
602+
/// <param name="emailId">Gets or sets the signer email.</param>
603+
/// <param name="signerOrder">
604+
/// Gets or sets the signer&#39;s order. When signer order is enabled for a document, this order is
605+
/// used to target that particular order with given signer email. (optional)
606+
/// </param>
607+
/// <returns>Task of void</returns>
608+
Task RemoveAuthenticationAsync(string documentId, string emailId, int? signerOrder = default);
609+
610+
/// <summary>
611+
/// Remove Authentication to user.
612+
/// </summary>
613+
/// <remarks>
614+
/// </remarks>
615+
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
616+
/// <param name="documentId">Gets or sets the document id.</param>
617+
/// <param name="emailId">Gets or sets the signer email.</param>
618+
/// <param name="signerOrder">
619+
/// Gets or sets the signer&#39;s order. When signer order is enabled for a document, this order is
620+
/// used to target that particular order with given signer email. (optional)
621+
/// </param>
622+
/// <returns>Task of ApiResponse</returns>
623+
Task<ApiResponse<object>> RemoveAuthenticationAsyncWithHttpInfo(string documentId, string emailId, int? signerOrder = default);
624+
524625
#endregion Asynchronous Operations
525626
}
526627
}

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>4.6.0</FileVersion>
5-
<ProductVersion>4.6.0</ProductVersion>
4+
<FileVersion>4.7.0</FileVersion>
5+
<ProductVersion>4.7.0</ProductVersion>
66
<Copyright>Copyright 2001-2022 Syncfusion Inc</Copyright>
77
<AssemblyName>BoldSign.Api</AssemblyName>
88
<RootNamespace>BoldSign.Api</RootNamespace>
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
// <copyright file="AddAuthenticationAccessCodeDetails.cs" company="Syncfusion Inc">
2+
// Copyright (c) Syncfusion Inc. All rights reserved.
3+
// </copyright>
4+
5+
/*
6+
* BoldSign API
7+
*
8+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
9+
*
10+
* The version of the OpenAPI document: 1
11+
*
12+
* Generated by: https://github.com/openapitools/openapi-generator.git
13+
*/
14+
15+
namespace BoldSign.Model
16+
{
17+
using System.ComponentModel.DataAnnotations;
18+
using System.IO;
19+
using System.Runtime.Serialization;
20+
using BoldSign.Api.Resources;
21+
using Newtonsoft.Json;
22+
23+
/// <summary>
24+
/// The access code model.
25+
/// </summary>
26+
[DataContract]
27+
public class AddAuthenticationAccessCodeDetails
28+
{
29+
/// <summary>
30+
/// Initializes a new instance of the <see cref="AddAuthenticationAccessCodeDetails" /> class.
31+
/// </summary>
32+
/// <param name="emailId">Gets or sets the emailId.</param>
33+
/// <param name="order">Gets or sets the zOrder.</param>
34+
/// <param name="accessCode">Gets or sets the access code.</param>
35+
/// <param name="authenticationType">Gets or sets the authentication type.</param>
36+
public AddAuthenticationAccessCodeDetails(string emailId, int? order, string accessCode = "", AuthenticationType authenticationType = default)
37+
{
38+
// to ensure "accessCode" is required (not null) for AuthenticationType AccessCode.
39+
if (string.IsNullOrEmpty(accessCode) && authenticationType == AuthenticationType.AccessCode)
40+
{
41+
throw new InvalidDataException(ApiValidationMessages.AccessCodePropertyRequired);
42+
}
43+
44+
// to ensure "accessCode" is not required for AuthenticationType EmailOTP.
45+
if (!string.IsNullOrEmpty(accessCode) && authenticationType == AuthenticationType.EmailOTP)
46+
{
47+
throw new InvalidDataException(ApiValidationMessages.AccessCodePropertyNoRequired);
48+
}
49+
50+
this.EmailId = emailId;
51+
this.Order = order;
52+
this.AccessCode = accessCode;
53+
this.AuthenticationType = authenticationType;
54+
}
55+
56+
/// <summary>
57+
/// Gets or sets the signer email.
58+
/// </summary>
59+
[Required]
60+
[DataMember(Name = "emailId", EmitDefaultValue = true)]
61+
public string EmailId { get; set; }
62+
63+
/// <summary>
64+
/// Gets or sets the ZOrder.
65+
/// </summary>
66+
[Range(1, 50)]
67+
[DataMember(Name = "order", EmitDefaultValue = true)]
68+
public int? Order { get; set; }
69+
70+
/// <summary>
71+
/// Gets or sets the access code.
72+
/// </summary>
73+
/// <value>Gets the value of access code.</value>
74+
[DataMember(Name = "accessCode", EmitDefaultValue = true)]
75+
public string AccessCode { get; set; }
76+
77+
/// <summary>
78+
/// Gets or sets the authenticationType.
79+
/// </summary>
80+
[Required]
81+
[DataMember(Name = "authenticationType", EmitDefaultValue = true)]
82+
public AuthenticationType AuthenticationType { get; set; }
83+
84+
/// <summary>
85+
/// Returns the JSON string presentation of the object.
86+
/// </summary>
87+
/// <returns>JSON string presentation of the object.</returns>
88+
public virtual string ToJson() => JsonConvert.SerializeObject(this, Formatting.Indented);
89+
}
90+
}

src/BoldSign/Model/AuditAction.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,5 +217,11 @@ public enum AuditAction
217217
/// </summary>
218218
[EnumMember(Value = "EditRecipient")]
219219
EditRecipient = 33,
220+
221+
/// <summary>
222+
/// Enum AuthenticationAdded for value: AuthenticationAdded
223+
/// </summary>
224+
[EnumMember(Value = "AuthenticationAdded")]
225+
AuthenticationAdded = 34,
220226
}
221227
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// <copyright file="AuthenticationType.cs" company="Syncfusion Inc">
2+
// Copyright (c) Syncfusion Inc. All rights reserved.
3+
// </copyright>
4+
5+
namespace BoldSign.Model
6+
{
7+
using System.Runtime.Serialization;
8+
using Newtonsoft.Json;
9+
using Newtonsoft.Json.Converters;
10+
11+
/// <summary>
12+
/// AuthenticationType.
13+
/// </summary>
14+
[JsonConverter(typeof(StringEnumConverter))]
15+
public enum AuthenticationType
16+
{
17+
/// <summary>
18+
/// Represents EmailOTP only.
19+
/// </summary>
20+
[EnumMember(Value = "EmailOTP")]
21+
EmailOTP = 1,
22+
23+
/// <summary>
24+
/// Represents AccessCode only.
25+
/// </summary>
26+
[EnumMember(Value = "AccessCode")]
27+
AccessCode = 2,
28+
}
29+
}

src/BoldSign/Model/DocumentFormFields.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ public partial class DocumentFormFields
5353
/// <param name="imageInfo">Gets or sets the imageField.</param>
5454
/// <param name="attachmentInfo">Gets or sets the attachmentField.</param>
5555
/// <param name="editableDateFieldSettings">Gets or sets the editableDateFieldSettings.</param>
56-
public DocumentFormFields(string id = default(string), string type = default(string), string value = default(string), string font = default(string), bool? isRequired = default(bool?), float? lineHeight = default(float?), float? fontSize = default(float?), string fontColor = default(string), bool? isUnderline = default(bool?), bool? isItalic = default(bool?), bool? isBold = default(bool?), string placeholder = default(string), string dateFormat = default(string), ValidationType validationType = default(ValidationType), string validationCustomRegex = default(string), string validationCustomRegexMessage = default(string), ImageInfo imageInfo = default(ImageInfo), AttachmentInfo attachmentInfo = default(AttachmentInfo), EditableDateFieldSettings editableDateFieldSettings = default(EditableDateFieldSettings))
56+
/// <param name="hyperlinkText">Gets or sets the hyperlinkText.</param>
57+
public DocumentFormFields(string id = default(string), string type = default(string), string value = default(string), string font = default(string), bool? isRequired = default(bool?), float? lineHeight = default(float?), float? fontSize = default(float?), string fontColor = default(string), bool? isUnderline = default(bool?), bool? isItalic = default(bool?), bool? isBold = default(bool?), string placeholder = default(string), string dateFormat = default(string), ValidationType validationType = default(ValidationType), string validationCustomRegex = default(string), string validationCustomRegexMessage = default(string), ImageInfo imageInfo = default(ImageInfo), AttachmentInfo attachmentInfo = default(AttachmentInfo), EditableDateFieldSettings editableDateFieldSettings = default(EditableDateFieldSettings), string hyperlinkText = default(string))
5758
{
5859
this.Id = id;
5960
this.Type = type;
@@ -74,6 +75,7 @@ public partial class DocumentFormFields
7475
this.ImageInfo = imageInfo;
7576
this.AttachmentInfo = attachmentInfo;
7677
this.EditableDateFieldSettings = editableDateFieldSettings;
78+
this.HyperlinkText = hyperlinkText;
7779
}
7880

7981
/// <summary>
@@ -210,6 +212,13 @@ public partial class DocumentFormFields
210212
[DataMember(Name = "editableDateFieldSettings", EmitDefaultValue = false)]
211213
public EditableDateFieldSettings EditableDateFieldSettings { get; set; }
212214

215+
/// <summary>
216+
/// Gets or sets the element HyperlinkText.
217+
/// </summary>
218+
/// <value>Gets the value of element HyperlinkText.</value>
219+
[DataMember(Name = "hyperlinkText", EmitDefaultValue = false)]
220+
public string HyperlinkText { get; set; }
221+
213222
/// <summary>
214223
/// Returns the JSON string presentation of the object
215224
/// </summary>

src/BoldSign/Model/FieldType.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,11 @@ public enum FieldType
8080
/// </summary>
8181
[EnumMember(Value = "EditableDate")]
8282
EditableDate = 10,
83+
84+
/// <summary>
85+
/// Enum Hyperlink for value: Hyperlink
86+
/// </summary>
87+
[EnumMember(Value = "Hyperlink")]
88+
Hyperlink = 11,
8389
}
8490
}

src/BoldSign/Model/FormField.cs

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ namespace BoldSign.Model
1616
using System.IO;
1717
using System.Runtime.Serialization;
1818
using System.Text;
19+
using System.Text.RegularExpressions;
1920
using BoldSign.Api.Model;
2021
using BoldSign.Api.Resources;
2122
using Newtonsoft.Json;
@@ -105,7 +106,8 @@ public FormField(string name = default, FieldType type = default, int pageNumber
105106
/// <param name="attachmentInfo">Gets or sets the attachmentInfo.</param>
106107
/// <param name="imageInfo">Gets or sets the imageInfo.</param>
107108
/// <param name="editableDateFieldSettings">Gets or sets the editableDateFieldSettings.</param>
108-
public FormField(FieldType type = default, int pageNumber = default, Rectangle bounds = default, bool isRequired = default, string value = default, FontFamily font = FontFamily.Helvetica, int fontSize = default, string fontHexColor = default, bool isBoldFont = default, bool isItalicFont = default, bool isUnderLineFont = default, int lineHeight = default, int characterLimit = default, string id = default, AttachmentInfo attachmentInfo = default(AttachmentInfo), ImageInfo imageInfo = default(ImageInfo), EditableDateFieldSettings editableDateFieldSettings = default(EditableDateFieldSettings))
109+
/// <param name="hyperlinkText">Gets or sets the hyperlinkText.</param>
110+
public FormField(FieldType type = default, int pageNumber = default, Rectangle bounds = default, bool isRequired = default, string value = default, FontFamily font = FontFamily.Helvetica, int fontSize = default, string fontHexColor = default, bool isBoldFont = default, bool isItalicFont = default, bool isUnderLineFont = default, int lineHeight = default, int characterLimit = default, string id = default, AttachmentInfo attachmentInfo = default(AttachmentInfo), ImageInfo imageInfo = default(ImageInfo), EditableDateFieldSettings editableDateFieldSettings = default(EditableDateFieldSettings), string hyperlinkText = default)
109111
{
110112
// to ensure "fieldType" is required (not null)
111113
if (type == null)
@@ -141,6 +143,7 @@ public FormField(string name = default, FieldType type = default, int pageNumber
141143
this.Font = font;
142144
this.FontSize = fontSize;
143145
this.Id = id;
146+
this.HyperlinkText = hyperlinkText;
144147
if (type == FieldType.Attachment && attachmentInfo == null)
145148
{
146149
throw new InvalidDataException(ApiValidationMessages.AttachmentInformationRequired);
@@ -159,6 +162,31 @@ public FormField(string name = default, FieldType type = default, int pageNumber
159162
}
160163

161164
this.EditableDateFieldSettings = editableDateFieldSettings;
165+
166+
if (type == FieldType.Hyperlink)
167+
{
168+
if (string.IsNullOrEmpty(hyperlinkText) && string.IsNullOrEmpty(value))
169+
{
170+
throw new InvalidDataContractException(ApiValidationMessages.BothHyperlinkFieldsRequired);
171+
}
172+
173+
if (string.IsNullOrEmpty(hyperlinkText) && !string.IsNullOrEmpty(value))
174+
{
175+
throw new InvalidDataContractException(ApiValidationMessages.HyperlinkLabelFieldsRequired);
176+
}
177+
178+
if (!string.IsNullOrEmpty(hyperlinkText) && string.IsNullOrEmpty(value))
179+
{
180+
throw new InvalidDataContractException(ApiValidationMessages.HyperlinkValueFieldsRequired);
181+
}
182+
183+
string regex = @"(http|https)://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?";
184+
var isValid = Regex.IsMatch(value, regex);
185+
if (!isValid)
186+
{
187+
throw new InvalidDataContractException(ApiValidationMessages.EnterValidURL);
188+
}
189+
}
162190
}
163191

164192
/// <summary>
@@ -288,6 +316,13 @@ public virtual FieldType Type
288316
[DataMember(Name = "editableDateFieldSettings", EmitDefaultValue = false)]
289317
public EditableDateFieldSettings EditableDateFieldSettings { get; set; }
290318

319+
/// <summary>
320+
/// Gets or sets the HyperlinkText to be set to the form field (if required).
321+
/// </summary>
322+
/// <value>Gets or sets the HyperlinkText.</value>
323+
[DataMember(Name = "hyperlinkText", EmitDefaultValue = true)]
324+
public string HyperlinkText { get; set; }
325+
291326
/// <summary>
292327
/// Returns the JSON string presentation of the object
293328
/// </summary>

0 commit comments

Comments
 (0)