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
561 changes: 561 additions & 0 deletions src/BoldSign/Api/DocumentClient.cs

Large diffs are not rendered by default.

101 changes: 101 additions & 0 deletions src/BoldSign/Api/IDocumentClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,53 @@ public interface IDocumentClient : IApiAccessor
/// <returns>Task of ApiResponse</returns>
Task<ApiResponse<object>> RemindDocumentAsyncWithHttpInfo(string documentId, List<string> receiverEmails, ReminderMessage reminderMessage = default);

/// <summary>
/// Add Authentication to user.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call.</exception>
/// <param name="documentId">DocumentId.</param>
/// <param name="emailId">EmailID.</param>
/// <param name="authenticationType">AuthenticationType.</param>
/// <param name="signerOrder">SignerOrder.</param>
/// <param name="newAccessCode">NewAccesscode.</param>
void AddAuthentication(string documentId, string emailId, AuthenticationType authenticationType, int? signerOrder = default, string newAccessCode = "");

/// <summary>
/// Add Authentication to user.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call.</exception>
/// <param name="documentId">DocumentId.</param>
/// <param name="emailId">EmailID.</param>
/// <param name="authenticationType">AuthenticationType.</param>
/// <param name="signerOrder">SignerOrder.</param>
/// <param name="newAccessCode">NewAccesscode.</param>
/// <returns>ApiResponse of Object(void).</returns>
ApiResponse<object> AddAuthenticationWithHttpInfo(string documentId, string emailId, AuthenticationType authenticationType, int? signerOrder = default, string newAccessCode = "");

/// <summary>
/// Add Authentication to user.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call.</exception>
/// <param name="documentId">DocumentId.</param>
/// <param name="emailId">EmailID.</param>
/// <param name="authenticationType">AuthenticationType.</param>
/// <param name="signerOrder">SignerOrder.</param>
/// <param name="newAccessCode">NewAccesscode.</param>
/// <returns>AddAuthentication.</returns>
Task AddAuthenticationAsync(string documentId, string emailId, AuthenticationType authenticationType, int? signerOrder = default, string newAccessCode = "");

/// <summary>
/// Add Authentication to user.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call.</exception>
/// <param name="documentId">DocumentId.</param>
/// <param name="emailId">EmailID.</param>
/// <param name="authenticationType">AuthenticationType.</param>
/// <param name="signerOrder">SignerOrder.</param>
/// <param name="newAccessCode">NewAccesscode.</param>
/// <returns>ApiResponse of Object(AddAuthentication).</returns>
Task<ApiResponse<object>> AddAuthenticationAsyncWithHttpInfo(string documentId, string emailId, AuthenticationType authenticationType, int? signerOrder = default, string newAccessCode = "");

/// <summary>
/// Revoke the document with the given document ID.
/// </summary>
Expand Down Expand Up @@ -521,6 +568,60 @@ public interface IDocumentClient : IApiAccessor
/// <returns>Task of ApiResponse (EmbeddedSendCreated).</returns>
Task<ApiResponse<EmbeddedSendCreated>> CreateEmbeddedRequestUrlAsyncWithHttpInfo(EmbeddedDocumentRequest sendRequest);

/// <summary>
/// Remove Authentication to user.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call.</exception>
/// <param name="documentId">DocumentId.</param>
/// <param name="emailId">EmailID.</param>
/// <param name="signerOrder">SignerOrder.</param>
void RemoveAuthentication(string documentId, string emailId, int? signerOrder = default);

/// <summary>
/// Remove Authentication to user.
/// </summary>
/// <remarks>
/// </remarks>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="documentId">Gets or sets the document id.</param>
/// <param name="emailId">Gets or sets the signer email.</param>
/// <param name="zOrder">
/// Gets or sets the signer&#39;s order. When signer order is enabled for a document, this order is
/// used to target that particular order with given signer email. (optional)
/// </param>
/// <returns>ApiResponse of Object(void)</returns>
ApiResponse<object> RemoveAuthenticationWithHttpInfo(string documentId, string emailId, int? signerOrder = default);

/// <summary>
/// Remove Authentication to user.
///</summary>
/// <remarks>
/// </remarks>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="documentId">Gets or sets the document id.</param>
/// <param name="emailId">Gets or sets the signer email.</param>
/// <param name="signerOrder">
/// Gets or sets the signer&#39;s order. When signer order is enabled for a document, this order is
/// used to target that particular order with given signer email. (optional)
/// </param>
/// <returns>Task of void</returns>
Task RemoveAuthenticationAsync(string documentId, string emailId, int? signerOrder = default);

/// <summary>
/// Remove Authentication to user.
/// </summary>
/// <remarks>
/// </remarks>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="documentId">Gets or sets the document id.</param>
/// <param name="emailId">Gets or sets the signer email.</param>
/// <param name="signerOrder">
/// Gets or sets the signer&#39;s order. When signer order is enabled for a document, this order is
/// used to target that particular order with given signer email. (optional)
/// </param>
/// <returns>Task of ApiResponse</returns>
Task<ApiResponse<object>> RemoveAuthenticationAsyncWithHttpInfo(string documentId, string emailId, int? signerOrder = default);

#endregion Asynchronous Operations
}
}
4 changes: 2 additions & 2 deletions src/BoldSign/BoldSign.Api.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net452</TargetFrameworks>
<FileVersion>4.6.0</FileVersion>
<ProductVersion>4.6.0</ProductVersion>
<FileVersion>4.7.0</FileVersion>
<ProductVersion>4.7.0</ProductVersion>
<Copyright>Copyright 2001-2022 Syncfusion Inc</Copyright>
<AssemblyName>BoldSign.Api</AssemblyName>
<RootNamespace>BoldSign.Api</RootNamespace>
Expand Down
90 changes: 90 additions & 0 deletions src/BoldSign/Model/AddAuthenticationAccessCodeDetails.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
// <copyright file="AddAuthenticationAccessCodeDetails.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.ComponentModel.DataAnnotations;
using System.IO;
using System.Runtime.Serialization;
using BoldSign.Api.Resources;
using Newtonsoft.Json;

/// <summary>
/// The access code model.
/// </summary>
[DataContract]
public class AddAuthenticationAccessCodeDetails
{
/// <summary>
/// Initializes a new instance of the <see cref="AddAuthenticationAccessCodeDetails" /> class.
/// </summary>
/// <param name="emailId">Gets or sets the emailId.</param>
/// <param name="order">Gets or sets the zOrder.</param>
/// <param name="accessCode">Gets or sets the access code.</param>
/// <param name="authenticationType">Gets or sets the authentication type.</param>
public AddAuthenticationAccessCodeDetails(string emailId, int? order, string accessCode = "", AuthenticationType authenticationType = default)
{
// to ensure "accessCode" is required (not null) for AuthenticationType AccessCode.
if (string.IsNullOrEmpty(accessCode) && authenticationType == AuthenticationType.AccessCode)
{
throw new InvalidDataException(ApiValidationMessages.AccessCodePropertyRequired);
}

// to ensure "accessCode" is not required for AuthenticationType EmailOTP.
if (!string.IsNullOrEmpty(accessCode) && authenticationType == AuthenticationType.EmailOTP)
{
throw new InvalidDataException(ApiValidationMessages.AccessCodePropertyNoRequired);
}

this.EmailId = emailId;
this.Order = order;
this.AccessCode = accessCode;
this.AuthenticationType = authenticationType;
}

/// <summary>
/// Gets or sets the signer email.
/// </summary>
[Required]
[DataMember(Name = "emailId", EmitDefaultValue = true)]
public string EmailId { get; set; }

/// <summary>
/// Gets or sets the ZOrder.
/// </summary>
[Range(1, 50)]
[DataMember(Name = "order", EmitDefaultValue = true)]
public int? Order { get; set; }

/// <summary>
/// Gets or sets the access code.
/// </summary>
/// <value>Gets the value of access code.</value>
[DataMember(Name = "accessCode", EmitDefaultValue = true)]
public string AccessCode { get; set; }

/// <summary>
/// Gets or sets the authenticationType.
/// </summary>
[Required]
[DataMember(Name = "authenticationType", EmitDefaultValue = true)]
public AuthenticationType AuthenticationType { 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);
}
}
6 changes: 6 additions & 0 deletions src/BoldSign/Model/AuditAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,5 +217,11 @@ public enum AuditAction
/// </summary>
[EnumMember(Value = "EditRecipient")]
EditRecipient = 33,

/// <summary>
/// Enum AuthenticationAdded for value: AuthenticationAdded
/// </summary>
[EnumMember(Value = "AuthenticationAdded")]
AuthenticationAdded = 34,
}
}
29 changes: 29 additions & 0 deletions src/BoldSign/Model/AuthenticationType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// <copyright file="AuthenticationType.cs" company="Syncfusion Inc">
// Copyright (c) Syncfusion Inc. All rights reserved.
// </copyright>

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

/// <summary>
/// AuthenticationType.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum AuthenticationType
{
/// <summary>
/// Represents EmailOTP only.
/// </summary>
[EnumMember(Value = "EmailOTP")]
EmailOTP = 1,

/// <summary>
/// Represents AccessCode only.
/// </summary>
[EnumMember(Value = "AccessCode")]
AccessCode = 2,
}
}
11 changes: 10 additions & 1 deletion src/BoldSign/Model/DocumentFormFields.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ public partial class DocumentFormFields
/// <param name="imageInfo">Gets or sets the imageField.</param>
/// <param name="attachmentInfo">Gets or sets the attachmentField.</param>
/// <param name="editableDateFieldSettings">Gets or sets the editableDateFieldSettings.</param>
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))
/// <param name="hyperlinkText">Gets or sets the hyperlinkText.</param>
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))
{
this.Id = id;
this.Type = type;
Expand All @@ -74,6 +75,7 @@ public partial class DocumentFormFields
this.ImageInfo = imageInfo;
this.AttachmentInfo = attachmentInfo;
this.EditableDateFieldSettings = editableDateFieldSettings;
this.HyperlinkText = hyperlinkText;
}

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

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

/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
Expand Down
6 changes: 6 additions & 0 deletions src/BoldSign/Model/FieldType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,11 @@ public enum FieldType
/// </summary>
[EnumMember(Value = "EditableDate")]
EditableDate = 10,

/// <summary>
/// Enum Hyperlink for value: Hyperlink
/// </summary>
[EnumMember(Value = "Hyperlink")]
Hyperlink = 11,
}
}
37 changes: 36 additions & 1 deletion src/BoldSign/Model/FormField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace BoldSign.Model
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using BoldSign.Api.Model;
using BoldSign.Api.Resources;
using Newtonsoft.Json;
Expand Down Expand Up @@ -105,7 +106,8 @@ public FormField(string name = default, FieldType type = default, int pageNumber
/// <param name="attachmentInfo">Gets or sets the attachmentInfo.</param>
/// <param name="imageInfo">Gets or sets the imageInfo.</param>
/// <param name="editableDateFieldSettings">Gets or sets the editableDateFieldSettings.</param>
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))
/// <param name="hyperlinkText">Gets or sets the hyperlinkText.</param>
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)
{
// to ensure "fieldType" is required (not null)
if (type == null)
Expand Down Expand Up @@ -141,6 +143,7 @@ public FormField(string name = default, FieldType type = default, int pageNumber
this.Font = font;
this.FontSize = fontSize;
this.Id = id;
this.HyperlinkText = hyperlinkText;
if (type == FieldType.Attachment && attachmentInfo == null)
{
throw new InvalidDataException(ApiValidationMessages.AttachmentInformationRequired);
Expand All @@ -159,6 +162,31 @@ public FormField(string name = default, FieldType type = default, int pageNumber
}

this.EditableDateFieldSettings = editableDateFieldSettings;

if (type == FieldType.Hyperlink)
{
if (string.IsNullOrEmpty(hyperlinkText) && string.IsNullOrEmpty(value))
{
throw new InvalidDataContractException(ApiValidationMessages.BothHyperlinkFieldsRequired);
}

if (string.IsNullOrEmpty(hyperlinkText) && !string.IsNullOrEmpty(value))
{
throw new InvalidDataContractException(ApiValidationMessages.HyperlinkLabelFieldsRequired);
}

if (!string.IsNullOrEmpty(hyperlinkText) && string.IsNullOrEmpty(value))
{
throw new InvalidDataContractException(ApiValidationMessages.HyperlinkValueFieldsRequired);
}

string regex = @"(http|https)://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?";
var isValid = Regex.IsMatch(value, regex);
if (!isValid)
{
throw new InvalidDataContractException(ApiValidationMessages.EnterValidURL);
}
}
}

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

/// <summary>
/// Gets or sets the HyperlinkText to be set to the form field (if required).
/// </summary>
/// <value>Gets or sets the HyperlinkText.</value>
[DataMember(Name = "hyperlinkText", EmitDefaultValue = true)]
public string HyperlinkText { get; set; }

/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
Expand Down
Loading