From a0b2cb485370cef511ff6aaa4f8bd1607e5b0340 Mon Sep 17 00:00:00 2001 From: MukeshV Date: Fri, 4 Oct 2024 11:39:26 +0530 Subject: [PATCH 1/3] Added_Master_MigrationChanges --- examples/BoldSign.Examples.csproj | 9 +- examples/BrandingExamples.cs | 57 +- examples/ContactExamples.cs | 97 + examples/CustomFieldExamples.cs | 90 + examples/DocumentExamples.cs | 133 +- examples/PlanExamples.cs | 1 - examples/Program.cs | 1 + examples/SenderIdentityExamples.cs | 6 +- examples/TemplateExamples.cs | 334 +++- src/BoldSign/Api/ApiClient.cs | 387 ++-- src/BoldSign/Api/BrandingClient.cs | 310 +++- src/BoldSign/Api/Configuration.cs | 23 +- src/BoldSign/Api/ContactClient.cs | 1063 +++++++++++ src/BoldSign/Api/CustomFieldClient.cs | 952 ++++++++++ src/BoldSign/Api/DocumentClient.cs | 910 ++++++---- src/BoldSign/Api/ExceptionFactory.cs | 8 +- src/BoldSign/Api/FromRequestHelper.cs | 88 +- src/BoldSign/Api/IBrandingClient.cs | 32 + src/BoldSign/Api/IContactClient.cs | 181 ++ src/BoldSign/Api/ICustomFieldClient.cs | 169 ++ src/BoldSign/Api/IDocumentClient.cs | 315 +++- src/BoldSign/Api/ISenderIdentityClient.cs | 12 +- src/BoldSign/Api/ITemplateClient.cs | 87 +- src/BoldSign/Api/PlanClient.cs | 21 +- src/BoldSign/Api/SenderIdentityClient.cs | 104 +- src/BoldSign/Api/TeamClient.cs | 44 +- src/BoldSign/Api/TemplateClient.cs | 1558 +++++++++++++---- src/BoldSign/Api/UserClient.cs | 67 +- src/BoldSign/BoldSign.Api.csproj | 18 +- src/BoldSign/BoldSign.Api.nuspec | 45 + .../Extensions/HttpRequestExtension.cs | 96 + src/BoldSign/Model/AccessCodeDetails.cs | 10 +- .../AddAuthenticationAccessCodeDetails.cs | 13 +- src/BoldSign/Model/ApiRequest.cs | 11 +- src/BoldSign/Model/AuditAction.cs | 138 ++ src/BoldSign/Model/AuthenticationType.cs | 14 +- src/BoldSign/Model/Brand/IImageFile.cs | 14 + src/BoldSign/Model/Brand/ImageFileBytes.cs | 22 + src/BoldSign/Model/Brand/ImageFilePath.cs | 22 + src/BoldSign/Model/Brand/ImageFileStream.cs | 24 + src/BoldSign/Model/BrandCustomFieldDetails.cs | 61 + src/BoldSign/Model/BrandDetails.cs | 24 + src/BoldSign/Model/BrandSettings.cs | 38 +- src/BoldSign/Model/ChangeRecipient.cs | 29 +- src/BoldSign/Model/ContactDetails.cs | 58 + src/BoldSign/Model/ContactPageDetails.cs | 57 + .../{CompletedEmailType.cs => ContactType.cs} | 17 +- src/BoldSign/Model/ContactsDetails.cs | 61 + src/BoldSign/Model/ContactsList.cs | 58 + src/BoldSign/Model/CreateContact.cs | 27 + src/BoldSign/Model/CreateTemplateRequest.cs | 43 + src/BoldSign/Model/CreatedContact.cs | 23 + src/BoldSign/Model/CustomFieldCollection.cs | 32 + src/BoldSign/Model/CustomFieldMessage.cs | 36 + src/BoldSign/Model/CustomFormField.cs | 309 ++++ src/BoldSign/Model/DateSignedField.cs | 14 +- src/BoldSign/Model/DeliveryMode.cs | 35 + src/BoldSign/Model/Document.cs | 18 +- src/BoldSign/Model/DocumentDownloadOption.cs | 22 + src/BoldSign/Model/DocumentFormFields.cs | 48 +- src/BoldSign/Model/DocumentInfo.cs | 34 +- src/BoldSign/Model/DocumentProperties.cs | 19 +- src/BoldSign/Model/DocumentSigner.cs | 96 +- src/BoldSign/Model/DocumentSignerDetails.cs | 58 +- src/BoldSign/Model/EditTemplateRequest.cs | 145 ++ .../Model/EmbeddedCustomFieldCreated.cs | 33 + .../Model/EmbeddedCustomFieldDetails.cs | 41 + .../Model/EmbeddedTemplateEditRequest.cs | 6 + src/BoldSign/Model/FormField.cs | 29 +- src/BoldSign/Model/ImposeAuthentication.cs | 6 + src/BoldSign/Model/Languages.cs | 5 + src/BoldSign/Model/Locales.cs | 6 + src/BoldSign/Model/MergeAndSendForSign.cs | 231 +++ src/BoldSign/Model/PhoneNumber.cs | 55 + src/BoldSign/Model/PrefillField.cs | 27 + src/BoldSign/Model/PrefillFieldRequest.cs | 44 + src/BoldSign/Model/RadioButtonField.cs | 10 +- .../Model/RecipientNotificationSettings.cs | 94 + src/BoldSign/Model/ReminderMessage.cs | 10 +- src/BoldSign/Model/RemoveAuthentication.cs | 11 +- src/BoldSign/Model/RoleProperties.cs | 38 +- src/BoldSign/Model/Roles.cs | 100 +- src/BoldSign/Model/SendForSign.cs | 20 + src/BoldSign/Model/SendForSignFromTemplate.cs | 43 +- src/BoldSign/Model/SenderIdentityRequest.cs | 19 +- src/BoldSign/Model/SenderIdentityViewModel.cs | 12 + src/BoldSign/Model/Template.cs | 38 +- src/BoldSign/Model/TemplateFormField.cs | 70 +- src/BoldSign/Model/TemplateProperties.cs | 68 +- src/BoldSign/Model/TemplateRole.cs | 90 +- src/BoldSign/Model/TemplateSignerDetails.cs | 36 +- src/BoldSign/Model/TemplateTag.cs | 39 + .../Model/TextTags/TextTagDefinition.cs | 24 +- src/BoldSign/Model/ViewBrandDetails.cs | 36 + src/BoldSign/Model/ViewCustomFieldDetails.cs | 67 + src/BoldSign/Model/Webhook/DocumentEvent.cs | 15 + .../Model/Webhook/SenderIdentityEvent.cs | 12 + src/BoldSign/Model/Webhook/SignerDetails.cs | 15 + .../Model/Webhook/Template/TemplateEvent.cs | 37 + .../Model/Webhook/Template/TemplateSigner.cs | 14 + .../ApiValidationMessages.Designer.cs | 189 ++ .../Resources/ApiValidationMessages.resx | 114 +- src/BoldSign/icon.png | Bin 0 -> 3394 bytes 103 files changed, 9442 insertions(+), 1110 deletions(-) create mode 100644 examples/ContactExamples.cs create mode 100644 examples/CustomFieldExamples.cs create mode 100644 src/BoldSign/Api/ContactClient.cs create mode 100644 src/BoldSign/Api/CustomFieldClient.cs create mode 100644 src/BoldSign/Api/IContactClient.cs create mode 100644 src/BoldSign/Api/ICustomFieldClient.cs create mode 100644 src/BoldSign/BoldSign.Api.nuspec create mode 100644 src/BoldSign/Extensions/HttpRequestExtension.cs create mode 100644 src/BoldSign/Model/Brand/IImageFile.cs create mode 100644 src/BoldSign/Model/Brand/ImageFileBytes.cs create mode 100644 src/BoldSign/Model/Brand/ImageFilePath.cs create mode 100644 src/BoldSign/Model/Brand/ImageFileStream.cs create mode 100644 src/BoldSign/Model/BrandCustomFieldDetails.cs create mode 100644 src/BoldSign/Model/BrandDetails.cs create mode 100644 src/BoldSign/Model/ContactDetails.cs create mode 100644 src/BoldSign/Model/ContactPageDetails.cs rename src/BoldSign/Model/{CompletedEmailType.cs => ContactType.cs} (64%) create mode 100644 src/BoldSign/Model/ContactsDetails.cs create mode 100644 src/BoldSign/Model/ContactsList.cs create mode 100644 src/BoldSign/Model/CreateContact.cs create mode 100644 src/BoldSign/Model/CreatedContact.cs create mode 100644 src/BoldSign/Model/CustomFieldCollection.cs create mode 100644 src/BoldSign/Model/CustomFieldMessage.cs create mode 100644 src/BoldSign/Model/CustomFormField.cs create mode 100644 src/BoldSign/Model/DeliveryMode.cs create mode 100644 src/BoldSign/Model/DocumentDownloadOption.cs create mode 100644 src/BoldSign/Model/EditTemplateRequest.cs create mode 100644 src/BoldSign/Model/EmbeddedCustomFieldCreated.cs create mode 100644 src/BoldSign/Model/EmbeddedCustomFieldDetails.cs create mode 100644 src/BoldSign/Model/MergeAndSendForSign.cs create mode 100644 src/BoldSign/Model/PhoneNumber.cs create mode 100644 src/BoldSign/Model/PrefillField.cs create mode 100644 src/BoldSign/Model/PrefillFieldRequest.cs create mode 100644 src/BoldSign/Model/RecipientNotificationSettings.cs create mode 100644 src/BoldSign/Model/TemplateTag.cs create mode 100644 src/BoldSign/Model/ViewCustomFieldDetails.cs create mode 100644 src/BoldSign/icon.png diff --git a/examples/BoldSign.Examples.csproj b/examples/BoldSign.Examples.csproj index c8dff02..36640cd 100644 --- a/examples/BoldSign.Examples.csproj +++ b/examples/BoldSign.Examples.csproj @@ -5,9 +5,14 @@ BoldSign.Examples + + false + true + + - - + + diff --git a/examples/BrandingExamples.cs b/examples/BrandingExamples.cs index 17651fc..d891f90 100644 --- a/examples/BrandingExamples.cs +++ b/examples/BrandingExamples.cs @@ -1,4 +1,5 @@ -using BoldSign.Api; +using System.IO; +using BoldSign.Api; using BoldSign.Model; namespace BoldSign.Examples @@ -41,14 +42,27 @@ public void ResetDefaultBrand() /// public BrandingData CreateBrand() { + var fileBytes = File.ReadAllBytes("assets/sample.jpg"); + var stream = new MemoryStream(fileBytes); + var createBrandData = new BrandSettings() { // This is an example brand settings data to create, add your own brand settings upon usage. BrandName = "Brand from SDK", - BrandLogo = new DocumentFileBytes + // BrandLogo = new ImageFileBytes() + // { + // ContentType = "image/jpeg", + // FileBytes = fileBytes, + // }, + // BrandLogo = new ImageFileStream() + // { + // FileStream = stream, + // ContentType = "image/jpeg", + // }, + BrandLogo = new ImageFilePath() { - ContentType = "image/jpg", - FileName = "assets/sample.jpg", + FilePath = "assets/sample.jpg", + ContentType = "image/jpeg", }, CombineAuditTrail = false, IsDefault = false, @@ -60,6 +74,11 @@ public BrandingData CreateBrand() ButtonColor = "#00BDD4", ButtonTextColor = "#FFFFFF", RedirectUrl = "https://app.boldsign.com/dashboard", + AllowCustomFieldCreation = false, + ShowBuiltInFormFields = true, + ShowSharedCustomFields = false, + HideDecline = false, + HideSave = false, }; var result = this.BrandingClient.CreateBrand(createBrandData); return result; @@ -71,15 +90,27 @@ public BrandingData CreateBrand() public BrandingData EditBrand() { string brandId = "Your brand-id"; + var fileBytes = File.ReadAllBytes("assets/sample.jpg"); + var stream = new MemoryStream(fileBytes); var editBrandData = new BrandSettings() { // This is an example brand settings data to edit, add your own brand settings upon usage. BrandName = "Brand edit from SDK", - BrandLogo = new DocumentFileBytes + // BrandLogo = new ImageFileBytes() + // { + // ContentType = "image/jpeg", + // FileBytes = fileBytes, + // }, + // BrandLogo = new ImageFileStream() + // { + // FileStream = stream, + // ContentType = "image/jpeg", + // }, + BrandLogo = new ImageFilePath() { - ContentType = "image/jpg", - FileName = "assets/sample.jpg", + FilePath = "assets/sample.jpg", + ContentType = "image/jpeg", }, CombineAuditTrail = false, IsDefault = false, @@ -104,5 +135,17 @@ public BrandingRecords ListBrand() var brandRecords = this.BrandingClient.ListBrand(); return brandRecords; } + + /// + /// Get the brand. + /// + public BrandDetails GetBrand() + { + // This is an example brand id, add your own brand id upon usage. + var brandId = "your brand-id"; + + var brandSettings = this.BrandingClient.GetBrandDetails(brandId); + return brandSettings; + } } } \ No newline at end of file diff --git a/examples/ContactExamples.cs b/examples/ContactExamples.cs new file mode 100644 index 0000000..3eb72d3 --- /dev/null +++ b/examples/ContactExamples.cs @@ -0,0 +1,97 @@ +namespace BoldSign.Examples +{ + using System.Collections.Generic; + using BoldSign.Api; + using BoldSign.Api.Model; + using BoldSign.Model; + using System.Threading.Tasks; + + /// + /// The create user examples. + /// + public class ContactExamples + { + private readonly ContactClient ContactClient; + + /// + /// Initializes a new instance of the class. + /// + /// The create user api. + public ContactExamples(ContactClient ContactClient) + { + this.ContactClient = ContactClient; + } + + /// + /// Get contact list + /// + public ContactsList ContactList() + { + var response = this.ContactClient.ListContacts(1, 10, "", ContactType.AllContacts); + return response; + } + + /// + /// Delete Contact details + /// + public void DeleteContact() + { + // This is an example contact id, add your own brand id upon usage. + var id = "contact-Id"; + this.ContactClient.DeleteContact(id); + } + + /// + /// Create Contact details + /// + public CreatedContact CreateContact() + { + var contactsDetailsList = new List(); + ContactDetails contactsDetails = new ContactDetails() + { + Email = "test1711@gmail.com", + Name = "API-SDK_Test", + PhoneNumber = new PhoneNumber() + { + CountryCode = "91", + Number = "6547456721" + }, + CompanyName = "1711", + JobTitle = "Test" + }; + + contactsDetailsList.Add(contactsDetails); + var response = this.ContactClient.CreateContact(contactsDetailsList); + return response; + } + + /// + /// Update Contact details + /// + public void UpdateContact() + { + string id = "6797a07d-26d7-41fa-b3a8-c8f72378a7a6c_gEkPI"; + var updateContact = new ContactDetails() + { + Email = "test1711@gmail.com", + Name = "Test_Engineer", + PhoneNumber = new PhoneNumber() + { + CountryCode = "91", + Number = "9182736450" + }, + CompanyName = "1711_1802", + JobTitle = "Test" + }; + + this.ContactClient.UpdateContact(id, updateContact); + } + + public ContactsDetails GetContact() + { + string id = "6797a07d-26d7-41fa-b3a8-c8f72378a7a6c_KRMh4"; + var response = this.ContactClient.GetContact(id); + return response; + } + } +} \ No newline at end of file diff --git a/examples/CustomFieldExamples.cs b/examples/CustomFieldExamples.cs new file mode 100644 index 0000000..4fe22ab --- /dev/null +++ b/examples/CustomFieldExamples.cs @@ -0,0 +1,90 @@ +using BoldSign.Api; +using BoldSign.Model; +using System; + +namespace BoldSign.Examples +{ + /// + /// The Custom Field Examples. + /// + public class CustomFieldExamples + { + private readonly ICustomFieldClient CustomFieldClient; + + public CustomFieldExamples(ICustomFieldClient customFieldClient) => this.CustomFieldClient = customFieldClient; + + /// + /// Creates a custom field for the specified brand. + /// + public void CreateCustomField() + { + var brandCustomFieldDetails = new BrandCustomFieldDetails() + { + FieldName = "Field Name", + FieldDescription = "Description", + FieldOrder = 1, + BrandId = "Brand Id", + FormField = new CustomFormField( + type: FieldType.Signature, + isRequired: true), + }; + + this.CustomFieldClient.CreateCustomField(brandCustomFieldDetails); + } + + /// + /// Edits a custom field for the specified brand. + /// + public void EditCustomField() + { + var brandCustomFieldDetails = new BrandCustomFieldDetails() + { + FieldName = "Field Name", + FieldDescription = "Description", + FieldOrder = 1, + BrandId = "Brand Id", + FormField = new CustomFormField( + type: FieldType.Signature, + isRequired: true), + }; + + var customFieldId = "custom field id"; + + this.CustomFieldClient.EditCustomField(customFieldId, brandCustomFieldDetails); + } + + /// + /// Deletes a custom field for the specified brand. + /// + public void DeleteCustomField() + { + var customFieldId = "custom field id"; + + this.CustomFieldClient.DeleteCustomField(customFieldId); + } + + /// + /// Gets the all custom field for the specified brand. + /// + public void GetCustomField() + { + var brandId = "Brand Id"; + + this.CustomFieldClient.GetBrandBasedCustomFields(brandId); + } + + /// + /// Generates a URL to embed manipulation of custom field process. + /// + public void CreateEmbeddedCustomFieldUrl() + { + var embeddedCustomFieldDetails = new EmbeddedCustomFieldDetails() + { + BrandId = "Brand Id", + LinkValidTill = DateTime.UtcNow.AddDays(1), + }; + + this.CustomFieldClient.CreateEmbeddedCustomFieldUrl(embeddedCustomFieldDetails); + } + } +} \ No newline at end of file diff --git a/examples/DocumentExamples.cs b/examples/DocumentExamples.cs index 08178b4..932e445 100644 --- a/examples/DocumentExamples.cs +++ b/examples/DocumentExamples.cs @@ -1,3 +1,5 @@ +using BoldSign.Api.Model; + namespace BoldSign.Examples { using BoldSign.Api; @@ -7,6 +9,7 @@ namespace BoldSign.Examples using System.IO; using System.Net.Http; using System.Threading.Tasks; + using System.Linq; /// /// The document examples. @@ -40,7 +43,7 @@ public TeamDocumentRecords ListTeamDocuments() return documents; } - + /// /// Lists the behalf documents. /// @@ -307,7 +310,7 @@ public void ChangeRecipient() // This is an example document id, add your own document id upon usage. var documentId = "1ace7c82-6770-4d03-b514-b593e20c4550"; - this.DocumentClient.ChangeRecipient(documentId, "signer1@email.com", "wrong email", "signer2", "signer2@email.com"); + this.DocumentClient.ChangeRecipient(documentId, "signer1@gmail.com", "wrong email", "signer2", "signer2@email.com"); } /// @@ -347,10 +350,11 @@ public async Task CreateDocument() List formFeilds = new List(); formFeilds.Add(new FormField( name: "Sign", - type: FieldType.Signature, + type: FieldType.CheckBox, pageNumber: 1, isRequired: true, bounds: new Rectangle(x: 50, y: 50, width: 200, height: 30))); + var documentDetails = new SendForSign { Title = "Sent from API SDK", @@ -359,15 +363,92 @@ public async Task CreateDocument() Signers = new List { new DocumentSigner( - name: "Signer Name 1", - emailAddress: "signer1@email.com", + signerName: "Signer Name 1", + signerType: SignerType.Signer, + signerEmail: "ranjitha.vazhivittan+1@syncfusion.com", + signerOrder: 1, + authenticationCode: "123", + privateMessage: "This is private message for signer", + formFields: formFeilds, + locale: Locales.EN) + }, + }; + + // document read from local as byte array + var fileBytes = File.ReadAllBytes("doc-1.pdf"); + + // document read from local as stream + using var fs = File.OpenRead("doc-2.pdf"); + + documentDetails.Files = new List + { + new DocumentFilePath + { + ContentType = "application/pdf", + // directly provide file path + FilePath = "doc-1.pdf", + }, + new DocumentFileBytes + { + ContentType = "application/pdf", + FileData = fileBytes, + FileName = "doc-1.pdf", + }, + new DocumentFileStream + { + ContentType = "application/pdf", + FileData = fs, + FileName = "doc-2.pdf", + }, + }; + + var documentCreated = this.DocumentClient.SendDocument(documentDetails); + + return documentCreated; + } + + /// + /// Creates the document with Radio button. + /// + public async Task CreateDocumentWithRadioButtonField() + { + var radioButtonFields = new List + { + new RadioButtonField( + id: "Tamil_Language", + pageNumber: 1, + isRequired: true, + label: "Tamil", + groupName: "Language", + bounds: new Rectangle(x: 50, y: 200, width: 20, height: 20)), + new RadioButtonField( + id: "Maths_Language", + pageNumber: 1, + isRequired: true, + label: "Maths", + groupName: "Language", + bounds: new Rectangle(x: 150, y: 200, width: 20, height: 20)), + }; + + var documentDetails = new SendForSign + { + Title = "Sent from API SDK", + Message = "This is document message sent from API SDK", + EnableSigningOrder = true, + Signers = new List + { + new DocumentSigner( + signerName: "Signer Name 1", + signerEmail: "signer1@email.com", signerOrder: 1, authenticationCode: "123", signerType: SignerType.Signer, privateMessage: "This is private message for signer", - formFields:formFeilds), + formFields: radioButtonFields.Cast().ToList(), + locale: Locales.EN), }, }; + // document read from local as byte array var fileBytes = File.ReadAllBytes("doc-1.pdf"); @@ -425,13 +506,14 @@ public async Task CreateDocumentWithFileUrl() Signers = new List { new DocumentSigner( - name: "Signer Name 1", - emailAddress: "signer1@email.com", + signerName: "Signer Name 1", + signerType: SignerType.Signer, + signerEmail: "signer1@email.com", signerOrder: 1, authenticationCode: "123", - signerType: SignerType.Signer, privateMessage: "This is private message for signer", - formFields:formFields), + formFields:formFields, + locale: Locales.EN), }, }; @@ -468,13 +550,14 @@ public async Task EmbeddedSendDocument() Signers = new List { new DocumentSigner( - name: "Signer Name 1", - emailAddress: "signer1@email.com", + signerName: "Signer Name 1", + signerType: SignerType.Signer, + signerEmail: "signer1@email.com", signerOrder: 1, authenticationCode: "123", - signerType: SignerType.Signer, privateMessage: "This is private message for signer", - formFields: formFields), + formFields: formFields, + locale: Locales.EN), }, Files = new List { @@ -511,6 +594,28 @@ public void RemoveAuthentication() this.DocumentClient.RemoveAuthentication(documentId, "signer1@email.com", 1); } + + /// + /// pre fill form field. + /// + public async Task PrefillFieldsAsync() + { + // This is an example document id, add your own document id upon usage. + var documentId = "702d9699-3f01-4a46-ac70-c0545cff73b7"; + var prefillFieldRequest = new PrefillFieldRequest(documentId) + { + Fields = new List() + { + new PrefillField() + { + Id = "checkbox_v4tuQ", + Value = "off" + } + }, + }; + + await this.DocumentClient.PrefillFieldsAsync(prefillFieldRequest); + } } } diff --git a/examples/PlanExamples.cs b/examples/PlanExamples.cs index 9ccaab8..cba037b 100644 --- a/examples/PlanExamples.cs +++ b/examples/PlanExamples.cs @@ -9,7 +9,6 @@ using BoldSign.Api; using BoldSign.Api.Resources; using BoldSign.Model; - using RestSharp; /// /// The plan examples. diff --git a/examples/Program.cs b/examples/Program.cs index 07848c7..3cade36 100644 --- a/examples/Program.cs +++ b/examples/Program.cs @@ -20,6 +20,7 @@ private static async Task Main(string[] args) var userExamples = new UserExamples(new UserClient(apiClient)); var brandingExamples = new BrandingExamples(new BrandingClient(apiClient)); var senderIdentityExamples = new SenderIdentityExamples(new SenderIdentityClient(apiClient)); + var customFieldExamples = new CustomFieldExamples(new CustomFieldClient(apiClient)); await documentExamples.CreateDocument().ConfigureAwait(false); // webhook event helpers diff --git a/examples/SenderIdentityExamples.cs b/examples/SenderIdentityExamples.cs index 58352e4..5d56b8e 100644 --- a/examples/SenderIdentityExamples.cs +++ b/examples/SenderIdentityExamples.cs @@ -51,7 +51,7 @@ public void UpdateSenderIdentity() /// public void ResendSenderIdentityInvitation() { - var email = "identity@email.com"; + var email = "identity@gmail.com"; this.senderIdentityClient.ResendInvitation(email); } @@ -60,7 +60,7 @@ public void ResendSenderIdentityInvitation() /// public void RerequestSenderIdentity() { - var email = "identity@email.com"; + var email = "identity@gmail.com"; this.senderIdentityClient.RerequestSenderIdentity(email); } @@ -69,7 +69,7 @@ public void RerequestSenderIdentity() /// public void DeleteSenderIdentity() { - var email = "identity@email.com"; + var email = "identity@gmail.com"; this.senderIdentityClient.DeleteSenderIdentity(email); } diff --git a/examples/TemplateExamples.cs b/examples/TemplateExamples.cs index bbf3ce3..1a1436e 100644 --- a/examples/TemplateExamples.cs +++ b/examples/TemplateExamples.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.IO; using System.Threading.Tasks; + using System.Linq; /// /// The template examples. @@ -41,6 +42,46 @@ public void DeleteTemplate() this.templateApi.DeleteTemplate(templateId); } + + /// + /// Edits a template. + /// + /// A task. + public async Task EditTemplate() + { + // This is an example template id, add your own template id upon usage. + var templateId = "cc8e9326-c0a9-4caf-808f-17d9499d1abc"; + var formFields = new List + { + new FormField( + id: "Sign", + type: FieldType.Signature, + pageNumber: 1, + isRequired: true, + bounds: new Rectangle(x: 50, y: 50, width: 200, height: 30)), + }; + var editTemplateRequest = new EditTemplateRequest(templateId) + { + DocumentTitle = "new title", + Roles = new List + { + new TemplateRole( + 1, + name: "RoleName", + defaultSignerEmail: "signer1@email.com", + defaultSignerName: "signer1", + signerOrder: 1, + signerType: SignerType.Signer, + formFields: formFields, + locale: Locales.EN), + }, + EnableSigningOrder = true, + + + }; + + await this.templateApi.EditTemplateAsync(editTemplateRequest).ConfigureAwait(false); + } /// /// Creates the document using template without any customization. @@ -71,16 +112,27 @@ public DocumentCreated CreateDocumentWithCustomRoles() // This is an example document id, add your own document id upon usage. var templateId = "949ebf20-45a8-4a3e-91a9-68e9540e0020"; - var roles = new List + var formFields = new List { - new Roles - { - RoleIndex = 1, - SignerEmail = "signer1@email.com", - SignerName = "Signer Name", - }, + new FormField( + id: "Sign", + type: FieldType.Signature, + pageNumber: 1, + isRequired: true, + bounds: new Rectangle(x: 50, y: 50, width: 200, height: 30)), }; + var roles = new List + { + new Roles( + roleSignerIndex: 1, + roleSignerEmailAddress: "signer1@email.com", + roleSignerName: "signer1", + signerOrder: 1, + signerType: SignerType.Signer, + formFields: formFields, + locale: Locales.EN) + }; var templateDetails = new SendForSignFromTemplate( templateId: templateId, title: "Document from Template", @@ -152,6 +204,52 @@ public TemplateProperties GetProperties() return templateProperties; } + /// + /// Add the template tag. + /// + public void AddTemplateTags() + { + TemplateTag addTags = new TemplateTag() + { + TemplateId = "6c386439-7f23-405a-98a3-a1bf3451a1ab", + TemplateLabels = new List + { + "test", + "test1" + }, + DocumentLabels = new List + { + "test2", + "test3" + } + }; + + this.templateApi.AddTag(addTags); + } + + /// + /// Delete the template properties. + /// + public void DeleteTags() + { + TemplateTag addTags = new TemplateTag() + { + TemplateId = "6c386439-7f23-405a-98a3-a1bf3451a1ab", + TemplateLabels = new List + { + "test", + "test1" + }, + DocumentLabels = new List + { + "test2", + "test3" + } + }; + + this.templateApi.DeleteTag(addTags); + } + /// /// Generates a edit URL to embeds template edit process into your application. /// @@ -192,29 +290,116 @@ public async Task CreateTemplate() isRequired: true, bounds: new Rectangle(x: 50, y: 50, width: 200, height: 30)), }; + + + var templateDetails = new CreateTemplateRequest + { + Title = "Template created from API SDK", + Description = "The is a template created to get a quick contract sign.", + EnableSigningOrder = true, + AutoDetectFields = true, + Roles = new List + { + new TemplateRole( + 1, + name: "RoleName", + defaultSignerEmail: "signer1@email.com", + defaultSignerName: "signer1", + signerOrder: 1, + signerType: SignerType.Signer, + formFields: formFields, + locale: Locales.EN) + }, + DocumentInfo = new List + { + new DocumentInfo( + documentTitle: "Sent using template created from API SDK", + documentDescription: "This is document message sent from API SDK", + locale: Locales.EN), + } + }; + + // document read from local as byte array + var fileBytes = await File.ReadAllBytesAsync("doc-1.pdf"); + + // document read from local as stream + await using var fs = File.OpenRead("doc-2.pdf"); + + templateDetails.Files = new List + { + new DocumentFilePath + { + ContentType = "application/pdf", + + // directly provide file path + FilePath = "doc-1.pdf", + }, + new DocumentFileBytes + { + ContentType = "application/pdf", + FileData = fileBytes, + FileName = "doc-1.pdf", + }, + new DocumentFileStream + { + ContentType = "application/pdf", + FileData = fs, + FileName = "doc-2.pdf", + }, + }; + + var templateCreated = await this.templateApi.CreateTemplateAsync(templateDetails); + + return templateCreated; + } + + /// + /// Creates the template. + /// + public async Task CreateTemplateWithRadioButtonField() + { + var radioButtonFields = new List + { + new RadioButtonField( + id: "Tamil_Language", + pageNumber: 1, + isRequired: true, + label: "Tamil", + groupName: "Language", + bounds: new Rectangle(x: 50, y: 100, width: 20, height: 20)), + new RadioButtonField( + id: "Maths_Language", + pageNumber: 1, + isRequired: true, + label: "Maths", + groupName: "Language", + bounds: new Rectangle(x: 150, y: 200, width: 20, height: 20)), + }; var templateDetails = new CreateTemplateRequest { Title = "Template created from API SDK", Description = "The is a template created to get a quick contract sign.", EnableSigningOrder = true, + AutoDetectFields = true, Roles = new List { new TemplateRole( - index: 1, + roleIndex: 1, name: "RoleName", defaultSignerEmail: "signer1@email.com", defaultSignerName: "signer1", signerOrder: 1, signerType: SignerType.Signer, - formFields: formFields), + formFields: radioButtonFields.Cast().ToList(), + locale: Locales.EN) }, DocumentInfo = new List { new DocumentInfo( - title: "Sent using template created from API SDK", - language: Languages.English, - description: "This is document message sent from API SDK"), + documentTitle: "Sent using template created from API SDK", + locale: Locales.EN, + documentDescription: "This is document message sent from API SDK"), } }; @@ -271,19 +456,27 @@ public async Task EmbeddedCreateTemplate() { Title = "Template created from API SDK", Description = "The is a template created to get a quick contract sign.", - DocumentTitle = "Sent using template created from API SDK", DocumentMessage = "This is document message sent from API SDK", EnableSigningOrder = true, + AutoDetectFields = true, Roles = new List { new TemplateRole( - index: 1, + 1, name: "Engineer", defaultSignerEmail: "signer1@email.com", defaultSignerName: "signer1", signerOrder: 1, signerType: SignerType.Signer, - formFields: formFields), + formFields: formFields, + locale: Locales.EN), + }, + DocumentInfo = new List + { + new DocumentInfo( + documentTitle: "Sent using template created from API SDK", + locale:Locales.EN, + documentDescription: "This is document message sent from API SDK"), }, Files = new List { @@ -310,5 +503,116 @@ public async Task EmbeddedCreateTemplate() // url to send the document from your web application var templateCreateUrl = templateCreated.CreateUrl; } + + /// + /// Creates the document using merge the templates. + /// + /// A DocumentCreated. + public DocumentCreated MergeAndSend() + { + // This is list of example template ids, add your own template ids created from the web app upon usage. + string[] templateIds = { "templateId1", "templateId2", "moreTemplateIds..." }; + + var formFields = new List + { + new FormField( + id: "Sign1", + type: FieldType.Signature, + pageNumber: 1, + isRequired: true, + bounds: new Rectangle(x: 50, y: 50, width: 200, height: 30)) + + }; + var formFields2 = new List + { + new FormField( + id: "Sign2", + type: FieldType.Signature, + pageNumber: 1, + isRequired: true, + bounds: new Rectangle(x: 150, y: 150, width: 200, height: 30)), + }; + var formFields3 = new List + { + new FormField( + id: "Sign3", + type: FieldType.Signature, + pageNumber: 1, + isRequired: true, + bounds: new Rectangle(x: 250, y: 250, width: 200, height: 30)), + }; + + + var roles = new List + { + new Roles( + roleSignerIndex: 1, + roleSignerEmailAddress: "sign1@gmail.com", + roleSignerName: "sign1", + signerOrder: 1, + signerType: SignerType.Signer, + formFields: formFields, + locale: Locales.EN), + new Roles( + roleSignerIndex: 2, + roleSignerEmailAddress: "sign2@gmail.com", + roleSignerName: "sign2", + signerOrder: 1, + signerType: SignerType.Signer, + formFields: formFields2, + locale: Locales.EN), + new Roles( + roleSignerIndex: 3, + roleSignerEmailAddress: "sign3@gmail.com", + roleSignerName: "sign3", + signerOrder: 1, + signerType: SignerType.Signer, + formFields: formFields3, + locale: Locales.EN) + }; + + var templateDetails = new MergeAndSendForSign( + templateIds: templateIds, + title: "Create Document from Merged Templates", + message: "This is the document description", + roles: roles); + + var documentCreated = this.templateApi.MergeAndSend(templateDetails); + + return documentCreated; + } + + /// + /// Remove the fields via send document using template. + /// + /// A DocumentCreated. + public DocumentCreated RemoveFieldsViaTemplateSend() + { + // This is an example document id, add your own template id created from the web app upon usage. + var templateId = "43707a56-e2e1-4bde-9ce1-1b2958fcc015"; + + var templateDetails = new SendForSignFromTemplate( + templateId: templateId, + title: "Document from Template", + message: "This document description", + roles:new List() + { + new Roles() + { + RoleIndex = 1, + SignerName = "signer", + SignerEmail = "signer@123.com", + SignerOrder = 1, + SignerRole = "signer", + SignerType = SignerType.Signer, + } + }); + var removefields = new List(); + removefields.Add("TextBox1"); + templateDetails.RemoveFormFields = removefields; + var documentCreated = this.templateApi.SendUsingTemplate(templateDetails); + + return documentCreated; + } } } diff --git a/src/BoldSign/Api/ApiClient.cs b/src/BoldSign/Api/ApiClient.cs index 7facdaa..d335f78 100644 --- a/src/BoldSign/Api/ApiClient.cs +++ b/src/BoldSign/Api/ApiClient.cs @@ -16,13 +16,17 @@ namespace BoldSign.Api using System.Globalization; using System.IO; using System.Linq; + using System.Net; + using System.Net.Http; + using System.Net.Http.Headers; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; + using System.Web; + using BoldSign.Api.Extensions; + using BoldSign.Api.Resources; using BoldSign.Model; using Newtonsoft.Json; - using RestSharp; - using RestSharp.Extensions; /// /// API client is mainly responsible for making the HTTP call to the API backend. @@ -43,6 +47,13 @@ public class ApiClient { ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, }; + private List noContentMethods = new List + { + HttpMethod.Get, + HttpMethod.Head, + HttpMethod.Delete, + }; + private HttpClient httpClient; /// /// Initializes a new instance of the class @@ -51,33 +62,36 @@ public class ApiClient public ApiClient() { this.Configuration = Api.Configuration.Default; - this.RestClient = new RestClient(this.Configuration.BasePath); + this.HttpClient = new HttpClient(); + this.HttpClient.BaseAddress = new Uri(this.Configuration.BasePath); } /// /// Initializes a new instance of the class - /// with default base path . + /// with default base path . /// /// An instance of Configuration. public ApiClient(Configuration config) { this.Configuration = config ?? Api.Configuration.Default; - this.RestClient = new RestClient(this.Configuration.BasePath); + this.HttpClient = new HttpClient(); + this.HttpClient.BaseAddress = new Uri(this.Configuration.BasePath); } /// /// Initializes a new instance of the class - /// with default base path and api key. . /// - /// An instance of Configuration. + /// An instance of base path. + /// An instance of api key. public ApiClient(string basePath, string apiKey) { if (string.IsNullOrEmpty(basePath)) { throw new ArgumentException("basePath cannot be empty"); } - this.RestClient = new RestClient(basePath); + this.HttpClient = new HttpClient(); + this.HttpClient.BaseAddress = new Uri(basePath); this.Configuration = Api.Configuration.Default; this.Configuration.DefaultHeader.Remove(XApiKey); this.Configuration.DefaultHeader.Add(XApiKey, apiKey); @@ -115,7 +129,8 @@ public ApiClient(string basePath = Api.Configuration.ApiBaseUrl) throw new ArgumentException("basePath cannot be empty"); } - this.RestClient = new RestClient(basePath); + this.HttpClient = new HttpClient(); + this.HttpClient.BaseAddress = new Uri(basePath); this.Configuration = Api.Configuration.Default; } @@ -131,61 +146,46 @@ public ApiClient(string basePath = Api.Configuration.ApiBaseUrl) public IReadableConfiguration Configuration { get; set; } /// - /// Gets or sets the RestClient. - /// - /// An instance of the RestClient - internal RestClient RestClient { get; set; } - - /// - /// Allows for extending request processing for generated code. + /// Gets or sets the HttpClient. /// - /// The RestSharp request object - private void InterceptRequest(IRestRequest request) + /// An instance of the HttpClient. + internal HttpClient HttpClient { - // Make this method partial, if extending or intercepting is required. + get => this.httpClient ?? new HttpClient(); + set => this.httpClient = value; } + // Creates and sets up a RestRequest prior to a call. /// - /// Allows for extending response processing for generated code. + /// Creates and sets up a RestRequest prior to a call. /// - /// The RestSharp request object - /// The RestSharp response object - private void InterceptResponse(IRestRequest request, IRestResponse response) - { - // Make this method partial, if extending or intercepting is required. - } - - // Creates and sets up a RestRequest prior to a call. - internal RestRequest PrepareRequest( - string path, Method method, List> queryParams, object postBody, - Dictionary headerParams, Dictionary formParams, - Dictionary> fileParams, Dictionary pathParams, - string contentType, Dictionary fileUrlsParams, Dictionary singleFileParam) + /// Gets or sets a path. + /// Gets or sets a method. + /// Gets or sets a queryParams. + /// Gets or sets a postBody. + /// Gets or sets a headerParams. + /// Gets or sets a formParams. + /// Gets or sets a fileParams. + /// Gets or sets a contentType. + /// Gets or sets a fileUrlParams.> + /// Gets or sets a singleFileParam.> + /// request. + internal HttpRequestMessage PrepareRequest(string path, HttpMethod method, List> queryParams, object postBody, Dictionary headerParams, Dictionary formParams, Dictionary> fileParams, string contentType, Dictionary fileUrlsParams, KeyValuePair singleFileParam) { - var request = new RestRequest(path, method); - - // add path parameter, if any - foreach (var param in pathParams) - { - request.AddParameter(param.Key, param.Value, ParameterType.UrlSegment); - } + var pathUrl = BuildUri(path, queryParams); + var request = new HttpRequestMessage(method, pathUrl); + var form = new MultipartFormDataContent(); // add header parameter, if any foreach (var param in headerParams) { - request.AddHeader(param.Key, param.Value); - } - - // add query parameter, if any - foreach (var param in queryParams) - { - request.AddQueryParameter(param.Key, param.Value); + request.Headers.Add(param.Key, param.Value); } // add form parameter, if any foreach (var param in formParams) { - request.AddParameter(param.Key, param.Value); + form.AddFormParameter(param.Key, param.Value); } // add file parameter, if any @@ -195,36 +195,93 @@ internal RestRequest PrepareRequest( { if (file is DocumentFilePath documentFilePath) { - request.AddFile(param.Key, Path.GetFullPath(documentFilePath.FilePath), documentFilePath.ContentType); + if (string.IsNullOrEmpty(documentFilePath.FilePath)) + { + throw new ApiException(400, string.Format(CultureInfo.CurrentCulture, ApiValidationMessages.EmptyFields, nameof(documentFilePath.FilePath))); + } + + if (string.IsNullOrEmpty(documentFilePath.ContentType)) + { + throw new ApiException(422, ApiValidationMessages.UnsupportedFileType); + } + + var fileContent = new ByteArrayContent(File.ReadAllBytes(documentFilePath.FilePath)); + fileContent.Headers.ContentType = MediaTypeHeaderValue.Parse(documentFilePath.ContentType); + var fileName = Path.GetFileName(documentFilePath.FilePath); + form.Add(fileContent, param.Key, fileName); } else { var documentFile = GetDocumentFile(file); - request.AddFile(param.Key, documentFile.FileData, documentFile.FileName, documentFile.ContentType); + if (string.IsNullOrEmpty(documentFile.FileName)) + { + throw new ApiException(400, string.Format(CultureInfo.CurrentCulture, ApiValidationMessages.EmptyFields, nameof(documentFile.FileName))); + } + + if (string.IsNullOrEmpty(documentFile.ContentType)) + { + throw new ApiException(422, ApiValidationMessages.UnsupportedFileType); + } + + var byteArrayContent = new ByteArrayContent(documentFile.FileData); + byteArrayContent.Headers.ContentType = MediaTypeHeaderValue.Parse(documentFile.ContentType); + form.Add(byteArrayContent, param.Key, documentFile.FileName); } } } - // add single file URL parameter, if any - if (singleFileParam != null) + if (!string.IsNullOrEmpty(singleFileParam.Key)) { - foreach (var param in singleFileParam) + var key = singleFileParam.Key; + if (singleFileParam.Value == null) + { + throw new ApiException((int)HttpStatusCode.BadRequest, string.Format(CultureInfo.CurrentCulture, ApiValidationMessages.EmptyFields, singleFileParam.Key)); + } + + switch (singleFileParam.Value) { - var documentFile = GetDocumentFile(param.Value); - request.AddFile(param.Key, documentFile.FileName, documentFile.ContentType); + case ImageFileStream brandingFileStream: + { + HandleFileStream(brandingFileStream, key, form); + break; + } + + case ImageFileBytes brandingFileBytes: + { + HandleFileBytes(brandingFileBytes, key, form); + break; + } + + case ImageFilePath brandingFilePath: + { + HandleFilePath(brandingFilePath, key, form); + break; + } + + default: + { + throw new InvalidOperationException(ApiValidationMessages.InvalidBrandFileInstance); + } } } // add file URL parameter, if any foreach (var param in fileUrlsParams) { - request.AddParameter(param.Key, param.Value); + form.AddFormParameter(param.Key, param.Value?.AbsoluteUri); } + // http body (model or byte[]) parameter + if (postBody != null) + { + var requestBodyContent = new StringContent(postBody.ToString(), Encoding.UTF8, contentType); + request.Content = requestBodyContent; + return request; + } - if (postBody != null) // http body (model or byte[]) parameter + if (!this.noContentMethods.Contains(method) && form.Any()) { - request.AddParameter(contentType, postBody, ParameterType.RequestBody); + request.Content = form; } return request; @@ -248,10 +305,11 @@ private static DocumentFile GetDocumentFile(IDocumentFile documentFile) } else if (documentFile is DocumentFileStream documentFileStream) { + var bytes = documentFileStream.FileData.ReadAsBytes(); return new DocumentFile { ContentType = documentFileStream.ContentType, - FileData = documentFileStream.FileData.ReadAsBytes(), + FileData = bytes, FileName = documentFileStream.FileName, }; } @@ -269,30 +327,23 @@ private static DocumentFile GetDocumentFile(IDocumentFile documentFile) /// Header parameters. /// Form parameters. /// File parameters. - /// Path parameters. - /// Content Type of the request - /// File Url parameter.> + /// Gets or sets a contentType. + /// File URL parameter. /// Single file parameter. - /// Object - internal object CallApi( - string path, Method method, List> queryParams, object postBody, - Dictionary headerParams, Dictionary formParams, - Dictionary> fileParams, Dictionary pathParams, - string contentType, Dictionary fileUrlParams, Dictionary singleFileParam = null) + /// Object. + internal HttpResponseMessage CallApi(string path, HttpMethod method, List> queryParams, object postBody, Dictionary headerParams, Dictionary formParams, Dictionary> fileParams, string contentType, Dictionary fileUrlParams, KeyValuePair singleFileParam = default) { - var request = this.PrepareRequest( - path, method, queryParams, postBody, headerParams, formParams, fileParams, - pathParams, contentType, fileUrlParams, singleFileParam); - - // set timeout + using var request = this.PrepareRequest(path, method, queryParams, postBody, headerParams, formParams, fileParams, contentType, fileUrlParams, singleFileParam); - this.RestClient.Timeout = this.Configuration.Timeout; // set user agent - this.RestClient.UserAgent = this.Configuration.UserAgent; + if (this.HttpClient.DefaultRequestHeaders.UserAgent.Count == 0) + { + this.HttpClient.DefaultRequestHeaders.UserAgent.ParseAdd(this.Configuration.UserAgent); + } - this.InterceptRequest(request); - var response = this.RestClient.Execute(request); - this.InterceptResponse(request, response); + this.InterceptRequest(); + var response = this.HttpClient.SendAsync(request).GetAwaiter().GetResult(); + this.InterceptResponse(); return response; } @@ -307,24 +358,21 @@ internal object CallApi( /// Header parameters. /// Form parameters. /// File parameters. - /// Path parameters. - /// Content type. + /// Gets or sets a contentType. /// File Urls parameter. /// single file parameter. /// The Task instance. - internal async Task CallApiAsync( - string path, Method method, List> queryParams, object postBody, - Dictionary headerParams, Dictionary formParams, - Dictionary> fileParams, Dictionary pathParams, - string contentType, Dictionary fileUrlsParams, Dictionary singleFileParam = null) - { - var request = this.PrepareRequest( - path, method, queryParams, postBody, headerParams, formParams, fileParams, - pathParams, contentType, fileUrlsParams, singleFileParam); - this.RestClient.UserAgent = this.Configuration.UserAgent; - this.InterceptRequest(request); - var response = await this.RestClient.ExecuteTaskAsync(request); - this.InterceptResponse(request, response); + internal async Task CallApiAsync(string path, HttpMethod method, List> queryParams, object postBody, Dictionary headerParams, Dictionary formParams, Dictionary> fileParams, string contentType, Dictionary fileUrlsParams, KeyValuePair singleFileParam = default) + { + using var request = this.PrepareRequest(path, method, queryParams, postBody, headerParams, formParams, fileParams, contentType, fileUrlsParams, singleFileParam); + if (this.HttpClient.DefaultRequestHeaders.UserAgent.Count == 0) + { + this.HttpClient.DefaultRequestHeaders.UserAgent.ParseAdd(this.Configuration.UserAgent); + } + + this.InterceptRequest(); + var response = await this.HttpClient.SendAsync(request).ConfigureAwait(false); + this.InterceptResponse(); return response; } @@ -337,19 +385,19 @@ internal async Task CallApiAsync( public string EscapeString(string str) => UrlEncode(str); /// - /// Create FileParameter based on Stream. + /// Allows for extending request processing for generated code. /// - /// Parameter name. - /// Input stream. - /// FileParameter. - private FileParameter ParameterToFile(string name, Stream stream) + private void InterceptRequest() { - if (stream is FileStream) - { - return FileParameter.Create(name, ReadAsBytes(stream), Path.GetFileName(((FileStream)stream).Name)); - } + // Make this method partial, if extending or intercepting is required. + } - return FileParameter.Create(name, ReadAsBytes(stream), "no_file_name_provided"); + /// + /// Allows for extending response processing for generated code. + /// + private void InterceptResponse() + { + // Make this method partial, if extending or intercepting is required. } /// @@ -411,13 +459,15 @@ internal string ParameterToString(object obj) /// The HTTP response. /// Object type. /// Object representation of the JSON string. - internal object Deserialize(IRestResponse response, Type type) + internal object Deserialize(HttpResponseMessage response, Type type) { var headers = response.Headers; - if (type == typeof(byte[])) // return byte array + // return byte array + if (type == typeof(byte[])) { - return response.RawBytes; + var res = response.Content.ReadAsStringAsync().GetAwaiter().GetResult(); + return res; } // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) @@ -436,25 +486,27 @@ internal object Deserialize(IRestResponse response, Type type) if (match.Success) { - var fileName = filePath + SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); - File.WriteAllBytes(fileName, response.RawBytes); + var fileName = filePath + SanitizeFilename(match.Groups[1].Value.Replace("\"", string.Empty).Replace("'", string.Empty)); + File.WriteAllBytes(fileName, response.Content.ReadAsByteArrayAsync().GetAwaiter().GetResult()); return new FileStream(fileName, FileMode.Open); } } } - var stream = new MemoryStream(response.RawBytes); + var stream = new MemoryStream(response.Content.ReadAsByteArrayAsync().GetAwaiter().GetResult()); return stream; } - if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object + // return a datetime object + if (type.Name.StartsWith("System.Nullable`1[[System.DateTime", StringComparison.CurrentCulture)) { - return DateTime.Parse(response.Content, null, DateTimeStyles.RoundtripKind); + return DateTime.Parse(response.Content.ReadAsStringAsync().GetAwaiter().GetResult(), null, DateTimeStyles.RoundtripKind); } - if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type + // return primitive type + if (type == typeof(string) || type.Name.StartsWith("System.Nullable", StringComparison.CurrentCulture)) { return ConvertType(response.Content, type); } @@ -462,7 +514,7 @@ internal object Deserialize(IRestResponse response, Type type) // at this point, it must be a model (json) try { - return JsonConvert.DeserializeObject(response.Content, type, this.serializerSettings); + return JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().GetAwaiter().GetResult(), type, this.serializerSettings); } catch (Exception e) { @@ -522,11 +574,11 @@ internal string SelectHeaderContentType(string[] contentTypes) { if (this.IsJsonMime(contentType.ToLower())) { - return contentType; + return "application/json"; } } - return contentTypes[0]; // use the first content type specified in 'consumes' + return "application/json"; // use the first content type specified in 'consumes' } /// @@ -588,6 +640,17 @@ private static byte[] ReadAsBytes(Stream inputStream) } } + private static string BuildUri(string path, IEnumerable> queryParams) + { + if (queryParams == null || !queryParams.Any()) + { + return path; + } + + var queryString = string.Join("&", queryParams.Select(x => $"{WebUtility.UrlEncode(x.Key)}={WebUtility.UrlEncode(x.Value)}")); + return $"{path}?{queryString}"; + } + /// /// URL encode a string /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 @@ -671,5 +734,99 @@ internal IEnumerable> ParameterToKeyValuePairs(stri /// /// True if object is a collection type private static bool IsCollection(object value) => value is IList || value is ICollection; + + private static void HandleFileBytes(ImageFileBytes brandLogoFileBytes, string key, MultipartFormDataContent form) + { + var fileBytes = brandLogoFileBytes.FileBytes; + if (fileBytes == null) + { + throw new ApiException((int)HttpStatusCode.BadRequest, string.Format(CultureInfo.CurrentCulture, ApiValidationMessages.EmptyFields, nameof(brandLogoFileBytes.FileBytes))); + } + + AddFileContentToForm(fileBytes, key, form); + } + + private static void HandleFileStream(ImageFileStream documentFileStream, string key, MultipartFormDataContent form) + { + var fileStream = documentFileStream.FileStream; + if (fileStream == null) + { + throw new ApiException((int)HttpStatusCode.BadRequest, string.Format(CultureInfo.CurrentCulture, ApiValidationMessages.EmptyFields, nameof(documentFileStream.FileStream))); + } + + using var memoryStream = new MemoryStream(); + fileStream.CopyTo(memoryStream); + + AddFileContentToForm(memoryStream.ToArray(), key, form); + } + + private static void HandleFilePath(ImageFilePath documentFilePath, string key, MultipartFormDataContent form) + { + // If FilePath is empty, throw an exception + if (string.IsNullOrEmpty(documentFilePath.FilePath)) + { + throw new ApiException((int)HttpStatusCode.BadRequest, string.Format(CultureInfo.CurrentCulture, ApiValidationMessages.EmptyFields, nameof(documentFilePath.FilePath))); + } + + AddFileContentToForm(File.ReadAllBytes(documentFilePath.FilePath), key, form); + } + + private static void AddFileContentToForm(byte[] fileBytes, string key, MultipartFormDataContent form) + { + var fileName = $"{GetExtension(fileBytes)}"; + var fileContent = new ByteArrayContent(fileBytes); + fileContent.Headers.ContentDisposition = new ContentDispositionHeaderValue("form-data") + { + Name = key, + FileName = fileName, + }; + form.Add(fileContent); + } + + private static string GetExtension(byte[] bytes) + { + if (IsPng(bytes)) + { + return ".png"; + } + else if (IsJpeg(bytes)) + { + return ".jpeg"; + } + else if (IsSvg(bytes)) + { + return ".svg"; + } + + throw new ApiException((int)HttpStatusCode.BadRequest, ApiValidationMessages.UnsupportedBrandLogoType); + } + + private static bool IsPng(byte[] fileBytes) + { + // PNG files start with the following bytes (magic number): 89 50 4E 47 0D 0A 1A 0A + return fileBytes.Length >= 8 && + fileBytes[0] == 0x89 && + fileBytes[1] == 0x50 && + fileBytes[2] == 0x4E && + fileBytes[3] == 0x47 && + fileBytes[4] == 0x0D && + fileBytes[5] == 0x0A && + fileBytes[6] == 0x1A && + fileBytes[7] == 0x0A; + } + + private static bool IsJpeg(byte[] fileBytes) + { + // JPEG or JPG files start with the following bytes (magic number): FF D8 + return fileBytes.Length >= 2 && + fileBytes[0] == 255 && // JPEG signature + fileBytes[1] == 216; + } + + private static bool IsSvg(byte[] fileBytes) + { + string fileHeader = Encoding.UTF8.GetString(fileBytes); + return fileHeader.StartsWith(" /// Represents a collection of functions to interact with the API endpoints. The functions perform actions such as creating brand, deleting brand, listing the brand and so on. @@ -108,7 +108,7 @@ public ExceptionFactory ExceptionFactory /// /// The base path. /// GetBasePath. - public string GetBasePath() => this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); + public string GetBasePath() => this.Configuration.ApiClient.HttpClient.BaseAddress.AbsoluteUri; /// /// Delete the branding when a particular brand’s ID is given as input. @@ -135,13 +135,11 @@ public ApiResponse DeleteBrandWithHttpInfo(string brandId) } var localVarPath = "/v1/brand/delete"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary>(); var localVarFileUrlParams = new Dictionary(); - var localVarSingleFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header @@ -184,7 +182,7 @@ public ApiResponse DeleteBrandWithHttpInfo(string brandId) } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams, localVarSingleFileParams); + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -197,7 +195,7 @@ public ApiResponse DeleteBrandWithHttpInfo(string brandId) return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -227,13 +225,11 @@ public async Task> DeleteBrandAsyncWithHttpInfo(string brand } var localVarPath = "/v1/brand/delete"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary>(); var localVarFileUrlParams = new Dictionary(); - var localVarSingleFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header @@ -276,7 +272,7 @@ public async Task> DeleteBrandAsyncWithHttpInfo(string brand } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams, localVarSingleFileParams).ConfigureAwait(false); + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -289,7 +285,7 @@ public async Task> DeleteBrandAsyncWithHttpInfo(string brand return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -318,13 +314,11 @@ public ApiResponse ResetDefaultBrandWithHttpInfo(string brandId) } var localVarPath = "/v1/brand/resetdefault"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary>(); var localVarFileUrlParams = new Dictionary(); - var localVarSingleFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header @@ -367,7 +361,7 @@ public ApiResponse ResetDefaultBrandWithHttpInfo(string brandId) } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams, localVarSingleFileParams); + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -380,7 +374,7 @@ public ApiResponse ResetDefaultBrandWithHttpInfo(string brandId) return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -410,13 +404,11 @@ public async Task> ResetDefaultBrandWithHttpInfoAsync(string } var localVarPath = "/v1/brand/resetdefault"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary>(); var localVarFileUrlParams = new Dictionary(); - var localVarSingleFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header @@ -459,7 +451,7 @@ public async Task> ResetDefaultBrandWithHttpInfoAsync(string } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams, localVarSingleFileParams).ConfigureAwait(false); + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -472,7 +464,7 @@ public async Task> ResetDefaultBrandWithHttpInfoAsync(string return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -504,13 +496,12 @@ public ApiResponse CreateBrandWithHttpInfo(BrandSettings createBra ValidateBrandSettings(createBrandData); var localVarPath = "/v1/brand/create"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary>(); var localVarFileUrlParams = new Dictionary(); - var localVarSingleFileParams = new Dictionary(); + KeyValuePair localVarSingleFileParams; object localVarPostBody = null; // to determine the Content-Type header @@ -539,18 +530,32 @@ public ApiResponse CreateBrandWithHttpInfo(BrandSettings createBra } localVarFormParams.Add(nameof(createBrandData.BrandName), createBrandData.BrandName); - localVarSingleFileParams.Add("BrandLogo", createBrandData.BrandLogo); + localVarSingleFileParams = new KeyValuePair(nameof(createBrandData.BrandLogo), createBrandData.BrandLogo); localVarFormParams.Add(nameof(createBrandData.BackgroundColor), createBrandData.BackgroundColor); localVarFormParams.Add(nameof(createBrandData.ButtonColor), createBrandData.ButtonColor); localVarFormParams.Add(nameof(createBrandData.ButtonTextColor), createBrandData.ButtonTextColor); localVarFormParams.Add(nameof(createBrandData.CanHideTagLine), createBrandData.CanHideTagLine ? "true" : "false"); localVarFormParams.Add(nameof(createBrandData.CombineAuditTrail), createBrandData.CombineAuditTrail ? "true" : "false"); + localVarFormParams.Add(nameof(createBrandData.ExcludeAuditTrailFromEmail), createBrandData.ExcludeAuditTrailFromEmail ? "true" : "false"); localVarFormParams.Add(nameof(createBrandData.IsDefault), createBrandData.IsDefault ? "true" : "false"); localVarFormParams.Add(nameof(createBrandData.RedirectUrl), createBrandData.RedirectUrl); localVarFormParams.Add(nameof(createBrandData.EmailDisplayName), createBrandData.EmailDisplayName); localVarFormParams.Add(nameof(createBrandData.DisclaimerDescription), createBrandData.DisclaimerDescription); localVarFormParams.Add(nameof(createBrandData.DisclaimerTitle), createBrandData.DisclaimerTitle); localVarFormParams.Add(nameof(createBrandData.DocumentTimeZone), createBrandData.DocumentTimeZone); + localVarFormParams.Add(nameof(createBrandData.AllowCustomFieldCreation), createBrandData.AllowCustomFieldCreation ? "true" : "false"); + localVarFormParams.Add(nameof(createBrandData.ShowBuiltInFormFields), createBrandData.ShowBuiltInFormFields ? "true" : "false"); + localVarFormParams.Add(nameof(createBrandData.ShowSharedCustomFields), createBrandData.ShowSharedCustomFields ? "true" : "false"); + + if (createBrandData.HideDecline != null) + { + localVarFormParams.Add(nameof(createBrandData.HideDecline), createBrandData.HideDecline.Value ? "true" : "false"); + } + + if (createBrandData.HideSave != null) + { + localVarFormParams.Add(nameof(createBrandData.HideSave), createBrandData.HideSave.Value ? "true" : "false"); + } if (createBrandData.EmailSignedDocument != 0) { @@ -558,7 +563,7 @@ public ApiResponse CreateBrandWithHttpInfo(BrandSettings createBra } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams, localVarSingleFileParams); + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams, localVarSingleFileParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -571,7 +576,7 @@ public ApiResponse CreateBrandWithHttpInfo(BrandSettings createBra return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (BrandingData)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(BrandingData))); } @@ -603,13 +608,12 @@ public async Task> CreateBrandAsyncWithHttpInfo(BrandS ValidateBrandSettings(createBrandData); var localVarPath = "/v1/brand/create"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary>(); var localVarFileUrlParams = new Dictionary(); - var localVarSingleFileParams = new Dictionary(); + KeyValuePair localVarSingleFileParams; object localVarPostBody = null; // to determine the Content-Type header @@ -638,18 +642,32 @@ public async Task> CreateBrandAsyncWithHttpInfo(BrandS } localVarFormParams.Add(nameof(createBrandData.BrandName), createBrandData.BrandName); - localVarSingleFileParams.Add("BrandLogo", createBrandData.BrandLogo); + localVarSingleFileParams = new KeyValuePair(nameof(createBrandData.BrandLogo), createBrandData.BrandLogo); localVarFormParams.Add(nameof(createBrandData.BackgroundColor), createBrandData.BackgroundColor); localVarFormParams.Add(nameof(createBrandData.ButtonColor), createBrandData.ButtonColor); localVarFormParams.Add(nameof(createBrandData.ButtonTextColor), createBrandData.ButtonTextColor); localVarFormParams.Add(nameof(createBrandData.CanHideTagLine), createBrandData.CanHideTagLine ? "true" : "false"); localVarFormParams.Add(nameof(createBrandData.CombineAuditTrail), createBrandData.CombineAuditTrail ? "true" : "false"); + localVarFormParams.Add(nameof(createBrandData.ExcludeAuditTrailFromEmail), createBrandData.ExcludeAuditTrailFromEmail ? "true" : "false"); localVarFormParams.Add(nameof(createBrandData.IsDefault), createBrandData.IsDefault ? "true" : "false"); localVarFormParams.Add(nameof(createBrandData.RedirectUrl), createBrandData.RedirectUrl); localVarFormParams.Add(nameof(createBrandData.EmailDisplayName), createBrandData.EmailDisplayName); localVarFormParams.Add(nameof(createBrandData.DisclaimerDescription), createBrandData.DisclaimerDescription); localVarFormParams.Add(nameof(createBrandData.DisclaimerTitle), createBrandData.DisclaimerTitle); localVarFormParams.Add(nameof(createBrandData.DocumentTimeZone), createBrandData.DocumentTimeZone); + localVarFormParams.Add(nameof(createBrandData.AllowCustomFieldCreation), createBrandData.AllowCustomFieldCreation ? "true" : "false"); + localVarFormParams.Add(nameof(createBrandData.ShowBuiltInFormFields), createBrandData.ShowBuiltInFormFields ? "true" : "false"); + localVarFormParams.Add(nameof(createBrandData.ShowSharedCustomFields), createBrandData.ShowSharedCustomFields ? "true" : "false"); + + if (createBrandData.HideDecline != null) + { + localVarFormParams.Add(nameof(createBrandData.HideDecline), createBrandData.HideDecline.Value ? "true" : "false"); + } + + if (createBrandData.HideSave != null) + { + localVarFormParams.Add(nameof(createBrandData.HideSave), createBrandData.HideSave.Value ? "true" : "false"); + } if (createBrandData.EmailSignedDocument != 0) { @@ -657,7 +675,7 @@ public async Task> CreateBrandAsyncWithHttpInfo(BrandS } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams, localVarSingleFileParams).ConfigureAwait(false); + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams, localVarSingleFileParams).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; var exception = this.ExceptionFactory?.Invoke("CreateBrand", localVarResponse); @@ -669,7 +687,7 @@ public async Task> CreateBrandAsyncWithHttpInfo(BrandS return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (BrandingData)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(BrandingData))); } @@ -700,16 +718,15 @@ public ApiResponse EditBrandWithHttpInfo(string brandId, BrandSett throw new ArgumentNullException(nameof(editBrandData)); } - ValidateBrandSettings(editBrandData); + ValidateEditBrandSettings(editBrandData); var localVarPath = "/v1/brand/edit"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary>(); var localVarFileUrlParams = new Dictionary(); - var localVarSingleFileParams = new Dictionary(); + KeyValuePair localVarSingleFileParams = default; object localVarPostBody = null; // to determine the Content-Type header @@ -739,18 +756,35 @@ public ApiResponse EditBrandWithHttpInfo(string brandId, BrandSett localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "brandId", brandId)); // query parameter localVarFormParams.Add(nameof(editBrandData.BrandName), editBrandData.BrandName); - localVarSingleFileParams.Add("BrandLogo", editBrandData.BrandLogo); + if (editBrandData.BrandLogo != null) + { + localVarSingleFileParams = new KeyValuePair(nameof(editBrandData.BrandLogo), editBrandData.BrandLogo); + } localVarFormParams.Add(nameof(editBrandData.BackgroundColor), editBrandData.BackgroundColor); localVarFormParams.Add(nameof(editBrandData.ButtonColor), editBrandData.ButtonColor); localVarFormParams.Add(nameof(editBrandData.ButtonTextColor), editBrandData.ButtonTextColor); localVarFormParams.Add(nameof(editBrandData.CanHideTagLine), editBrandData.CanHideTagLine ? "true" : "false"); localVarFormParams.Add(nameof(editBrandData.CombineAuditTrail), editBrandData.CombineAuditTrail ? "true" : "false"); + localVarFormParams.Add(nameof(editBrandData.ExcludeAuditTrailFromEmail), editBrandData.ExcludeAuditTrailFromEmail ? "true" : "false"); localVarFormParams.Add(nameof(editBrandData.IsDefault), editBrandData.IsDefault ? "true" : "false"); localVarFormParams.Add(nameof(editBrandData.RedirectUrl), editBrandData.RedirectUrl); localVarFormParams.Add(nameof(editBrandData.EmailDisplayName), editBrandData.EmailDisplayName); localVarFormParams.Add(nameof(editBrandData.DisclaimerDescription), editBrandData.DisclaimerDescription); localVarFormParams.Add(nameof(editBrandData.DisclaimerTitle), editBrandData.DisclaimerTitle); localVarFormParams.Add(nameof(editBrandData.DocumentTimeZone), editBrandData.DocumentTimeZone); + localVarFormParams.Add(nameof(editBrandData.AllowCustomFieldCreation), editBrandData.AllowCustomFieldCreation ? "true" : "false"); + localVarFormParams.Add(nameof(editBrandData.ShowBuiltInFormFields), editBrandData.ShowBuiltInFormFields ? "true" : "false"); + localVarFormParams.Add(nameof(editBrandData.ShowSharedCustomFields), editBrandData.ShowSharedCustomFields ? "true" : "false"); + + if (editBrandData.HideDecline != null) + { + localVarFormParams.Add(nameof(editBrandData.HideDecline), editBrandData.HideDecline.Value ? "true" : "false"); + } + + if (editBrandData.HideSave != null) + { + localVarFormParams.Add(nameof(editBrandData.HideSave), editBrandData.HideSave.Value ? "true" : "false"); + } if (editBrandData.EmailSignedDocument != 0) { @@ -758,7 +792,7 @@ public ApiResponse EditBrandWithHttpInfo(string brandId, BrandSett } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams, localVarSingleFileParams); + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams, localVarSingleFileParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -771,7 +805,7 @@ public ApiResponse EditBrandWithHttpInfo(string brandId, BrandSett return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (BrandingData)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(BrandingData))); } @@ -802,16 +836,15 @@ public async Task> EditBrandAsyncWithHttpInfo(string b throw new ArgumentNullException(nameof(editBrandData)); } - ValidateBrandSettings(editBrandData); + ValidateEditBrandSettings(editBrandData); var localVarPath = "/v1/brand/edit"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary>(); var localVarFileUrlParams = new Dictionary(); - var localVarSingleFileParams = new Dictionary(); + KeyValuePair localVarSingleFileParams = default; object localVarPostBody = null; // to determine the Content-Type header @@ -841,18 +874,35 @@ public async Task> EditBrandAsyncWithHttpInfo(string b localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "brandId", brandId)); // query parameter localVarFormParams.Add(nameof(editBrandData.BrandName), editBrandData.BrandName); - localVarSingleFileParams.Add("BrandLogo", editBrandData.BrandLogo); + if (editBrandData.BrandLogo != null) + { + localVarSingleFileParams = new KeyValuePair(nameof(editBrandData.BrandLogo), editBrandData.BrandLogo); + } localVarFormParams.Add(nameof(editBrandData.BackgroundColor), editBrandData.BackgroundColor); localVarFormParams.Add(nameof(editBrandData.ButtonColor), editBrandData.ButtonColor); localVarFormParams.Add(nameof(editBrandData.ButtonTextColor), editBrandData.ButtonTextColor); localVarFormParams.Add(nameof(editBrandData.CanHideTagLine), editBrandData.CanHideTagLine ? "true" : "false"); localVarFormParams.Add(nameof(editBrandData.CombineAuditTrail), editBrandData.CombineAuditTrail ? "true" : "false"); + localVarFormParams.Add(nameof(editBrandData.ExcludeAuditTrailFromEmail), editBrandData.ExcludeAuditTrailFromEmail ? "true" : "false"); localVarFormParams.Add(nameof(editBrandData.IsDefault), editBrandData.IsDefault ? "true" : "false"); localVarFormParams.Add(nameof(editBrandData.RedirectUrl), editBrandData.RedirectUrl); localVarFormParams.Add(nameof(editBrandData.EmailDisplayName), editBrandData.EmailDisplayName); localVarFormParams.Add(nameof(editBrandData.DisclaimerDescription), editBrandData.DisclaimerDescription); localVarFormParams.Add(nameof(editBrandData.DisclaimerTitle), editBrandData.DisclaimerTitle); localVarFormParams.Add(nameof(editBrandData.DocumentTimeZone), editBrandData.DocumentTimeZone); + localVarFormParams.Add(nameof(editBrandData.AllowCustomFieldCreation), editBrandData.AllowCustomFieldCreation ? "true" : "false"); + localVarFormParams.Add(nameof(editBrandData.ShowBuiltInFormFields), editBrandData.ShowBuiltInFormFields ? "true" : "false"); + localVarFormParams.Add(nameof(editBrandData.ShowSharedCustomFields), editBrandData.ShowSharedCustomFields ? "true" : "false"); + + if (editBrandData.HideDecline != null) + { + localVarFormParams.Add(nameof(editBrandData.HideDecline), editBrandData.HideDecline.Value ? "true" : "false"); + } + + if (editBrandData.HideSave != null) + { + localVarFormParams.Add(nameof(editBrandData.HideSave), editBrandData.HideSave.Value ? "true" : "false"); + } if (editBrandData.EmailSignedDocument != 0) { @@ -860,7 +910,7 @@ public async Task> EditBrandAsyncWithHttpInfo(string b } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams, localVarSingleFileParams).ConfigureAwait(false); + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams, localVarSingleFileParams).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; var exception = this.ExceptionFactory?.Invoke("EditBrand", localVarResponse); @@ -872,7 +922,7 @@ public async Task> EditBrandAsyncWithHttpInfo(string b return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (BrandingData)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(BrandingData))); } @@ -896,13 +946,11 @@ public BrandingRecords ListBrand() public ApiResponse ListBrandWithHttpInfo() { var localVarPath = "/v1/brand/list"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary>(); var localVarFileUrlParams = new Dictionary(); - var localVarSingleFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header @@ -931,7 +979,7 @@ public ApiResponse ListBrandWithHttpInfo() } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams, localVarSingleFileParams); + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -944,7 +992,7 @@ public ApiResponse ListBrandWithHttpInfo() return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (BrandingRecords)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(BrandingRecords))); } @@ -968,13 +1016,11 @@ public async Task ListBrandAsync() public async Task> ListBrandAsyncWithHttpInfo() { var localVarPath = "/v1/brand/list"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary>(); var localVarFileUrlParams = new Dictionary(); - var localVarSingleFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header @@ -1003,7 +1049,7 @@ public async Task> ListBrandAsyncWithHttpInfo() } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams, localVarSingleFileParams).ConfigureAwait(false); + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; var exception = this.ExceptionFactory?.Invoke("ListBrand", localVarResponse); @@ -1015,10 +1061,165 @@ public async Task> ListBrandAsyncWithHttpInfo() return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (BrandingRecords)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(BrandingRecords))); } + /// + /// Get the brand. + /// + /// Thrown when fails to make API call. + /// Brand Id. + /// BrandDetails. + public BrandDetails GetBrandDetails(string brandId) + { + var localVarResponse = this.GetBrandDetailsWithHttpInfo(brandId); + + return localVarResponse.Data; + } + + /// + /// Get the brand. + /// + /// Thrown when fails to make API call. + /// Brand Id. + /// ApiResponse of BrandDetails. + public ApiResponse GetBrandDetailsWithHttpInfo(string brandId) + { + // verify the required parameter 'brandId' is set + if (brandId == null) + { + throw new ApiException(400, ApiValidationMessages.BrandIdGet); + } + + var localVarPath = "/v1/brand/get"; + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary>(); + var localVarFileUrlParams = new Dictionary(); + object localVarPostBody = null; + + // to determine the Content-Type header + var localVarHttpContentTypes = Enumerable.Empty().ToArray(); + var localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new[] + { + "application/json", + }; + var localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + + if (localVarHttpHeaderAccept != null) + { + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + } + + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "brandId", brandId)); // query parameter + + // authentication (Bearer) required + string apiKey = this.Configuration.GetApiKeyWithPrefix("Authorization"); + if (!string.IsNullOrEmpty(apiKey)) + { + localVarHeaderParams["Authorization"] = apiKey; + } + + // make the HTTP request + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); + + var localVarStatusCode = (int)localVarResponse.StatusCode; + + var exception = this.ExceptionFactory?.Invoke("GetBrand", localVarResponse); + + if (exception != null) + { + throw exception; + } + + return new ApiResponse( + localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + (BrandDetails)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(BrandDetails))); + } + + /// + /// Get the brand. + /// + /// Thrown when fails to make API call. + /// Brand Id. + /// Task of BrandDetails. + public async Task GetBrandDetailsAsync(string brandId) + { + var localVarResponse = await this.GetBrandDetailsAsyncWithHttpInfo(brandId).ConfigureAwait(false); + + return localVarResponse.Data; + } + + /// + /// Get the brand. + /// + /// Thrown when fails to make API call. + /// Brand Id. + /// Task of ApiResponse (BrandDetails). + public async Task> GetBrandDetailsAsyncWithHttpInfo(string brandId) + { + // verify the required parameter 'brandId' is set + if (brandId == null) + { + throw new ApiException(400, ApiValidationMessages.BrandIdGet); + } + + var localVarPath = "/v1/brand/get"; + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary>(); + var localVarFileUrlParams = new Dictionary(); + object localVarPostBody = null; + + // to determine the Content-Type header + var localVarHttpContentTypes = Enumerable.Empty().ToArray(); + var localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new[] + { + "application/json", + }; + var localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + + if (localVarHttpHeaderAccept != null) + { + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + } + + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "brandId", brandId)); // query parameter + + // authentication (Bearer) required + string apiKey = this.Configuration.GetApiKeyWithPrefix("Authorization"); + if (!string.IsNullOrEmpty(apiKey)) + { + localVarHeaderParams["Authorization"] = apiKey; + } + + // make the HTTP request + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + + var localVarStatusCode = (int)localVarResponse.StatusCode; + var exception = this.ExceptionFactory?.Invoke("GetBrand", localVarResponse); + + if (exception != null) + { + throw exception; + } + + return new ApiResponse( + localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + (BrandDetails)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(BrandDetails))); + } + private static void ValidateBrandSettings(BrandSettings brandSettings) { if (string.IsNullOrEmpty(brandSettings.BrandName)) @@ -1030,6 +1231,19 @@ private static void ValidateBrandSettings(BrandSettings brandSettings) { throw new ApiException(422, ApiValidationMessages.BrandLogoRequired); } + + if (!brandSettings.ShowBuiltInFormFields && brandSettings.AllowCustomFieldCreation) + { + throw new ApiException(422, ApiValidationMessages.StandardFieldVisibilityErr); + } + } + + private static void ValidateEditBrandSettings(BrandSettings brandSettings) + { + if (!brandSettings.ShowBuiltInFormFields && brandSettings.AllowCustomFieldCreation) + { + throw new ApiException(422, ApiValidationMessages.StandardFieldVisibilityErr); + } } } } diff --git a/src/BoldSign/Api/Configuration.cs b/src/BoldSign/Api/Configuration.cs index ceac9ef..4f447bb 100644 --- a/src/BoldSign/Api/Configuration.cs +++ b/src/BoldSign/Api/Configuration.cs @@ -55,35 +55,36 @@ public class Configuration : IReadableConfiguration public static readonly ExceptionFactory DefaultExceptionFactory = (methodName, response) => { var status = (int)response.StatusCode; + var error = response.Content.ReadAsStringAsync().GetAwaiter().GetResult(); if (status == 403) { return new ApiException( status, - string.Format(CultureInfo.CurrentCulture, "You don't have permission to access this resource."), - response.Content); + string.Format("Error calling {0}: {1}", methodName, error), + error); } else if (status >= 400) { return new ApiException( status, - string.Format("Error calling {0}: {1}", methodName, response.Content), - response.Content); + string.Format("Error calling {0}: {1}", methodName, error), + error); } if (status == 0) { return new ApiException( status, - string.Format("Error calling {0}: {1}", methodName, response.ErrorMessage), response.ErrorMessage); + string.Format("Error calling {0}: {1}", methodName, error), error); } else if (status == 202) { return new ApiException( status, - string.Format(CultureInfo.CurrentCulture, "Error calling {0}: {1}", methodName, response.Content), - response.Content); + string.Format(CultureInfo.CurrentCulture, "Error calling {0}: {1}", methodName, error), + error); } return null; @@ -135,7 +136,7 @@ public static Configuration Default /// public Configuration() { - this.UserAgent = "OpenAPI-Generator/1.0.0/csharp"; + this.UserAgent = "OpenAPI-Generator/1.0.0 (CSharp)"; this.BasePath = ApiBaseUrl; this.DefaultHeader = new ConcurrentDictionary(); this.ApiKey = new ConcurrentDictionary(); @@ -223,7 +224,7 @@ public virtual string BasePath // pass-through to ApiClient if it's set. if (this._apiClient != null) { - this._apiClient.RestClient.BaseUrl = new Uri(this._basePath); + this._apiClient.HttpClient.BaseAddress = new Uri(this._basePath); } } } @@ -238,8 +239,8 @@ public virtual string BasePath /// public virtual int Timeout { - get => this.ApiClient.RestClient.Timeout; - set => this.ApiClient.RestClient.Timeout = value; + get => this.ApiClient.HttpClient.Timeout.Milliseconds; + set => this.ApiClient.HttpClient.Timeout = TimeSpan.FromMilliseconds(value); } /// diff --git a/src/BoldSign/Api/ContactClient.cs b/src/BoldSign/Api/ContactClient.cs new file mode 100644 index 0000000..db40620 --- /dev/null +++ b/src/BoldSign/Api/ContactClient.cs @@ -0,0 +1,1063 @@ +// +// Copyright (c) Syncfusion Inc. All rights reserved. +// + +/* + * 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.Api +{ + using System; + using System.Collections.Generic; + using System.ComponentModel.DataAnnotations; + using System.Globalization; + using System.IO; + using System.Linq; + using System.Net.Http; + using System.Text.RegularExpressions; + using System.Threading.Tasks; + using BoldSign.Api.Model; + using BoldSign.Api.Resources; + using BoldSign.Model; + using Newtonsoft.Json; + + /// + /// Represents a function to interact with the API endpoints. The function perform action such as getting the Api credit details and so on. + /// + public class ContactClient : IContactClient + { + private ExceptionFactory exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// A basePath. + public ContactClient(string basePath) + { + this.Configuration = new Configuration { BasePath = basePath }; + + this.ExceptionFactory = Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class. + /// + public ContactClient() + { + this.Configuration = Configuration.Default; + + this.ExceptionFactory = Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object. + /// + /// An instance of Configuration. + public ContactClient(Configuration configuration = null) + { + this.Configuration = configuration ?? Configuration.Default; + + this.ExceptionFactory = Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object. + /// + /// An instance of ApiClient. + public ContactClient(ApiClient apiClient) + { + if (apiClient == null) + { + throw new ArgumentNullException(nameof(apiClient)); + } + + this.Configuration = (Configuration)apiClient.Configuration; + this.Configuration.ApiClient = apiClient; + + this.ExceptionFactory = Configuration.DefaultExceptionFactory; + } + + /// + /// Gets or sets the configuration object. + /// + /// An instance of the Configuration. + public Configuration Configuration { get; set; } + + /// + /// Gets or sets provides a factory method hook for the creation of exceptions. + /// + public ExceptionFactory ExceptionFactory + { + get + { + if (this.exceptionFactory != null && this.exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException(ApiValidationMessages.ExceptionFactoryUnsupported); + } + + return this.exceptionFactory; + } + set => this.exceptionFactory = value; + } + + /// + /// Gets the base path of the API client. + /// + /// The base path. + /// base path. + public string GetBasePath() => this.Configuration.ApiClient.HttpClient.BaseAddress.AbsoluteUri; + + /// + /// Gets the contact list. + /// + /// The page number. + /// The page size. + /// The search key. + /// contactType. + /// A Task. + public ContactsList ListContacts(int page, int? pageSize = default, string searchKey = default, + ContactType? contactType = ContactType.AllContacts) + { + var localVarResponse = this.ListContactsWithHttpInfo(page, pageSize, searchKey, contactType); + + return localVarResponse.Data; + } + + /// + /// Gets the contact list. + /// + /// The page number. + /// The page size. + /// The search key. + /// contactType. + /// A Task. + public ApiResponse ListContactsWithHttpInfo(int page, int? pageSize = default, + string searchKey = default, ContactType? contactType = ContactType.AllContacts) + { + // verify the required parameter 'page' is set + var localVarPath = "/v1/contacts/list"; + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary>(); + var localVarFileUrlParams = new Dictionary(); + object localVarPostBody = null; + + // to determine the Content-Type header + var localVarHttpContentTypes = Enumerable.Empty().ToArray(); + var localVarHttpContentType = + this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new[] + { + "application/json", + }; + var localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + + if (localVarHttpHeaderAccept != null) + { + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + } + + localVarQueryParams.AddRange( + this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "Page", page)); // query parameter + + if (pageSize != null) + { + localVarQueryParams.AddRange( + this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "PageSize", + pageSize)); // query parameter + } + + if (contactType != null) + { + localVarQueryParams.AddRange( + this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "ContactType", + contactType)); // query parameter + } + + if (searchKey != null) + { + localVarQueryParams.AddRange( + this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "SearchKey", + searchKey)); // query parameter + } + + // authentication (Bearer) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); + } + + // make the HTTP request + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Get, + localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarHttpContentType, localVarFileUrlParams); + + var localVarStatusCode = (int)localVarResponse.StatusCode; + + var exception = this.ExceptionFactory?.Invoke("ContactLists", localVarResponse); + + if (exception != null) + { + throw exception; + } + + return new ApiResponse( + localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + (ContactsList)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ContactsList))); + } + + /// + /// Gets the contact list. + /// + /// The page number. + /// The page size. + /// The search key. + /// contactType. + /// Task of ListContacts. + public async Task ListContactsAsync(int page, int? pageSize = default, string searchKey = default, + ContactType? contactType = ContactType.AllContacts) + { + var localVarResponse = await this.ListContactsAsyncWithHttpInfo(page, pageSize, searchKey, contactType) + .ConfigureAwait(false); + + return localVarResponse.Data; + } + + /// + /// Gets the contact list. + /// + /// The page number. + /// The page size. + /// The search key. + /// contactType. + /// Task of ApiResponse (ListContacts). + public async Task> ListContactsAsyncWithHttpInfo(int page, int? pageSize = default, + string searchKey = default, ContactType? contactType = ContactType.AllContacts) + { + // verify the required parameter 'page' is set + var localVarPath = "/v1/contacts/list"; + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary>(); + var localVarFileUrlParams = new Dictionary(); + object localVarPostBody = null; + + // to determine the Content-Type header + var localVarHttpContentTypes = Enumerable.Empty().ToArray(); + var localVarHttpContentType = + this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new[] + { + "application/json", + }; + var localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + + if (localVarHttpHeaderAccept != null) + { + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + } + + localVarQueryParams.AddRange( + this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "Page", page)); // query parameter + + if (pageSize != null) + { + localVarQueryParams.AddRange( + this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "PageSize", + pageSize)); // query parameter + } + + if (contactType != null) + { + localVarQueryParams.AddRange( + this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "ContactType", + contactType)); // query parameter + } + + if (searchKey != null) + { + localVarQueryParams.AddRange( + this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "SearchKey", + searchKey)); // query parameter + } + + // authentication (Bearer) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); + } + + // make the HTTP request + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Get, + localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + + var localVarStatusCode = (int)localVarResponse.StatusCode; + + var exception = this.ExceptionFactory?.Invoke("ContactLists", localVarResponse); + + if (exception != null) + { + throw exception; + } + + return new ApiResponse( + localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + (ContactsList)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ContactsList))); + } + + /// + /// Delete the contact when a particular contact’s ID is given as input. + /// + /// Thrown when fails to make API call. + /// Contact Id. + public void DeleteContact(string id) + { + this.DeleteContactWithHttpInfo(id); + } + + /// + /// Delete the contact when a particular contact’s ID is given as input. + /// + /// Thrown when fails to make API call. + /// Contact Id. + /// ApiResponse of Object(void). + public ApiResponse DeleteContactWithHttpInfo(string id) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new ApiException(400, ApiValidationMessages.ContactIdDelete); + } + + var localVarPath = "/v1/contacts/delete"; + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary>(); + var localVarFileUrlParams = new Dictionary(); + object localVarPostBody = null; + + // to determine the Content-Type header + var localVarHttpContentTypes = Enumerable.Empty().ToArray(); + var localVarHttpContentType = + this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new[] + { + "application/json;odata.metadata=minimal;odata.streaming=true", + "application/json;odata.metadata=minimal;odata.streaming=false", + "application/json;odata.metadata=minimal", + "application/json;odata.metadata=full;odata.streaming=true", + "application/json;odata.metadata=full;odata.streaming=false", + "application/json;odata.metadata=full", + "application/json;odata.metadata=none;odata.streaming=true", + "application/json;odata.metadata=none;odata.streaming=false", + "application/json;odata.metadata=none", + "application/json;odata.streaming=true", + "application/json;odata.streaming=false", + "application/json", + "application/xml", + "application/prs.odatatestxx-odata", + "text/plain", + "text/json", + }; + var localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + + if (localVarHttpHeaderAccept != null) + { + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + } + + localVarQueryParams.AddRange( + this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "Id", id)); // query parameter + + // authentication (Bearer) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); + } + + // make the HTTP request + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Delete, + localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarHttpContentType, localVarFileUrlParams); + + var localVarStatusCode = (int)localVarResponse.StatusCode; + + var exception = this.ExceptionFactory?.Invoke("DeleteContact", localVarResponse); + + if (exception != null) + { + throw exception; + } + + return new ApiResponse( + localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + null); + } + + /// + /// Gets invite the user. + /// + /// Thrown when fails to make API call. + /// The create user details. + /// Task of void. + public async Task DeleteContactAsync(string id) + { + await this.DeleteContactAsyncWithHttpInfo(id).ConfigureAwait(false); + } + + /// + /// Gets invite the user. + /// + /// Thrown when fails to make API call. + /// The create user details. + /// Task of ApiResponse. + public async Task> DeleteContactAsyncWithHttpInfo(string id) + { + // verify the required parameter 'id' is set + if (id == null) + { + throw new ApiException(400, ApiValidationMessages.ContactIdDelete); + } + + var localVarPath = "/v1/contacts/delete"; + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary>(); + var localVarFileUrlParams = new Dictionary(); + object localVarPostBody = null; + + // to determine the Content-Type header + var localVarHttpContentTypes = Enumerable.Empty().ToArray(); + var localVarHttpContentType = + this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new[] + { + "application/json;odata.metadata=minimal;odata.streaming=true", + "application/json;odata.metadata=minimal;odata.streaming=false", + "application/json;odata.metadata=minimal", + "application/json;odata.metadata=full;odata.streaming=true", + "application/json;odata.metadata=full;odata.streaming=false", + "application/json;odata.metadata=full", + "application/json;odata.metadata=none;odata.streaming=true", + "application/json;odata.metadata=none;odata.streaming=false", + "application/json;odata.metadata=none", + "application/json;odata.streaming=true", + "application/json;odata.streaming=false", + "application/json", + "application/xml", + "application/prs.odatatestxx-odata", + "text/plain", + "text/json", + }; + var localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + + if (localVarHttpHeaderAccept != null) + { + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + } + + localVarQueryParams.AddRange( + this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "Id", id)); // query parameter + + // authentication (Bearer) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); + } + + // make the HTTP request + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, + HttpMethod.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, + localVarFileParams, localVarHttpContentType, localVarFileUrlParams) + .ConfigureAwait(false); + + var localVarStatusCode = (int)localVarResponse.StatusCode; + + var exception = this.ExceptionFactory?.Invoke("DeleteContact", localVarResponse); + + if (exception != null) + { + throw exception; + } + + return new ApiResponse( + localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + null); + } + + /// + public CreatedContact CreateContact(List contactsDetailsList = default) + { + var createContactResponse = this.CreateContactWithHttpInfo(contactsDetailsList); + + return createContactResponse.Data; + } + + /// + public ApiResponse CreateContactWithHttpInfo(List contactsDetailsList = default) + { + if (contactsDetailsList == null) + { + throw new ArgumentNullException(nameof(contactsDetailsList)); + } + + ValidateCreateContactProperties(contactsDetailsList); + + var localVarPath = "/v1/contacts/create"; + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary>(); + var localVarFileUrlParams = new Dictionary(); + object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = + { + "application/json;odata.metadata=minimal;odata.streaming=true", + "application/json;odata.metadata=minimal;odata.streaming=false", + "application/json;odata.metadata=minimal", + "application/json;odata.metadata=full;odata.streaming=true", + "application/json;odata.metadata=full;odata.streaming=false", + "application/json;odata.metadata=full", + "application/json;odata.metadata=none;odata.streaming=true", + "application/json;odata.metadata=none;odata.streaming=false", + "application/json;odata.metadata=none", + "application/json;odata.streaming=true", + "application/json;odata.streaming=false", + "application/json", + "application/xml", + "application/prs.odatatestxx-odata", + "text/json", + "application/_*+json", + }; + var localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = + { + "application/json", + }; + var localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + + if (localVarHttpHeaderAccept != null) + { + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + } + + if (contactsDetailsList.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(contactsDetailsList); + } + else + { + localVarPostBody = contactsDetailsList; // byte array + } + + // authentication (Bearer) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); + } + + // make the HTTP request + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); + + var localVarStatusCode = (int)localVarResponse.StatusCode; + + var exception = this.ExceptionFactory?.Invoke("CreateContact", localVarResponse); + + if (exception != null) + { + throw exception; + } + + return new ApiResponse( + localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + (CreatedContact)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreatedContact))); + } + + /// + public async Task CreateContactAsync(List contactDetailsList = default) + { + var localVarResponse = await this.CreateContactAsyncWithHttpInfo(contactDetailsList).ConfigureAwait(false); + + return localVarResponse.Data; + } + + /// + public async Task> CreateContactAsyncWithHttpInfo(List contactsDetailsList = default) + { + if (contactsDetailsList == null) + { + throw new ArgumentNullException(nameof(contactsDetailsList)); + } + + ValidateCreateContactProperties(contactsDetailsList); + + var localVarPath = "/v1/contacts/create"; + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary>(); + var localVarFileUrlParams = new Dictionary(); + object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = + { + "application/json;odata.metadata=minimal;odata.streaming=true", + "application/json;odata.metadata=minimal;odata.streaming=false", + "application/json;odata.metadata=minimal", + "application/json;odata.metadata=full;odata.streaming=true", + "application/json;odata.metadata=full;odata.streaming=false", + "application/json;odata.metadata=full", + "application/json;odata.metadata=none;odata.streaming=true", + "application/json;odata.metadata=none;odata.streaming=false", + "application/json;odata.metadata=none", + "application/json;odata.streaming=true", + "application/json;odata.streaming=false", + "application/json", + "application/xml", + "application/prs.odatatestxx-odata", + "text/json", + "application/_*+json", + }; + var localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = + { + "application/json", + }; + var localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + + if (localVarHttpHeaderAccept != null) + { + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + } + + if (contactsDetailsList.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(contactsDetailsList); + } + else + { + localVarPostBody = contactsDetailsList; // byte array + } + + // authentication (Bearer) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); + } + + // make the HTTP request + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + + var localVarStatusCode = (int)localVarResponse.StatusCode; + + var exception = this.ExceptionFactory?.Invoke("CreateContact", localVarResponse); + + if (exception != null) + { + throw exception; + } + + return new ApiResponse( + localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + (CreatedContact)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreatedContact))); + } + + /// + public void UpdateContact(string id, ContactDetails updateContact) + { + this.UpdateContactWithHttpInfo(id, updateContact); + } + + /// + public ApiResponse UpdateContactWithHttpInfo(string id, ContactDetails updateContact) + { + if (updateContact == null) + { + throw new ArgumentNullException(nameof(updateContact)); + } + + if (string.IsNullOrEmpty(id)) + { + throw new ApiException(400, ApiValidationMessages.ContactIdMissing); + } + + var localVarPath = "/v1/contacts/update"; + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary>(); + var localVarFileUrlParams = new Dictionary(); + object localVarPostBody = null; + + // to determine the Content-Type header + var localVarHttpContentTypes = Enumerable.Empty().ToArray(); + var localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new[] + { + "application/json", + }; + var localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + + if (localVarHttpHeaderAccept != null) + { + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + } + + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "Id", id)); // query parameter + if (updateContact.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(updateContact); + } + else + { + localVarPostBody = updateContact; // byte array + } + + // authentication (Bearer) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); + } + + // make the HTTP request + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); + + var localVarStatusCode = (int)localVarResponse.StatusCode; + + var exception = this.ExceptionFactory?.Invoke("UpdateContact", localVarResponse); + + if (exception != null) + { + throw exception; + } + + return new ApiResponse( + localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + null); + } + + /// + public async Task UpdateContactAsync(string id, ContactDetails updateContact) + { + await this.UpdateContactAsyncWithHttpInfo(id, updateContact).ConfigureAwait(false); + } + + /// + public async Task> UpdateContactAsyncWithHttpInfo(string id, ContactDetails updateContact) + { + if (updateContact == null) + { + throw new ArgumentNullException(nameof(updateContact)); + } + + if (string.IsNullOrEmpty(id)) + { + throw new ApiException(400, ApiValidationMessages.ContactIdMissing); + } + + var localVarPath = "/v1/contacts/update"; + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary>(); + var localVarFileUrlParams = new Dictionary(); + object localVarPostBody = null; + + // to determine the Content-Type header + var localVarHttpContentTypes = Enumerable.Empty().ToArray(); + var localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new[] + { + "application/json", + }; + var localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + + if (localVarHttpHeaderAccept != null) + { + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + } + + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "Id", id)); // query parameter + if (updateContact.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(updateContact); + } + else + { + localVarPostBody = updateContact; // byte array + } + + // authentication (Bearer) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); + } + + // make the HTTP request + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + + var localVarStatusCode = (int)localVarResponse.StatusCode; + + var exception = this.ExceptionFactory?.Invoke("UpdateContact", localVarResponse); + + if (exception != null) + { + throw exception; + } + + return new ApiResponse( + localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + null); + } + + /// + public ContactsDetails GetContact(string id) + { + var localVarResponse = this.GetContactWithHttpInfo(id); + + return localVarResponse.Data; + } + + /// + public ApiResponse GetContactWithHttpInfo(string id) + { + if (string.IsNullOrEmpty(id)) + { + throw new ApiException(400, ApiValidationMessages.ContactIdMissing); + } + + var localVarPath = "/v1/contacts/get"; + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary>(); + var localVarFileUrlParams = new Dictionary(); + object localVarPostBody = null; + + // to determine the Content-Type header + var localVarHttpContentTypes = Enumerable.Empty().ToArray(); + var localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new[] + { + "application/json", + }; + var localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + + if (localVarHttpHeaderAccept != null) + { + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + } + + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "Id", id)); // query parameter + + // authentication (Bearer) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); + } + + // make the HTTP request + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); + + var localVarStatusCode = (int)localVarResponse.StatusCode; + + var exception = this.ExceptionFactory?.Invoke("GetProperties", localVarResponse); + + if (exception != null) + { + throw exception; + } + + return new ApiResponse( + localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + (ContactsDetails)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ContactsDetails))); + } + + /// + public async Task GetContactAsync(string id) + { + var localVarResponse = await this.GetContactAsyncWithHttpInfo(id).ConfigureAwait(false); + + return localVarResponse.Data; + } + + /// + public async Task> GetContactAsyncWithHttpInfo(string id) + { + if (string.IsNullOrEmpty(id)) + { + throw new ApiException(400, ApiValidationMessages.ContactIdMissing); + } + + var localVarPath = "/v1/contacts/get"; + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary>(); + var localVarFileUrlParams = new Dictionary(); + object localVarPostBody = null; + + // to determine the Content-Type header + var localVarHttpContentTypes = Enumerable.Empty().ToArray(); + var localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new[] + { + "application/json", + }; + var localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + + if (localVarHttpHeaderAccept != null) + { + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + } + + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "Id", id)); // query parameter + + // authentication (Bearer) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); + } + + // make the HTTP request + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + + var localVarStatusCode = (int)localVarResponse.StatusCode; + + var exception = this.ExceptionFactory?.Invoke("GetProperties", localVarResponse); + + if (exception != null) + { + throw exception; + } + + return new ApiResponse( + localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + (ContactsDetails)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(UserProperties))); + } + + private static void ValidateCreateContactProperties(List contactDetailsList) + { + foreach (var contacts in contactDetailsList) + { + if (string.IsNullOrEmpty(contacts.Email)) + { + throw new ApiException(422, ApiValidationMessages.EmailIdRequired); + } + + if (!IsValidEmail(contacts.Email)) + { + throw new ApiException(422, ApiValidationMessages.InvalidEmailAddress); + } + } + } + + /// + /// Validate Email. + /// + /// Email Id. + /// True if the email is valid. + /// https://docs.microsoft.com/en-us/dotnet/standard/base-types/how-to-verify-that-strings-are-in-valid-email-format + private static bool IsValidEmail(string email) + { + if (string.IsNullOrWhiteSpace(email)) + { + return false; + } + + try + { + // Normalize the domain + email = Regex.Replace( + email, + @"(@)(.+)$", + DomainMapper, + RegexOptions.None, + TimeSpan.FromMilliseconds(200)); + + // Examines the domain part of the email and normalizes it. + string DomainMapper(Match match) + { + // Use IdnMapping class to convert Unicode domain names. + var idn = new IdnMapping(); + + // Pull out and process domain name (throws ArgumentException on invalid) + var domainName = idn.GetAscii(match.Groups[2].Value); + + return match.Groups[1].Value + domainName; + } + } + catch (RegexMatchTimeoutException) + { + return false; + } + catch (ArgumentException) + { + return false; + } + + try + { + return Regex.IsMatch( + email, +#pragma warning disable SA1118 // Parameter should not span multiple lines + @"^(?("")("".+?(? +// Copyright (c) Syncfusion Inc. All rights reserved. +// + +/* + * 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.Api +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Net.Http; + using System.Threading.Tasks; + using BoldSign.Api.Resources; + using BoldSign.Model; + + /// + /// Represents a collection of functions to interact with the API endpoints. The functions perform actions such as creating custom field, deleting custom field, editing custom field and so on. + /// + public class CustomFieldClient : ICustomFieldClient + { + private ExceptionFactory exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// Gets or set the basePath. + public CustomFieldClient(string basePath) + { + this.Configuration = new Configuration { BasePath = basePath }; + + this.ExceptionFactory = Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class. + /// + public CustomFieldClient() + { + this.Configuration = Configuration.Default; + + this.ExceptionFactory = Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object. + /// + /// An instance of Configuration. + public CustomFieldClient(Configuration configuration = null) + { + this.Configuration = configuration ?? Configuration.Default; + + this.ExceptionFactory = Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object. + /// + /// An instance of ApiClient. + public CustomFieldClient(ApiClient apiClient) + { + if (apiClient == null) + { + throw new ArgumentNullException(nameof(apiClient)); + } + + this.Configuration = (Configuration)apiClient.Configuration; + this.Configuration.ApiClient = apiClient; + + this.ExceptionFactory = Configuration.DefaultExceptionFactory; + } + + /// + /// Gets or sets the configuration object. + /// + /// An instance of the Configuration. + public Configuration Configuration { get; set; } + + /// + /// Gets or sets provides a factory method hook for the creation of exceptions. + /// + public ExceptionFactory ExceptionFactory + { + get + { + if (this.exceptionFactory != null && this.exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + + return this.exceptionFactory; + } + set => this.exceptionFactory = value; + } + + /// + /// Custom field paths. + /// + /// The base path. + /// GetBasePath. + public string GetBasePath() => this.Configuration.ApiClient.HttpClient.BaseAddress.AbsoluteUri; + + /// + /// Creates a custom field for the specified brand. + /// + /// The brand custom fields class. + /// Return the custom message. + public CustomFieldMessage CreateCustomField(BrandCustomFieldDetails brandCustomFieldDetails) + { + var localVarResponse = this.CreateCustomFieldWithHttpInfo(brandCustomFieldDetails); + return localVarResponse.Data; + } + + /// + /// Created a custom field for the specified brand. + /// + /// The brand custom fields class. + /// Return the custom message. + /// Thrown when fails to make API call. + /// Thrown when fails to make call. + public ApiResponse CreateCustomFieldWithHttpInfo(BrandCustomFieldDetails brandCustomFieldDetails) + { + // verify the required parameter 'brandId' is set + if (brandCustomFieldDetails == null) + { + throw new ArgumentNullException(nameof(brandCustomFieldDetails)); + } + + var localVarPath = "/v1/customField/create"; + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary>(); + var localVarFileUrlParams = new Dictionary(); + object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = + { + "application/json;odata.metadata=minimal;odata.streaming=true", + "application/json;odata.metadata=minimal;odata.streaming=false", + "application/json;odata.metadata=minimal", + "application/json;odata.metadata=full;odata.streaming=true", + "application/json;odata.metadata=full;odata.streaming=false", + "application/json;odata.metadata=full", + "application/json;odata.metadata=none;odata.streaming=true", + "application/json;odata.metadata=none;odata.streaming=false", + "application/json;odata.metadata=none", + "application/json;odata.streaming=true", + "application/json;odata.streaming=false", + "application/json", + "application/xml", + "application/prs.odatatestxx-odata", + "text/json", + "application/_*+json", + }; + var localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = + { + "application/json", + }; + var localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + + if (localVarHttpHeaderAccept != null) + { + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + } + + if (brandCustomFieldDetails != null && brandCustomFieldDetails.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(brandCustomFieldDetails); // http body (model) parameter + } + else + { + localVarPostBody = brandCustomFieldDetails; // byte array + } + + // authentication (Bearer) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); + } + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); + + var localVarStatusCode = (int)localVarResponse.StatusCode; + + var exception = this.ExceptionFactory?.Invoke("SaveCustomFieldDetails", localVarResponse); + + if (exception != null) + { + throw exception; + } + + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (CustomFieldMessage)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CustomFieldMessage))); + } + + /// + /// Creates a custom field for the specified brand. + /// + /// The brand custom fields class. + /// Return the custom message. + public async Task CreateCustomFieldAsync(BrandCustomFieldDetails brandCustomFieldDetails) + { + var localVarResponse = await this.CreateCustomFieldAsyncWithHttpInfo(brandCustomFieldDetails).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Creates a custom field for the specified brand. + /// + /// The brand custom fields class. + /// Return the custom message. + /// Thrown when fails to make API call. + /// Thrown when fails to make call. + public async Task> CreateCustomFieldAsyncWithHttpInfo(BrandCustomFieldDetails brandCustomFieldDetails) + { + if (brandCustomFieldDetails == null) + { + throw new ArgumentNullException(nameof(brandCustomFieldDetails)); + } + + var localVarPath = "/v1/customField/create"; + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary>(); + var localVarFileUrlParams = new Dictionary(); + object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = + { + "application/json;odata.metadata=minimal;odata.streaming=true", + "application/json;odata.metadata=minimal;odata.streaming=false", + "application/json;odata.metadata=minimal", + "application/json;odata.metadata=full;odata.streaming=true", + "application/json;odata.metadata=full;odata.streaming=false", + "application/json;odata.metadata=full", + "application/json;odata.metadata=none;odata.streaming=true", + "application/json;odata.metadata=none;odata.streaming=false", + "application/json;odata.metadata=none", + "application/json;odata.streaming=true", + "application/json;odata.streaming=false", + "application/json", + "application/xml", + "application/prs.odatatestxx-odata", + "text/json", + "application/_*+json", + }; + var localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = + { + "application/json", + }; + var localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + + if (localVarHttpHeaderAccept != null) + { + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + } + + // authentication (Bearer) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); + } + + if (brandCustomFieldDetails != null && brandCustomFieldDetails.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(brandCustomFieldDetails); // http body (model) parameter + } + else + { + localVarPostBody = brandCustomFieldDetails; // byte array + } + + // make the HTTP request + var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + + var localVarStatusCode = (int)localVarResponse.StatusCode; + var exception = this.ExceptionFactory?.Invoke("SaveCustomFieldDetails", localVarResponse); + + if (exception != null) + { + throw exception; + } + + return new ApiResponse( + localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + (CustomFieldMessage)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CustomFieldMessage))); + } + + /// + /// Edits a custom field for the specified brand. + /// + /// The custom field identifier. + /// The brand custom fields class. + /// Return the custom message. + public CustomFieldMessage EditCustomField( string customFieldId, BrandCustomFieldDetails brandCustomFieldDetails) + { + var localVarResponse = this.EditCustomFieldWithHttpInfo(customFieldId, brandCustomFieldDetails); + return localVarResponse.Data; + } + + /// + /// Edits a custom field for the specified brand. + /// + /// The custom field identifier. + /// The brand custom fields class. + /// Return the custom message. + /// Thrown when fails to make API call. + /// Thrown when fails to make call. + public ApiResponse EditCustomFieldWithHttpInfo(string customFieldId, BrandCustomFieldDetails brandCustomFieldDetails) + { + if (brandCustomFieldDetails == null) + { + throw new ArgumentNullException(nameof(brandCustomFieldDetails)); + } + + var localVarPath = "/v1/customField/edit"; + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary>(); + var localVarFileUrlParams = new Dictionary(); + object localVarPostBody = null; + + // to determine the Content-Type header + var localVarHttpContentTypes = Enumerable.Empty().ToArray(); + var localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new[] + { + "application/json", + }; + var localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + + if (localVarHttpHeaderAccept != null) + { + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + } + + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "customFieldId", customFieldId)); // query parameter + + // authentication (Bearer) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); + } + + if (brandCustomFieldDetails != null && brandCustomFieldDetails.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(brandCustomFieldDetails); // http body (model) parameter + } + else + { + localVarPostBody = brandCustomFieldDetails; // byte array + } + + // make the HTTP request + var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); + + var localVarStatusCode = (int)localVarResponse.StatusCode; + + var exception = this.ExceptionFactory?.Invoke("EditCustomFieldDetails", localVarResponse); + + if (exception != null) + { + throw exception; + } + + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (CustomFieldMessage)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CustomFieldMessage))); + } + + /// + /// Edits a custom field for the specified brand. + /// + /// The custom field identifier. + /// The brand custom fields class. + /// Return the custom message. + public async Task EditCustomFieldAsync(string customFieldId, BrandCustomFieldDetails brandCustomFieldDetails) + { + var localVarResponse = await this.EditCustomFieldAsyncWithHttpInfo(customFieldId, brandCustomFieldDetails).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Edits a custom field for the specified brand. + /// + /// The custom field identifier. + /// The brand custom fields class. + /// Return the custom field message. + /// Thrown when fails to make API call. + /// Thrown when fails to make call. + public async Task> EditCustomFieldAsyncWithHttpInfo(string customFieldId, BrandCustomFieldDetails brandCustomFieldDetails) + { + if (brandCustomFieldDetails == null) + { + throw new ArgumentNullException(nameof(brandCustomFieldDetails)); + } + + var localVarPath = "/v1/customField/edit"; + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary>(); + var localVarFileUrlParams = new Dictionary(); + object localVarPostBody = null; + + // to determine the Content-Type header + var localVarHttpContentTypes = Enumerable.Empty().ToArray(); + var localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new[] + { + "application/json", + }; + var localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + + if (localVarHttpHeaderAccept != null) + { + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + } + + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "customFieldId", customFieldId)); // query parameter + + // authentication (Bearer) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); + } + + if (brandCustomFieldDetails != null && brandCustomFieldDetails.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(brandCustomFieldDetails); // http body (model) parameter + } + else + { + localVarPostBody = brandCustomFieldDetails; // byte array + } + + // make the HTTP request + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + + var localVarStatusCode = (int)localVarResponse.StatusCode; + var exception = this.ExceptionFactory?.Invoke("EditCustomFieldDetails", localVarResponse); + + if (exception != null) + { + throw exception; + } + + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (CustomFieldMessage)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CustomFieldMessage))); + } + + /// + /// Deletes the custom field for the specified brand. + /// + /// The custom field id. + /// Return the custom field message. + public CustomFieldMessage DeleteCustomField(string customFieldId) + { + var localVarResponse = this.DeleteCustomFieldWithHttpInfo(customFieldId); + return localVarResponse.Data; + } + + /// + /// Deletes the custom field for the specified brand. + /// + /// The custom field id. + /// Return the custom field message. + /// Thrown when fails to make API call. + /// Thrown when fails to make call. + public ApiResponse DeleteCustomFieldWithHttpInfo(string customFieldId) + { + var localVarPath = "/v1/customField/delete"; + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary>(); + var localVarFileUrlParams = new Dictionary(); + object localVarPostBody = null; + + // to determine the Content-Type header + var localVarHttpContentTypes = Enumerable.Empty().ToArray(); + var localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new[] + { + "application/json;odata.metadata=minimal;odata.streaming=true", + "application/json;odata.metadata=minimal;odata.streaming=false", + "application/json;odata.metadata=minimal", + "application/json;odata.metadata=full;odata.streaming=true", + "application/json;odata.metadata=full;odata.streaming=false", + "application/json;odata.metadata=full", + "application/json;odata.metadata=none;odata.streaming=true", + "application/json;odata.metadata=none;odata.streaming=false", + "application/json;odata.metadata=none", + "application/json;odata.streaming=true", + "application/json;odata.streaming=false", + "application/json", + "application/xml", + "application/prs.odatatestxx-odata", + "text/plain", + "text/json", + }; + var localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + + if (localVarHttpHeaderAccept != null) + { + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + } + + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "customFieldId", customFieldId)); // query parameter + + // authentication (Bearer) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); + } + + // make the HTTP request + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); + + var localVarStatusCode = (int)localVarResponse.StatusCode; + + var exception = this.ExceptionFactory?.Invoke("DeleteAndReorderCustomFields", localVarResponse); + + if (exception != null) + { + throw exception; + } + + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (CustomFieldMessage)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CustomFieldMessage))); + } + + /// + /// Deletes the custom field for the specified brand. + /// + /// The custom field id. + /// Return the custom field message. + public async Task DeleteCustomFieldAsync(string customFieldId) + { + var localVarResponse = await this.DeleteCustomFieldAsyncWithHttpInfo(customFieldId).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Deletes the custom field for the specified brand. + /// + /// The custom field id. + /// Return the custom field message. + /// Thrown when fails to make API call. + /// Thrown when fails to make call. + public async Task> DeleteCustomFieldAsyncWithHttpInfo( string customFieldId) + { + var localVarPath = "/v1/customField/delete"; + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary>(); + var localVarFileUrlParams = new Dictionary(); + object localVarPostBody = null; + + // to determine the Content-Type header + var localVarHttpContentTypes = Enumerable.Empty().ToArray(); + var localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new[] + { + "application/json;odata.metadata=minimal;odata.streaming=true", + "application/json;odata.metadata=minimal;odata.streaming=false", + "application/json;odata.metadata=minimal", + "application/json;odata.metadata=full;odata.streaming=true", + "application/json;odata.metadata=full;odata.streaming=false", + "application/json;odata.metadata=full", + "application/json;odata.metadata=none;odata.streaming=true", + "application/json;odata.metadata=none;odata.streaming=false", + "application/json;odata.metadata=none", + "application/json;odata.streaming=true", + "application/json;odata.streaming=false", + "application/json", + "application/xml", + "application/prs.odatatestxx-odata", + "text/plain", + "text/json", + }; + var localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + + if (localVarHttpHeaderAccept != null) + { + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + } + + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "customFieldId", customFieldId)); // query parameter + + // authentication (Bearer) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); + } + + // make the HTTP request + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + + var localVarStatusCode = (int)localVarResponse.StatusCode; + + var exception = this.ExceptionFactory?.Invoke("DeleteAndReorderCustomFields", localVarResponse); + + if (exception != null) + { + throw exception; + } + + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (CustomFieldMessage)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CustomFieldMessage))); + } + + /// + /// Gets the collections of custom fields for the specified brand. + /// + /// The brand Id. + /// Returns the collection of custom fields. + public CustomFieldCollection GetBrandBasedCustomFields(string brandId) + { + var localVarResponse = this.GetBrandBasedCustomFieldsWithHttpInfo(brandId); + return localVarResponse.Data; + } + + /// + /// Gets the collections of custom fields for the specified brand. + /// + /// The brand Id. + /// Returns the collection of custom fields. + /// Thrown when fails to make API call. + /// Thrown when fails to make call. + public ApiResponse GetBrandBasedCustomFieldsWithHttpInfo(string brandId) + { + if (brandId == null) + { + throw new ArgumentNullException(nameof(brandId)); + } + + var localVarPath = "/v1/customField/list"; + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary>(); + var localVarFileUrlParams = new Dictionary(); + object localVarPostBody = null; + + // to determine the Content-Type header + var localVarHttpContentTypes = Enumerable.Empty().ToArray(); + var localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new[] + { + "application/json", + }; + var localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + + if (localVarHttpHeaderAccept != null) + { + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + } + + // authentication (Bearer) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); + } + + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "brandId", brandId)); // query parameter + + // make the HTTP request + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); + + var localVarStatusCode = (int)localVarResponse.StatusCode; + + var exception = this.ExceptionFactory?.Invoke("GetBrandBasedCustomFields", localVarResponse); + + if (exception != null) + { + throw exception; + } + + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (CustomFieldCollection)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CustomFieldCollection))); + } + + /// + /// Gets the collections of custom fields for the specified brand. + /// + /// The brand Id. + /// Returns the collection of custom fields. + public async Task GetBrandBasedCustomFieldsAsync(string brandId) + { + var localVarResponse = await this.GetBrandBasedCustomFieldsAsyncWithHttpInfo(brandId).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Gets the collections of custom fields for the specified brand. + /// + /// The brand Id. + /// Returns the collection of custom fields. + /// Thrown when fails to make API call. + /// Thrown when fails to make call. + public async Task> GetBrandBasedCustomFieldsAsyncWithHttpInfo(string brandId) + { + if (brandId == null) + { + throw new ArgumentNullException(nameof(brandId)); + } + + var localVarPath = "/v1/customField/list"; + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary>(); + var localVarFileUrlParams = new Dictionary(); + object localVarPostBody = null; + + // to determine the Content-Type header + var localVarHttpContentTypes = Enumerable.Empty().ToArray(); + var localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new[] + { + "application/json", + }; + var localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + + if (localVarHttpHeaderAccept != null) + { + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + } + + // authentication (Bearer) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); + } + + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "brandId", brandId)); // query parameter + + // make the HTTP request + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + + var localVarStatusCode = (int)localVarResponse.StatusCode; + var exception = this.ExceptionFactory?.Invoke("ListBrand", localVarResponse); + + if (exception != null) + { + throw exception; + } + + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (CustomFieldCollection)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CustomFieldCollection))); + } + + /// + /// Generates a URL to embed manipulation of custom field process into your application. + /// + /// The embedded custom field details. + /// Returns the embedded custom field url. + public EmbeddedCustomFieldCreated CreateEmbeddedCustomFieldUrl(EmbeddedCustomFieldDetails embeddedCustomFieldDetails) + { + var localVarResponse = this.CreateEmbeddedCustomFieldUrlWithHttpInfo(embeddedCustomFieldDetails); + + return localVarResponse.Data; + } + + /// + /// Generates a URL to embed manipulation of custom field process into your application. + /// + /// The embedded custom field details. + /// Returns the embedded custom field url. + /// Thrown when fails to make API call. + /// Thrown when fails to make call. + public ApiResponse CreateEmbeddedCustomFieldUrlWithHttpInfo(EmbeddedCustomFieldDetails embeddedCustomFieldDetails) + { + if (embeddedCustomFieldDetails == null) + { + throw new ArgumentNullException(nameof(embeddedCustomFieldDetails)); + } + + if (string.IsNullOrEmpty(embeddedCustomFieldDetails.BrandId)) + { + throw new ApiException(422, ApiValidationMessages.InvalidBrandId); + } + + const string localVarPath = "/v1/customField/createEmbeddedCustomFieldUrl"; + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary>(); + var localVarFileUrlParams = new Dictionary(); + + // to determine the Content-Type header + var localVarHttpContentTypes = Enumerable.Empty().ToArray(); + var localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new[] + { + "application/json", + }; + var localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + + if (localVarHttpHeaderAccept != null) + { + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + } + + // authentication (Bearer) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); + } + + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "brandId", embeddedCustomFieldDetails.BrandId)); // query parameter + + if (embeddedCustomFieldDetails.LinkValidTill != null) + { + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "linkValidTill", embeddedCustomFieldDetails.LinkValidTill)); // query parameter + } + + // make the HTTP request + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Post, localVarQueryParams, null, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); + + var localVarStatusCode = (int)localVarResponse.StatusCode; + + var exception = this.ExceptionFactory?.Invoke("CreateEmbeddedCustomFieldUrl", localVarResponse); + + if (exception != null) + { + throw exception; + } + + return new ApiResponse( + localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + (EmbeddedCustomFieldCreated)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(EmbeddedCustomFieldCreated))); + } + + /// + /// Generates a URL to embed manipulation of custom field process into your application. + /// + /// The embedded custom field details. + /// Returns the embedded custom field url. + public async Task CreateEmbeddedCustomFieldUrlAsync(EmbeddedCustomFieldDetails embeddedCustomFieldDetails) + { + var localVarResponse = await this.CreateEmbeddedCustomFieldUrlAsyncWithHttpInfo(embeddedCustomFieldDetails).ConfigureAwait(false); + + return localVarResponse.Data; + } + + /// + /// Generates a URL to embed manipulation of custom field process into your application. + /// + /// The embedded custom field details. + /// Returns the embedded custom field url. + /// Thrown when fails to make API call. + /// Thrown when fails to make call. + public async Task> CreateEmbeddedCustomFieldUrlAsyncWithHttpInfo(EmbeddedCustomFieldDetails embeddedCustomFieldDetails) + { + if (embeddedCustomFieldDetails == null) + { + throw new ArgumentNullException(nameof(embeddedCustomFieldDetails)); + } + + if (string.IsNullOrEmpty(embeddedCustomFieldDetails.BrandId)) + { + throw new ApiException(422, ApiValidationMessages.InvalidBrandId); + } + + const string localVarPath = "/v1/customField/createEmbeddedCustomFieldUrl"; + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary>(); + var localVarFileUrlParams = new Dictionary(); + + // to determine the Content-Type header + var localVarHttpContentTypes = Enumerable.Empty().ToArray(); + var localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new[] + { + "application/json", + }; + var localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + + if (localVarHttpHeaderAccept != null) + { + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + } + + // authentication (Bearer) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); + } + + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "brandId", embeddedCustomFieldDetails.BrandId)); // query parameter + + if (embeddedCustomFieldDetails.LinkValidTill != null) + { + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "linkValidTill", embeddedCustomFieldDetails.LinkValidTill)); // query parameter + } + + // make the HTTP request + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Post, localVarQueryParams, null, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + + var localVarStatusCode = (int)localVarResponse.StatusCode; + + var exception = this.ExceptionFactory?.Invoke("CreateEmbeddedCustomFieldUrl", localVarResponse); + + if (exception != null) + { + throw exception; + } + + return new ApiResponse( + localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + (EmbeddedCustomFieldCreated)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(EmbeddedCustomFieldCreated))); + } + } +} diff --git a/src/BoldSign/Api/DocumentClient.cs b/src/BoldSign/Api/DocumentClient.cs index 30d3d63..b469131 100644 --- a/src/BoldSign/Api/DocumentClient.cs +++ b/src/BoldSign/Api/DocumentClient.cs @@ -16,11 +16,11 @@ namespace BoldSign.Api using System.Globalization; using System.IO; using System.Linq; + using System.Net.Http; using System.Threading.Tasks; using BoldSign.Api.Model; using BoldSign.Api.Resources; using BoldSign.Model; - using RestSharp; /// /// Represents a collection of functions to interact with the API endpoints. The functions perform actions such as sending document to sign, getting document list, deleting a document, downloading audit log, downloading a document, changing access code of the desired signer and so on. @@ -31,6 +31,7 @@ public class DocumentClient : IDocumentClient private const long MaxFileSize = 104857600; private ExceptionFactory exceptionFactory = (name, response) => null; + private static readonly HttpMethod PatchHttpMethod = new HttpMethod("PATCH"); /// /// Initializes a new instance of the class. @@ -87,7 +88,7 @@ public DocumentClient(ApiClient apiClient) /// Gets the base path of the API client. /// /// The base path - public string GetBasePath() => this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); + public string GetBasePath() => this.Configuration.ApiClient.HttpClient.BaseAddress.AbsoluteUri; /// /// Gets or sets the configuration object. @@ -123,16 +124,20 @@ public ExceptionFactory ExceptionFactory /// The new email address of recipient. /// The signer order. /// The on behalfof email. + /// The signer phone number. + /// The Old Signer Phone Number. public void ChangeRecipient( string documentId, - string oldSignerEmail, - string reason, - string newSignerName, - string newSignerEmail, + string oldSignerEmail = default, + string reason = default, + string newSignerName = default, + string newSignerEmail = default, int? signerOrder = default, - string onBehalfOf = default) + string onBehalfOf = default, + PhoneNumber phoneNumber = default, + PhoneNumber oldPhoneNumber = default) { - this.ChangeRecipientWithHttpInfo(documentId, oldSignerEmail, reason, newSignerName, newSignerEmail, signerOrder, onBehalfOf); + this.ChangeRecipientWithHttpInfo(documentId, oldSignerEmail, reason, newSignerName, newSignerEmail, signerOrder, onBehalfOf, phoneNumber, oldPhoneNumber); } /// @@ -146,26 +151,29 @@ public void ChangeRecipient( /// The new email address of recipient. /// The signer order. /// The on behalfof email. + /// The signer phone number. + /// The old Signer phone Number. /// ApiResponse of Object(void). public ApiResponse ChangeRecipientWithHttpInfo( string documentId, - string oldSignerEmail, - string reason, - string newSignerName, - string newSignerEmail, + string oldSignerEmail = default, + string reason = default, + string newSignerName = default, + string newSignerEmail = default, int? signerOrder = default, - string onBehalfOf = default) + string onBehalfOf = default, + PhoneNumber phoneNumber = default, + PhoneNumber oldPhoneNumber = default) { - ValidationForChangeRecipient(documentId, oldSignerEmail, reason, newSignerName, newSignerEmail, signerOrder); + ValidationForChangeRecipient(documentId, oldSignerEmail, reason, newSignerName, newSignerEmail, signerOrder, phoneNumber, oldPhoneNumber); var localVarPath = "/v1/document/ChangeRecipient"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary>(); var localVarFileUrlParams = new Dictionary(); - var recipientDetails = new ChangeRecipient(newSignerName, reason, oldSignerEmail, newSignerEmail, signerOrder, onBehalfOf); + var recipientDetails = new ChangeRecipient(newSignerName, reason, oldSignerEmail, newSignerEmail, signerOrder, onBehalfOf, phoneNumber, oldPhoneNumber); object localVarPostBody; // to determine the Content-Type header @@ -235,7 +243,7 @@ public ApiResponse ChangeRecipientWithHttpInfo( } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, PatchHttpMethod, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -248,7 +256,7 @@ public ApiResponse ChangeRecipientWithHttpInfo( return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -263,17 +271,21 @@ public ApiResponse ChangeRecipientWithHttpInfo( /// The new email address of recipient . /// The signer order. /// The on behalfof email. + /// The signer phone number. + /// The Old Signer Phone number. /// A representing the asynchronous operation. public async Task ChangeRecipientasync( string documentId, - string oldSignerEmail, - string reason, - string newSignerName, - string newSignerEmail, + string oldSignerEmail = default, + string reason = default, + string newSignerName = default, + string newSignerEmail = default, int? signerOrder = default, - string onBehalfOf = default) + string onBehalfOf = default, + PhoneNumber phoneNumber = default, + PhoneNumber oldPhoneNumber = default) { - await this.ChangeRecipientasyncWithHttpInfo(documentId, oldSignerEmail, reason, newSignerName, newSignerEmail, signerOrder, onBehalfOf).ConfigureAwait(false); + await this.ChangeRecipientasyncWithHttpInfo(documentId, oldSignerEmail, reason, newSignerName, newSignerEmail, signerOrder, onBehalfOf, phoneNumber, oldPhoneNumber).ConfigureAwait(false); } @@ -288,26 +300,29 @@ public async Task ChangeRecipientasync( /// The new email address of recipient . /// The signer order. /// The on behalfof email. + /// The signer phone number. + /// The Old signer phone number. /// ApiResponse of Object(void). public async Task> ChangeRecipientasyncWithHttpInfo( string documentId, - string oldSignerEmail, - string reason, - string newSignerName, - string newSignerEmail, + string oldSignerEmail = default, + string reason = default, + string newSignerName = default, + string newSignerEmail = default, int? signerOrder = default, - string onBehalfOf = default) + string onBehalfOf = default, + PhoneNumber phoneNumber = default, + PhoneNumber oldPhoneNumber = default) { - ValidationForChangeRecipient(documentId, oldSignerEmail, reason, newSignerName, newSignerEmail, signerOrder); + ValidationForChangeRecipient(documentId, oldSignerEmail, reason, newSignerName, newSignerEmail, signerOrder, phoneNumber, oldPhoneNumber); var localVarPath = "/v1/document/ChangeRecipient"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary>(); var localVarFileUrlParams = new Dictionary(); - var recipientDetails = new ChangeRecipient(newSignerName, reason, oldSignerEmail, newSignerEmail, signerOrder, onBehalfOf); + var recipientDetails = new ChangeRecipient(newSignerName, reason, oldSignerEmail, newSignerEmail, signerOrder, onBehalfOf, phoneNumber, oldPhoneNumber); object localVarPostBody; // to determine the Content-Type header @@ -377,7 +392,7 @@ public async Task> ChangeRecipientasyncWithHttpInfo( } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, PatchHttpMethod, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -390,7 +405,7 @@ public async Task> ChangeRecipientasyncWithHttpInfo( return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -406,10 +421,11 @@ public async Task> ChangeRecipientasyncWithHttpInfo( /// used to target that particular order with given signer email. (optional) /// /// The on behalfof email. + /// The phone number. /// - public void ChangeAccessCode(string documentId, string emailId, string newAccessCode, int? signerOrder = default, string onBehalfOf = default) + public void ChangeAccessCode(string documentId, string emailId = default, string newAccessCode = default, int? signerOrder = default, string onBehalfOf = default, PhoneNumber phoneNumber = default) { - this.ChangeAccessCodeWithHttpInfo(documentId, emailId, newAccessCode, signerOrder, onBehalfOf); + this.ChangeAccessCodeWithHttpInfo(documentId, emailId, newAccessCode, signerOrder, onBehalfOf, phoneNumber); } /// @@ -424,8 +440,9 @@ public void ChangeAccessCode(string documentId, string emailId, string newAccess /// used to target that particular order with given signer email. (optional) /// /// The on behalfof email. + /// The phone number. /// ApiResponse of Object(void) - public ApiResponse ChangeAccessCodeWithHttpInfo(string documentId, string emailId, string newAccessCode, int? signerOrder = default, string onBehalfOf = default) + public ApiResponse ChangeAccessCodeWithHttpInfo(string documentId, string emailId = default, string newAccessCode = default, int? signerOrder = default, string onBehalfOf = default, PhoneNumber phoneNumber = default) { // verify the required parameter 'documentId' is set if (documentId == null) @@ -434,7 +451,7 @@ public ApiResponse ChangeAccessCodeWithHttpInfo(string documentId, strin } // verify the required parameter 'emailId' is set - if (emailId == null) + if (emailId == null && phoneNumber == null) { throw new ApiException(400, "Missing required parameter 'emailId' when calling DocumentApi->ChangeAccessCode"); } @@ -446,12 +463,12 @@ public ApiResponse ChangeAccessCodeWithHttpInfo(string documentId, strin } var localVarPath = "/v1/document/changeAccessCode"; - var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary>(); - var accessCodeDetails = new AccessCodeDetails(newAccessCode, onBehalfOf); + var accessCodeDetails = new AccessCodeDetails(newAccessCode, onBehalfOf, phoneNumber); var localVarFileUrlParams = new Dictionary(); object localVarPostBody; @@ -531,10 +548,9 @@ public ApiResponse ChangeAccessCodeWithHttpInfo(string documentId, strin } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi( + using var localVarResponse = this.Configuration.ApiClient.CallApi( localVarPath, - Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + PatchHttpMethod, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -547,7 +563,7 @@ public ApiResponse ChangeAccessCodeWithHttpInfo(string documentId, strin return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -563,10 +579,11 @@ public ApiResponse ChangeAccessCodeWithHttpInfo(string documentId, strin /// used to target that particular order with given signer email. (optional) /// /// The on behalfof email. + /// The phone number. /// Task of void - public async Task ChangeAccessCodeAsync(string documentId, string emailId, string newAccessCode, int? signerOrder = default, string onBehalfOf = default) + public async Task ChangeAccessCodeAsync(string documentId, string emailId = default, string newAccessCode = default, int? signerOrder = default, string onBehalfOf = default, PhoneNumber phoneNumber = default) { - await this.ChangeAccessCodeAsyncWithHttpInfo(documentId, emailId, newAccessCode, signerOrder, onBehalfOf).ConfigureAwait(false); + await this.ChangeAccessCodeAsyncWithHttpInfo(documentId, emailId, newAccessCode, signerOrder, onBehalfOf, phoneNumber).ConfigureAwait(false); } /// @@ -581,8 +598,9 @@ public async Task ChangeAccessCodeAsync(string documentId, string emailId, strin /// used to target that particular order with given signer email. (optional) /// /// The on behalfof email. + /// The phone number. /// Task of ApiResponse - public async Task> ChangeAccessCodeAsyncWithHttpInfo(string documentId, string emailId, string newAccessCode, int? signerOrder = default, string onBehalfOf = default) + public async Task> ChangeAccessCodeAsyncWithHttpInfo(string documentId, string emailId = default, string newAccessCode = default, int? signerOrder = default, string onBehalfOf = default, PhoneNumber phoneNumber = default) { // verify the required parameter 'documentId' is set if (documentId == null) @@ -591,7 +609,7 @@ public async Task> ChangeAccessCodeAsyncWithHttpInfo(string } // verify the required parameter 'emailId' is set - if (emailId == null) + if (emailId == null && phoneNumber == null) { throw new ApiException(400, "Missing required parameter 'emailId' when calling DocumentApi->ChangeAccessCode"); } @@ -603,12 +621,11 @@ public async Task> ChangeAccessCodeAsyncWithHttpInfo(string } var localVarPath = "/v1/document/changeAccessCode"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary>(); - var accessCodeDetails = new AccessCodeDetails(newAccessCode, onBehalfOf); + var accessCodeDetails = new AccessCodeDetails(newAccessCode, onBehalfOf, phoneNumber); var localVarFileUrlParams = new Dictionary(); object localVarPostBody; @@ -687,10 +704,9 @@ public async Task> ChangeAccessCodeAsyncWithHttpInfo(string } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync( + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync( localVarPath, - Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + PatchHttpMethod, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -703,7 +719,7 @@ public async Task> ChangeAccessCodeAsyncWithHttpInfo(string return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -718,13 +734,15 @@ public async Task> ChangeAccessCodeAsyncWithHttpInfo(string /// used to target that particular order with given signer email. (optional). /// /// The on behalfof email. + /// The phone number. public void RemoveAuthentication( string documentId, - string emailId, + string emailId = default, int? signerOrder = default, - string onBehalfOf = default) + string onBehalfOf = default, + PhoneNumber phoneNumber = default) { - this.RemoveAuthenticationWithHttpInfo(documentId, emailId, signerOrder, onBehalfOf); + this.RemoveAuthenticationWithHttpInfo(documentId, emailId, signerOrder, onBehalfOf, phoneNumber); } /// @@ -737,13 +755,15 @@ public void RemoveAuthentication( /// Gets or sets the signer's order. When signer order is enabled for a document, this order is /// used to target that particular order with given signer email. (optional). /// - // The on behalfof email. + /// The on behalfof email. + /// The phone number. /// ApiResponse of Object(void). public ApiResponse RemoveAuthenticationWithHttpInfo( string documentId, - string emailId, + string emailId = default, int? signerOrder = default, - string onBehalfOf = default) + string onBehalfOf = default, + PhoneNumber phoneNumber = default) { // verify the required parameter 'documentId' is set if (documentId == null) @@ -752,19 +772,18 @@ public ApiResponse RemoveAuthenticationWithHttpInfo( } // verify the required parameter 'emailId' is set - if (emailId == null) + if (emailId == null && phoneNumber == null) { throw new ApiException(400, "Missing required parameter 'emailId' when calling DocumentApi->RemoveAuthentication"); } var localVarPath = "/v1/document/RemoveAuthentication"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary>(); var localVarFileUrlParams = new Dictionary(); - var bodyDetails = new RemoveAuthentication(emailId, signerOrder, onBehalfOf); + var bodyDetails = new RemoveAuthentication(emailId, signerOrder, onBehalfOf, phoneNumber); object localVarPatchBody; // to determine the Content-Type header @@ -833,7 +852,7 @@ public ApiResponse RemoveAuthenticationWithHttpInfo( } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.PATCH, localVarQueryParams, localVarPatchBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, PatchHttpMethod, localVarQueryParams, localVarPatchBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -846,7 +865,7 @@ public ApiResponse RemoveAuthenticationWithHttpInfo( return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -861,14 +880,16 @@ public ApiResponse RemoveAuthenticationWithHttpInfo( /// used to target that particular order with given signer email. (optional). /// /// The on behalfof email. + /// The phone number. /// Task of void. public async Task RemoveAuthenticationAsync( string documentId, - string emailId, + string emailId = default, int? signerOrder = default, - string onBehalfOf = default) + string onBehalfOf = default, + PhoneNumber phoneNumber = default) { - await this.RemoveAuthenticationAsyncWithHttpInfo(documentId, emailId, signerOrder, onBehalfOf).ConfigureAwait(false); + await this.RemoveAuthenticationAsyncWithHttpInfo(documentId, emailId, signerOrder, onBehalfOf, phoneNumber).ConfigureAwait(false); } /// @@ -882,12 +903,14 @@ public async Task RemoveAuthenticationAsync( /// used to target that particular order with given signer email. (optional). /// /// The on behalfof email. + /// The phone number. /// Task of ApiResponse. public async Task> RemoveAuthenticationAsyncWithHttpInfo( string documentId, - string emailId, + string emailId = default, int? signerOrder = default, - string onBehalfOf = default) + string onBehalfOf = default, + PhoneNumber phoneNumber = default) { // verify the required parameter 'documentId' is set if (documentId == null) @@ -896,19 +919,18 @@ public async Task> RemoveAuthenticationAsyncWithHttpInfo( } // verify the required parameter 'emailId' is set - if (emailId == null) + if (emailId == null && phoneNumber == null) { throw new ApiException(400, "Missing required parameter 'emailId' when calling DocumentApi->RemoveAuthentication"); } var localVarPath = "/v1/document/RemoveAuthentication"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary>(); var localVarFileUrlParams = new Dictionary(); - var bodyDetails = new RemoveAuthentication(emailId, signerOrder, onBehalfOf); + var bodyDetails = new RemoveAuthentication(emailId, signerOrder, onBehalfOf, phoneNumber); object localVarPatchBody; // to determine the Content-Type header @@ -977,7 +999,7 @@ public async Task> RemoveAuthenticationAsyncWithHttpInfo( } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.PATCH, localVarQueryParams, localVarPatchBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, PatchHttpMethod, localVarQueryParams, localVarPatchBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); var exception = this.ExceptionFactory?.Invoke("RemoveAuthentication", localVarResponse); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -988,7 +1010,7 @@ public async Task> RemoveAuthenticationAsyncWithHttpInfo( return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1031,7 +1053,6 @@ public ApiResponse ExtendExpiryWithHttpinfo(string documentId, string ne ValidationForExtendExpiry(documentId, newExpiryValue); var localVarPath = "/v1/document/extendExpiry"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -1107,7 +1128,7 @@ public ApiResponse ExtendExpiryWithHttpinfo(string documentId, string ne } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, PatchHttpMethod, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1120,7 +1141,7 @@ public ApiResponse ExtendExpiryWithHttpinfo(string documentId, string ne return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1164,7 +1185,6 @@ public async Task> ExtendExpiryAsyncWithHttpInfo(string docu ValidationForExtendExpiry(documentId, newExpiryValue); var localVarPath = "/v1/document/extendExpiry"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -1241,7 +1261,7 @@ public async Task> ExtendExpiryAsyncWithHttpInfo(string docu } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, PatchHttpMethod, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1254,7 +1274,7 @@ public async Task> ExtendExpiryAsyncWithHttpInfo(string docu return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1292,7 +1312,6 @@ public ApiResponse DeleteDocumentWithHttpInfo(string documentId, bool de } var localVarPath = "/v1/document/delete"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -1343,10 +1362,9 @@ public ApiResponse DeleteDocumentWithHttpInfo(string documentId, bool de } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi( + using var localVarResponse = this.Configuration.ApiClient.CallApi( localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + HttpMethod.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1359,7 +1377,7 @@ public ApiResponse DeleteDocumentWithHttpInfo(string documentId, bool de return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1397,7 +1415,6 @@ public async Task> DeleteDocumentAsyncWithHttpInfo(string do } var localVarPath = "/v1/document/delete"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -1448,10 +1465,9 @@ public async Task> DeleteDocumentAsyncWithHttpInfo(string do } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync( + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync( localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + HttpMethod.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1464,7 +1480,7 @@ public async Task> DeleteDocumentAsyncWithHttpInfo(string do return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1494,7 +1510,6 @@ public ApiResponse AddTagWithHttpInfo(DocumentTags addTags) ValidationForAddDeleteTags(addTags.DocumentId, addTags.Tags); var localVarPath = "v1/document/addTags"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -1549,7 +1564,7 @@ public ApiResponse AddTagWithHttpInfo(DocumentTags addTags) } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, PatchHttpMethod, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1562,7 +1577,7 @@ public ApiResponse AddTagWithHttpInfo(DocumentTags addTags) return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1593,7 +1608,6 @@ public Task> AddTagAsyncWithHttpInfo(DocumentTags addTags) ValidationForAddDeleteTags(addTags.DocumentId, addTags.Tags); var localVarPath = "/v1/document/addTags"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -1648,7 +1662,7 @@ public Task> AddTagAsyncWithHttpInfo(DocumentTags addTags) } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, PatchHttpMethod, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1661,7 +1675,7 @@ public Task> AddTagAsyncWithHttpInfo(DocumentTags addTags) return Task.FromResult(new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null)); } @@ -1691,7 +1705,6 @@ public ApiResponse DeleteTagWithHttpInfo(DocumentTags deleteTags) ValidationForAddDeleteTags(deleteTags.DocumentId, deleteTags.Tags); var localVarPath = "/v1/document/deleteTags"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -1745,7 +1758,7 @@ public ApiResponse DeleteTagWithHttpInfo(DocumentTags deleteTags) } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1758,7 +1771,7 @@ public ApiResponse DeleteTagWithHttpInfo(DocumentTags deleteTags) return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1789,7 +1802,6 @@ public Task> DeleteTagAsyncWithHttpInfo(DocumentTags deleteT ValidationForAddDeleteTags(deleteTags.DocumentId, deleteTags.Tags); var localVarPath = "/v1/document/deleteTags"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -1844,7 +1856,7 @@ public Task> DeleteTagAsyncWithHttpInfo(DocumentTags deleteT } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1857,7 +1869,7 @@ public Task> DeleteTagAsyncWithHttpInfo(DocumentTags deleteT return Task.FromResult(new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null)); } @@ -1891,7 +1903,6 @@ public ApiResponse DownloadAuditLogWithHttpInfo(string documentId, strin } var localVarPath = "/v1/document/downloadAuditLog"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -1945,10 +1956,9 @@ public ApiResponse DownloadAuditLogWithHttpInfo(string documentId, strin } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi( + using var localVarResponse = this.Configuration.ApiClient.CallApi( localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1961,7 +1971,7 @@ public ApiResponse DownloadAuditLogWithHttpInfo(string documentId, strin return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (Stream)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Stream))); } @@ -1995,7 +2005,6 @@ public async Task> DownloadAuditLogAsyncWithHttpInfo(string } var localVarPath = "/v1/document/downloadAuditLog"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -2049,10 +2058,9 @@ public async Task> DownloadAuditLogAsyncWithHttpInfo(string } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync( + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync( localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -2065,7 +2073,7 @@ public async Task> DownloadAuditLogAsyncWithHttpInfo(string return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (Stream)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Stream))); } @@ -2088,9 +2096,9 @@ public Stream DownloadDocument(string documentId, string onBehalfOf = default) /// /// Thrown when fails to make API call /// Document Id. - /// The on behalfof email. + /// The on behalf of email. /// ApiResponse of System.IO.Stream - public ApiResponse DownloadDocumentWithHttpInfo(string documentId, string onBehalfOf) + public ApiResponse DownloadDocumentWithHttpInfo(string documentId, string onBehalfOf = default) { // verify the required parameter 'documentId' is set if (documentId == null) @@ -2099,7 +2107,6 @@ public ApiResponse DownloadDocumentWithHttpInfo(string documentId, strin } var localVarPath = "/v1/document/download"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -2154,10 +2161,9 @@ public ApiResponse DownloadDocumentWithHttpInfo(string documentId, strin } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi( + using var localVarResponse = this.Configuration.ApiClient.CallApi( localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -2170,7 +2176,7 @@ public ApiResponse DownloadDocumentWithHttpInfo(string documentId, strin return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (Stream)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Stream))); } @@ -2204,7 +2210,6 @@ public async Task> DownloadDocumentAsyncWithHttpInfo(string } var localVarPath = "/v1/document/download"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -2259,10 +2264,9 @@ public async Task> DownloadDocumentAsyncWithHttpInfo(string } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync( + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync( localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -2275,7 +2279,7 @@ public async Task> DownloadDocumentAsyncWithHttpInfo(string return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (Stream)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Stream))); } @@ -2316,7 +2320,6 @@ public ApiResponse DownloadAttachmenttWithHttpInfo(string documentId, st } var localVarPath = "/v1/document/downloadAttachment"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -2370,7 +2373,7 @@ public ApiResponse DownloadAttachmenttWithHttpInfo(string documentId, st } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -2383,7 +2386,7 @@ public ApiResponse DownloadAttachmenttWithHttpInfo(string documentId, st return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (Stream)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Stream))); } @@ -2424,7 +2427,6 @@ public async Task> DownloadAttachmentAsyncWithHttpInfo(strin } var localVarPath = "/v1/document/downloadAttachment"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -2478,7 +2480,7 @@ public async Task> DownloadAttachmentAsyncWithHttpInfo(strin } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -2491,7 +2493,7 @@ public async Task> DownloadAttachmentAsyncWithHttpInfo(strin return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (Stream)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Stream))); } @@ -2501,13 +2503,15 @@ public async Task> DownloadAttachmentAsyncWithHttpInfo(strin /// /// Thrown when fails to make API call /// Gets or sets Document Id. - /// Gets or sets signer email. + /// Gets or sets signer email. (optional) /// Gets or sets sign link expiration date (Valid Till). (optional) /// Gets or sets Redirect URL. (optional) + /// Gets or sets Country Code. (optional) + /// Gets or sets Phone Number. (optional) /// EmbeddedSigningLink - public EmbeddedSigningLink GetEmbeddedSignLink(string documentId, string signerEmail, DateTime? signLinkValidTill = default, string redirectUrl = default) + public EmbeddedSigningLink GetEmbeddedSignLink(string documentId, string signerEmail = default, DateTime? signLinkValidTill = default, string redirectUrl = default, string countryCode = default, string phoneNumber = default) { - var localVarResponse = this.GetEmbeddedSignLinkWithHttpInfo(documentId, signerEmail, signLinkValidTill, redirectUrl); + var localVarResponse = this.GetEmbeddedSignLinkWithHttpInfo(documentId, signerEmail, signLinkValidTill, redirectUrl, countryCode, phoneNumber); return localVarResponse.Data; } @@ -2517,11 +2521,13 @@ public EmbeddedSigningLink GetEmbeddedSignLink(string documentId, string signerE /// /// Thrown when fails to make API call /// Gets or sets Document Id. - /// Gets or sets signer email. + /// Gets or sets signer email. (optional) /// Gets or sets sign link expiration date (Valid Till). (optional) /// Gets or sets Redirect URL. (optional) + /// Gets or sets Country Code. (optional) + /// Gets or sets Phone Number. (optional) /// ApiResponse of EmbeddedSigningLink - public ApiResponse GetEmbeddedSignLinkWithHttpInfo(string documentId, string signerEmail, DateTime? signLinkValidTill = default, string redirectUrl = default) + public ApiResponse GetEmbeddedSignLinkWithHttpInfo(string documentId, string signerEmail = default, DateTime? signLinkValidTill = default, string redirectUrl = default, string countryCode = default, string phoneNumber = default) { // verify the required parameter 'documentId' is set if (documentId == null) @@ -2529,14 +2535,13 @@ public ApiResponse GetEmbeddedSignLinkWithHttpInfo(string d throw new ApiException(400, "Missing required parameter 'documentId' when calling DocumentApi->GetEmbeddedSignLink"); } - // verify the required parameter 'signerEmail' is set - if (signerEmail == null) + // verify the required parameter 'signerEmail' or 'countryCode' and 'phoneNumber' is set + if (signerEmail == null && (string.IsNullOrEmpty(countryCode) || string.IsNullOrEmpty(phoneNumber))) { - throw new ApiException(400, "Missing required parameter 'signerEmail' when calling DocumentApi->GetEmbeddedSignLink"); + throw new ApiException(400, "Missing required parameter 'signerEmail' or 'countryCode' and 'phoneNumber' when calling DocumentApi->GetEmbeddedSignLink"); } var localVarPath = "/v1/document/getEmbeddedSignLink"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -2590,6 +2595,12 @@ public ApiResponse GetEmbeddedSignLinkWithHttpInfo(string d localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "RedirectUrl", redirectUrl)); // query parameter } + if (countryCode != null && phoneNumber != null) + { + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "CountryCode", countryCode)); // query parameter + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "PhoneNumber", phoneNumber)); // query parameter + } + // authentication (Bearer) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) { @@ -2597,10 +2608,9 @@ public ApiResponse GetEmbeddedSignLinkWithHttpInfo(string d } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi( + using var localVarResponse = this.Configuration.ApiClient.CallApi( localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -2613,7 +2623,7 @@ public ApiResponse GetEmbeddedSignLinkWithHttpInfo(string d return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (EmbeddedSigningLink)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(EmbeddedSigningLink))); } @@ -2622,13 +2632,15 @@ public ApiResponse GetEmbeddedSignLinkWithHttpInfo(string d /// /// Thrown when fails to make API call /// Gets or sets Document Id. - /// Gets or sets signer email. + /// Gets or sets signer email. (optional) /// Gets or sets sign link expiration date (Valid Till). (optional) /// Gets or sets Redirect URL. (optional) + /// Gets or sets Country Code. (optional) + /// Gets or sets Phone Number. (optional) /// Task of EmbeddedSigningLink - public async Task GetEmbeddedSignLinkAsync(string documentId, string signerEmail, DateTime? signLinkValidTill = default, string redirectUrl = default) + public async Task GetEmbeddedSignLinkAsync(string documentId, string signerEmail = default, DateTime? signLinkValidTill = default, string redirectUrl = default, string countryCode = default, string phoneNumber = default) { - var localVarResponse = await this.GetEmbeddedSignLinkAsyncWithHttpInfo(documentId, signerEmail, signLinkValidTill, redirectUrl); + var localVarResponse = await this.GetEmbeddedSignLinkAsyncWithHttpInfo(documentId, signerEmail, signLinkValidTill, redirectUrl, countryCode, phoneNumber); return localVarResponse.Data; } @@ -2638,11 +2650,13 @@ public async Task GetEmbeddedSignLinkAsync(string documentI /// /// Thrown when fails to make API call /// Gets or sets Document Id. - /// Gets or sets signer email. + /// Gets or sets signer email. (optional) /// Gets or sets sign link expiration date (Valid Till). (optional) /// Gets or sets Redirect URL. (optional) + /// Gets or sets Country Code. (optional) + /// Gets or sets Phone Number. (optional) /// Task of ApiResponse (EmbeddedSigningLink) - public async Task> GetEmbeddedSignLinkAsyncWithHttpInfo(string documentId, string signerEmail, DateTime? signLinkValidTill = default, string redirectUrl = default) + public async Task> GetEmbeddedSignLinkAsyncWithHttpInfo(string documentId, string signerEmail = default, DateTime? signLinkValidTill = default, string redirectUrl = default, string countryCode = default, string phoneNumber = default) { // verify the required parameter 'documentId' is set if (documentId == null) @@ -2650,14 +2664,13 @@ public async Task> GetEmbeddedSignLinkAsyncWith throw new ApiException(400, "Missing required parameter 'documentId' when calling DocumentApi->GetEmbeddedSignLink"); } - // verify the required parameter 'signerEmail' is set - if (signerEmail == null) + // verify the required parameter 'signerEmail' or 'countryCode' and 'phoneNumber' is set + if (signerEmail == null && (string.IsNullOrEmpty(countryCode) || string.IsNullOrEmpty(phoneNumber))) { - throw new ApiException(400, "Missing required parameter 'signerEmail' when calling DocumentApi->GetEmbeddedSignLink"); + throw new ApiException(400, "Missing required parameter 'signerEmail' or 'countryCode' and 'phoneNumber' when calling DocumentApi->GetEmbeddedSignLink"); } var localVarPath = "/v1/document/getEmbeddedSignLink"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -2711,6 +2724,12 @@ public async Task> GetEmbeddedSignLinkAsyncWith localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "RedirectUrl", redirectUrl)); // query parameter } + if (countryCode != null && phoneNumber != null) + { + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "CountryCode", countryCode)); // query parameter + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "PhoneNumber", phoneNumber)); // query parameter + } + // authentication (Bearer) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) { @@ -2718,10 +2737,9 @@ public async Task> GetEmbeddedSignLinkAsyncWith } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync( + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync( localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -2734,7 +2752,7 @@ public async Task> GetEmbeddedSignLinkAsyncWith return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (EmbeddedSigningLink)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(EmbeddedSigningLink))); } @@ -2766,7 +2784,6 @@ public ApiResponse GetPropertiesWithHttpInfo(string document } var localVarPath = "/v1/document/properties"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -2801,10 +2818,9 @@ public ApiResponse GetPropertiesWithHttpInfo(string document } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi( + using var localVarResponse = this.Configuration.ApiClient.CallApi( localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -2817,7 +2833,7 @@ public ApiResponse GetPropertiesWithHttpInfo(string document return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (DocumentProperties)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(DocumentProperties))); } @@ -2849,7 +2865,6 @@ public async Task> GetPropertiesAsyncWithHttpInf } var localVarPath = "/v1/document/properties"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -2884,10 +2899,9 @@ public async Task> GetPropertiesAsyncWithHttpInf } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync( + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync( localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -2900,7 +2914,7 @@ public async Task> GetPropertiesAsyncWithHttpInf return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (DocumentProperties)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(DocumentProperties))); } @@ -2916,10 +2930,12 @@ public async Task> GetPropertiesAsyncWithHttpInf /// Gets or sets the status. (optional) /// Gets or sets the endDate. (optional) /// Gets or sets the searchKey. (optional) + /// Gets or sets the nextCursor. + /// Gets or sets the brandIds. /// DocumentRecords - public DocumentRecords ListDocuments(int page, int? pageSize = default, List sentBy = default, List recipients = default, DateTime? startDate = default, List status = default, DateTime? endDate = default, string searchKey = default, List labels = default, TransmitType? transmitType = default) + public DocumentRecords ListDocuments(int page = 1, int? pageSize = default, List sentBy = default, List recipients = default, DateTime? startDate = default, List status = default, DateTime? endDate = default, string searchKey = default, List labels = default, TransmitType? transmitType = default, long? nextCursor = default, List brandIds = default) { - var localVarResponse = this.ListDocumentsWithHttpInfo(page, pageSize, sentBy, recipients, startDate, status, endDate, searchKey, labels, transmitType); + var localVarResponse = this.ListDocumentsWithHttpInfo(page, pageSize, sentBy, recipients, startDate, status, endDate, searchKey, labels, transmitType, nextCursor, brandIds); return localVarResponse.Data; } @@ -2936,13 +2952,14 @@ public DocumentRecords ListDocuments(int page, int? pageSize = default, ListGets or sets the status. (optional) /// Gets or sets the endDate. (optional) /// Gets or sets the searchKey. (optional) + /// Gets or sets the nextCursor. + /// Gets or sets the brandIds. /// ApiResponse of DocumentRecords - public ApiResponse ListDocumentsWithHttpInfo(int page, int? pageSize = default, List sentBy = default, List recipients = default, DateTime? startDate = default, List status = default, DateTime? endDate = default, string searchKey = default, List labels = default, TransmitType? transmitType = default) + public ApiResponse ListDocumentsWithHttpInfo(int page = 1, int? pageSize = default, List sentBy = default, List recipients = default, DateTime? startDate = default, List status = default, DateTime? endDate = default, string searchKey = default, List labels = default, TransmitType? transmitType = default, long? nextCursor = default, List brandIds = default) { // verify the required parameter 'page' is set var localVarPath = "/v1/document/list"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -3010,6 +3027,11 @@ public ApiResponse ListDocumentsWithHttpInfo(int page, int? pag localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "SearchKey", searchKey)); // query parameter } + if (nextCursor != null) + { + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "NextCursor", nextCursor)); // query parameter + } + // authentication (Bearer) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) { @@ -3021,11 +3043,15 @@ public ApiResponse ListDocumentsWithHttpInfo(int page, int? pag localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "Labels", labels)); // query parameter } + if (brandIds != null) + { + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "BrandIds", brandIds)); // query parameter + } + // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi( + using var localVarResponse = this.Configuration.ApiClient.CallApi( localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -3038,7 +3064,7 @@ public ApiResponse ListDocumentsWithHttpInfo(int page, int? pag return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (DocumentRecords)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(DocumentRecords))); } @@ -3054,10 +3080,12 @@ public ApiResponse ListDocumentsWithHttpInfo(int page, int? pag /// Gets or sets the status. (optional) /// Gets or sets the endDate. (optional) /// Gets or sets the searchKey. (optional) + /// Gets or sets the nextCursor. + /// Gets or sets the brandIds. /// Task of DocumentRecords - public async Task ListDocumentsAsync(int page, int? pageSize = default, List sentBy = default, List recipients = default, DateTime? startDate = default, List status = default, DateTime? endDate = default, string searchKey = default, List labels = default, TransmitType? transmitType = default) + public async Task ListDocumentsAsync(int page = 1, int? pageSize = default, List sentBy = default, List recipients = default, DateTime? startDate = default, List status = default, DateTime? endDate = default, string searchKey = default, List labels = default, TransmitType? transmitType = default, long? nextCursor = default, List brandIds = default) { - var localVarResponse = await this.ListDocumentsAsyncWithHttpInfo(page, pageSize, sentBy, recipients, startDate, status, endDate, searchKey, labels, transmitType); + var localVarResponse = await this.ListDocumentsAsyncWithHttpInfo(page, pageSize, sentBy, recipients, startDate, status, endDate, searchKey, labels, transmitType, nextCursor, brandIds); return localVarResponse.Data; } @@ -3074,13 +3102,14 @@ public async Task ListDocumentsAsync(int page, int? pageSize = /// Gets or sets the status. (optional) /// Gets or sets the endDate. (optional) /// Gets or sets the searchKey. (optional) + /// Gets or sets the nextCursor. + /// Gets or sets the brandIds. /// Task of ApiResponse (DocumentRecords) - public async Task> ListDocumentsAsyncWithHttpInfo(int page, int? pageSize = default, List sentBy = default, List recipients = default, DateTime? startDate = default, List status = default, DateTime? endDate = default, string searchKey = default, List labels = default, TransmitType? transmitType = default) + public async Task> ListDocumentsAsyncWithHttpInfo(int page = 1, int? pageSize = default, List sentBy = default, List recipients = default, DateTime? startDate = default, List status = default, DateTime? endDate = default, string searchKey = default, List labels = default, TransmitType? transmitType = default, long? nextCursor = default, List brandIds = default) { // verify the required parameter 'page' is set var localVarPath = "/v1/document/list"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -3148,6 +3177,11 @@ public async Task> ListDocumentsAsyncWithHttpInfo(i localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "TransmitType", transmitType)); // query parameter } + if (nextCursor != null) + { + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "NextCursor", nextCursor)); // query parameter + } + // authentication (Bearer) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) { @@ -3159,11 +3193,15 @@ public async Task> ListDocumentsAsyncWithHttpInfo(i localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "Labels", labels)); // query parameter } + if (brandIds != null) + { + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "BrandIds", brandIds)); // query parameter + } + // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync( + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync( localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -3176,13 +3214,13 @@ public async Task> ListDocumentsAsyncWithHttpInfo(i return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (DocumentRecords)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(DocumentRecords))); } /// public BehalfDocumentRecords ListBehalfDocuments( - int page, + int page = 1, int? pageSize = default, List emailAddress = default, List status = default, @@ -3191,7 +3229,9 @@ public BehalfDocumentRecords ListBehalfDocuments( DateTime? startDate = default, DateTime? endDate = default, List signers = default, - List labels = default) + List labels = default, + long? nextCursor = default, + List brandIds = default) { var localVarResponse = this.ListBehalfDocumentsWithHttpInfo( page, @@ -3203,14 +3243,16 @@ public BehalfDocumentRecords ListBehalfDocuments( startDate, endDate, signers, - labels); + labels, + nextCursor, + brandIds); return localVarResponse.Data; } /// public ApiResponse ListBehalfDocumentsWithHttpInfo( - int page, + int page = 1, int? pageSize = default, List emailAddress = default, List status = default, @@ -3219,7 +3261,9 @@ public ApiResponse ListBehalfDocumentsWithHttpInfo( DateTime? startDate = default, DateTime? endDate = default, List signers = default, - List labels = default) + List labels = default, + long? nextCursor = default, + List brandIds = default) { var request = GetBehalfListValues( this.Configuration, @@ -3232,18 +3276,19 @@ public ApiResponse ListBehalfDocumentsWithHttpInfo( startDate, endDate, signers, - labels); + labels, + nextCursor, + brandIds); // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi( + using var localVarResponse = this.Configuration.ApiClient.CallApi( request.LocalVarPath, - Method.GET, + HttpMethod.Get, request.LocalVarQueryParams, request.LocalVarPostBody, request.LocalVarHeaderParams, request.LocalVarFormParams, request.LocalVarFileParams, - request.LocalVarPathParams, request.LocalVarHttpContentType, request.LocalVarFileUrlParams); @@ -3258,13 +3303,13 @@ public ApiResponse ListBehalfDocumentsWithHttpInfo( return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (BehalfDocumentRecords)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(BehalfDocumentRecords))); } /// public async Task ListBehalfDocumentsAsync( - int page, + int page = 1, int? pageSize = default, List emailAddress = default, List status = default, @@ -3273,7 +3318,9 @@ public async Task ListBehalfDocumentsAsync( DateTime? startDate = default, DateTime? endDate = default, List signers = default, - List labels = default) + List labels = default, + long? nextCursor = default, + List brandIds = default) { var localVarResponse = await this.ListBehalfDocumentsAsyncWithHttpInfo( page, @@ -3285,14 +3332,16 @@ public async Task ListBehalfDocumentsAsync( startDate, endDate, signers, - labels).ConfigureAwait(false); + labels, + nextCursor, + brandIds).ConfigureAwait(false); return localVarResponse.Data; } /// public async Task> ListBehalfDocumentsAsyncWithHttpInfo( - int page, + int page = 1, int? pageSize = default, List emailAddress = default, List status = default, @@ -3301,7 +3350,9 @@ public async Task> ListBehalfDocumentsAsyncWi DateTime? startDate = default, DateTime? endDate = default, List signers = default, - List labels = default) + List labels = default, + long? nextCursor = default, + List brandIds = default) { var request = GetBehalfListValues( this.Configuration, @@ -3314,18 +3365,19 @@ public async Task> ListBehalfDocumentsAsyncWi startDate, endDate, signers, - labels); + labels, + nextCursor, + brandIds); // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync( + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync( request.LocalVarPath, - Method.GET, + HttpMethod.Get, request.LocalVarQueryParams, request.LocalVarPostBody, request.LocalVarHeaderParams, request.LocalVarFormParams, request.LocalVarFileParams, - request.LocalVarPathParams, request.LocalVarHttpContentType, request.LocalVarFileUrlParams).ConfigureAwait(false); @@ -3340,7 +3392,7 @@ public async Task> ListBehalfDocumentsAsyncWi return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (BehalfDocumentRecords)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(BehalfDocumentRecords))); } @@ -3358,10 +3410,12 @@ public async Task> ListBehalfDocumentsAsyncWi /// Gets or sets the searchKey. (optional). /// Gets or set the labels. /// transmitType. + /// Gets or sets the nextCursor. + /// Gets or sets the brandIds. /// ApiResponse of TeamDocumentRecords. - public TeamDocumentRecords ListTeamDocuments(int page, int? pageSize = default, DateTime? startDate = default, List status = default, List teamId = default, List userId = default, DateTime? endDate = default, string searchKey = default, List labels = default, TransmitType? transmitType = default) + public TeamDocumentRecords ListTeamDocuments(int page = 1, int? pageSize = default, DateTime? startDate = default, List status = default, List teamId = default, List userId = default, DateTime? endDate = default, string searchKey = default, List labels = default, TransmitType? transmitType = default, long? nextCursor = default, List brandIds = default) { - var localVarResponse = this.ListTeamDocumentsWithHttpInfo(page, pageSize, startDate, status, teamId, userId, endDate, searchKey, labels, transmitType); + var localVarResponse = this.ListTeamDocumentsWithHttpInfo(page, pageSize, startDate, status, teamId, userId, endDate, searchKey, labels, transmitType, nextCursor, brandIds); return localVarResponse.Data; } @@ -3380,14 +3434,15 @@ public TeamDocumentRecords ListTeamDocuments(int page, int? pageSize = default, /// Gets or sets the searchKey. (optional). /// Gets or set the labels. /// transmitType. + /// Gets or sets the nextCursor. + /// Gets or sets the brandIds. /// ApiResponse of TeamDocumentRecords. - public ApiResponse ListTeamDocumentsWithHttpInfo(int page, int? pageSize = default, DateTime? startDate = default, List status = default, List teamId = default, List userId = default, DateTime? endDate = default, string searchKey = default, List labels = default, TransmitType? transmitType = default) + public ApiResponse ListTeamDocumentsWithHttpInfo(int page = 1, int? pageSize = default, DateTime? startDate = default, List status = default, List teamId = default, List userId = default, DateTime? endDate = default, string searchKey = default, List labels = default, TransmitType? transmitType = default, long? nextCursor = default, List brandIds = default) { ValidationForEndDate(startDate, endDate); // verify the required parameter 'page' is set var localVarPath = "/v1/document/teamlist"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -3453,6 +3508,11 @@ public ApiResponse ListTeamDocumentsWithHttpInfo(int page, localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "SearchKey", searchKey)); // query parameter } + if (nextCursor != null) + { + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "NextCursor", nextCursor)); // query parameter + } + // authentication (Bearer) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) { @@ -3464,8 +3524,13 @@ public ApiResponse ListTeamDocumentsWithHttpInfo(int page, localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "Labels", labels)); // query parameter } + if (brandIds != null) + { + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "BrandIds", brandIds)); // query parameter + } + // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -3478,7 +3543,7 @@ public ApiResponse ListTeamDocumentsWithHttpInfo(int page, return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (TeamDocumentRecords)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(TeamDocumentRecords))); } @@ -3496,10 +3561,12 @@ public ApiResponse ListTeamDocumentsWithHttpInfo(int page, /// Gets or sets the searchKey. (optional). /// Gets or set the labels. /// transmitType. + /// Gets or sets the nextCursor. + /// Gets or sets the brandIds. /// Task of TeamDocumentRecords. - public async Task ListTeamDocumentsAsync(int page, int? pageSize = default, DateTime? startDate = default, List status = default, List teamId = default, List userId = default, DateTime? endDate = default, string searchKey = default, List labels = default, TransmitType? transmitType = default) + public async Task ListTeamDocumentsAsync(int page = 1, int? pageSize = default, DateTime? startDate = default, List status = default, List teamId = default, List userId = default, DateTime? endDate = default, string searchKey = default, List labels = default, TransmitType? transmitType = default, long? nextCursor = default, List brandIds = default) { - var localVarResponse = await this.ListTeamDocumentsAsyncWithHttpInfo(page, pageSize, startDate, status, teamId, userId, endDate, searchKey, labels, transmitType).ConfigureAwait(false); + var localVarResponse = await this.ListTeamDocumentsAsyncWithHttpInfo(page, pageSize, startDate, status, teamId, userId, endDate, searchKey, labels, transmitType, nextCursor, brandIds).ConfigureAwait(false); return localVarResponse.Data; } @@ -3518,14 +3585,15 @@ public async Task ListTeamDocumentsAsync(int page, int? pag /// Gets or sets the searchKey. (optional). /// Gets or set the labels. /// transmitType. + /// Gets or sets the nextCursor. + /// Gets or sets the brandIds. /// Task of ApiResponse (TeamDocumentRecords). - public async Task> ListTeamDocumentsAsyncWithHttpInfo(int page, int? pageSize = default, DateTime? startDate = default, List status = default, List teamId = default, List userId = default, DateTime? endDate = default, string searchKey = default, List labels = default, TransmitType? transmitType = default) + public async Task> ListTeamDocumentsAsyncWithHttpInfo(int page = 1, int? pageSize = default, DateTime? startDate = default, List status = default, List teamId = default, List userId = default, DateTime? endDate = default, string searchKey = default, List labels = default, TransmitType? transmitType = default, long? nextCursor = default, List brandIds = default) { ValidationForEndDate(startDate, endDate); // verify the required parameter 'page' is set var localVarPath = "/v1/document/teamlist"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -3591,6 +3659,11 @@ public async Task> ListTeamDocumentsAsyncWithHt localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "TransmitType", transmitType)); // query parameter } + if (nextCursor != null) + { + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "NextCursor", nextCursor)); // query parameter + } + // authentication (Bearer) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) { @@ -3602,8 +3675,13 @@ public async Task> ListTeamDocumentsAsyncWithHt localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "Labels", labels)); // query parameter } + if (brandIds != null) + { + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "BrandIds", brandIds)); // query parameter + } + // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -3616,7 +3694,7 @@ public async Task> ListTeamDocumentsAsyncWithHt return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (TeamDocumentRecords)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(TeamDocumentRecords))); } @@ -3650,7 +3728,6 @@ public ApiResponse RemindDocumentWithHttpInfo(string documentId, List(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -3730,10 +3807,9 @@ public ApiResponse RemindDocumentWithHttpInfo(string documentId, List RemindDocumentWithHttpInfo(string documentId, List( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -3780,7 +3856,6 @@ public async Task> RemindDocumentAsyncWithHttpInfo(string do } var localVarPath = "/v1/document/remind"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -3860,10 +3935,9 @@ public async Task> RemindDocumentAsyncWithHttpInfo(string do } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync( + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync( localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -3876,7 +3950,7 @@ public async Task> RemindDocumentAsyncWithHttpInfo(string do return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -3916,7 +3990,6 @@ public ApiResponse RevokeDocumentWithHttpInfo(string documentId, string } var localVarPath = "/v1/document/revoke"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -3977,10 +4050,9 @@ public ApiResponse RevokeDocumentWithHttpInfo(string documentId, string } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi( + using var localVarResponse = this.Configuration.ApiClient.CallApi( localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -3993,7 +4065,7 @@ public ApiResponse RevokeDocumentWithHttpInfo(string documentId, string return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -4033,7 +4105,6 @@ public async Task> RevokeDocumentAsyncWithHttpInfo(string do } var localVarPath = "/v1/document/revoke"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -4094,10 +4165,9 @@ public async Task> RevokeDocumentAsyncWithHttpInfo(string do } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync( + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync( localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -4110,7 +4180,7 @@ public async Task> RevokeDocumentAsyncWithHttpInfo(string do return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -4136,7 +4206,6 @@ public ApiResponse SendDocumentWithHttpInfo(SendForSign signReq ValidateSendProperties(signRequestDetails); var localVarPath = "/v1/document/send"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -4183,10 +4252,9 @@ public ApiResponse SendDocumentWithHttpInfo(SendForSign signReq } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi( + using var localVarResponse = this.Configuration.ApiClient.CallApi( localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -4199,7 +4267,7 @@ public ApiResponse SendDocumentWithHttpInfo(SendForSign signReq return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (DocumentCreated)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(DocumentCreated))); } @@ -4222,7 +4290,6 @@ public ApiResponse CreateEmbeddedRequestUrlWithHttpInfo(Emb ValidateSendProperties(sendRequest); var localVarPath = "/v1/document/createEmbeddedRequestUrl"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -4268,15 +4335,14 @@ public ApiResponse CreateEmbeddedRequestUrlWithHttpInfo(Emb } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi( + using var localVarResponse = this.Configuration.ApiClient.CallApi( localVarPath, - Method.POST, + HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams); @@ -4291,7 +4357,7 @@ public ApiResponse CreateEmbeddedRequestUrlWithHttpInfo(Emb return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (EmbeddedSendCreated)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(EmbeddedSendCreated))); } @@ -4314,7 +4380,6 @@ public async Task> CreateEmbeddedRequestUrlAsyn ValidateSendProperties(sendRequest); var localVarPath = "/v1/document/createEmbeddedRequestUrl"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -4360,15 +4425,14 @@ public async Task> CreateEmbeddedRequestUrlAsyn } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync( + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync( localVarPath, - Method.POST, + HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); @@ -4382,7 +4446,7 @@ public async Task> CreateEmbeddedRequestUrlAsyn return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (EmbeddedSendCreated)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(EmbeddedSendCreated))); } @@ -4408,7 +4472,6 @@ public async Task> SendDocumentAsyncWithHttpInfo(Se ValidateSendProperties(signRequestDetails); var localVarPath = "/v1/document/send"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -4454,10 +4517,7 @@ public async Task> SendDocumentAsyncWithHttpInfo(Se } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync( - localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; var exception = this.ExceptionFactory?.Invoke("SendDocument", localVarResponse); @@ -4469,7 +4529,7 @@ public async Task> SendDocumentAsyncWithHttpInfo(Se return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (DocumentCreated)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(DocumentCreated))); } @@ -4483,15 +4543,17 @@ public async Task> SendDocumentAsyncWithHttpInfo(Se /// SignerOrder. /// NewAccesscode. /// The on behalf of email. + /// The signer phone number. public void AddAuthentication( string documentId, - string emailId, - AuthenticationType authenticationType, + string emailId = default, + AuthenticationType authenticationType = default, int? signerOrder = default, string newAccessCode = "", - string onBehalfOf = default) + string onBehalfOf = default, + PhoneNumber phoneNumber = default) { - this.AddAuthenticationWithHttpInfo(documentId, emailId, authenticationType, signerOrder, newAccessCode, onBehalfOf); + this.AddAuthenticationWithHttpInfo(documentId, emailId, authenticationType, signerOrder, newAccessCode, onBehalfOf, phoneNumber); } /// @@ -4504,14 +4566,16 @@ public void AddAuthentication( /// SignerOrder. /// NewAccesscode. /// The on behalf of email. + /// The signer phone number. /// ApiResponse of Object(void). public ApiResponse AddAuthenticationWithHttpInfo( string documentId, - string emailId, - AuthenticationType authenticationType, + string emailId = default, + AuthenticationType authenticationType = default, int? signerOrder = default, string newAccessCode = "", - string onBehalfOf = default) + string onBehalfOf = default, + PhoneNumber phoneNumber = default) { // verify the required parameter 'documentId' is set if (documentId == null) @@ -4520,7 +4584,7 @@ public ApiResponse AddAuthenticationWithHttpInfo( } // verify the required parameter 'emailId' is set - if (emailId == null) + if (emailId == null && phoneNumber == null) { throw new ApiException(400, ApiValidationMessages.EmailIdRequiredAPI); } @@ -4538,13 +4602,12 @@ public ApiResponse AddAuthenticationWithHttpInfo( } var localVarPath = "/v1/document/addAuthentication"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary>(); var localVarFileUrlParams = new Dictionary(); - var accessCodeDetails = new AddAuthenticationAccessCodeDetails(emailId, signerOrder, newAccessCode, authenticationType, onBehalfOf); + var accessCodeDetails = new AddAuthenticationAccessCodeDetails(emailId, signerOrder, newAccessCode, authenticationType, onBehalfOf, phoneNumber); object localVarPostBody; // to determine the Content-Type header @@ -4614,7 +4677,7 @@ public ApiResponse AddAuthenticationWithHttpInfo( } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, PatchHttpMethod, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -4627,7 +4690,7 @@ public ApiResponse AddAuthenticationWithHttpInfo( return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -4641,16 +4704,18 @@ public ApiResponse AddAuthenticationWithHttpInfo( /// SignerOrder. /// NewAccesscode. /// The on behalf of email. + /// The signer phone number. /// AddAuthentication. public async Task AddAuthenticationAsync( string documentId, - string emailId, - AuthenticationType authenticationType, + string emailId = default, + AuthenticationType authenticationType = default, int? signerOrder = default, string newAccessCode = "", - string onBehalfOf = default) + string onBehalfOf = default, + PhoneNumber phoneNumber = default) { - await this.AddAuthenticationAsyncWithHttpInfo(documentId, emailId, authenticationType, signerOrder, newAccessCode, onBehalfOf).ConfigureAwait(false); + await this.AddAuthenticationAsyncWithHttpInfo(documentId, emailId, authenticationType, signerOrder, newAccessCode, onBehalfOf, phoneNumber).ConfigureAwait(false); } /// @@ -4663,14 +4728,16 @@ public async Task AddAuthenticationAsync( /// SignerOrder. /// NewAccesscode. /// The on behalf of email. + /// The signer phone number. /// ApiResponse of Object(AddAuthentication). public async Task> AddAuthenticationAsyncWithHttpInfo( string documentId, - string emailId, - AuthenticationType authenticationType, + string emailId = default, + AuthenticationType authenticationType = default, int? signerOrder = default, string newAccessCode = "", - string onBehalfOf = default) + string onBehalfOf = default, + PhoneNumber phoneNumber = default) { // verify the required parameter 'documentId' is set if (documentId == null) @@ -4679,7 +4746,7 @@ public async Task> AddAuthenticationAsyncWithHttpInfo( } // verify the required parameter 'emailId' is set - if (emailId == null) + if (emailId == null && phoneNumber == null) { throw new ApiException(400, ApiValidationMessages.EmailIdRequiredAPI); } @@ -4697,13 +4764,12 @@ public async Task> AddAuthenticationAsyncWithHttpInfo( } var localVarPath = "/v1/document/addAuthentication"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary>(); var localVarFileUrlParams = new Dictionary(); - var accessCodeDetails = new AddAuthenticationAccessCodeDetails(emailId, signerOrder, newAccessCode, authenticationType, onBehalfOf); + var accessCodeDetails = new AddAuthenticationAccessCodeDetails(emailId, signerOrder, newAccessCode, authenticationType, onBehalfOf, phoneNumber); object localVarPostBody; // to determine the Content-Type header @@ -4773,7 +4839,7 @@ public async Task> AddAuthenticationAsyncWithHttpInfo( } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, PatchHttpMethod, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -4786,7 +4852,260 @@ public async Task> AddAuthenticationAsyncWithHttpInfo( return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + null); + } + + /// + /// Pre fill form fields. + /// + /// Thrown when fails to make API call + public void PrefillFields(PrefillFieldRequest request) + { + this.PrefillFieldsWithHttpInfo(request); + } + + /// + /// Pre fill form fields. + /// + /// Thrown when fails to make API call + public ApiResponse PrefillFieldsWithHttpInfo(PrefillFieldRequest request) + { + if (request == null) + { + throw new ArgumentNullException(nameof(request)); + } + + // verify the required parameter 'documentId' is set + if (request.DocumentId == null) + { + throw new ApiException(400, "Missing required parameter 'documentId' when calling DocumentApi->PrefillFields"); + } + + // verify the required parameter 'pre fill filed' is set + if (request.Fields == null || !request.Fields.Any()) + { + throw new ApiException(400, "Missing required parameter 'prefillField' when calling DocumentApi->PrefillFields"); + } + + var localVarPath = "/v1/document/prefillFields"; + + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary>(); + var localVarFileUrlParams = new Dictionary(); + object localVarPostBody; + + // to determine the Content-Type header + var localVarHttpContentTypes = new[] + { + "application/json;odata.metadata=minimal;odata.streaming=true", + "application/json;odata.metadata=minimal;odata.streaming=false", + "application/json;odata.metadata=minimal", + "application/json;odata.metadata=full;odata.streaming=true", + "application/json;odata.metadata=full;odata.streaming=false", + "application/json;odata.metadata=full", + "application/json;odata.metadata=none;odata.streaming=true", + "application/json;odata.metadata=none;odata.streaming=false", + "application/json;odata.metadata=none", + "application/json;odata.streaming=true", + "application/json;odata.streaming=false", + "application/json", + "application/xml", + "application/prs.odatatestxx-odata", + "text/json", + "application/_*+json", + }; + var localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new[] + { + "application/json;odata.metadata=minimal;odata.streaming=true", + "application/json;odata.metadata=minimal;odata.streaming=false", + "application/json;odata.metadata=minimal", + "application/json;odata.metadata=full;odata.streaming=true", + "application/json;odata.metadata=full;odata.streaming=false", + "application/json;odata.metadata=full", + "application/json;odata.metadata=none;odata.streaming=true", + "application/json;odata.metadata=none;odata.streaming=false", + "application/json;odata.metadata=none", + "application/json;odata.streaming=true", + "application/json;odata.streaming=false", + "application/json", + "application/xml", + "application/prs.odatatestxx-odata", + "text/plain", + "text/json", + }; + var localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + + if (localVarHttpHeaderAccept != null) + { + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + } + + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "DocumentId", request.DocumentId)); // query parameter + + if (request.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(request); // http body (model) parameter + } + else + { + localVarPostBody = request; // byte array + } + + // authentication (Bearer) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); + } + + // make the HTTP request + using var localVarResponse = this.Configuration.ApiClient.CallApi( + localVarPath, + PatchHttpMethod, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); + + var localVarStatusCode = (int)localVarResponse.StatusCode; + + var exception = this.ExceptionFactory?.Invoke("PrefillFields", localVarResponse); + + if (exception != null) + { + throw exception; + } + + return new ApiResponse( + localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + null); + } + + /// + /// Pre fill form fields. + /// + /// Thrown when fails to make API call + public async Task PrefillFieldsAsync(PrefillFieldRequest request) + { + await this.PrefillFieldsAsyncWithHttpInfo(request).ConfigureAwait(false); + } + + /// + /// Pre fill form fields. + /// + /// Thrown when fails to make API call + public async Task> PrefillFieldsAsyncWithHttpInfo(PrefillFieldRequest request) + { + if (request == null) + { + throw new ArgumentException(nameof(request)); + } + + // verify the required parameter 'documentId' is set + if (request.DocumentId == null) + { + throw new ApiException(400, "Missing required parameter 'documentId' when calling DocumentApi->PrefillFields"); + } + + if (request.Fields == null || !request.Fields.Any()) + { + throw new ApiException(400, "Missing required parameter 'prefillField' when calling DocumentApi->PrefillFields"); + } + + var localVarPath = "/v1/document/prefillFields"; + + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary>(); + var localVarFileUrlParams = new Dictionary(); + object localVarPostBody; + + // to determine the Content-Type header + var localVarHttpContentTypes = new[] + { + "application/json;odata.metadata=minimal;odata.streaming=true", + "application/json;odata.metadata=minimal;odata.streaming=false", + "application/json;odata.metadata=minimal", + "application/json;odata.metadata=full;odata.streaming=true", + "application/json;odata.metadata=full;odata.streaming=false", + "application/json;odata.metadata=full", + "application/json;odata.metadata=none;odata.streaming=true", + "application/json;odata.metadata=none;odata.streaming=false", + "application/json;odata.metadata=none", + "application/json;odata.streaming=true", + "application/json;odata.streaming=false", + "application/json", + "application/xml", + "application/prs.odatatestxx-odata", + "text/json", + "application/_*+json", + }; + var localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new[] + { + "application/json;odata.metadata=minimal;odata.streaming=true", + "application/json;odata.metadata=minimal;odata.streaming=false", + "application/json;odata.metadata=minimal", + "application/json;odata.metadata=full;odata.streaming=true", + "application/json;odata.metadata=full;odata.streaming=false", + "application/json;odata.metadata=full", + "application/json;odata.metadata=none;odata.streaming=true", + "application/json;odata.metadata=none;odata.streaming=false", + "application/json;odata.metadata=none", + "application/json;odata.streaming=true", + "application/json;odata.streaming=false", + "application/json", + "application/xml", + "application/prs.odatatestxx-odata", + "text/plain", + "text/json", + }; + var localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + + if (localVarHttpHeaderAccept != null) + { + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + } + + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "DocumentId", request.DocumentId)); // query parameter + + if (request.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(request); // http body (model) parameter + } + else + { + localVarPostBody = request; // byte array + } + + // authentication (Bearer) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); + } + + // make the HTTP request + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync( + localVarPath, + PatchHttpMethod, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + + var localVarStatusCode = (int)localVarResponse.StatusCode; + + var exception = this.ExceptionFactory?.Invoke("PrefillFields", localVarResponse); + + if (exception != null) + { + throw exception; + } + + return new ApiResponse( + localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -4819,11 +5138,6 @@ private static void ValidateSendProperties(SendForSign sendRequest) throw new ApiException(422, ApiValidationMessages.TitleOrDocumentInfoIsRequired); } - if (!string.IsNullOrEmpty(sendRequest.Title) && sendRequest.DocumentInfo != null && sendRequest.DocumentInfo.Any()) - { - throw new ApiException(422, ApiValidationMessages.TitleAndDocumentInfo); - } - // verify the required parameter 'signers' is set if (sendRequest.Signers == null && !(sendRequest is EmbeddedDocumentRequest embed && embed.SendViewOption == PageViewOption.FillingPage)) { @@ -4892,7 +5206,7 @@ private static bool ValidateUri(string uri) || (Uri.TryCreate(uri, UriKind.Absolute, out var result) && (result.Scheme == Uri.UriSchemeHttp || result.Scheme == Uri.UriSchemeHttps)); } - private static void ValidationForChangeRecipient(string documentId, string oldSignerEmail, string reason, string newSignerName, string newSignerEmail, int? signerOrder) + private static void ValidationForChangeRecipient(string documentId, string oldSignerEmail, string reason, string newSignerName, string newSignerEmail, int? signerOrder, PhoneNumber phoneNumber, PhoneNumber oldPhoneNumber) { // verify the required parameter 'documentId' is set if (string.IsNullOrEmpty(documentId)) @@ -4901,25 +5215,25 @@ private static void ValidationForChangeRecipient(string documentId, string oldSi } // verify the required parameter 'oldSignerEmailAddress' is set - if (string.IsNullOrEmpty(oldSignerEmail)) + if (string.IsNullOrEmpty(oldSignerEmail) && oldPhoneNumber == null) { throw new ApiException(400, ApiValidationMessages.OldSignerEmailRequired); } // verify the required parameter 'newSignerEmailAddress' is set - if (string.IsNullOrEmpty(newSignerEmail)) + if (string.IsNullOrEmpty(newSignerEmail) && phoneNumber == null) { throw new ApiException(400, ApiValidationMessages.NewSignerEmailAddressRequired); } // to ensure "oldSignermail"and "newSignermail" are not as same - if (oldSignerEmail.ToUpperInvariant() == newSignerEmail.ToUpperInvariant()) + if (!string.IsNullOrEmpty(oldSignerEmail) && !string.IsNullOrEmpty(newSignerEmail) && oldSignerEmail.ToUpperInvariant() == newSignerEmail.ToUpperInvariant()) { throw new ApiException(400, ApiValidationMessages.SameSignerEmailNotAllowed); } // verify the required parameter 'new signer name' is set - if (string.IsNullOrEmpty(newSignerName)) + if (string.IsNullOrEmpty(newSignerName) && phoneNumber == null) { throw new ApiException(400, ApiValidationMessages.SignerNameRequired); } @@ -4962,11 +5276,12 @@ private static ApiRequest GetBehalfListValues( DateTime? startDate = default, DateTime? endDate = default, List signers = default, - List labels = default) + List labels = default, + long? nextCursor = default, + List brandIds = default) { // verify the required parameter 'page' is set var localVarPath = "/v1/document/behalfList"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -5037,6 +5352,16 @@ private static ApiRequest GetBehalfListValues( localVarQueryParams.AddRange(configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "EndDate", endDate)); // query parameter } + if (nextCursor != null) + { + localVarQueryParams.AddRange(configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "NextCursor", nextCursor)); // query parameter + } + + if (brandIds != null && brandIds.Any()) + { + localVarQueryParams.AddRange(configuration.ApiClient.ParameterToKeyValuePairs("multi", "BrandIds", brandIds)); // query parameter + } + // authentication (Bearer) required if (!string.IsNullOrEmpty(configuration.GetApiKeyWithPrefix("Authorization"))) { @@ -5050,7 +5375,6 @@ private static ApiRequest GetBehalfListValues( localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams); } diff --git a/src/BoldSign/Api/ExceptionFactory.cs b/src/BoldSign/Api/ExceptionFactory.cs index 45478b8..e1e255e 100644 --- a/src/BoldSign/Api/ExceptionFactory.cs +++ b/src/BoldSign/Api/ExceptionFactory.cs @@ -1,17 +1,17 @@ -/* +/* * 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.Api { using System; - using RestSharp; + using System.Net.Http; /// /// A delegate to ExceptionFactory method @@ -19,5 +19,5 @@ namespace BoldSign.Api /// Method name /// Response /// Exceptions - public delegate Exception ExceptionFactory(string methodName, IRestResponse response); + public delegate Exception ExceptionFactory(string methodName, HttpResponseMessage response); } diff --git a/src/BoldSign/Api/FromRequestHelper.cs b/src/BoldSign/Api/FromRequestHelper.cs index efca622..97ff33d 100644 --- a/src/BoldSign/Api/FromRequestHelper.cs +++ b/src/BoldSign/Api/FromRequestHelper.cs @@ -6,6 +6,7 @@ namespace BoldSign.Api using System.Globalization; using System.Linq; using BoldSign.Api.Model; + using BoldSign.Api.Resources; using BoldSign.Model; internal static class FromRequestHelper @@ -51,6 +52,11 @@ public static Dictionary ConvertToFormRequest(SendForSign signRe var i = -1; foreach (var tag in signRequestDetails.Labels) { + if (string.IsNullOrEmpty(tag)) + { + throw new ApiException(400, ApiValidationMessages.EmptyLabels); + } + localVarFormParams.Add($"{nameof(signRequestDetails.Labels)}[{++i}]", tag?.ToString()); } } @@ -72,6 +78,11 @@ public static Dictionary ConvertToFormRequest(SendForSign signRe localVarFormParams.Add($"{nameof(signRequestDetails.ReminderSettings)}.{nameof(signRequestDetails.ReminderSettings.ReminderCount)}", signRequestDetails.ReminderSettings.ReminderCount.ToString()); } + if (signRequestDetails.RecipientNotificationSettings != null) + { + InitializeRecipientNotificationSettings(localVarFormParams, signRequestDetails.RecipientNotificationSettings); + } + if (signRequestDetails is IEmbeddedRequest embeddedRequest) { if (embeddedRequest.RedirectUrl != null) @@ -104,6 +115,8 @@ public static Dictionary ConvertToFormRequest(SendForSign signRe signRequestDetails.DisableEmails || signRequestDetails.EnableEmbeddedSigning ? "true" : "false"); #pragma warning restore CS0618 // Type or member is obsolete + localVarFormParams.Add(nameof(signRequestDetails.DisableSMS), signRequestDetails.DisableSMS ? "true" : "false"); + if (signRequestDetails.HideDocumentId != null) { localVarFormParams.Add(nameof(signRequestDetails.HideDocumentId), signRequestDetails.HideDocumentId == true ? "true" : "false"); @@ -112,9 +125,13 @@ public static Dictionary ConvertToFormRequest(SendForSign signRe localVarFormParams.Add(nameof(signRequestDetails.EnablePrintAndSign), signRequestDetails.EnablePrintAndSign ? "true" : "false"); localVarFormParams.Add(nameof(signRequestDetails.EnableReassign), signRequestDetails.EnableReassign ? "true" : "false"); + if (signRequestDetails.DocumentDownloadOption != null) + { + localVarFormParams.Add(nameof(signRequestDetails.DocumentDownloadOption), signRequestDetails.DocumentDownloadOption.ToString()); + } + return localVarFormParams; } - /// /// Represents a ConvertToFormRequest. /// @@ -168,6 +185,11 @@ public static Dictionary ConvertToFormRequestForTemplate(CreateT localVarFormParams = ToFormParameter(localVarFormParams, templateRequest.TextTagDefinitions.ToList(), nameof(templateRequest.TextTagDefinitions)); } + if (templateRequest.RecipientNotificationSettings != null) + { + InitializeRecipientNotificationSettings(localVarFormParams, templateRequest.RecipientNotificationSettings); + } + if (templateRequest is CreateEmbeddedTemplateRequest embeddedRequest) { if (embeddedRequest.RedirectUrl != null) @@ -202,8 +224,26 @@ public static Dictionary ConvertToFormRequestForTemplate(CreateT localVarFormParams.Add(nameof(templateRequest.EnablePrintAndSign), templateRequest.EnablePrintAndSign ? "true" : "false"); localVarFormParams.Add(nameof(templateRequest.EnableReassign), templateRequest.EnableReassign ? "true" : "false"); localVarFormParams.Add(nameof(templateRequest.AllowNewRoles), templateRequest.AllowNewRoles ? "true" : "false"); + localVarFormParams.Add(nameof(templateRequest.AllowNewFiles), templateRequest.AllowNewFiles ? "true" : "false"); + localVarFormParams.Add(nameof(templateRequest.AllowModifyFiles), templateRequest.AllowModifyFiles ? "true" : "false"); localVarFormParams.Add(nameof(templateRequest.AllowMessageEditing), templateRequest.AllowMessageEditing ? "true" : "false"); localVarFormParams.Add(nameof(templateRequest.UseTextTags), templateRequest.UseTextTags ? "true" : "false"); + localVarFormParams.Add(nameof(templateRequest.AutoDetectFields), templateRequest.AutoDetectFields ? "true" : "false"); + + if (!string.IsNullOrEmpty(templateRequest.OnBehalfOf)) + { + localVarFormParams.Add(nameof(templateRequest.OnBehalfOf), templateRequest.OnBehalfOf); + } + + if (templateRequest.Labels != null) + { + localVarFormParams = ToFormParameter(localVarFormParams, templateRequest.Labels.ToList(), nameof(templateRequest.Labels)); + } + + if (templateRequest.TemplateLabels != null) + { + localVarFormParams = ToFormParameter(localVarFormParams, templateRequest.TemplateLabels.ToList(), nameof(templateRequest.TemplateLabels)); + } return localVarFormParams; } @@ -225,6 +265,38 @@ public static Dictionary ToFormParameter(Dictionary lo return localVarFileUrlParams; } + /// + /// Initialize Recipient Notification Settings. + /// + /// localVarFormParams. + /// recipientNotificationSettings. + private static void InitializeRecipientNotificationSettings(Dictionary localVarFormParams, RecipientNotificationSettings recipientNotificationSettings) + { + const string baseKey = "RecipientNotificationSettings"; + + localVarFormParams.Add($"{baseKey}.{nameof(recipientNotificationSettings.SignatureRequest)}", recipientNotificationSettings.SignatureRequest ? "true" : "false"); + localVarFormParams.Add($"{baseKey}.{nameof(recipientNotificationSettings.Declined)}", recipientNotificationSettings.Declined ? "true" : "false"); + localVarFormParams.Add($"{baseKey}.{nameof(recipientNotificationSettings.Revoked)}", recipientNotificationSettings.Revoked ? "true" : "false"); + localVarFormParams.Add($"{baseKey}.{nameof(recipientNotificationSettings.Signed)}", recipientNotificationSettings.Signed ? "true" : "false"); + localVarFormParams.Add($"{baseKey}.{nameof(recipientNotificationSettings.Completed)}", recipientNotificationSettings.Completed ? "true" : "false"); + localVarFormParams.Add($"{baseKey}.{nameof(recipientNotificationSettings.Expired)}", recipientNotificationSettings.Expired ? "true" : "false"); + localVarFormParams.Add($"{baseKey}.{nameof(recipientNotificationSettings.Reassigned)}", recipientNotificationSettings.Reassigned ? "true" : "false"); + localVarFormParams.Add($"{baseKey}.{nameof(recipientNotificationSettings.Deleted)}", recipientNotificationSettings.Deleted ? "true" : "false"); + localVarFormParams.Add($"{baseKey}.{nameof(recipientNotificationSettings.Reminders)}", recipientNotificationSettings.Reminders ? "true" : "false"); + localVarFormParams.Add($"{baseKey}.{nameof(recipientNotificationSettings.EditRecipient)}", recipientNotificationSettings.EditRecipient ? "true" : "false"); + localVarFormParams.Add($"{baseKey}.{nameof(recipientNotificationSettings.EditDocument)}", recipientNotificationSettings.EditDocument ? "true" : "false"); + } + + private static Dictionary ToFormParameter(Dictionary localVarFormParams, List array, string parameterName) + { + for (int i = 0; i < array.Count; i++) + { + localVarFormParams.Add($"{parameterName}[{i}]", array[i]); + } + + return localVarFormParams; + } + private static Dictionary ToFormParameter(Dictionary localVarFormParams, object property, string parameterName) { switch (property) @@ -259,7 +331,7 @@ private static Dictionary ToFormParameter(Dictionary) { - List acceptedFileTypes = (List)value; + var acceptedFileTypes = (List)value; var i = -1; foreach (var acceptedFileType in acceptedFileTypes) @@ -270,7 +342,7 @@ private static Dictionary ToFormParameter(Dictionary) { - List dropdownOptions = (List)value; + var dropdownOptions = (List)value; var i = -1; foreach (var dropdownOption in dropdownOptions) @@ -279,18 +351,18 @@ private static Dictionary ToFormParameter(Dictionary().Any(enumValue => Convert.ToInt32(value).ToString() == Convert.ToInt32(enumValue).ToString())) { localVarFormParams.Add(name, value.ToString()); } } - else if (value is string || prop.PropertyType.IsPrimitive) + else if (value is string || propertyType.IsPrimitive) { localVarFormParams.Add(name, value.ToString()); } @@ -302,7 +374,7 @@ private static Dictionary ToFormParameter(DictionaryBrand Id. /// Task of ApiResponse. Task> DeleteBrandAsyncWithHttpInfo(string brandId); + + /// + /// Get the brand. + /// + /// brandId. + /// Thrown when fails to make API call. + /// Task of BrandDetails. + Task GetBrandDetailsAsync(string brandId); + + /// + /// Get the brand. + /// + /// brandId. + /// Thrown when fails to make API call. + /// Task of BrandDetails. + Task> GetBrandDetailsAsyncWithHttpInfo(string brandId); + + /// + /// Get the brand. + /// + /// Thrown when fails to make API call. + /// Brand Id. + /// ApiResponse of BrandDetails. + ApiResponse GetBrandDetailsWithHttpInfo(string brandId); + + /// + /// Get the brand. + /// + /// Thrown when fails to make API call. + /// Brand Id. + /// BrandDetails. + BrandDetails GetBrandDetails(string brandId); } } diff --git a/src/BoldSign/Api/IContactClient.cs b/src/BoldSign/Api/IContactClient.cs new file mode 100644 index 0000000..ae256fa --- /dev/null +++ b/src/BoldSign/Api/IContactClient.cs @@ -0,0 +1,181 @@ +// +// Copyright (c) Syncfusion Inc. All rights reserved. +// + +namespace BoldSign.Api +{ + using System.Collections.Generic; + using System.Threading.Tasks; + using BoldSign.Api.Model; + using BoldSign.Model; + + /// + /// Contact Client. + /// + public interface IContactClient : IApiAccessor + { + /// + /// Gets the contact list. + /// + /// The page number. + /// The page size. + /// The search key. + /// contactType. + /// A Task. + ContactsList ListContacts(int page, int? pageSize = default, string searchKey = default, + ContactType? contactType = ContactType.AllContacts); + + /// + /// Gets the contact list. + /// + /// The page number. + /// The page size. + /// The search key. + /// contactType. + /// A Task. + ApiResponse ListContactsWithHttpInfo(int page, int? pageSize = default, + string searchKey = default, ContactType? contactType = ContactType.AllContacts); + + /// + /// Gets the contact list. + /// + /// The page number. + /// The page size. + /// The search key. + /// contactType. + /// A Task. + Task ListContactsAsync(int page, int? pageSize = default, string searchKey = default, + ContactType? contactType = ContactType.AllContacts); + + /// + /// Gets the contact list. + /// + /// The page number. + /// The page size. + /// The search key. + /// contactType. + /// A Task. + Task> ListContactsAsyncWithHttpInfo(int page, int? pageSize = default, + string searchKey = default, ContactType? contactType = ContactType.AllContacts); + + /// + /// Delete the brand when a particular brand’s ID is given as input. + /// + /// Thrown when fails to make API call. + /// Contact Id. + void DeleteContact(string id); + + /// + /// Delete the brand when a particular brand’s ID is given as input. + /// + /// Thrown when fails to make API call. + /// Contact Id. + /// ApiResponse of Object(void). + ApiResponse DeleteContactWithHttpInfo(string id); + + /// + /// Delete the brand when a particular brand’s ID is given as input. + /// + /// Thrown when fails to make API call. + /// Contact Id. + /// Task of void. + Task DeleteContactAsync(string id); + + /// + /// Delete the brand. + /// + /// Thrown when fails to make API call. + /// Contact Id. + /// Task of ApiResponse. + Task> DeleteContactAsyncWithHttpInfo(string id); + + /// + /// Create Contact details. + /// + /// Thrown when fails to make API call. + /// Contact details. + /// CreatedContact. + CreatedContact CreateContact(List contactsDetails); + + /// + /// Creates a new contact. + /// + /// The contactsDetailsList. + /// A Task. + ApiResponse CreateContactWithHttpInfo(List contactsDetailsList = default); + + /// + /// Creates a new contact. + /// + /// The contactDetailsList. + /// A Task. + Task CreateContactAsync(List contactDetailsList = default); + + /// + /// Gets create the contact. + /// + /// Thrown when fails to make API call. + /// The contactDetailsList. + /// A Task of Response. + Task> CreateContactAsyncWithHttpInfo(List contactsDetailsList = default); + + /// + /// Creates a new contact. + /// + /// The Contact ID. + /// The Update Contact. + void UpdateContact(string id, ContactDetails updateContact); + + /// + /// Creates a new contact. + /// + /// The Contact ID. + /// The Update Contact. + /// A Task. + ApiResponse UpdateContactWithHttpInfo(string id, ContactDetails updateContact); + + /// + /// Creates a new contact. + /// + /// The Contact ID. + /// The Update Contact. + /// A Task. + Task UpdateContactAsync(string id, ContactDetails updateContact); + + /// + /// Creates a new contact. + /// + /// The Contact ID. + /// The Update Contact. + /// A Task. + Task> UpdateContactAsyncWithHttpInfo(string id, ContactDetails updateContact); + + /// + /// Gets the contact. + /// + /// The Contact ID. + /// A Contact Details. + ContactsDetails GetContact(string id); + + /// + /// Gets the contact. + /// + /// The Contact ID. + /// A Task. + ApiResponse GetContactWithHttpInfo(string id); + + /// + /// Gets the contact. + /// + /// The Contact ID. + /// A Task. + Task GetContactAsync(string id); + + /// + /// Gets the contact. + /// + /// The Contact ID. + /// A Task. + Task> GetContactAsyncWithHttpInfo(string id); + } +} diff --git a/src/BoldSign/Api/ICustomFieldClient.cs b/src/BoldSign/Api/ICustomFieldClient.cs new file mode 100644 index 0000000..85a1dc2 --- /dev/null +++ b/src/BoldSign/Api/ICustomFieldClient.cs @@ -0,0 +1,169 @@ +// +// Copyright (c) Syncfusion Inc. All rights reserved. +// + +namespace BoldSign.Api +{ + using System.Threading.Tasks; + using BoldSign.Model; + + /// + /// Represents a collection of functions to interact with the API endpoints. The functions perform actions such as creating custom field, deleting custom field, editing custom field and so on. + /// + public interface ICustomFieldClient : IApiAccessor + { + /// + /// Creates a custom field for the specified brand. + /// + /// The brand custom fields class. + /// Return the custom message. + CustomFieldMessage CreateCustomField(BrandCustomFieldDetails brandCustomFieldDetails); + + /// + /// Created a custom field for the specified brand. + /// + /// The brand custom fields class. + /// Return the custom message. + /// Thrown when fails to make API call. + ApiResponse CreateCustomFieldWithHttpInfo(BrandCustomFieldDetails brandCustomFieldDetails); + + /// + /// Creates a custom field for the specified brand. + /// + /// The brand custom fields class. + /// Return the custom message. + Task CreateCustomFieldAsync(BrandCustomFieldDetails brandCustomFieldDetails); + + /// + /// Creates a custom field for the specified brand. + /// + /// The brand custom fields class. + /// Return the custom message. + /// Thrown when fails to make API call. + Task> CreateCustomFieldAsyncWithHttpInfo(BrandCustomFieldDetails brandCustomFieldDetails); + + /// + /// Edits a custom field for the specified brand. + /// + /// The custom field id. + /// The brand custom fields class. + /// Return the custom message. + CustomFieldMessage EditCustomField(string customFieldId, BrandCustomFieldDetails brandCustomFieldDetails); + + /// + /// Edits a custom field for the specified brand. + /// + /// The custom field id. + /// The brand custom fields class. + /// Return the custom message. + /// Thrown when fails to make API call. + ApiResponse EditCustomFieldWithHttpInfo(string customFieldId, BrandCustomFieldDetails brandCustomFieldDetails); + + /// + /// Edits a custom field for the specified brand. + /// + /// The custom field id. + /// The brand custom fields class. + /// Return the custom message. + Task EditCustomFieldAsync(string customFieldId, BrandCustomFieldDetails brandCustomFieldDetails); + + /// + /// Edits a custom field for the specified brand. + /// + /// The custom field id. + /// The brand custom fields class. + /// Return the custom field message. + /// Thrown when fails to make API call. + Task> EditCustomFieldAsyncWithHttpInfo(string customFieldId, BrandCustomFieldDetails brandCustomFieldDetails); + + /// + /// Deletes the custom field for the specified brand. + /// + /// The custom field id. + /// Return the custom field message. + CustomFieldMessage DeleteCustomField(string customFieldId); + + /// + /// Deletes the custom field for the specified brand. + /// + /// The custom field id. + /// Return the custom field message. + /// Thrown when fails to make API call. + ApiResponse DeleteCustomFieldWithHttpInfo(string customFieldId); + + /// + /// Deletes the custom field for the specified brand. + /// + /// The custom field id. + /// Return the custom field message. + Task DeleteCustomFieldAsync(string customFieldId); + + /// + /// Deletes the custom field for the specified brand. + /// + /// The custom field id. + /// Return the custom field message. + /// Thrown when fails to make API call. + Task> DeleteCustomFieldAsyncWithHttpInfo(string customFieldId); + + /// + /// Gets the collections of custom fields for the specified brand. + /// + /// The brand Id. + /// Returns the collection of custom fields. + CustomFieldCollection GetBrandBasedCustomFields(string brandId); + + /// + /// Gets the collections of custom fields for the specified brand. + /// + /// The brand Id. + /// Returns the collection of custom fields. + /// Thrown when fails to make API call. + ApiResponse GetBrandBasedCustomFieldsWithHttpInfo(string brandId); + + /// + /// Gets the collections of custom fields for the specified brand. + /// + /// The brand Id. + /// Returns the collection of custom fields. + Task GetBrandBasedCustomFieldsAsync(string brandId); + + /// + /// Gets the collections of custom fields for the specified brand. + /// + /// The brand Id. + /// Returns the collection of custom fields. + /// Thrown when fails to make API call. + Task> GetBrandBasedCustomFieldsAsyncWithHttpInfo(string brandId); + + /// + /// Generates a URL to embed manipulation of custom field process into your application. + /// + /// The embedded custom field details. + /// Returns the embedded custom field url. + EmbeddedCustomFieldCreated CreateEmbeddedCustomFieldUrl(EmbeddedCustomFieldDetails embeddedCustomFieldDetails); + + /// + /// Generates a URL to embed manipulation of custom field process into your application. + /// + /// The embedded custom field details. + /// Returns the embedded custom field url. + /// Thrown when fails to make API call. + ApiResponse CreateEmbeddedCustomFieldUrlWithHttpInfo(EmbeddedCustomFieldDetails embeddedCustomFieldDetails); + + /// + /// Generates a URL to embed manipulation of custom field process into your application. + /// + /// The embedded custom field details. + /// Returns the embedded custom field url. + Task CreateEmbeddedCustomFieldUrlAsync(EmbeddedCustomFieldDetails embeddedCustomFieldDetails); + + /// + /// Generates a URL to embed manipulation of custom field process into your application. + /// + /// The embedded custom field details. + /// Returns the embedded custom field url. + /// Thrown when fails to make API call. + Task> CreateEmbeddedCustomFieldUrlAsyncWithHttpInfo(EmbeddedCustomFieldDetails embeddedCustomFieldDetails); + } +} diff --git a/src/BoldSign/Api/IDocumentClient.cs b/src/BoldSign/Api/IDocumentClient.cs index 2a87eef..1419775 100644 --- a/src/BoldSign/Api/IDocumentClient.cs +++ b/src/BoldSign/Api/IDocumentClient.cs @@ -1,9 +1,11 @@ + namespace BoldSign.Api { using System; using System.Collections.Generic; using System.IO; using System.Threading.Tasks; + using BoldSign.Api.Model; using BoldSign.Model; /// @@ -24,7 +26,9 @@ public interface IDocumentClient : IApiAccessor /// The new email address of recipient. /// The signer order. /// The on behalfof email. - void ChangeRecipient(string documentId, string oldSignerEmail, string reason, string newSignerName, string newSignerEmail, int? signerOrder = null, string onBehalfOf = null); + /// The signer phone number. + /// The Old Signer Phone Number. + void ChangeRecipient(string documentId, string oldSignerEmail = null, string reason = null, string newSignerName = null, string newSignerEmail = null, int? signerOrder = null, string onBehalfOf = null, PhoneNumber phoneNumber = null, PhoneNumber oldPhoneNumber = null); /// /// Change recipient details of a document. @@ -37,8 +41,11 @@ public interface IDocumentClient : IApiAccessor /// The new email address of recipient. /// The signer order. /// The on behalfof email. + /// The signer phone number. + /// ApiResponse of Object(void). + /// The Old Signer phone number. /// ApiResponse of Object(void). - ApiResponse ChangeRecipientWithHttpInfo(string documentId, string oldSignerEmail, string reason, string newSignerName, string newSignerEmail, int? signerOrder = null, string onBehalfOf = null); + ApiResponse ChangeRecipientWithHttpInfo(string documentId, string oldSignerEmail = null, string reason = null, string newSignerName = null, string newSignerEmail = null, int? signerOrder = null, string onBehalfOf = null, PhoneNumber phoneNumber = null, PhoneNumber oldPhoneNumber = null); /// /// Changes the access code for the desired document signer by verifying the email ID of the signer. @@ -54,8 +61,9 @@ public interface IDocumentClient : IApiAccessor /// used to target that particular order with given signer email. (optional) /// /// The on behalfof email. + /// The phone number. /// - void ChangeAccessCode(string documentId, string emailId, string newAccessCode, int? signerOrder = default, string onBehalfOf = default); + void ChangeAccessCode(string documentId, string emailId = default, string newAccessCode = default, int? signerOrder = default, string onBehalfOf = default, PhoneNumber phoneNumber = default); /// /// Changes the access code for the desired document signer by verifying the email ID of the signer. @@ -71,8 +79,175 @@ public interface IDocumentClient : IApiAccessor /// used to target that particular order with given signer email. (optional) /// /// The on behalfof email. + /// The phone number. /// ApiResponse of Object(void) - ApiResponse ChangeAccessCodeWithHttpInfo(string documentId, string emailId, string newAccessCode, int? zOrder = default, string onBehalfOf = default); + ApiResponse ChangeAccessCodeWithHttpInfo(string documentId, string emailId = default, string newAccessCode = default, int? zOrder = default, string onBehalfOf = default, PhoneNumber phoneNumber = default); + + /// + /// Add tag. + /// + /// Add Tags. + /// + void AddTag(DocumentTags addTags); + + /// + /// Add tag with Http info. + /// + /// ets or sets the add tags. + /// + ApiResponse AddTagWithHttpInfo(DocumentTags addTags); + + /// + /// Pre fill form fields. + /// + /// Thrown when fails to make API call. + void PrefillFields(PrefillFieldRequest request); + + /// + /// Pre fill form fields. + /// + /// Thrown when fails to make API call. + ApiResponse PrefillFieldsWithHttpInfo(PrefillFieldRequest request); + + /// + /// Add tag async. + /// + /// Gets or sets the add tags. + /// + Task AddTagAsync(DocumentTags addTags); + + /// + /// Add tag async with Http info. + /// + /// Gets or sets the add tags. + /// + Task> AddTagAsyncWithHttpInfo(DocumentTags addTags); + + /// + /// Pre fill form fields. + /// + /// Thrown when fails to make API call. + Task PrefillFieldsAsync(PrefillFieldRequest request); + + /// + /// Pre fill form fields. + /// + /// Thrown when fails to make API call + Task> PrefillFieldsAsyncWithHttpInfo(PrefillFieldRequest request); + + /// + /// Delete tag. + /// + /// Gets or sets the delete tags. + void DeleteTag(DocumentTags deleteTags); + + /// + /// Delete with Http info. + /// + /// Gets or sets the delete tags. + /// + ApiResponse DeleteTagWithHttpInfo(DocumentTags deleteTags); + + /// + /// Delete tag async. + /// + /// Gets or sets the delete tags. + /// + Task DeleteTagAsync(DocumentTags deleteTags); + + /// + /// Delete tag async with Http info. + /// + /// Gets or sets the delete tags. + /// + Task> DeleteTagAsyncWithHttpInfo(DocumentTags deleteTags); + + /// + /// List team documents. + /// + /// Gets or sets the page. + /// Gets or sets the page size. + /// Gets or sets the start date. + /// Gets or sets the status. + /// Gets or sets the team id. + /// Gets or sets the user id. + /// Gets or sets the end date. + /// Gets or sets the search key. + /// Gets or sets the labels. + /// Gets or sets the transmit type. + /// Gets or sets the nextCursor. + /// Gets or sets the brandIds. + /// + TeamDocumentRecords ListTeamDocuments(int page = 1, int? pageSize = default, DateTime? startDate = default, + List status = default, List teamId = default, List userId = default, + DateTime? endDate = default, string searchKey = default, List labels = default, + TransmitType? transmitType = default, long? nextCursor = default, List brandIds = default); + + /// + /// List team documents with Http info. + /// + /// Gets or sets the page. + /// Gets or sets the page size. + /// Gets or sets the start date. + /// Gets or sets the status. + /// Gets or sets the team id. + /// Gets or sets the user id. + /// Gets or sets the end date. + /// Gets or sets the search key. + /// Gets or sets the labels. + /// Gets or sets the transmit type. + /// Gets or sets the nextCursor. + /// Gets or sets the brandIds. + /// + ApiResponse ListTeamDocumentsWithHttpInfo(int page = 1, int? pageSize = default, + DateTime? startDate = default, List status = default, List teamId = default, + List userId = default, DateTime? endDate = default, string searchKey = default, + List labels = default, TransmitType? transmitType = default, long? nextCursor = default, List brandIds = default); + + /// + /// List team documents async. + /// + /// Gets or sets the page. + /// Gets or sets the page size. + /// Gets or sets the start date. + /// Gets or sets the status. + /// Gets or sets the team id. + /// Gets or sets the user id. + /// Gets or sets the end date. + /// Gets or sets the search key. + /// Gets or sets the labels. + /// Gets or sets the transmit type. + /// Gets or sets the nextCursor. + /// Gets or sets the brandIds. + /// + Task ListTeamDocumentsAsync(int page = 1, int? pageSize = default, + DateTime? startDate = default, List status = default, List teamId = default, + List userId = default, DateTime? endDate = default, string searchKey = default, + List labels = default, TransmitType? transmitType = default, long? nextCursor = default, List brandIds = default); + + /// + /// List team documents async with Http info. + /// + /// Gets or sets the page. + /// Gets or sets the page size. + /// Gets or sets the start date. + /// Gets or sets the status. + /// Gets or sets the team id. + /// Gets or sets the user id. + /// Gets or sets the end date. + /// Gets or sets the search key. + /// Gets or sets the labels. + /// Gets or sets the transmit type. + /// Gets or sets the nextCursor. + /// Gets or sets the brandIds. + /// + Task> ListTeamDocumentsAsyncWithHttpInfo(int page = 1, int? pageSize = default, + DateTime? startDate = default, List status = default, List teamId = default, + List userId = default, DateTime? endDate = default, string searchKey = default, + List labels = default, TransmitType? transmitType = default, long? nextCursor = default, List brandIds = default); + + + /// /// Delete the document when a particular document’s ID is given as input. @@ -85,7 +260,7 @@ public interface IDocumentClient : IApiAccessor /// if true, the document will be deleted permanently. /// if false, the document will be moved to the trash. /// - /// + /// Gets or sets the delete permanently. void DeleteDocument(string documentId, bool deletePermanently = false); /// @@ -173,11 +348,13 @@ public interface IDocumentClient : IApiAccessor /// /// Thrown when fails to make API call /// Gets or sets Document Id. - /// Gets or sets signer email. + /// Gets or sets signer email. (optional) /// Gets or sets sign link expiration date (Valid Till). (optional) /// Gets or sets Redirect URL. (optional) + /// Gets or sets Country Code. (optional) + /// Gets or sets Phone Number. (optional) /// EmbeddedSigningLink - EmbeddedSigningLink GetEmbeddedSignLink(string documentId, string signerEmail, DateTime? signLinkValidTill = default, string redirectUrl = default); + EmbeddedSigningLink GetEmbeddedSignLink(string documentId, string signerEmail = default, DateTime? signLinkValidTill = default, string redirectUrl = default, string countryCode = default, string phoneNumber = default); /// /// Get sign link in a mail for Embedded Sign to given Email ID. The link has expiry time. This method can also be used to send a redirect URL. @@ -186,11 +363,13 @@ public interface IDocumentClient : IApiAccessor /// /// Thrown when fails to make API call /// Gets or sets Document Id. - /// Gets or sets signer email. + /// Gets or sets signer email. (optional) /// Gets or sets sign link expiration date (Valid Till). (optional) /// Gets or sets Redirect URL. (optional) + /// Gets or sets Country Code. (optional) + /// Gets or sets Phone Number. (optional) /// ApiResponse of EmbeddedSigningLink - ApiResponse GetEmbeddedSignLinkWithHttpInfo(string documentId, string signerEmail, DateTime? signLinkValidTill = default, string redirectUrl = default); + ApiResponse GetEmbeddedSignLinkWithHttpInfo(string documentId, string signerEmail = default, DateTime? signLinkValidTill = default, string redirectUrl = default, string countryCode = default, string phoneNumber = default); /// /// Get summary of the document for the given document ID. @@ -226,8 +405,10 @@ public interface IDocumentClient : IApiAccessor /// Gets or sets the status. (optional) /// Gets or sets the endDate. (optional) /// Gets or sets the searchKey. (optional) + /// Gets or sets the nextCursor. + /// Gets or sets the brandIds. /// DocumentRecords - DocumentRecords ListDocuments(int page, int? pageSize = default, List sentBy = default, List recipients = default, DateTime? startDate = default, List status = default, DateTime? endDate = default, string searchKey = default, List labels = default, TransmitType? transmitType = default); + DocumentRecords ListDocuments(int page = 1, int? pageSize = default, List sentBy = default, List recipients = default, DateTime? startDate = default, List status = default, DateTime? endDate = default, string searchKey = default, List labels = default, TransmitType? transmitType = default, long? nextCursor = default, List brandIds = default); /// /// List all user documents which can be filtered by date, time, sender, status, and so on. @@ -243,8 +424,10 @@ public interface IDocumentClient : IApiAccessor /// Gets or sets the status. (optional) /// Gets or sets the endDate. (optional) /// Gets or sets the searchKey. (optional) + /// Gets or sets the nextCursor. + /// Gets or sets the brandIds. /// ApiResponse of DocumentRecords - ApiResponse ListDocumentsWithHttpInfo(int page, int? pageSize = default, List sentBy = default, List recipients = default, DateTime? startDate = default, List status = default, DateTime? endDate = default, string searchKey = default, List labels = default, TransmitType? transmitType = default); + ApiResponse ListDocumentsWithHttpInfo(int page = 1, int? pageSize = default, List sentBy = default, List recipients = default, DateTime? startDate = default, List status = default, DateTime? endDate = default, string searchKey = default, List labels = default, TransmitType? transmitType = default, long? nextCursor = default, List brandIds = default); /// /// List of behalf documents which can be filtered by status, page size and so on. @@ -260,9 +443,11 @@ public interface IDocumentClient : IApiAccessor /// Gets or sets the endDate used to filter the documents returned in the API. The API will return documents that were created on or before this date. (optional). /// Gets or sets the list of signer email addresses used to filter the documents returned in the API. The API will return documents where the signer's email address matches one of the email addresses provided in this list. (optional). /// Gets or sets the list of labels or tags used to filter the documents returned in the API. The API will return documents that have been tagged with one or more of the labels provided in this list. (optional). + /// Gets or sets the nextCursor. + /// The list of brand IDs to filter associated with the behalf documents. /// BehalfDocumentRecords. BehalfDocumentRecords ListBehalfDocuments( - int page, + int page = 1, int? pageSize = default, List emailAddress = default, List status = default, @@ -271,7 +456,9 @@ BehalfDocumentRecords ListBehalfDocuments( DateTime? startDate = default, DateTime? endDate = default, List signers = default, - List labels = default); + List labels = default, + long? nextCursor = default, + List brandIds = default); /// /// List of behalf documents which can be filtered by status, page size and so on. /// @@ -286,9 +473,11 @@ BehalfDocumentRecords ListBehalfDocuments( /// Gets or sets the endDate used to filter the documents returned in the API. The API will return documents that were created on or before this date. (optional). /// Gets or sets the list of signer email addresses used to filter the documents returned in the API. The API will return documents where the signer's email address matches one of the email addresses provided in this list. (optional). /// Gets or sets the list of labels or tags used to filter the documents returned in the API. The API will return documents that have been tagged with one or more of the labels provided in this list. (optional). + /// Gets or sets the nextCursor. + /// The list of brand IDs to filter associated with the behalf documents. /// ApiResponse of BehalfDocumentRecords. ApiResponse ListBehalfDocumentsWithHttpInfo( - int page, + int page = 1, int? pageSize = default, List emailAddress = default, List status = default, @@ -297,7 +486,9 @@ ApiResponse ListBehalfDocumentsWithHttpInfo( DateTime? startDate = default, DateTime? endDate = default, List signers = default, - List labels = default); + List labels = default, + long? nextCursor = default, + List brandIds = default); /// /// Send a reminder message to pending signers for a particular document to their respective email IDs. @@ -380,8 +571,11 @@ ApiResponse ListBehalfDocumentsWithHttpInfo( /// The new email address of recipient . /// The signer order. /// The on behalfof email. + /// The signer phone number. /// A representing the asynchronous operation. - Task ChangeRecipientasync(string documentId, string oldSignerEmail, string reason, string newSignerName, string newSignerEmail, int? signerOrder = null, string onBehalfOf = null); + /// The Old Signer Phone number. + /// A representing the asynchronous operation. + Task ChangeRecipientasync(string documentId, string oldSignerEmail = null, string reason = null, string newSignerName = null, string newSignerEmail = null, int? signerOrder = null, string onBehalfOf = null, PhoneNumber phoneNumber = null, PhoneNumber oldPhoneNumber = null); /// /// Change recipient details of a document. @@ -394,8 +588,11 @@ ApiResponse ListBehalfDocumentsWithHttpInfo( /// The new email address of recipient . /// The signer order. /// The on behalfof email. + /// The signer phone number. + /// ApiResponse of Object(void). + /// The Old Signer Phone number. /// ApiResponse of Object(void). - Task> ChangeRecipientasyncWithHttpInfo(string documentId, string oldSignerEmail, string reason, string newSignerName, string newSignerEmail, int? signerOrder = null, string onBehalfOf = null); + Task> ChangeRecipientasyncWithHttpInfo(string documentId, string oldSignerEmail = null, string reason = null, string newSignerName = null, string newSignerEmail = null, int? signerOrder = null, string onBehalfOf = null, PhoneNumber phoneNumber = null, PhoneNumber oldPhoneNumber = null); /// /// Changes the access code for the desired document signer by verifying the email ID of the signer. @@ -411,8 +608,9 @@ ApiResponse ListBehalfDocumentsWithHttpInfo( /// used to target that particular order with given signer email. (optional) /// /// The on behalfof email. + /// The phone number. /// Task of void - Task ChangeAccessCodeAsync(string documentId, string emailId, string newAccessCode, int? signerOrder = default, string onBehalfOf = default); + Task ChangeAccessCodeAsync(string documentId, string emailId = default, string newAccessCode = default, int? signerOrder = default, string onBehalfOf = default, PhoneNumber phoneNumber = default); /// /// Changes the access code for the desired document signer by verifying the email ID of the signer. @@ -428,8 +626,9 @@ ApiResponse ListBehalfDocumentsWithHttpInfo( /// used to target that particular order with given signer email. (optional) /// /// The on behalfof email. + /// The phone number. /// Task of ApiResponse - Task> ChangeAccessCodeAsyncWithHttpInfo(string documentId, string emailId, string newAccessCode, int? signerOrder = default, string onBehalfOf = default); + Task> ChangeAccessCodeAsyncWithHttpInfo(string documentId, string emailId = default, string newAccessCode = default, int? signerOrder = default, string onBehalfOf = default, PhoneNumber phoneNumber = default); /// /// Delete the document. @@ -530,11 +729,13 @@ ApiResponse ListBehalfDocumentsWithHttpInfo( /// /// Thrown when fails to make API call /// Gets or sets Document Id. - /// Gets or sets signer email. + /// Gets or sets signer email. (optional) /// Gets or sets sign link expiration date (Valid Till). (optional) /// Gets or sets Redirect URL. (optional) + /// Gets or sets Country Code. (optional) + /// Gets or sets Phone Number. (optional) /// Task of EmbeddedSigningLink - Task GetEmbeddedSignLinkAsync(string documentId, string signerEmail, DateTime? signLinkValidTill = default, string redirectUrl = default); + Task GetEmbeddedSignLinkAsync(string documentId, string signerEmail = default, DateTime? signLinkValidTill = default, string redirectUrl = default, string countryCode = default, string phoneNumber = default); /// /// Get sign link in a mail for Embedded Sign to given Email ID. The link has expiry time. This method can also be used to send a redirect URL. @@ -543,11 +744,13 @@ ApiResponse ListBehalfDocumentsWithHttpInfo( /// /// Thrown when fails to make API call /// Gets or sets Document Id. - /// Gets or sets signer email. + /// Gets or sets signer email. (optional) /// Gets or sets sign link expiration date (Valid Till). (optional) /// Gets or sets Redirect URL. (optional) + /// Gets or sets Country Code. (optional) + /// Gets or sets Phone Number. (optional) /// Task of ApiResponse (EmbeddedSigningLink) - Task> GetEmbeddedSignLinkAsyncWithHttpInfo(string documentId, string signerEmail, DateTime? signLinkValidTill = default, string redirectUrl = default); + Task> GetEmbeddedSignLinkAsyncWithHttpInfo(string documentId, string signerEmail = default, DateTime? signLinkValidTill = default, string redirectUrl = default, string countryCode = default, string phoneNumber = default); /// /// Get summary of the document for the given document ID. @@ -583,8 +786,10 @@ ApiResponse ListBehalfDocumentsWithHttpInfo( /// Gets or sets the status. (optional) /// Gets or sets the endDate. (optional) /// Gets or sets the searchKey. (optional) + /// Gets or sets the nextCursor. + /// Gets or sets the brandIds. /// Task of DocumentRecords - Task ListDocumentsAsync(int page, int? pageSize = default, List sentBy = default, List recipients = default, DateTime? startDate = default, List status = default, DateTime? endDate = default, string searchKey = default, List labels = default, TransmitType? transmitType = default); + Task ListDocumentsAsync(int page = 1, int? pageSize = default, List sentBy = default, List recipients = default, DateTime? startDate = default, List status = default, DateTime? endDate = default, string searchKey = default, List labels = default, TransmitType? transmitType = default, long? nextCursor = default, List brandIds = default); /// /// List all user documents which can be filtered by date, time, sender, status, and so on. @@ -600,8 +805,10 @@ ApiResponse ListBehalfDocumentsWithHttpInfo( /// Gets or sets the status. (optional) /// Gets or sets the endDate. (optional) /// Gets or sets the searchKey. (optional) + /// Gets or sets the nextCursor. + /// Gets or sets the brandIds. /// Task of ApiResponse (DocumentRecords) - Task> ListDocumentsAsyncWithHttpInfo(int page, int? pageSize = default, List sentBy = default, List recipients = default, DateTime? startDate = default, List status = default, DateTime? endDate = default, string searchKey = default, List labels = default, TransmitType? transmitType = default); + Task> ListDocumentsAsyncWithHttpInfo(int page = 1, int? pageSize = default, List sentBy = default, List recipients = default, DateTime? startDate = default, List status = default, DateTime? endDate = default, string searchKey = default, List labels = default, TransmitType? transmitType = default, long? nextCursor = default, List brandIds = default); /// /// List of behalf documents which can be filtered by status, page size and so on. @@ -617,9 +824,11 @@ ApiResponse ListBehalfDocumentsWithHttpInfo( /// Gets or sets the endDate used to filter the documents returned in the API. The API will return documents that were created on or before this date. (optional). /// Gets or sets the list of signer email addresses used to filter the documents returned in the API. The API will return documents where the signer's email address matches one of the email addresses provided in this list. (optional). /// Gets or sets the list of labels or tags used to filter the documents returned in the API. The API will return documents that have been tagged with one or more of the labels provided in this list. (optional). + /// Gets or sets the nextCursor. + /// The list of brand IDs to filter associated with the behalf documents. /// Task of BehalfDocumentRecords. Task ListBehalfDocumentsAsync( - int page, + int page = 1, int? pageSize = default, List emailAddress = default, List status = default, @@ -628,7 +837,9 @@ Task ListBehalfDocumentsAsync( DateTime? startDate = default, DateTime? endDate = default, List signers = default, - List labels = default); + List labels = default, + long? nextCursor = default, + List brandIds = default); /// /// List of behalf documents which can be filtered by status, page size and so on. @@ -644,9 +855,11 @@ Task ListBehalfDocumentsAsync( /// Gets or sets the endDate used to filter the documents returned in the API. The API will return documents that were created on or before this date. (optional). /// Gets or sets the list of signer email addresses used to filter the documents returned in the API. The API will return documents where the signer's email address matches one of the email addresses provided in this list. (optional). /// Gets or sets the list of labels or tags used to filter the documents returned in the API. The API will return documents that have been tagged with one or more of the labels provided in this list. (optional). + /// Gets or sets the nextCursor. + /// The list of brand IDs to filter associated with the behalf documents. /// Task of ApiResponse (BehalfDocumentRecords). Task> ListBehalfDocumentsAsyncWithHttpInfo( - int page, + int page = 1, int? pageSize = default, List emailAddress = default, List status = default, @@ -655,7 +868,9 @@ Task> ListBehalfDocumentsAsyncWithHttpInfo( DateTime? startDate = default, DateTime? endDate = default, List signers = default, - List labels = default); + List labels = default, + long? nextCursor = default, + List brandIds = default); /// /// Send a reminder message to pending signers for a particular document to their respective email IDs. @@ -691,13 +906,15 @@ Task> ListBehalfDocumentsAsyncWithHttpInfo( /// SignerOrder. /// NewAccesscode. /// The on behalf of email. + /// The signer phone number. void AddAuthentication( string documentId, - string emailId, - AuthenticationType authenticationType, + string emailId = default, + AuthenticationType authenticationType = default, int? signerOrder = default, string newAccessCode = "", - string onBehalfOf = default); + string onBehalfOf = default, + PhoneNumber phoneNumber = default); /// /// Add Authentication to user. @@ -709,14 +926,16 @@ void AddAuthentication( /// SignerOrder. /// NewAccesscode. /// The on behalf of email. + /// The signer phone number. /// ApiResponse of Object(void). ApiResponse AddAuthenticationWithHttpInfo( string documentId, - string emailId, - AuthenticationType authenticationType, + string emailId = default, + AuthenticationType authenticationType = default, int? signerOrder = default, string newAccessCode = "", - string onBehalfOf = default); + string onBehalfOf = default, + PhoneNumber phoneNumber = default); /// /// Add Authentication to user. @@ -728,14 +947,16 @@ ApiResponse AddAuthenticationWithHttpInfo( /// SignerOrder. /// NewAccesscode. /// The on behalf of email. + /// The signer phone number. /// AddAuthentication. Task AddAuthenticationAsync( string documentId, - string emailId, - AuthenticationType authenticationType, + string emailId = default, + AuthenticationType authenticationType = default, int? signerOrder = default, string newAccessCode = "", - string onBehalfOf = default); + string onBehalfOf = default, + PhoneNumber phoneNumber = default); /// /// Add Authentication to user. @@ -747,14 +968,16 @@ Task AddAuthenticationAsync( /// SignerOrder. /// NewAccesscode. /// The on behalf of email. + /// The signer phone number. /// ApiResponse of Object(AddAuthentication). Task> AddAuthenticationAsyncWithHttpInfo( string documentId, - string emailId, - AuthenticationType authenticationType, + string emailId = default, + AuthenticationType authenticationType = default, int? signerOrder = default, string newAccessCode = "", - string onBehalfOf = default); + string onBehalfOf = default, + PhoneNumber phoneNumber = default); /// /// Revoke the document with the given document ID. @@ -838,7 +1061,8 @@ Task> AddAuthenticationAsyncWithHttpInfo( /// EmailID. /// SignerOrder. /// The on behalfof email. - void RemoveAuthentication(string documentId, string emailId, int? signerOrder = default, string onBehalfOf = default); + /// The phone number. + void RemoveAuthentication(string documentId, string emailId = default, int? signerOrder = default, string onBehalfOf = default, PhoneNumber phoneNumber = default); /// /// Remove Authentication to user. @@ -853,8 +1077,9 @@ Task> AddAuthenticationAsyncWithHttpInfo( /// used to target that particular order with given signer email. (optional) /// /// The on behalfof email. + /// The phone number. /// ApiResponse of Object(void) - ApiResponse RemoveAuthenticationWithHttpInfo(string documentId, string emailId, int? signerOrder = default, string onBehalfOf = default); + ApiResponse RemoveAuthenticationWithHttpInfo(string documentId, string emailId = default, int? signerOrder = default, string onBehalfOf = default, PhoneNumber phoneNumber = default); /// /// Remove Authentication to user. @@ -870,7 +1095,7 @@ Task> AddAuthenticationAsyncWithHttpInfo( /// /// The on behalfof email. /// Task of void - Task RemoveAuthenticationAsync(string documentId, string emailId, int? signerOrder = default, string onBehalfOf = default); + Task RemoveAuthenticationAsync(string documentId, string emailId = default, int? signerOrder = default, string onBehalfOf = default, PhoneNumber phoneNumber = default); /// /// Remove Authentication to user. @@ -886,7 +1111,7 @@ Task> AddAuthenticationAsyncWithHttpInfo( /// /// The on behalfof email. /// Task of ApiResponse - Task> RemoveAuthenticationAsyncWithHttpInfo(string documentId, string emailId, int? signerOrder = default, string onBehalfOf = default); + Task> RemoveAuthenticationAsyncWithHttpInfo(string documentId, string emailId = default, int? signerOrder = default, string onBehalfOf = default, PhoneNumber phoneNumber = default); /// /// Extends the expiration date of the document. diff --git a/src/BoldSign/Api/ISenderIdentityClient.cs b/src/BoldSign/Api/ISenderIdentityClient.cs index 7370262..98df4d7 100644 --- a/src/BoldSign/Api/ISenderIdentityClient.cs +++ b/src/BoldSign/Api/ISenderIdentityClient.cs @@ -175,8 +175,9 @@ public interface ISenderIdentityClient : IApiAccessor /// The page number. /// The page size. /// The search key. + /// The list of brand IDs to filter associated with the sender identity. /// A Task. - SenderIdentityList ListSenderIdentities(int page, int? pageSize = default, string search = default); + SenderIdentityList ListSenderIdentities(int page, int? pageSize = default, string search = default, List brandIds = default); /// /// Gets the sender identity list. @@ -184,8 +185,9 @@ public interface ISenderIdentityClient : IApiAccessor /// The page number. /// The page size. /// The search key. + /// The list of brand IDs to filter associated with the sender identity. /// A Task. - ApiResponse ListSenderIdentitiesWithHttpInfo(int page, int? pageSize = default, string search = default); + ApiResponse ListSenderIdentitiesWithHttpInfo(int page, int? pageSize = default, string search = default, List brandIds = default); /// /// Gets the sender identity list. @@ -193,8 +195,9 @@ public interface ISenderIdentityClient : IApiAccessor /// The page number. /// The page size. /// The search key. + /// The list of brand IDs to filter associated with the sender identity. /// A Task. - Task ListSenderIdentitiesAsync(int page, int? pageSize = default, string search = default); + Task ListSenderIdentitiesAsync(int page, int? pageSize = default, string search = default, List brandIds = default); /// /// Gets the sender identity list. @@ -202,7 +205,8 @@ public interface ISenderIdentityClient : IApiAccessor /// The page number. /// The page size. /// The search key. + /// The list of brand IDs to filter associated with the sender identity. /// A Task. - Task> ListSenderIdentitiesAsyncWithHttpInfo(int page, int? pageSize = default, string search = default); + Task> ListSenderIdentitiesAsyncWithHttpInfo(int page, int? pageSize = default, string search = default, List brandIds = default); } } diff --git a/src/BoldSign/Api/ITemplateClient.cs b/src/BoldSign/Api/ITemplateClient.cs index a74513e..e1097b1 100644 --- a/src/BoldSign/Api/ITemplateClient.cs +++ b/src/BoldSign/Api/ITemplateClient.cs @@ -1,5 +1,7 @@ namespace BoldSign.Api { + using System; + using System.Collections.Generic; using System.IO; using System.Threading.Tasks; using BoldSign.Model; @@ -19,8 +21,9 @@ public interface ITemplateClient : IApiAccessor /// /// Thrown when fails to make API call /// The template id. + /// The on behalf of email. /// - void DeleteTemplate(string templateId); + void DeleteTemplate(string templateId, string onBehalfOf = default); /// /// Deletes a template with the given template ID. @@ -29,8 +32,23 @@ public interface ITemplateClient : IApiAccessor /// /// Thrown when fails to make API call /// The template id. + /// The on behalf of email. /// ApiResponse of Object(void) - ApiResponse DeleteTemplateWithHttpInfo(string templateId); + ApiResponse DeleteTemplateWithHttpInfo(string templateId, string onBehalfOf = default); + + /// + /// Edit and update a template. + /// + /// The edit template request. + /// Thrown when fails to make API call. + void EditTemplate(EditTemplateRequest editTemplate); + + /// + /// Edit and update a template. + /// + /// The edit template request. + /// A Task. + ApiResponse EditTemplateWithHttpInfo(EditTemplateRequest editTemplate); /// /// List all the templates created. @@ -41,8 +59,14 @@ public interface ITemplateClient : IApiAccessor /// Gets or sets the page. /// Gets or sets the page size. (optional, default to 10) /// Gets or sets the templateType. (optional, default to all). + /// Gets or sets the on behalf of emails. + /// Gets or sets the created by. + /// Gets or sets the template labels. + /// Gets or sets the start date. + /// Gets or sets the end date. + /// Gets or sets the brandIds. /// TemplateRecords - TemplateRecords ListTemplates(int page, int? pageSize = default, string searchKey = default, TemplateType? templateType = default); + TemplateRecords ListTemplates(int page, int? pageSize = default, string searchKey = default, TemplateType? templateType = default, List onBehalfOf = default, List createdBy = default, List templateLabels = default, DateTime? startDate = default, DateTime? endDate = default, List brandIds = default); /// /// List all the templates created. @@ -53,8 +77,14 @@ public interface ITemplateClient : IApiAccessor /// Gets or sets the page. /// Gets or sets the page size. (optional, default to 10) /// Gets or sets the templateType. (optional, default to all). + /// Gets or sets the on behalf of emails. + /// Gets or sets the created by. + /// Gets or sets the template labels. + /// Gets or sets the start date. + /// Gets or sets the end date. + /// Gets or sets the brandIds. /// ApiResponse of TemplateRecords - ApiResponse ListTemplatesWithHttpInfo(int page, int? pageSize = default, string searchKey = default, TemplateType? templateType = default); + ApiResponse ListTemplatesWithHttpInfo(int page, int? pageSize = default, string searchKey = default, TemplateType? templateType = default, List onBehalfOf = default, List createdBy = default, List templateLabels = default, DateTime? startDate = default, DateTime? endDate = default, List brandIds = default); /// /// Send a document for signature using a Template. @@ -81,16 +111,18 @@ public interface ITemplateClient : IApiAccessor /// /// Thrown when fails to make API call. /// Template Id. + /// The on behalf of email. /// System.IO.Stream. - Stream DownloadTemplate(string templateId); + Stream DownloadTemplate(string templateId, string onBehalfOf = default); /// /// Download the template for given template ID. /// /// Thrown when fails to make API call. /// Template Id. + /// The on behalf of email. /// ApiResponse of System.IO.Stream. - ApiResponse DownloadTemplateWithHttpInfo(string templateId); + ApiResponse DownloadTemplateWithHttpInfo(string templateId, string onBehalfOf = default); /// /// Creates a template. @@ -199,8 +231,9 @@ public interface ITemplateClient : IApiAccessor /// /// Thrown when fails to make API call /// The template id. + /// The on behalf of email. /// Task of void - Task DeleteTemplateAsync(string templateId); + Task DeleteTemplateAsync(string templateId, string onBehalfOf = default); /// /// Deletes a template with the given template ID. @@ -209,8 +242,24 @@ public interface ITemplateClient : IApiAccessor /// /// Thrown when fails to make API call /// The template id. + /// The on behalf of email. /// Task of ApiResponse - Task> DeleteTemplateAsyncWithHttpInfo(string templateId); + Task> DeleteTemplateAsyncWithHttpInfo(string templateId, string onBehalfOf = default); + + /// + /// Edit and update a template. + /// + /// The edit template request. + /// Thrown when fails to make API call. + /// A Task. + Task EditTemplateAsync(EditTemplateRequest editTemplate); + + /// + /// Edit and update a template. + /// + /// The edit template request. + /// A Task. + Task> EditTemplateWithHttpInfoAsync(EditTemplateRequest editTemplate); /// /// List all the templates created. @@ -221,8 +270,14 @@ public interface ITemplateClient : IApiAccessor /// Gets or sets the page. /// Gets or sets the page size. (optional, default to 10) /// Gets or sets the templateType. (optional, default to all). + /// Gets or sets the on behalf of emails. + /// Gets or sets the created by. + /// Gets or sets the template labels. + /// Gets or sets the start date. + /// Gets or sets the end date. + /// Gets or sets the brandIds. /// Task of TemplateRecords - Task ListTemplatesAsync(int page, int? pageSize = default, string searchKey = default, TemplateType? templateType = default); + Task ListTemplatesAsync(int page, int? pageSize = default, string searchKey = default, TemplateType? templateType = default, List onBehalfOf = default, List createdBy = default, List templateLabels = default, DateTime? startDate = default, DateTime? endDate = default, List brandIds = default); /// /// List all the templates created. @@ -233,8 +288,14 @@ public interface ITemplateClient : IApiAccessor /// Gets or sets the page. /// Gets or sets the page size. (optional, default to 10) /// Gets or sets the templateType. (optional, default to all). + /// Gets or sets the on behalf of emails. + /// Gets or sets the created by. + /// Gets or sets the template labels. + /// Gets or sets the start date. + /// Gets or sets the end date. + /// Gets or sets the brandIds. /// Task of ApiResponse (TemplateRecords) - Task> ListTemplatesAsyncWithHttpInfo(int page, int? pageSize = default, string searchKey = default, TemplateType? templateType = default); + Task> ListTemplatesAsyncWithHttpInfo(int page, int? pageSize = default, string searchKey = default, TemplateType? templateType = default, List onBehalfOf = default, List createdBy = default, List templateLabels = default, DateTime? startDate = default, DateTime? endDate = default, List brandIds = default); /// /// Send a document for signature using a Template. @@ -293,16 +354,18 @@ public interface ITemplateClient : IApiAccessor /// /// Thrown when fails to make API call. /// Template Id. + /// The on behalf of email. /// Task of System.IO.Stream. - Task DownloadTemplateAsync(string templateId); + Task DownloadTemplateAsync(string templateId, string onBehalfOf = default); /// /// Download the template for given template ID. /// /// Thrown when fails to make API call. /// Template Id. + /// The on behalf of email. /// Task of ApiResponse (System.IO.Stream). - Task> DownloadTemplateAsyncWithHttpInfo(string templateId); + Task> DownloadTemplateAsyncWithHttpInfo(string templateId, string onBehalfOf = default); /// /// Get summary of the template for the given template ID. diff --git a/src/BoldSign/Api/PlanClient.cs b/src/BoldSign/Api/PlanClient.cs index 46189fa..6bacccb 100644 --- a/src/BoldSign/Api/PlanClient.cs +++ b/src/BoldSign/Api/PlanClient.cs @@ -8,15 +8,16 @@ * Generated by: https://github.com/openapitools/openapi-generator.git */ + namespace BoldSign.Api { using System; using System.Collections.Generic; using System.Linq; + using System.Net.Http; using System.Threading.Tasks; using BoldSign.Api.Resources; using BoldSign.Model; - using RestSharp; /// /// Represents a function to interact with the API endpoints. The function perform action such as getting the Api credit details and so on. @@ -77,7 +78,7 @@ public PlanClient(ApiClient apiClient) /// Gets the base path of the API client. /// /// The base path - public string GetBasePath() => this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); + public string GetBasePath() => this.Configuration.ApiClient.HttpClient.BaseAddress.AbsoluteUri; /// /// Gets or sets the configuration object. @@ -120,7 +121,6 @@ public BillingViewModel GetApiCreditsCount() public ApiResponse GetApiCreditsCountWithHttpInfo() { var localVarPath = "/v1/plan/apiCreditsCount"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -153,10 +153,9 @@ public ApiResponse GetApiCreditsCountWithHttpInfo() } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi( + using var localVarResponse = this.Configuration.ApiClient.CallApi( localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -169,7 +168,7 @@ public ApiResponse GetApiCreditsCountWithHttpInfo() return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (BillingViewModel)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(BillingViewModel))); } @@ -193,7 +192,6 @@ public async Task GetApiCreditsCountAsync() public async Task> GetApiCreditsCountAsyncWithHttpInfo() { var localVarPath = "/v1/plan/apiCreditsCount"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -226,10 +224,9 @@ public async Task> GetApiCreditsCountAsyncWithHttp } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync( + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync( localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -242,7 +239,7 @@ public async Task> GetApiCreditsCountAsyncWithHttp return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (BillingViewModel)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(BillingViewModel))); } } diff --git a/src/BoldSign/Api/SenderIdentityClient.cs b/src/BoldSign/Api/SenderIdentityClient.cs index bb1cd5a..7c94632 100644 --- a/src/BoldSign/Api/SenderIdentityClient.cs +++ b/src/BoldSign/Api/SenderIdentityClient.cs @@ -20,12 +20,12 @@ namespace BoldSign.Api using System.Globalization; using System.IO; using System.Linq; + using System.Net.Http; using System.Text.RegularExpressions; using System.Threading.Tasks; using BoldSign.Api.Resources; using BoldSign.Model; using Newtonsoft.Json; - using RestSharp; /// /// Represents a function to interact with the API endpoints. The function perform action such as creating sender identity and so on. @@ -113,7 +113,7 @@ public ExceptionFactory ExceptionFactory /// /// The base path. /// base path. - public string GetBasePath() => this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); + public string GetBasePath() => this.Configuration.ApiClient.HttpClient.BaseAddress.AbsoluteUri; /// public SenderIdentityCreated CreateSenderIdentity(SenderIdentityRequest createSenderIdentityRequest = default) @@ -134,7 +134,6 @@ public ApiResponse CreateSenderIdentityWithHttpInfo(Sende ValidateCreateSenderIdentityProperties(createSenderIdentityRequest); var localVarPath = "/v1/senderIdentities/create"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -192,7 +191,7 @@ public ApiResponse CreateSenderIdentityWithHttpInfo(Sende } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -205,7 +204,7 @@ public ApiResponse CreateSenderIdentityWithHttpInfo(Sende return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (SenderIdentityCreated)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(SenderIdentityCreated))); } @@ -228,7 +227,6 @@ public async Task> CreateSenderIdentityAsyncW ValidateCreateSenderIdentityProperties(createSenderIdentityRequest); var localVarPath = "/v1/senderIdentities/create"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -286,7 +284,7 @@ public async Task> CreateSenderIdentityAsyncW } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -299,7 +297,7 @@ public async Task> CreateSenderIdentityAsyncW return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (SenderIdentityCreated)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(SenderIdentityCreated))); } @@ -317,10 +315,9 @@ public ApiResponse UpdateSenderIdentityWithHttpInfo(SenderIdentityReques throw new ArgumentNullException(nameof(editSenderIdentityRequest)); } - ValidateCreateSenderIdentityProperties(editSenderIdentityRequest); + ValidateEditSenderIdentityProperties(editSenderIdentityRequest); var localVarPath = "/v1/senderIdentities/update"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -366,7 +363,7 @@ public ApiResponse UpdateSenderIdentityWithHttpInfo(SenderIdentityReques } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -379,7 +376,7 @@ public ApiResponse UpdateSenderIdentityWithHttpInfo(SenderIdentityReques return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -397,10 +394,9 @@ public async Task> UpdateSenderIdentityAsyncWithHttpInfo(Sen throw new ArgumentNullException(nameof(editSenderIdentityRequest)); } - ValidateCreateSenderIdentityProperties(editSenderIdentityRequest); + ValidateEditSenderIdentityProperties(editSenderIdentityRequest); var localVarPath = "/v1/senderIdentities/update"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -446,7 +442,7 @@ public async Task> UpdateSenderIdentityAsyncWithHttpInfo(Sen } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -459,7 +455,7 @@ public async Task> UpdateSenderIdentityAsyncWithHttpInfo(Sen return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -478,7 +474,6 @@ public ApiResponse ResendInvitationWithHttpInfo(string email) } var localVarPath = "/v1/senderIdentities/resendInvitation"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -512,7 +507,7 @@ public ApiResponse ResendInvitationWithHttpInfo(string email) } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -525,7 +520,7 @@ public ApiResponse ResendInvitationWithHttpInfo(string email) return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -544,7 +539,6 @@ public async Task> ResendInvitationAsyncWithHttpInfo(string } var localVarPath = "/v1/senderIdentities/resendInvitation"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -578,7 +572,7 @@ public async Task> ResendInvitationAsyncWithHttpInfo(string } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -591,7 +585,7 @@ public async Task> ResendInvitationAsyncWithHttpInfo(string return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -610,7 +604,6 @@ public ApiResponse RerequestSenderIdentityWithHttpInfo(string email) } var localVarPath = "/v1/senderIdentities/rerequest"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -644,7 +637,7 @@ public ApiResponse RerequestSenderIdentityWithHttpInfo(string email) } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -657,7 +650,7 @@ public ApiResponse RerequestSenderIdentityWithHttpInfo(string email) return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -676,7 +669,6 @@ public async Task> RerequestSenderIdentityAsyncWithHttpInfo( } var localVarPath = "/v1/senderIdentities/rerequest"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -710,7 +702,7 @@ public async Task> RerequestSenderIdentityAsyncWithHttpInfo( } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -723,7 +715,7 @@ public async Task> RerequestSenderIdentityAsyncWithHttpInfo( return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -742,7 +734,6 @@ public ApiResponse DeleteSenderIdentityWithHttpInfo(string email) } var localVarPath = "/v1/senderIdentities/delete"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -776,7 +767,7 @@ public ApiResponse DeleteSenderIdentityWithHttpInfo(string email) } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -789,7 +780,7 @@ public ApiResponse DeleteSenderIdentityWithHttpInfo(string email) return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -808,7 +799,6 @@ public async Task> DeleteSenderIdentityAsyncWithHttpInfo(str } var localVarPath = "/v1/senderIdentities/delete"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -842,7 +832,7 @@ public async Task> DeleteSenderIdentityAsyncWithHttpInfo(str } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -855,7 +845,7 @@ public async Task> DeleteSenderIdentityAsyncWithHttpInfo(str return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -923,19 +913,18 @@ string DomainMapper(Match match) } /// - public SenderIdentityList ListSenderIdentities(int page, int? pageSize = default, string search = default) + public SenderIdentityList ListSenderIdentities(int page, int? pageSize = default, string search = default, List brandIds = default) { - var localVarResponse = this.ListSenderIdentitiesWithHttpInfo(page, pageSize, search); + var localVarResponse = this.ListSenderIdentitiesWithHttpInfo(page, pageSize, search, brandIds); return localVarResponse.Data; } /// - public ApiResponse ListSenderIdentitiesWithHttpInfo(int page, int? pageSize = default, string search = default) + public ApiResponse ListSenderIdentitiesWithHttpInfo(int page, int? pageSize = default, string search = default, List brandIds = default) { // verify the required parameter 'page' is set var localVarPath = "/v1/senderIdentities/list"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -971,6 +960,11 @@ public ApiResponse ListSenderIdentitiesWithHttpInfo(int page localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "Search", search)); // query parameter } + if (brandIds != null && brandIds.Any()) + { + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "BrandIds", brandIds)); // query parameter + } + // authentication (Bearer) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) { @@ -978,7 +972,7 @@ public ApiResponse ListSenderIdentitiesWithHttpInfo(int page } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -991,24 +985,23 @@ public ApiResponse ListSenderIdentitiesWithHttpInfo(int page return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (SenderIdentityList)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(SenderIdentityList))); } /// - public async Task ListSenderIdentitiesAsync(int page, int? pageSize = default, string search = default) + public async Task ListSenderIdentitiesAsync(int page, int? pageSize = default, string search = default, List brandIds = default) { - var localVarResponse = await this.ListSenderIdentitiesAsyncWithHttpInfo(page, pageSize, search).ConfigureAwait(false); + var localVarResponse = await this.ListSenderIdentitiesAsyncWithHttpInfo(page, pageSize, search, brandIds).ConfigureAwait(false); return localVarResponse.Data; } /// - public async Task> ListSenderIdentitiesAsyncWithHttpInfo(int page, int? pageSize = default, string search = default) + public async Task> ListSenderIdentitiesAsyncWithHttpInfo(int page, int? pageSize = default, string search = default, List brandIds = default) { // verify the required parameter 'page' is set var localVarPath = "/v1/senderIdentities/list"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -1044,6 +1037,11 @@ public async Task> ListSenderIdentitiesAsyncWith localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "Search", search)); // query parameter } + if (brandIds != null && brandIds.Any()) + { + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "BrandIds", brandIds)); // query parameter + } + // authentication (Bearer) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) { @@ -1051,7 +1049,7 @@ public async Task> ListSenderIdentitiesAsyncWith } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1064,7 +1062,7 @@ public async Task> ListSenderIdentitiesAsyncWith return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (SenderIdentityList)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(SenderIdentityList))); } @@ -1080,5 +1078,19 @@ private static void ValidateCreateSenderIdentityProperties(SenderIdentityRequest throw new ApiException(422, ApiValidationMessages.InvalidEmailAddress); } } + + private static void ValidateEditSenderIdentityProperties(SenderIdentityRequest editSenderIdentityRequest) + { + if (string.IsNullOrEmpty(editSenderIdentityRequest.Name) && + string.IsNullOrEmpty(editSenderIdentityRequest.RedirectUrl?.ToString())) + { + throw new ApiException(422, ApiValidationMessages.RequiredNameOrRedirectUrl); + } + + if (!IsValidEmail(editSenderIdentityRequest.Email)) + { + throw new ApiException(422, ApiValidationMessages.InvalidEmailAddress); + } + } } } diff --git a/src/BoldSign/Api/TeamClient.cs b/src/BoldSign/Api/TeamClient.cs index dcd9df5..9a2f99b 100644 --- a/src/BoldSign/Api/TeamClient.cs +++ b/src/BoldSign/Api/TeamClient.cs @@ -17,10 +17,10 @@ namespace BoldSign.Api using System; using System.Collections.Generic; using System.Linq; + using System.Net.Http; using System.Threading.Tasks; using BoldSign.Api.Resources; using BoldSign.Model; - using RestSharp; /// /// Represents a collection of functions to interact with the API endpoints. The functions perform actions such as create a new team, update team name, get team details with its group members, and get list of teams in an organization. @@ -108,7 +108,7 @@ public ExceptionFactory ExceptionFactory /// /// The base path. /// base path. - public string GetBasePath() => this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); + public string GetBasePath() => this.Configuration.ApiClient.HttpClient.BaseAddress.AbsoluteUri; /// /// Get team Details for the given team Id. @@ -138,7 +138,6 @@ public ApiResponse GetTeamDetailsWithHttpInfo(string teamId) } var localVarPath = "/v1/teams/get"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -171,7 +170,7 @@ public ApiResponse GetTeamDetailsWithHttpInfo(string teamId) } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -184,7 +183,7 @@ public ApiResponse GetTeamDetailsWithHttpInfo(string teamId) return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (TeamDetails)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(TeamDetails))); } @@ -216,7 +215,6 @@ public async Task> GetTeamDetailsAsyncWithHttpInfo(stri } var localVarPath = "/v1/teams/get"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -249,7 +247,7 @@ public async Task> GetTeamDetailsAsyncWithHttpInfo(stri } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -262,7 +260,7 @@ public async Task> GetTeamDetailsAsyncWithHttpInfo(stri return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (TeamDetails)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(TeamDetails))); } @@ -292,7 +290,6 @@ public TeamList ListTeam(int page, int? pageSize = default, string searchKey = d public ApiResponse ListTeamWithHttpInfo(int page, int? pageSize = default, string searchKey = default) { var localVarPath = "/v1/teams/list"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -335,7 +332,7 @@ public ApiResponse ListTeamWithHttpInfo(int page, int? pageSize = defa } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -348,7 +345,7 @@ public ApiResponse ListTeamWithHttpInfo(int page, int? pageSize = defa return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (TeamList)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(TeamList))); } @@ -378,7 +375,6 @@ public async Task ListTeamAsync(int page, int? pageSize = default, str public async Task> ListTeamAsyncWithHttpInfo(int page, int? pageSize = default, string searchKey = default) { var localVarPath = "/v1/teams/list"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -421,7 +417,7 @@ public async Task> ListTeamAsyncWithHttpInfo(int page, int } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -434,7 +430,7 @@ public async Task> ListTeamAsyncWithHttpInfo(int page, int return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (TeamList)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(TeamList))); } @@ -467,7 +463,6 @@ public ApiResponse CreateTeamWithHttpInfo(CreateTeam createTeam) ValidateCreateTeamProperties(createTeam); var localVarPath = "/v1/teams/create"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -528,7 +523,7 @@ public ApiResponse CreateTeamWithHttpInfo(CreateTeam createTeam) } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -541,7 +536,7 @@ public ApiResponse CreateTeamWithHttpInfo(CreateTeam createTeam) return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (TeamCreated)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(TeamCreated))); } @@ -574,7 +569,6 @@ public async Task> CreateTeamAsyncWithHttpInfo(CreateTe ValidateCreateTeamProperties(createTeam); var localVarPath = "/v1/teams/create"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -635,7 +629,7 @@ public async Task> CreateTeamAsyncWithHttpInfo(CreateTe } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -648,7 +642,7 @@ public async Task> CreateTeamAsyncWithHttpInfo(CreateTe return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (TeamCreated)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(TeamCreated))); } @@ -678,7 +672,6 @@ public ApiResponse UpdateTeamWithHttpInfo(UpdateTeam updateTeam) ValidateUpdateTeamProperties(updateTeam); var localVarPath = "/v1/teams/update"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -741,7 +734,7 @@ public ApiResponse UpdateTeamWithHttpInfo(UpdateTeam updateTeam) } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -754,7 +747,7 @@ public ApiResponse UpdateTeamWithHttpInfo(UpdateTeam updateTeam) return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -785,7 +778,6 @@ public async Task> UpdateTeamAsyncWithHttpInfo(UpdateTeam up ValidateUpdateTeamProperties(updateTeam); var localVarPath = "/v1/teams/update"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -849,7 +841,7 @@ public async Task> UpdateTeamAsyncWithHttpInfo(UpdateTeam up } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -862,7 +854,7 @@ public async Task> UpdateTeamAsyncWithHttpInfo(UpdateTeam up return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } diff --git a/src/BoldSign/Api/TemplateClient.cs b/src/BoldSign/Api/TemplateClient.cs index fd03427..25dd501 100644 --- a/src/BoldSign/Api/TemplateClient.cs +++ b/src/BoldSign/Api/TemplateClient.cs @@ -8,27 +8,31 @@ * Generated by: https://github.com/openapitools/openapi-generator.git */ -using System.Globalization; - namespace BoldSign.Api { using System; using System.Collections.Generic; using System.Collections.ObjectModel; + using System.Globalization; using System.IO; using System.Linq; + using System.Net.Http; using System.Threading.Tasks; using BoldSign.Api.Model; using BoldSign.Api.Resources; using BoldSign.Model; - using RestSharp; /// /// Represents a collection of functions to interact with the API endpoints. The functions perform actions such as sending document sign request from template, deleting a template, listing the templates and so on. /// public class TemplateClient : ITemplateClient { + private static readonly HttpMethod PatchHttpMethod = new HttpMethod("PATCH"); + + // verify the Filesize is within 100MB +#pragma warning disable SA1203 private const long MaxFileSize = 104857600; +#pragma warning restore SA1203 private ExceptionFactory exceptionFactory = (name, response) => null; /// @@ -83,7 +87,7 @@ public TemplateClient(ApiClient apiClient) /// Gets the base path of the API client. /// /// The base path - public string GetBasePath() => this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); + public string GetBasePath() => this.Configuration.ApiClient.HttpClient.BaseAddress.AbsoluteUri; /// /// Gets or sets the configuration object. @@ -113,10 +117,11 @@ public ExceptionFactory ExceptionFactory /// /// Thrown when fails to make API call /// The template id. + /// The on behalf of email. /// - public void DeleteTemplate(string templateId) + public void DeleteTemplate(string templateId, string onBehalfOf = default) { - this.DeleteTemplateWithHttpInfo(templateId); + this.DeleteTemplateWithHttpInfo(templateId, onBehalfOf); } /// @@ -124,8 +129,9 @@ public void DeleteTemplate(string templateId) /// /// Thrown when fails to make API call /// The template id. + /// The on behalf of email. /// ApiResponse of Object(void) - public ApiResponse DeleteTemplateWithHttpInfo(string templateId) + public ApiResponse DeleteTemplateWithHttpInfo(string templateId, string onBehalfOf = default) { // verify the required parameter 'templateId' is set if (templateId == null) @@ -134,7 +140,6 @@ public ApiResponse DeleteTemplateWithHttpInfo(string templateId) } var localVarPath = "/v1/template/delete"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -162,6 +167,11 @@ public ApiResponse DeleteTemplateWithHttpInfo(string templateId) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "templateId", templateId)); // query parameter + if (!string.IsNullOrEmpty(onBehalfOf)) + { + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "onBehalfOf", onBehalfOf)); // query parameter + } + // authentication (Bearer) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) { @@ -169,10 +179,9 @@ public ApiResponse DeleteTemplateWithHttpInfo(string templateId) } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi( + using var localVarResponse = this.Configuration.ApiClient.CallApi( localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + HttpMethod.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -185,7 +194,7 @@ public ApiResponse DeleteTemplateWithHttpInfo(string templateId) return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -194,10 +203,11 @@ public ApiResponse DeleteTemplateWithHttpInfo(string templateId) /// /// Thrown when fails to make API call /// The template id. + /// The on behalf of email. /// Task of void - public async Task DeleteTemplateAsync(string templateId) + public async Task DeleteTemplateAsync(string templateId, string onBehalfOf = default) { - await this.DeleteTemplateAsyncWithHttpInfo(templateId); + await this.DeleteTemplateAsyncWithHttpInfo(templateId, onBehalfOf); } /// @@ -205,8 +215,9 @@ public async Task DeleteTemplateAsync(string templateId) /// /// Thrown when fails to make API call /// The template id. + /// The on behalf of email. /// Task of ApiResponse - public async Task> DeleteTemplateAsyncWithHttpInfo(string templateId) + public async Task> DeleteTemplateAsyncWithHttpInfo(string templateId, string onBehalfOf = default) { // verify the required parameter 'templateId' is set if (templateId == null) @@ -215,7 +226,6 @@ public async Task> DeleteTemplateAsyncWithHttpInfo(string te } var localVarPath = "/v1/template/delete"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -243,6 +253,11 @@ public async Task> DeleteTemplateAsyncWithHttpInfo(string te localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "templateId", templateId)); // query parameter + if (!string.IsNullOrEmpty(onBehalfOf)) + { + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "onBehalfOf", onBehalfOf)); // query parameter + } + // authentication (Bearer) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) { @@ -250,10 +265,9 @@ public async Task> DeleteTemplateAsyncWithHttpInfo(string te } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync( + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync( localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + HttpMethod.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -266,10 +280,194 @@ public async Task> DeleteTemplateAsyncWithHttpInfo(string te return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + null); + } + + /// + public void EditTemplate(EditTemplateRequest editTemplate) + { + this.EditTemplateWithHttpInfo(editTemplate); + } + + /// + public ApiResponse EditTemplateWithHttpInfo(EditTemplateRequest editTemplate) + { + if (editTemplate == null) + { + throw new ArgumentNullException(nameof(editTemplate)); + } + + var localVarPath = "/v1/template/edit"; + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary>(); + var localVarFileUrlParams = new Dictionary(); + object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = + { + "application/json;odata.metadata=minimal;odata.streaming=true", + "application/json;odata.metadata=minimal;odata.streaming=false", + "application/json;odata.metadata=minimal", + "application/json;odata.metadata=full;odata.streaming=true", + "application/json;odata.metadata=full;odata.streaming=false", + "application/json;odata.metadata=full", + "application/json;odata.metadata=none;odata.streaming=true", + "application/json;odata.metadata=none;odata.streaming=false", + "application/json;odata.metadata=none", + "application/json;odata.streaming=true", + "application/json;odata.streaming=false", + "application/json", + "application/xml", + "application/prs.odatatestxx-odata", + "text/json", + "application/_*+json", + }; + var localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = + { + "application/json", + }; + var localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + + if (localVarHttpHeaderAccept != null) + { + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + } + + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "templateId", editTemplate.TemplateId)); // query parameter + + if (editTemplate.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(editTemplate); // http body (model) parameter + } + else + { + localVarPostBody = editTemplate; // byte array + } + + // authentication (Bearer) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); + } + + // make the HTTP request + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); + + var localVarStatusCode = (int)localVarResponse.StatusCode; + + var exception = this.ExceptionFactory?.Invoke("EditTemplate", localVarResponse); + + if (exception != null) + { + throw exception; + } + + return new ApiResponse( + localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + null); + } + + + /// + public async Task EditTemplateAsync(EditTemplateRequest editTemplate) + { + await this.EditTemplateWithHttpInfoAsync(editTemplate).ConfigureAwait(false); + } + + /// + public async Task> EditTemplateWithHttpInfoAsync(EditTemplateRequest editTemplate) + { + if (editTemplate == null) + { + throw new ArgumentNullException(nameof(editTemplate)); + } + + var localVarPath = "/v1/template/edit"; + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary>(); + var localVarFileUrlParams = new Dictionary(); + object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = + { + "application/json;odata.metadata=minimal;odata.streaming=true", + "application/json;odata.metadata=minimal;odata.streaming=false", + "application/json;odata.metadata=minimal", + "application/json;odata.metadata=full;odata.streaming=true", + "application/json;odata.metadata=full;odata.streaming=false", + "application/json;odata.metadata=full", + "application/json;odata.metadata=none;odata.streaming=true", + "application/json;odata.metadata=none;odata.streaming=false", + "application/json;odata.metadata=none", + "application/json;odata.streaming=true", + "application/json;odata.streaming=false", + "application/json", + "application/xml", + "application/prs.odatatestxx-odata", + "text/json", + "application/_*+json", + }; + var localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = + { + "application/json", + }; + var localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + + if (localVarHttpHeaderAccept != null) + { + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + } + + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "templateId", editTemplate.TemplateId)); // query parameter + + if (editTemplate.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(editTemplate); // http body (model) parameter + } + else + { + localVarPostBody = editTemplate; // byte array + } + + // authentication (Bearer) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); + } + + // make the HTTP request + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + + var localVarStatusCode = (int)localVarResponse.StatusCode; + + var exception = this.ExceptionFactory?.Invoke("EditTemplate", localVarResponse); + + if (exception != null) + { + throw exception; + } + + return new ApiResponse( + localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } + /// /// List all the templates created. /// @@ -277,10 +475,16 @@ public async Task> DeleteTemplateAsyncWithHttpInfo(string te /// Gets or sets the page. /// Gets or sets the page size. (optional, default to 10) /// Gets or sets the templateType. (optional, default to all). + /// Gets or sets the on behalf of emails. + /// Gets or sets the created by. + /// Gets or sets the template labels. + /// Gets or sets the start date. + /// Gets or sets the end date. + /// Gets or sets the brandIds. /// TemplateRecords - public TemplateRecords ListTemplates(int page, int? pageSize = default, string searchKey = default, TemplateType? templateType = default) + public TemplateRecords ListTemplates(int page, int? pageSize = default, string searchKey = default, TemplateType? templateType = default, List onBehalfOf = default, List createdBy = default, List templateLabels = default, DateTime? startDate = default, DateTime? endDate = default, List brandIds = default) { - var localVarResponse = this.ListTemplatesWithHttpInfo(page, pageSize, searchKey, templateType); + var localVarResponse = this.ListTemplatesWithHttpInfo(page, pageSize, searchKey, templateType, onBehalfOf, createdBy, templateLabels, startDate, endDate, brandIds); return localVarResponse.Data; } @@ -292,8 +496,14 @@ public TemplateRecords ListTemplates(int page, int? pageSize = default, string s /// Gets or sets the page. /// Gets or sets the page size. (optional, default to 10) /// Gets or sets the templateType. (optional, default to all). + /// Gets or sets the on behalf of emails. + /// Gets or sets the created by. + /// Gets or sets the template labels. + /// /// /// Gets or sets the start date. + /// Gets or sets the end date. + /// Gets or sets the brandIds. /// ApiResponse of TemplateRecords - public ApiResponse ListTemplatesWithHttpInfo(int page, int? pageSize = default, string searchKey = default, TemplateType? templateType = default) + public ApiResponse ListTemplatesWithHttpInfo(int page, int? pageSize = default, string searchKey = default, TemplateType? templateType = default, List onBehalfOf = default, List createdBy = default, List templateLabels = default, DateTime? startDate = default, DateTime? endDate = default, List brandIds = default) { // verify the required parameter 'page' is set if (page < 1) @@ -302,7 +512,6 @@ public ApiResponse ListTemplatesWithHttpInfo(int page, int? pag } var localVarPath = "/v1/template/list"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -345,6 +554,36 @@ public ApiResponse ListTemplatesWithHttpInfo(int page, int? pag localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "TemplateType", templateType)); // query parameter } + if (onBehalfOf != null) + { + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "onBehalfOf", onBehalfOf)); // query parameter + } + + if (createdBy != null) + { + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "createdBy", createdBy)); // query parameter + } + + if (templateLabels != null) + { + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "templateLabels", templateLabels)); // query parameter + } + + if (startDate != null) + { + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "startDate", startDate)); // query parameter + } + + if (endDate != null) + { + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "endDate", endDate)); // query parameter + } + + if (brandIds != null) + { + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "BrandIds", brandIds)); // query parameter + } + // authentication (Bearer) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) { @@ -352,10 +591,9 @@ public ApiResponse ListTemplatesWithHttpInfo(int page, int? pag } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi( + using var localVarResponse = this.Configuration.ApiClient.CallApi( localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -368,7 +606,7 @@ public ApiResponse ListTemplatesWithHttpInfo(int page, int? pag return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (TemplateRecords)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(TemplateRecords))); } @@ -379,10 +617,16 @@ public ApiResponse ListTemplatesWithHttpInfo(int page, int? pag /// Gets or sets the page. /// Gets or sets the page size. (optional, default to 10) /// Gets or sets the templateType. (optional, default to all). + /// Gets or sets the on behalf of emails. + /// Gets or sets the created by. + /// Gets or sets the template labels. + /// Gets or sets the start date.; + /// Gets or sets the end date.; + /// Gets or sets the brandIds. /// Task of TemplateRecords - public async Task ListTemplatesAsync(int page, int? pageSize = default, string searchKey = default, TemplateType? templateType = default) + public async Task ListTemplatesAsync(int page, int? pageSize = default, string searchKey = default, TemplateType? templateType = default, List onBehalfOf = default, List createdBy = default, List templateLabels = default, DateTime? startDate = default, DateTime? endDate = default, List brandIds = default) { - var localVarResponse = await this.ListTemplatesAsyncWithHttpInfo(page, pageSize, searchKey, templateType); + var localVarResponse = await this.ListTemplatesAsyncWithHttpInfo(page, pageSize, searchKey, templateType, onBehalfOf, createdBy, templateLabels, startDate, endDate, brandIds); return localVarResponse.Data; } @@ -394,8 +638,14 @@ public async Task ListTemplatesAsync(int page, int? pageSize = /// Gets or sets the page. /// Gets or sets the page size. (optional, default to 10) /// Gets or sets the templateType. (optional, default to all). + /// Gets or sets the on behalf of emails. + /// Gets or sets the created by. + /// Gets or sets the template labels. + /// Gets or sets the start date.; + /// Gets or sets the end date.; + /// Gets or sets the brandIds. /// Task of ApiResponse (TemplateRecords) - public async Task> ListTemplatesAsyncWithHttpInfo(int page, int? pageSize = default, string searchKey = default, TemplateType? templateType = default) + public async Task> ListTemplatesAsyncWithHttpInfo(int page, int? pageSize = default, string searchKey = default, TemplateType? templateType = default, List onBehalfOf = default, List createdBy = default, List templateLabels = default, DateTime? startDate = default, DateTime? endDate = default, List brandIds = default) { // verify the required parameter 'page' is set if (page < 1) @@ -404,7 +654,6 @@ public async Task> ListTemplatesAsyncWithHttpInfo(i } var localVarPath = "/v1/template/list"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -447,6 +696,36 @@ public async Task> ListTemplatesAsyncWithHttpInfo(i localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "TemplateType", templateType)); // query parameter } + if (onBehalfOf != null) + { + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "onBehalfOf", onBehalfOf)); // query parameter + } + + if (createdBy != null) + { + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "createdBy", createdBy)); // query parameter + } + + if (templateLabels != null) + { + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "templateLabels", templateLabels)); // query parameter + } + + if (startDate != null) + { + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "startDate", startDate)); // query parameter + } + + if (endDate != null) + { + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "endDate", endDate)); // query parameter + } + + if (brandIds != null) + { + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "BrandIds", brandIds)); // query parameter + } + // authentication (Bearer) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) { @@ -454,10 +733,9 @@ public async Task> ListTemplatesAsyncWithHttpInfo(i } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync( + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync( localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -470,7 +748,7 @@ public async Task> ListTemplatesAsyncWithHttpInfo(i return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (TemplateRecords)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(TemplateRecords))); } @@ -510,7 +788,6 @@ public ApiResponse SendUsingTemplateWithHttpInfo(SendForSignFro ValidateExpiryDateTypeValues(sendForSignFromTemplate); var localVarPath = "/v1/template/send"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -575,10 +852,9 @@ public ApiResponse SendUsingTemplateWithHttpInfo(SendForSignFro } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi( + using var localVarResponse = this.Configuration.ApiClient.CallApi( localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -591,7 +867,7 @@ public ApiResponse SendUsingTemplateWithHttpInfo(SendForSignFro return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (DocumentCreated)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(DocumentCreated))); } @@ -632,7 +908,6 @@ public async Task> SendUsingTemplateAsyncWithHttpIn ValidateExpiryDateTypeValues(sendForSignFromTemplate); var localVarPath = "/v1/template/send"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -697,10 +972,9 @@ public async Task> SendUsingTemplateAsyncWithHttpIn } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync( + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync( localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -713,7 +987,7 @@ public async Task> SendUsingTemplateAsyncWithHttpIn return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (DocumentCreated)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(DocumentCreated))); } @@ -736,7 +1010,6 @@ public ApiResponse CreateEmbeddedRequestUrlWithHttpInfo(Emb ValidateTemplateProperties(send); var localVarPath = "/v1/template/createEmbeddedRequestUrl"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -783,15 +1056,14 @@ public ApiResponse CreateEmbeddedRequestUrlWithHttpInfo(Emb } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi( + using var localVarResponse = this.Configuration.ApiClient.CallApi( localVarPath, - Method.POST, + HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams); @@ -806,7 +1078,7 @@ public ApiResponse CreateEmbeddedRequestUrlWithHttpInfo(Emb return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (EmbeddedSendCreated)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(EmbeddedSendCreated))); } @@ -829,7 +1101,6 @@ public async Task> CreateEmbeddedRequestUrlAsyn ValidateTemplateProperties(send); var localVarPath = "/v1/template/createEmbeddedRequestUrl"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -877,15 +1148,14 @@ public async Task> CreateEmbeddedRequestUrlAsyn } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync( + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync( localVarPath, - Method.POST, + HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams) .ConfigureAwait(false); @@ -901,78 +1171,197 @@ public async Task> CreateEmbeddedRequestUrlAsyn return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (EmbeddedSendCreated)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(EmbeddedSendCreated))); } /// - public TemplateCreated CreateTemplate(CreateTemplateRequest createTemplate) + public EmbeddedTemplateEdited GetEmbeddedTemplateEditUrl(EmbeddedTemplateEditRequest embedTemplateEdit) { - var localVarResponse = this.CreateTemplateWithHttpInfo(createTemplate); + var localVarResponse = this.GetEmbeddedTemplateEditUrlWithHttpInfo(embedTemplateEdit); return localVarResponse.Data; } /// - public ApiResponse CreateTemplateWithHttpInfo(CreateTemplateRequest createTemplate) + public ApiResponse GetEmbeddedTemplateEditUrlWithHttpInfo(EmbeddedTemplateEditRequest embedTemplateEdit) { - if (createTemplate == null) + if (embedTemplateEdit == null) { - throw new ArgumentNullException(nameof(createTemplate)); + throw new ArgumentNullException(nameof(embedTemplateEdit)); } - ValidateCreateTemplateProperties(createTemplate); + // verify the required parameter 'templateId' is set + if (string.IsNullOrEmpty(embedTemplateEdit.TemplateId)) + { + throw new ApiException(422, ApiValidationMessages.EmbeddedTemplateIdNull); + } - const string localVarPath = "/v1/template/create"; - var localVarPathParams = this.PrepareCreateTemplate( - createTemplate, + const string localVarPath = "/v1/template/getEmbeddedTemplateEditUrl"; + var localVarFileParams = new Dictionary>(); + var localVarFileUrlParams = new Dictionary(); + this.PrepareEmbeddedTemplateEdit( + embedTemplateEdit, out var localVarQueryParams, out var localVarHeaderParams, out var localVarFormParams, - out var localVarFileParams, - out var localVarFileUrlParams, - out var localVarPostBody, out var localVarHttpContentType); // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + using var localVarResponse = this.Configuration.ApiClient.CallApi( + localVarPath, + HttpMethod.Post, + localVarQueryParams, + null, + localVarHeaderParams, + localVarFormParams, + localVarFileParams, + localVarHttpContentType, + localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; - var exception = this.ExceptionFactory?.Invoke("CreateTemplate", localVarResponse); + var exception = this.ExceptionFactory?.Invoke("getEmbeddedTemplateEditUrl", localVarResponse); if (exception != null) { throw exception; } - return new ApiResponse( + return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (TemplateCreated)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(TemplateCreated))); + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + (EmbeddedTemplateEdited)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(EmbeddedTemplateEdited))); } /// - public async Task CreateTemplateAsync(CreateTemplateRequest createTemplate) + public async Task GetEmbeddedTemplateEditUrlAsync(EmbeddedTemplateEditRequest embeddedTemplateEditRequest) { - var localVarResponse = await this.CreateTemplateWithHttpInfoAsync(createTemplate).ConfigureAwait(false); + var localVarResponse = await this.GetEmbeddedTemplateEditUrlWithHttpInfoAsync(embeddedTemplateEditRequest).ConfigureAwait(false); return localVarResponse.Data; } /// - public async Task> CreateTemplateWithHttpInfoAsync(CreateTemplateRequest createTemplate) + public async Task> GetEmbeddedTemplateEditUrlWithHttpInfoAsync(EmbeddedTemplateEditRequest embeddedTemplateEditRequest) { - if (createTemplate == null) + if (embeddedTemplateEditRequest == null) { - throw new ArgumentNullException(nameof(createTemplate)); + throw new ArgumentNullException(nameof(embeddedTemplateEditRequest)); } - ValidateCreateTemplateProperties(createTemplate); + // verify the required parameter 'templateId' is set + if (string.IsNullOrEmpty(embeddedTemplateEditRequest.TemplateId)) + { + throw new ApiException(422, ApiValidationMessages.EmbeddedTemplateIdNull); + } + + const string localVarPath = "/v1/template/getEmbeddedTemplateEditUrl"; + var localVarFileParams = new Dictionary>(); + var localVarFileUrlParams = new Dictionary(); + this.PrepareEmbeddedTemplateEdit( + embeddedTemplateEditRequest, + out var localVarQueryParams, + out var localVarHeaderParams, + out var localVarFormParams, + out var localVarHttpContentType); + + // make the HTTP request + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync( + localVarPath, + HttpMethod.Post, + localVarQueryParams, + null, + localVarHeaderParams, + localVarFormParams, + localVarFileParams, + localVarHttpContentType, + localVarFileUrlParams) + .ConfigureAwait(false); + + var localVarStatusCode = (int)localVarResponse.StatusCode; + + var exception = this.ExceptionFactory?.Invoke("getEmbeddedTemplateEditUrl", localVarResponse); + + if (exception != null) + { + throw exception; + } + + return new ApiResponse( + localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + (EmbeddedTemplateEdited)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(EmbeddedTemplateEdited))); + } + + /// + public TemplateCreated CreateTemplate(CreateTemplateRequest createTemplate) + { + var localVarResponse = this.CreateTemplateWithHttpInfo(createTemplate); + + return localVarResponse.Data; + } + + /// + public ApiResponse CreateTemplateWithHttpInfo(CreateTemplateRequest createTemplate) + { + if (createTemplate == null) + { + throw new ArgumentNullException(nameof(createTemplate)); + } + + ValidateCreateTemplateProperties(createTemplate); + + const string localVarPath = "/v1/template/create"; + this.PrepareCreateTemplate( + createTemplate, + out var localVarQueryParams, + out var localVarHeaderParams, + out var localVarFormParams, + out var localVarFileParams, + out var localVarFileUrlParams, + out var localVarPostBody, + out var localVarHttpContentType); + + // make the HTTP request + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); + + var localVarStatusCode = (int)localVarResponse.StatusCode; + + var exception = this.ExceptionFactory?.Invoke("CreateTemplate", localVarResponse); + + if (exception != null) + { + throw exception; + } + + return new ApiResponse( + localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + (TemplateCreated)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(TemplateCreated))); + } + + /// + public async Task CreateTemplateAsync(CreateTemplateRequest createTemplate) + { + var localVarResponse = await this.CreateTemplateWithHttpInfoAsync(createTemplate).ConfigureAwait(false); + + return localVarResponse.Data; + } + + /// + public async Task> CreateTemplateWithHttpInfoAsync(CreateTemplateRequest createTemplate) + { + if (createTemplate == null) + { + throw new ArgumentNullException(nameof(createTemplate)); + } + + ValidateCreateTemplateProperties(createTemplate); const string localVarPath = "/v1/template/create"; - var localVarPathParams = this.PrepareCreateTemplate( + this.PrepareCreateTemplate( createTemplate, out var localVarQueryParams, out var localVarHeaderParams, @@ -983,7 +1372,7 @@ public async Task> CreateTemplateWithHttpInfoAsync( out var localVarHttpContentType); // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -996,7 +1385,7 @@ public async Task> CreateTemplateWithHttpInfoAsync( return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (TemplateCreated)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(TemplateCreated))); } @@ -1020,7 +1409,7 @@ public ApiResponse CreateEmbeddedTemplateUrlWithHttpInf const string localVarPath = "/v1/template/createEmbeddedTemplateUrl"; - var localVarPathParams = this.PrepareCreateTemplate( + this.PrepareCreateTemplate( createTemplate, out var localVarQueryParams, out var localVarHeaderParams, @@ -1031,15 +1420,14 @@ public ApiResponse CreateEmbeddedTemplateUrlWithHttpInf out var localVarHttpContentType); // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi( + using var localVarResponse = this.Configuration.ApiClient.CallApi( localVarPath, - Method.POST, + HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams); @@ -1054,7 +1442,7 @@ public ApiResponse CreateEmbeddedTemplateUrlWithHttpInf return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (EmbeddedTemplateCreated)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(EmbeddedTemplateCreated))); } @@ -1078,7 +1466,7 @@ public async Task> CreateEmbeddedTemplateUr const string localVarPath = "/v1/template/createEmbeddedTemplateUrl"; - var localVarPathParams = this.PrepareCreateTemplate( + this.PrepareCreateTemplate( createRequest, out var localVarQueryParams, out var localVarHeaderParams, @@ -1089,15 +1477,14 @@ public async Task> CreateEmbeddedTemplateUr out var localVarHttpContentType); // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync( + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync( localVarPath, - Method.POST, + HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType, localVarFileUrlParams) .ConfigureAwait(false); @@ -1113,7 +1500,7 @@ public async Task> CreateEmbeddedTemplateUr return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (EmbeddedTemplateCreated)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(EmbeddedTemplateCreated))); } @@ -1122,10 +1509,11 @@ public async Task> CreateEmbeddedTemplateUr /// /// Thrown when fails to make API call. /// Template Id. + /// The on behalf of email. /// System.IO.Stream. - public Stream DownloadTemplate(string templateId) + public Stream DownloadTemplate(string templateId, string onBehalfOf = default) { - var localVarResponse = this.DownloadTemplateWithHttpInfo(templateId); + var localVarResponse = this.DownloadTemplateWithHttpInfo(templateId, onBehalfOf); return localVarResponse.Data; } @@ -1135,8 +1523,9 @@ public Stream DownloadTemplate(string templateId) /// /// Thrown when fails to make API call. /// Template Id. + /// The on behalf of email. /// ApiResponse of System.IO.Stream. - public ApiResponse DownloadTemplateWithHttpInfo(string templateId) + public ApiResponse DownloadTemplateWithHttpInfo(string templateId, string onBehalfOf = default) { // verify the required parameter 'templateId' is set if (templateId == null) @@ -1145,7 +1534,6 @@ public ApiResponse DownloadTemplateWithHttpInfo(string templateId) } var localVarPath = "/v1/template/download"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -1186,6 +1574,11 @@ public ApiResponse DownloadTemplateWithHttpInfo(string templateId) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "templateId", templateId)); // query parameter + if (!string.IsNullOrEmpty(onBehalfOf)) + { + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "onBehalfOf", onBehalfOf)); // query parameter + } + // authentication (Bearer) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) { @@ -1193,7 +1586,7 @@ public ApiResponse DownloadTemplateWithHttpInfo(string templateId) } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1206,7 +1599,7 @@ public ApiResponse DownloadTemplateWithHttpInfo(string templateId) return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (Stream)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Stream))); } @@ -1215,10 +1608,11 @@ public ApiResponse DownloadTemplateWithHttpInfo(string templateId) /// /// Thrown when fails to make API call. /// Template Id. + /// The on behalf of email. /// Task of System.IO.Stream. - public async Task DownloadTemplateAsync(string templateId) + public async Task DownloadTemplateAsync(string templateId, string onBehalfOf = default) { - var localVarResponse = await this.DownloadTemplateAsyncWithHttpInfo(templateId).ConfigureAwait(false); + var localVarResponse = await this.DownloadTemplateAsyncWithHttpInfo(templateId, onBehalfOf).ConfigureAwait(false); return localVarResponse.Data; } @@ -1228,8 +1622,9 @@ public async Task DownloadTemplateAsync(string templateId) /// /// Thrown when fails to make API call. /// Template Id. + /// The on behalf of email. /// Task of ApiResponse (System.IO.Stream). - public async Task> DownloadTemplateAsyncWithHttpInfo(string templateId) + public async Task> DownloadTemplateAsyncWithHttpInfo(string templateId, string onBehalfOf = default) { // verify the required parameter 'templateId' is set if (templateId == null) @@ -1238,7 +1633,6 @@ public async Task> DownloadTemplateAsyncWithHttpInfo(string } var localVarPath = "/v1/template/download"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -1279,6 +1673,11 @@ public async Task> DownloadTemplateAsyncWithHttpInfo(string localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "templateId", templateId)); // query parameter + if (!string.IsNullOrEmpty(onBehalfOf)) + { + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "onBehalfOf", onBehalfOf)); // query parameter + } + // authentication (Bearer) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) { @@ -1286,7 +1685,7 @@ public async Task> DownloadTemplateAsyncWithHttpInfo(string } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1299,7 +1698,7 @@ public async Task> DownloadTemplateAsyncWithHttpInfo(string return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (Stream)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Stream))); } @@ -1331,7 +1730,6 @@ public ApiResponse GetPropertiesWithHttpInfo(string template } var localVarPath = "/v1/template/properties"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -1364,7 +1762,7 @@ public ApiResponse GetPropertiesWithHttpInfo(string template } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1377,7 +1775,7 @@ public ApiResponse GetPropertiesWithHttpInfo(string template return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (TemplateProperties)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(TemplateProperties))); } @@ -1409,7 +1807,6 @@ public async Task> GetPropertiesAsyncWithHttpInf } var localVarPath = "/v1/template/properties"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -1442,7 +1839,7 @@ public async Task> GetPropertiesAsyncWithHttpInf } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1455,154 +1852,163 @@ public async Task> GetPropertiesAsyncWithHttpInf return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (TemplateProperties)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(TemplateProperties))); } - /// - public EmbeddedTemplateEdited GetEmbeddedTemplateEditUrl(EmbeddedTemplateEditRequest embedTemplateEdit) + /// + /// Delete the document when a particular document’s ID is given as input. + /// + /// Thrown when fails to make API call. + /// contains DocumentId and Label Parameter. + public void AddTag(TemplateTag addTags) { - var localVarResponse = this.GetEmbeddedTemplateEditUrlWithHttpInfo(embedTemplateEdit); - - return localVarResponse.Data; + this.AddTagWithHttpInfo(addTags); } - /// - public ApiResponse GetEmbeddedTemplateEditUrlWithHttpInfo(EmbeddedTemplateEditRequest embedTemplateEdit) + /// + /// Adding the document's Label when a particular document’s ID and Tag Name is given as input. + /// + /// Thrown when fails to make API call. + /// contains DocumentId and Label Parameter. + /// ApiResponse of Object(void). + public ApiResponse AddTagWithHttpInfo(TemplateTag addTags) { - if (embedTemplateEdit == null) - { - throw new ArgumentNullException(nameof(embedTemplateEdit)); - } - - // verify the required parameter 'templateId' is set - if (string.IsNullOrEmpty(embedTemplateEdit.TemplateId)) + if (addTags == null) { - throw new ApiException(422, ApiValidationMessages.EmbeddedTemplateIdNull); + throw new ArgumentNullException(nameof(addTags)); } - const string localVarPath = "/v1/template/getEmbeddedTemplateEditUrl"; + ValidationForAddDeleteTags(addTags.TemplateId, addTags.TemplateLabels, addTags.DocumentLabels); + var localVarPath = "v1/template/addTags"; + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary>(); var localVarFileUrlParams = new Dictionary(); - var localVarPathParams = this.PrepareEmbeddedTemplateEdit( - embedTemplateEdit, - out var localVarQueryParams, - out var localVarHeaderParams, - out var localVarFormParams, - out var localVarHttpContentType); - - // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi( - localVarPath, - Method.POST, - localVarQueryParams, - null, - localVarHeaderParams, - localVarFormParams, - localVarFileParams, - localVarPathParams, - localVarHttpContentType, - localVarFileUrlParams); + object localVarPostBody = null; - var localVarStatusCode = (int)localVarResponse.StatusCode; + // to determine the Content-Type header + var localVarHttpContentTypes = Enumerable.Empty().ToArray(); + var localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - var exception = this.ExceptionFactory?.Invoke("getEmbeddedTemplateEditUrl", localVarResponse); + // to determine the Accept header + var localVarHttpHeaderAccepts = new[] + { + "application/json;odata.metadata=minimal;odata.streaming=true", + "application/json;odata.metadata=minimal;odata.streaming=false", + "application/json;odata.metadata=minimal", + "application/json;odata.metadata=full;odata.streaming=true", + "application/json;odata.metadata=full;odata.streaming=false", + "application/json;odata.metadata=full", + "application/json;odata.metadata=none;odata.streaming=true", + "application/json;odata.metadata=none;odata.streaming=false", + "application/json;odata.metadata=none", + "application/json;odata.streaming=true", + "application/json;odata.streaming=false", + "application/json", + "application/xml", + "application/prs.odatatestxx-odata", + "text/plain", + "text/json", + }; + var localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (exception != null) + if (localVarHttpHeaderAccept != null) { - throw exception; + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } - return new ApiResponse( - localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (EmbeddedTemplateEdited)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(EmbeddedTemplateEdited))); - } - - /// - public async Task GetEmbeddedTemplateEditUrlAsync(EmbeddedTemplateEditRequest embeddedTemplateEditRequest) - { - var localVarResponse = await this.GetEmbeddedTemplateEditUrlWithHttpInfoAsync(embeddedTemplateEditRequest).ConfigureAwait(false); - - return localVarResponse.Data; - } - - /// - public async Task> GetEmbeddedTemplateEditUrlWithHttpInfoAsync(EmbeddedTemplateEditRequest embeddedTemplateEditRequest) - { - if (embeddedTemplateEditRequest == null) + if (addTags.GetType() != typeof(byte[])) { - throw new ArgumentNullException(nameof(embeddedTemplateEditRequest)); + localVarPostBody = this.Configuration.ApiClient.Serialize(addTags); // http body (model) parameter } - - // verify the required parameter 'templateId' is set - if (string.IsNullOrEmpty(embeddedTemplateEditRequest.TemplateId)) + else { - throw new ApiException(422, ApiValidationMessages.EmbeddedTemplateIdNull); + localVarPostBody = addTags; // byte array } - const string localVarPath = "/v1/template/getEmbeddedTemplateEditUrl"; - var localVarFileParams = new Dictionary>(); - var localVarFileUrlParams = new Dictionary(); - var localVarPathParams = this.PrepareEmbeddedTemplateEdit( - embeddedTemplateEditRequest, - out var localVarQueryParams, - out var localVarHeaderParams, - out var localVarFormParams, - out var localVarHttpContentType); + // authentication (Bearer) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); + } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync( - localVarPath, - Method.POST, - localVarQueryParams, - null, - localVarHeaderParams, - localVarFormParams, - localVarFileParams, - localVarPathParams, - localVarHttpContentType, - localVarFileUrlParams) - .ConfigureAwait(false); + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, PatchHttpMethod, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; - var exception = this.ExceptionFactory?.Invoke("getEmbeddedTemplateEditUrl", localVarResponse); + var exception = this.ExceptionFactory?.Invoke("AddTag", localVarResponse); if (exception != null) { throw exception; } - return new ApiResponse( + return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (EmbeddedTemplateEdited)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(EmbeddedTemplateEdited))); + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + null); } - private Dictionary PrepareEmbeddedTemplateEdit( - EmbeddedTemplateEditRequest embeddedEditTemplate, - out List> localVarQueryParams, - out Dictionary localVarHeaderParams, - out Dictionary localVarFormParams, - out string localVarHttpContentType) + /// + /// Add the Tag to the document when a particular document’s ID and TagNames are given as input. + /// + /// Thrown when fails to make API call. + /// contains DocumentId and Label Parameter. + /// Task of void. + public async Task AddTagAsync(TemplateTag addTags) { - var localVarPathParams = new Dictionary(); - localVarQueryParams = new List>(); - localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - localVarFormParams = new Dictionary(); + await this.AddTagAsyncWithHttpInfo(addTags).ConfigureAwait(false); + } - // to determine the Content-Type header - var localVarHttpContentTypes = new[] + /// + /// Adding the document's Label when a particular document’s ID and Tag Name is given as input. + /// + /// Thrown when fails to make API call. + /// contains DocumentId and Label Parameter. + /// ApiResponse of Object(void). + public Task> AddTagAsyncWithHttpInfo(TemplateTag addTags) + { + // verify the required parameter 'addDeleteTag' is set + if (addTags == null) { - "multipart/form-data", - }; - localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + throw new ArgumentNullException(nameof(addTags)); + } + + ValidationForAddDeleteTags(addTags.TemplateId, addTags.TemplateLabels, addTags.DocumentLabels); + var localVarPath = "/v1/template/addTags"; + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary>(); + var localVarFileUrlParams = new Dictionary(); + object localVarPostBody = null; + + // to determine the Content-Type header + var localVarHttpContentTypes = Enumerable.Empty().ToArray(); + var localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header var localVarHttpHeaderAccepts = new[] { + "application/json;odata.metadata=minimal;odata.streaming=true", + "application/json;odata.metadata=minimal;odata.streaming=false", + "application/json;odata.metadata=minimal", + "application/json;odata.metadata=full;odata.streaming=true", + "application/json;odata.metadata=full;odata.streaming=false", + "application/json;odata.metadata=full", + "application/json;odata.metadata=none;odata.streaming=true", + "application/json;odata.metadata=none;odata.streaming=false", + "application/json;odata.metadata=none", + "application/json;odata.streaming=true", + "application/json;odata.streaming=false", "application/json", + "application/xml", + "application/prs.odatatestxx-odata", + "text/plain", + "text/json", }; var localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1611,27 +2017,207 @@ private Dictionary PrepareEmbeddedTemplateEdit( localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } - if (embeddedEditTemplate is EmbeddedTemplateEditRequest embeddedRequest) + if (addTags.GetType() != typeof(byte[])) { - localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "TemplateId", embeddedRequest.TemplateId)); // query parameter - if (embeddedRequest.RedirectUrl != null) - { - localVarFormParams.Add(nameof(embeddedRequest.RedirectUrl), embeddedRequest.RedirectUrl.ToString()); - } + localVarPostBody = this.Configuration.ApiClient.Serialize(addTags); // http body (model) parameter + } + else + { + localVarPostBody = addTags; // byte array + } - localVarFormParams.Add(nameof(embeddedRequest.ShowToolbar), embeddedRequest.ShowToolbar ? "true" : "false"); - localVarFormParams.Add(nameof(embeddedRequest.ShowSaveButton), embeddedRequest.ShowSaveButton ? "true" : "false"); - localVarFormParams.Add(nameof(embeddedRequest.ShowCreateButton), embeddedRequest.ShowCreateButton ? "true" : "false"); - localVarFormParams.Add(nameof(embeddedRequest.ShowPreviewButton), embeddedRequest.ShowPreviewButton ? "true" : "false"); - localVarFormParams.Add(nameof(embeddedRequest.ShowNavigationButtons), embeddedRequest.ShowNavigationButtons ? "true" : "false"); - localVarFormParams.Add(nameof(embeddedRequest.ViewOption), embeddedRequest.ViewOption.ToString()); - localVarFormParams.Add(nameof(embeddedRequest.Locale), embeddedRequest.Locale.ToString()); - localVarFormParams.Add(nameof(embeddedRequest.ShowTooltip), embeddedRequest.ShowTooltip ? "true" : "false"); + // authentication (Bearer) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); + } - if (embeddedRequest.LinkValidTill.HasValue) - { - localVarFormParams.Add(nameof(embeddedRequest.LinkValidTill), embeddedRequest.LinkValidTill.ToString()); - } + // make the HTTP request + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, PatchHttpMethod, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); + + var localVarStatusCode = (int)localVarResponse.StatusCode; + + var exception = this.ExceptionFactory?.Invoke("AddTag", localVarResponse); + + if (exception != null) + { + throw exception; + } + + return Task.FromResult(new ApiResponse( + localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + null)); + } + + /// + /// Delete the document's Tag when a particular document’s ID and Tags Names is given as input. + /// + /// Thrown when fails to make API call. + /// contains DocumentId and Label Parameter. + public void DeleteTag(TemplateTag deleteTags) + { + this.DeleteTagWithHttpInfo(deleteTags); + } + + /// + /// Delete the document when a particular document’s ID is given as input. + /// + /// Thrown when fails to make API call. + /// contains DocumentId and Label Parameter. + /// ApiResponse of Object(void). + public ApiResponse DeleteTagWithHttpInfo(TemplateTag deleteTags) + { + // verify the required parameter 'documentId' is set + if (deleteTags == null) + { + throw new ArgumentNullException(nameof(deleteTags)); + } + + ValidationForAddDeleteTags(deleteTags.TemplateId, deleteTags.TemplateLabels, deleteTags.DocumentLabels); + var localVarPath = "/v1/template/deleteTags"; + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary>(); + var localVarFileUrlParams = new Dictionary(); + object localVarPostBody; + + // to determine the Content-Type header + var localVarHttpContentTypes = Enumerable.Empty().ToArray(); + var localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new[] + { + "application/json;odata.metadata=minimal;odata.streaming=true", + "application/json;odata.metadata=minimal;odata.streaming=false", + "application/json;odata.metadata=minimal", + "application/json;odata.metadata=full;odata.streaming=true", + "application/json;odata.metadata=full;odata.streaming=false", + "application/json;odata.metadata=full", + "application/json;odata.metadata=none;odata.streaming=true", + "application/json;odata.metadata=none;odata.streaming=false", + "application/json;odata.metadata=none", + "application/json;odata.streaming=true", + "application/json;odata.streaming=false", + "application/json", + "application/xml", + "application/prs.odatatestxx-odata", + "text/plain", + "text/json", + }; + var localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + + if (localVarHttpHeaderAccept != null) + { + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + } + + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); + } + + if (deleteTags.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(deleteTags); // http body (model) parameter + } + else + { + localVarPostBody = deleteTags; // byte array + } + + // make the HTTP request + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); + + var localVarStatusCode = (int)localVarResponse.StatusCode; + + var exception = this.ExceptionFactory?.Invoke("DeleteTag", localVarResponse); + + if (exception != null) + { + throw exception; + } + + return new ApiResponse( + localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + null); + } + + /// + /// Delete the document when a particular document’s ID is given as input. + /// + /// Thrown when fails to make API call. + /// contains DocumentId and Label Parameter. + /// ApiResponse of Object(void). + public async Task DeleteTagAsync(TemplateTag deleteTags) + { + await this.DeleteTagAsyncWithHttpInfo(deleteTags).ConfigureAwait(false); + } + + /// + /// Adding the document's Label when a particular document’s ID and Tag Name is given as input. + /// + /// Thrown when fails to make API call. + /// contains DocumentId and Label Parameter. + /// ApiResponse of Object(void). + public Task> DeleteTagAsyncWithHttpInfo(TemplateTag deleteTags) + { + // verify the required parameter 'addDeleteTag' is set + if (deleteTags == null) + { + throw new ArgumentNullException(nameof(deleteTags)); + } + + ValidationForAddDeleteTags(deleteTags.TemplateId, deleteTags.TemplateLabels, deleteTags.DocumentLabels); + var localVarPath = "/v1/template/deleteTags"; + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary>(); + var localVarFileUrlParams = new Dictionary(); + object localVarPostBody = null; + + // to determine the Content-Type header + var localVarHttpContentTypes = Enumerable.Empty().ToArray(); + var localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new[] + { + "application/json;odata.metadata=minimal;odata.streaming=true", + "application/json;odata.metadata=minimal;odata.streaming=false", + "application/json;odata.metadata=minimal", + "application/json;odata.metadata=full;odata.streaming=true", + "application/json;odata.metadata=full;odata.streaming=false", + "application/json;odata.metadata=full", + "application/json;odata.metadata=none;odata.streaming=true", + "application/json;odata.metadata=none;odata.streaming=false", + "application/json;odata.metadata=none", + "application/json;odata.streaming=true", + "application/json;odata.streaming=false", + "application/json", + "application/xml", + "application/prs.odatatestxx-odata", + "text/plain", + "text/json", + }; + var localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + + if (localVarHttpHeaderAccept != null) + { + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + } + + if (deleteTags.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(deleteTags); // http body (model) parameter + } + else + { + localVarPostBody = deleteTags; // byte array } // authentication (Bearer) required @@ -1640,36 +2226,191 @@ private Dictionary PrepareEmbeddedTemplateEdit( localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); } - return localVarPathParams; + // make the HTTP request + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); + + var localVarStatusCode = (int)localVarResponse.StatusCode; + + var exception = this.ExceptionFactory?.Invoke("deleteTag", localVarResponse); + + if (exception != null) + { + throw exception; + } + + return Task.FromResult(new ApiResponse( + localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + null)); } - private Dictionary PrepareCreateTemplate( - CreateTemplateRequest createTemplate, - out List> localVarQueryParams, - out Dictionary localVarHeaderParams, - out Dictionary localVarFormParams, - out Dictionary> localVarFileParams, - out Dictionary localVarFileUrlParams, - out object localVarPostBody, - out string localVarHttpContentType) + /// + /// Send document using multiple templates. + /// + /// Thrown when fails to make API call. + /// The merge and send details for sign. + /// DocumentCreated. + public DocumentCreated MergeAndSend(MergeAndSendForSign mergeAndSendForSign = default) + { + var localVarResponse = this.MergeAndSendWithHttpInfo(mergeAndSendForSign); + + return localVarResponse.Data; + } + + /// + /// Send document using multiple templates. + /// + /// Thrown when fails to make API call. + /// The merge and send details for sign. + /// ApiResponse of DocumentCreated. + public ApiResponse MergeAndSendWithHttpInfo(MergeAndSendForSign mergeAndSendForSign = default) + { + if (mergeAndSendForSign == null) + { + throw new ArgumentNullException(nameof(mergeAndSendForSign)); + } + + ValidateTitleAndMessage(mergeAndSendForSign.Title, mergeAndSendForSign.Message, mergeAndSendForSign.BrandId); + + ValidateExpiryDateType(mergeAndSendForSign.ExpiryDateType, mergeAndSendForSign.ExpiryValue); + + var localVarPath = "/v1/template/mergeAndSend"; + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary>(); + var localVarFileUrlParams = new Dictionary(); + var localVarQueryParams = new List>(); + object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarHttpContentTypes = + { + "application/json;odata.metadata=minimal;odata.streaming=true", + "application/json;odata.metadata=minimal;odata.streaming=false", + "application/json;odata.metadata=minimal", + "application/json;odata.metadata=full;odata.streaming=true", + "application/json;odata.metadata=full;odata.streaming=false", + "application/json;odata.metadata=full", + "application/json;odata.metadata=none;odata.streaming=true", + "application/json;odata.metadata=none;odata.streaming=false", + "application/json;odata.metadata=none", + "application/json;odata.streaming=true", + "application/json;odata.streaming=false", + "application/json", + "application/xml", + "application/prs.odatatestxx-odata", + "text/json", + "application/_*+json", + }; + var localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + string[] localVarHttpHeaderAccepts = + { + "application/json", + }; + var localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + + if (localVarHttpHeaderAccept != null) + { + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + } + + if (mergeAndSendForSign.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(mergeAndSendForSign); // http body (model) parameter + } + else + { + localVarPostBody = mergeAndSendForSign; // byte array + } + + // authentication (Bearer) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); + } + + // make the HTTP request + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); + + var localVarStatusCode = (int)localVarResponse.StatusCode; + + var exception = this.ExceptionFactory?.Invoke("MergeTemplate", localVarResponse); + + if (exception != null) + { + throw exception; + } + + return new ApiResponse( + localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + (DocumentCreated)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(DocumentCreated))); + } + + /// + /// Send a document for signature using a Template ids. + /// + /// Thrown when fails to make API call. + /// The merge and send for sign details. (optional). + /// DocumentCreated. + public async Task MergeAndSendAsync(MergeAndSendForSign mergeAndSendForSign = default) + { + var localVarResponse = await this.MergeAndSendAsyncWithHttpInfo(mergeAndSendForSign).ConfigureAwait(false); + + return localVarResponse.Data; + } + + /// + /// Send a document for signature using a Template. + /// + /// Thrown when fails to make API call. + /// The merge and send for sign details. (optional). + /// ApiResponse of DocumentCreated. + public async Task> MergeAndSendAsyncWithHttpInfo(MergeAndSendForSign mergeAndSendForSign = default) { - var localVarPathParams = new Dictionary(); - localVarQueryParams = new List>(); - localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - localVarFormParams = new Dictionary(); - localVarFileParams = new Dictionary>(); - localVarFileUrlParams = new Dictionary(); - localVarPostBody = null; + if (mergeAndSendForSign == null) + { + throw new ArgumentNullException(nameof(mergeAndSendForSign)); + } + + ValidateTitleAndMessage(mergeAndSendForSign.Title, mergeAndSendForSign.Message, mergeAndSendForSign.BrandId); + + ValidateExpiryDateType(mergeAndSendForSign.ExpiryDateType, mergeAndSendForSign.ExpiryValue); + + var localVarPath = "/v1/template/mergeAndSend"; + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary>(); + var localVarFileUrlParams = new Dictionary(); + var localVarQueryParams = new List>(); + object localVarPostBody = null; // to determine the Content-Type header - var localVarHttpContentTypes = new[] + string[] localVarHttpContentTypes = { - "multipart/form-data", + "application/json;odata.metadata=minimal;odata.streaming=true", + "application/json;odata.metadata=minimal;odata.streaming=false", + "application/json;odata.metadata=minimal", + "application/json;odata.metadata=full;odata.streaming=true", + "application/json;odata.metadata=full;odata.streaming=false", + "application/json;odata.metadata=full", + "application/json;odata.metadata=none;odata.streaming=true", + "application/json;odata.metadata=none;odata.streaming=false", + "application/json;odata.metadata=none", + "application/json;odata.streaming=true", + "application/json;odata.streaming=false", + "application/json", + "application/xml", + "application/prs.odatatestxx-odata", + "text/json", + "application/_*+json", }; - localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + var localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header - var localVarHttpHeaderAccepts = new[] + string[] localVarHttpHeaderAccepts = { "application/json", }; @@ -1680,27 +2421,40 @@ private Dictionary PrepareCreateTemplate( localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } - if (createTemplate.Files?.Count > 0) + if (mergeAndSendForSign.GetType() != typeof(byte[])) { - localVarFileParams.Add("Files", createTemplate.Files); + localVarPostBody = this.Configuration.ApiClient.Serialize(mergeAndSendForSign); // http body (model) parameter } - - if (createTemplate.FileUrls?.Count > 0) + else { - localVarFileUrlParams = FromRequestHelper.ToFormParameter(localVarFileUrlParams, createTemplate.FileUrls, nameof(createTemplate.FileUrls)); + localVarPostBody = mergeAndSendForSign; // byte array } - localVarFormParams = FromRequestHelper.ConvertToFormRequestForTemplate(createTemplate, localVarFormParams); - // authentication (Bearer) required if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) { localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); } - return localVarPathParams; + // make the HTTP request + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + + var localVarStatusCode = (int)localVarResponse.StatusCode; + + var exception = this.ExceptionFactory?.Invoke("MergeTemplate", localVarResponse); + + if (exception != null) + { + throw exception; + } + + return new ApiResponse( + localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + (DocumentCreated)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(DocumentCreated))); } - private static void ValidateCreateTemplateProperties(CreateTemplateRequest templateDetails) + + private static void ValidateCreateTemplateProperties(CreateTemplateRequest templateDetails) { DocumentHelper.ValidateFiles(templateDetails); @@ -1724,13 +2478,6 @@ private static void ValidateCreateTemplateProperties(CreateTemplateRequest templ throw new ApiException(422, ApiValidationMessages.TitleOrDocumentInfoIsRequired); } - if (!string.IsNullOrEmpty(templateDetails.DocumentTitle) - && templateDetails.DocumentInfo != null - && templateDetails.DocumentInfo.Any()) - { - throw new ApiException(422, ApiValidationMessages.TitleAndDocumentInfo); - } - if (string.IsNullOrEmpty(templateDetails.Title)) { throw new ApiException(422, ApiValidationMessages.TemplateTitleRequired); @@ -1766,14 +2513,10 @@ private static void ValidateCreateTemplateRoles(CreateTemplateRequest templateDe return; } - if (!(templateDetails is CreateEmbeddedTemplateRequest) && templateDetails.UseTextTags == false) + var reviewerWithAllowConfigureField = roles?.Any(x => x.SignerType == SignerType.Reviewer && x.AllowFieldConfiguration); + if (reviewerWithAllowConfigureField == true) { - var isEmptyFormField = roles?.Any(x => (x.SignerType != SignerType.Reviewer && x.FormFields == null)); - - if (isEmptyFormField == true) - { - throw new ApiException(400, ApiValidationMessages.FormFieldsRequired); - } + throw new ApiException(422, ApiValidationMessages.AllowConfigureFieldsError); } var isReviewerFormField = roles?.Any(x => x.SignerType == SignerType.Reviewer && x.FormFields != null); @@ -1812,26 +2555,44 @@ private static void ValidateCreateTemplateRoles(CreateTemplateRequest templateDe { foreach (var signer in roles) { - if (documentInfo.Any(x => x.Language == signer.Language)) + var isLocaleExist = documentInfo.Any(y => + y.Locale == signer.Locale || + (y.Locale == Locales.Default && signer.Locale == Locales.EN) || + (y.Locale == Locales.EN && signer.Locale == Locales.Default)); +#pragma warning disable CS0618 // Type or member is obsolete + if (documentInfo.Any(x => x.Language == signer.Language) && isLocaleExist) { +#pragma warning disable CS0618 // Type or member is obsolete continue; } - var errMsg = string.Format( - CultureInfo.InvariantCulture, - ApiValidationMessages.DocumentInfoMissing, - signer.Language.ToString()); - throw new ApiException(422, errMsg); + string errorMessage = ApiValidationMessages.DocumentInfoLocaleMissing; + string signerLanguage = signer.Locale.ToString(); + + if (signer.Language != Languages.None) + { + errorMessage = ApiValidationMessages.DocumentInfoMissing; + signerLanguage = signer.Language.ToString(); + } + + throw new ApiException(422, string.Format(CultureInfo.InvariantCulture, errorMessage, signerLanguage)); } } - var anyDuplicate = templateDetails.DocumentInfo.GroupBy(x => x.Language).Any(g => g.Count() > 1); + var anyDuplicate = templateDetails.DocumentInfo.Where(x => x.Language != Languages.None).GroupBy(x => x.Language).Any(g => g.Count() > 1); if (anyDuplicate) { throw new ApiException(422, ApiValidationMessages.ExtraLanguageValues); } + var anyDuplicateLocale = templateDetails.DocumentInfo.Where(x => x.Language == Languages.None).GroupBy(x => x.Locale).Any(g => g.Count() > 1); + + if (anyDuplicateLocale) + { + throw new ApiException(422, ApiValidationMessages.ExtraLocaleValues); + } + if (templateDetails.DocumentInfo.Any(x => string.IsNullOrEmpty(x.Title))) { throw new ApiException(422, ApiValidationMessages.DocumentTitleRequired); @@ -1839,31 +2600,43 @@ private static void ValidateCreateTemplateRoles(CreateTemplateRequest templateDe foreach (var documentInfos in templateDetails.DocumentInfo) { - if (roles.Any(y => y.Language == documentInfos.Language)) + var isLocaleExist = roles.Any(y => + y.Locale == documentInfos.Locale || + (y.Locale == Locales.Default && documentInfos.Locale == Locales.EN) || + (y.Locale == Locales.EN && documentInfos.Locale == Locales.Default)); + + if (roles.Any(y => y.Language == documentInfos.Language) && isLocaleExist) { continue; } + string errorMessage = ApiValidationMessages.InvalidLocale; + string signerLanguage = documentInfos.Locale.ToString(); - var errMsg = string.Format( - CultureInfo.InvariantCulture, - ApiValidationMessages.InvalidLanguage, - documentInfos.Language.ToString()); + if (documentInfos.Language != Languages.None) + { + errorMessage = ApiValidationMessages.InvalidLanguage; + signerLanguage = documentInfos.Language.ToString(); + } - throw new ApiException(422, errMsg); + throw new ApiException(422, string.Format(CultureInfo.InvariantCulture, errorMessage, signerLanguage)); } } if (roles != null && templateDetails.DocumentInfo == null - && !string.IsNullOrEmpty(templateDetails.DocumentTitle) - && roles.Any(x => x.Language != Languages.English)) + && !string.IsNullOrEmpty(templateDetails.DocumentTitle)) { - var errMsg = string.Format( - CultureInfo.InvariantCulture, - ApiValidationMessages.DocumentInfoMissing, - roles.First(x => x.Language != Languages.English).Language.ToString()); - - throw new ApiException(422, errMsg); + foreach (var signer in roles) + { + if (signer.Language != Languages.None && signer.Language != Languages.English) + { + throw new ApiException(422, string.Format(CultureInfo.InvariantCulture, ApiValidationMessages.DocumentInfoMissing, signer.Language)); + } + else if (signer.Locale != Locales.EN && signer.Locale != Locales.Default) + { + throw new ApiException(422, string.Format(CultureInfo.InvariantCulture, ApiValidationMessages.DocumentInfoLocaleMissing, signer.Locale)); + } + } } } @@ -1916,5 +2689,200 @@ private static void ValidateExpiryDateTypeValues(SendForSignFromTemplate send) } } } + + private void PrepareCreateTemplate( + CreateTemplateRequest createTemplate, + out List> localVarQueryParams, + out Dictionary localVarHeaderParams, + out Dictionary localVarFormParams, + out Dictionary> localVarFileParams, + out Dictionary localVarFileUrlParams, + out object localVarPostBody, + out string localVarHttpContentType) + { + localVarQueryParams = new List>(); + localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + localVarFormParams = new Dictionary(); + localVarFileParams = new Dictionary>(); + localVarFileUrlParams = new Dictionary(); + localVarPostBody = null; + + // to determine the Content-Type header + var localVarHttpContentTypes = new[] + { + "multipart/form-data", + }; + localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new[] + { + "application/json", + }; + var localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + + if (localVarHttpHeaderAccept != null) + { + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + } + + if (createTemplate.Files?.Count > 0) + { + localVarFileParams.Add("Files", createTemplate.Files); + } + + if (createTemplate.FileUrls?.Count > 0) + { + localVarFileUrlParams = FromRequestHelper.ToFormParameter(localVarFileUrlParams, createTemplate.FileUrls, nameof(createTemplate.FileUrls)); + } + + localVarFormParams = FromRequestHelper.ConvertToFormRequestForTemplate(createTemplate, localVarFormParams); + + // authentication (Bearer) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); + } + } + + private void PrepareEmbeddedTemplateEdit( + EmbeddedTemplateEditRequest embeddedEditTemplate, + out List> localVarQueryParams, + out Dictionary localVarHeaderParams, + out Dictionary localVarFormParams, + out string localVarHttpContentType) + { + localVarQueryParams = new List>(); + localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + localVarFormParams = new Dictionary(); + + // to determine the Content-Type header + var localVarHttpContentTypes = new[] + { + "multipart/form-data", + }; + localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + var localVarHttpHeaderAccepts = new[] + { + "application/json", + }; + var localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + + if (localVarHttpHeaderAccept != null) + { + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + } + + if (embeddedEditTemplate is EmbeddedTemplateEditRequest embeddedRequest) + { + localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs(string.Empty, "TemplateId", embeddedRequest.TemplateId)); // query parameter + if (embeddedRequest.RedirectUrl != null) + { + localVarFormParams.Add(nameof(embeddedRequest.RedirectUrl), embeddedRequest.RedirectUrl.ToString()); + } + + localVarFormParams.Add(nameof(embeddedRequest.ShowToolbar), embeddedRequest.ShowToolbar ? "true" : "false"); + localVarFormParams.Add(nameof(embeddedRequest.ShowSaveButton), embeddedRequest.ShowSaveButton ? "true" : "false"); + localVarFormParams.Add(nameof(embeddedRequest.ShowCreateButton), embeddedRequest.ShowCreateButton ? "true" : "false"); + localVarFormParams.Add(nameof(embeddedRequest.ShowPreviewButton), embeddedRequest.ShowPreviewButton ? "true" : "false"); + localVarFormParams.Add(nameof(embeddedRequest.ShowNavigationButtons), embeddedRequest.ShowNavigationButtons ? "true" : "false"); + localVarFormParams.Add(nameof(embeddedRequest.ViewOption), embeddedRequest.ViewOption.ToString()); + localVarFormParams.Add(nameof(embeddedRequest.Locale), embeddedRequest.Locale.ToString()); + localVarFormParams.Add(nameof(embeddedRequest.ShowTooltip), embeddedRequest.ShowTooltip ? "true" : "false"); + + if (embeddedRequest.LinkValidTill.HasValue) + { + localVarFormParams.Add(nameof(embeddedRequest.LinkValidTill), embeddedRequest.LinkValidTill.ToString()); + } + + if (!string.IsNullOrEmpty(embeddedRequest.OnBehalfOf)) + { + localVarFormParams.Add(nameof(embeddedRequest.OnBehalfOf), embeddedRequest.OnBehalfOf); + } + } + + // authentication (Bearer) required + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); + } + } + + private static void ValidateTitleAndMessage(string title, string message, string brandId) + { + // verify the title length + if (title != null && title.Length > 256) + { + throw new ApiException(422, ApiValidationMessages.TitleLengthExceeds); + } + + // verify the message length + if (message != null && message.Length > 5000) + { + throw new ApiException(422, ApiValidationMessages.MessageLengthExceeds); + } + + if (!string.IsNullOrEmpty(brandId) && !Guid.TryParse(brandId, out _)) + { + throw new ApiException(422, ApiValidationMessages.InvalidBrandId); + } + } + + private static void ValidateExpiryDateType(ExpiryDateType? expiryDateType, long expiryValue) + { + if (expiryDateType == ExpiryDateType.Days) + { + if (expiryValue < 1 || expiryValue > 180) + { + throw new ApiException(422, ApiValidationMessages.ExpiryDaysValOutOfRange); + } + } + else if (expiryDateType == ExpiryDateType.Hours) + { + if (expiryValue < 8 || expiryValue > 4320) + { + throw new ApiException(422, ApiValidationMessages.ExpiryHoursValOutOfRange); + } + } + else if (expiryDateType == ExpiryDateType.SpecificDateTime) + { + DateTime startDate = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); + DateTime expiryDate = startDate.AddSeconds(expiryValue); + var totaldays = (expiryDate - DateTime.UtcNow).TotalDays; + if (totaldays < 1 || totaldays > 180) + { + throw new ApiException(422, ApiValidationMessages.ExpirySpecifcDateOutOfRange); + } + } + } + + private static void ValidationForAddDeleteTags(string templateId, List templateLabels, List documentLabels) + { + // verify the required parameter 'documentId' is not null and in Guid format. + if (string.IsNullOrEmpty(templateId) && Guid.TryParse(templateId.ToString(), out _)) + { + throw new ApiException(400, ApiValidationMessages.TemplateIdRequired); + } + + // verify the required parameter 'labels' is not Empty + if (templateLabels.Any(x => string.IsNullOrEmpty(x)) || documentLabels.Any(x => string.IsNullOrEmpty(x))) + { + throw new ApiException(400, ApiValidationMessages.EmptyLabels); + } + + // verify the required parameter 'labels' is not having more than 255 characters + if (templateLabels.Any(x => x.Length > 255) || documentLabels.Any(x => x.Length > 255)) + { + throw new ApiException(400, ApiValidationMessages.LabelMaxLength); + } + + // verify the required parameter 'labels' is not contains more than 50 tags. + if (templateLabels.Count > 50 || documentLabels.Count > 50) + { + throw new ApiException(400, ApiValidationMessages.MaxTemplateOrDocumentLabelsCount); + } + } } } diff --git a/src/BoldSign/Api/UserClient.cs b/src/BoldSign/Api/UserClient.cs index bfd2f9c..3306118 100644 --- a/src/BoldSign/Api/UserClient.cs +++ b/src/BoldSign/Api/UserClient.cs @@ -12,6 +12,7 @@ * Generated by: https://github.com/openapitools/openapi-generator.git */ + namespace BoldSign.Api { using System; @@ -20,12 +21,12 @@ namespace BoldSign.Api using System.Globalization; using System.IO; using System.Linq; + using System.Net.Http; using System.Text.RegularExpressions; using System.Threading.Tasks; using BoldSign.Api.Resources; using BoldSign.Model; using Newtonsoft.Json; - using RestSharp; /// /// Represents a function to interact with the API endpoints. The function perform action such as getting the Api credit details and so on. @@ -113,7 +114,7 @@ public ExceptionFactory ExceptionFactory /// /// The base path. /// base path. - public string GetBasePath() => this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); + public string GetBasePath() => this.Configuration.ApiClient.HttpClient.BaseAddress.AbsoluteUri; /// /// Invite the user. @@ -144,7 +145,6 @@ public ApiResponse CreateUserWithHttpInfo(List(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -202,7 +202,7 @@ public ApiResponse CreateUserWithHttpInfo(List CreateUserWithHttpInfo(List( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (CreateUserResponse)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateUserResponse))); } @@ -248,7 +248,6 @@ public async Task> CreateUserAsyncWithHttpInfo(L ValidateCreateUserProperties(createUserRequest); var localVarPath = "/v1/users/create"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -306,7 +305,7 @@ public async Task> CreateUserAsyncWithHttpInfo(L } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -319,7 +318,7 @@ public async Task> CreateUserAsyncWithHttpInfo(L return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (CreateUserResponse)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateUserResponse))); } @@ -340,7 +339,6 @@ public ApiResponse UpdateUserWithHttpInfo(UpdateUser updateUserQuery) ValidateUpdateUserProperties(updateUserQuery); var localVarPath = "/v1/users/update"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -381,7 +379,7 @@ public ApiResponse UpdateUserWithHttpInfo(UpdateUser updateUserQuery) } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -394,7 +392,7 @@ public ApiResponse UpdateUserWithHttpInfo(UpdateUser updateUserQuery) return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -415,7 +413,6 @@ public async Task> UpdateUserAsyncWithHttpInfo(UpdateUser up ValidateUpdateUserProperties(updateUserQuery); var localVarPath = "/v1/users/update"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -456,7 +453,7 @@ public async Task> UpdateUserAsyncWithHttpInfo(UpdateUser up } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -469,7 +466,7 @@ public async Task> UpdateUserAsyncWithHttpInfo(UpdateUser up return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -488,7 +485,6 @@ public ApiResponse ResendInvitationWithHttpInfo(string userId) } var localVarPath = "/v1/users/resendInvitation"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -522,7 +518,7 @@ public ApiResponse ResendInvitationWithHttpInfo(string userId) } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -535,7 +531,7 @@ public ApiResponse ResendInvitationWithHttpInfo(string userId) return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -554,7 +550,6 @@ public async Task> ResendInvitationAsyncWithHttpInfo(string } var localVarPath = "/v1/users/resendInvitation"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -588,7 +583,7 @@ public async Task> ResendInvitationAsyncWithHttpInfo(string } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -601,7 +596,7 @@ public async Task> ResendInvitationAsyncWithHttpInfo(string return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -620,7 +615,6 @@ public ApiResponse CancelInvitationWithHttpInfo(string userId) } var localVarPath = "/v1/users/cancelInvitation"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -654,7 +648,7 @@ public ApiResponse CancelInvitationWithHttpInfo(string userId) } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -667,7 +661,7 @@ public ApiResponse CancelInvitationWithHttpInfo(string userId) return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -686,7 +680,6 @@ public async Task> CancelInvitationAsyncWithHttpInfo(string } var localVarPath = "/v1/users/cancelInvitation"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -720,7 +713,7 @@ public async Task> CancelInvitationAsyncWithHttpInfo(string } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -733,7 +726,7 @@ public async Task> CancelInvitationAsyncWithHttpInfo(string return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -765,7 +758,6 @@ public ApiResponse GetUserDetailsWithHttpInfo(string userId) } var localVarPath = "/v1/users/get"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -798,7 +790,7 @@ public ApiResponse GetUserDetailsWithHttpInfo(string userId) } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -811,7 +803,7 @@ public ApiResponse GetUserDetailsWithHttpInfo(string userId) return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (UserProperties)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(UserProperties))); } @@ -843,7 +835,6 @@ public async Task> GetUserDetailsAsyncWithHttpInfo(s } var localVarPath = "/v1/users/get"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -876,7 +867,7 @@ public async Task> GetUserDetailsAsyncWithHttpInfo(s } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -889,7 +880,7 @@ public async Task> GetUserDetailsAsyncWithHttpInfo(s return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (UserProperties)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(UserProperties))); } @@ -919,7 +910,6 @@ public ApiResponse ListUsersWithHttpInfo(int page, int? pageSize, s { // verify the required parameter 'page' is set var localVarPath = "/v1/users/list"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -962,7 +952,7 @@ public ApiResponse ListUsersWithHttpInfo(int page, int? pageSize, s } // make the HTTP request - var localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams); + using var localVarResponse = this.Configuration.ApiClient.CallApi(localVarPath, HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -975,7 +965,7 @@ public ApiResponse ListUsersWithHttpInfo(int page, int? pageSize, s return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (UserRecords)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(UserRecords))); } @@ -1004,7 +994,6 @@ public async Task> ListUsersAsyncWithHttpInfo(int page, { // verify the required parameter 'page' is set var localVarPath = "/v1/users/list"; - var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); @@ -1047,7 +1036,7 @@ public async Task> ListUsersAsyncWithHttpInfo(int page, } // make the HTTP request - var localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); + using var localVarResponse = await this.Configuration.ApiClient.CallApiAsync(localVarPath, HttpMethod.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarHttpContentType, localVarFileUrlParams).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1060,7 +1049,7 @@ public async Task> ListUsersAsyncWithHttpInfo(int page, return new ApiResponse( localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (UserRecords)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(UserRecords))); } @@ -1153,4 +1142,4 @@ private static void ValidateUpdateUserProperties(UpdateUser updateUserQuery) } } } -} \ No newline at end of file +} diff --git a/src/BoldSign/BoldSign.Api.csproj b/src/BoldSign/BoldSign.Api.csproj index b60f565..9b6dbd3 100644 --- a/src/BoldSign/BoldSign.Api.csproj +++ b/src/BoldSign/BoldSign.Api.csproj @@ -1,9 +1,9 @@ netstandard2.0;net452 - 4.9.5 - 4.9.5 - Copyright 2001-2023 Syncfusion Inc + 1.0.1 + 1.0.1 + Copyright 2001-2024 Syncfusion Inc BoldSign.Api BoldSign.Api latest @@ -12,14 +12,22 @@ BoldSign.Api.xml + + false + true + + - - + + + + + True diff --git a/src/BoldSign/BoldSign.Api.nuspec b/src/BoldSign/BoldSign.Api.nuspec new file mode 100644 index 0000000..af75dfa --- /dev/null +++ b/src/BoldSign/BoldSign.Api.nuspec @@ -0,0 +1,45 @@ + + + + BoldSign.Api + #VERSION# + Syncfusion Inc. + false + MIT + https://licenses.nuget.org/MIT + https://github.com/boldsign/api-csharp-sdk + This client library lets you initiate and track e-signature requests through Syncfusion's BoldSign API service. BoldSign is an e-signature app for getting your documents signed online on any device. + +For more information visit https://boldsign.com/?utm_source=nuget&utm_medium=referral&utm_campaign=boldsign. + +Getting Started: https://developers.boldsign.com/api-overview/getting-started/?utm_source=nuget&utm_medium=referral&utm_campaign=boldsign. + + + https://developers.boldsign.com/release-notes/#RELEASENOTES#/?utm_source=nuget&utm_medium=referral&utm_campaign=boldsign + icon.png + Copyright 2001 - 2024 Syncfusion Inc. + boldsign;syncfusion;e-sign;e-signature;boldsign-sdk;document-workflow;api-client + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/BoldSign/Extensions/HttpRequestExtension.cs b/src/BoldSign/Extensions/HttpRequestExtension.cs new file mode 100644 index 0000000..fc070ae --- /dev/null +++ b/src/BoldSign/Extensions/HttpRequestExtension.cs @@ -0,0 +1,96 @@ +// +// Copyright (c) Syncfusion Inc. All rights reserved. +// + +namespace BoldSign.Api.Extensions +{ + using System; + using System.Globalization; + using System.IO; + using System.Linq; + using System.Net.Http; + using System.Net.Http.Headers; + using System.Text; + using BoldSign.Api; + using BoldSign.Api.Resources; + + /// + /// The http request extension. + /// + public static class HttpRequestExtension + { + /// + /// Adds the form parameter. + /// + /// The value. + /// The key. + /// The content. + public static void AddFormParameter(this MultipartFormDataContent value, string key, string content) + { + if (value is null || string.IsNullOrEmpty(key)) + { + throw new ApiException(415, ApiValidationMessages.UnsupportedMediaType); + } + + if (string.IsNullOrEmpty(content)) + { + return; + } + + value.Add(new StringContent(content), key); + } + + /// + /// Adds the file parameter. + /// + /// The value. + /// The path value. + /// The key. + public static void AddFileParameter(this MultipartFormDataContent value, string content, string key) + { + if (value is null || string.IsNullOrEmpty(key)) + { + throw new ApiException(415, ApiValidationMessages.UnsupportedMediaType); + } + + var fileName = Path.GetFileName(content); + using var fileStream = new FileStream(content, FileMode.Open, FileAccess.Read); + using var memoryStream = new MemoryStream(); + fileStream.CopyTo(memoryStream); + var fileBytes = memoryStream.ToArray(); + + var fileContent = new ByteArrayContent(fileBytes); + fileContent.Headers.ContentDisposition = new ContentDispositionHeaderValue("form-data") + { + Name = key, + FileName = fileName, + }; + value.Add(fileContent); + } + + /// + /// Extracts the byte array. + /// + /// The input stream. + /// The byte array. + public static byte[] ReadAsBytes(this Stream input) + { + if (input is null) + { + throw new ArgumentNullException(nameof(input)); + } + + byte[] buffer = new byte[16384]; + using (MemoryStream memoryStream = new MemoryStream()) + { + int count; + while ((count = input.Read(buffer, 0, buffer.Length)) > 0) + { + memoryStream.Write(buffer, 0, count); + } + + return memoryStream.ToArray(); + } + } + } +} diff --git a/src/BoldSign/Model/AccessCodeDetails.cs b/src/BoldSign/Model/AccessCodeDetails.cs index f94374a..f1fa314 100644 --- a/src/BoldSign/Model/AccessCodeDetails.cs +++ b/src/BoldSign/Model/AccessCodeDetails.cs @@ -29,7 +29,8 @@ public class AccessCodeDetails /// /// Gets or sets the access code. (required). /// The on behalfof email. - public AccessCodeDetails(string accessCode = default, string onBehalfOf = default) + /// Gets or sets the phone number. + public AccessCodeDetails(string accessCode = default, string onBehalfOf = default, PhoneNumber phoneNumber = default) { // to ensure "accessCode" is required (not null) if (accessCode == null) @@ -39,6 +40,7 @@ public AccessCodeDetails(string accessCode = default, string onBehalfOf = defaul this.AccessCode = accessCode; this.OnBehalfOf = onBehalfOf; + this.PhoneNumber = phoneNumber; } /// @@ -54,6 +56,12 @@ public AccessCodeDetails(string accessCode = default, string onBehalfOf = defaul [DataMember(Name = "onBehalfOf", EmitDefaultValue = true)] public string OnBehalfOf { get; set; } + /// + /// Gets or sets the on behalf of email. + /// + [DataMember(Name = "phoneNumber", EmitDefaultValue = true)] + public PhoneNumber PhoneNumber { get; set; } + /// /// Returns the JSON string presentation of the object /// diff --git a/src/BoldSign/Model/AddAuthenticationAccessCodeDetails.cs b/src/BoldSign/Model/AddAuthenticationAccessCodeDetails.cs index f16bbea..e4413a8 100644 --- a/src/BoldSign/Model/AddAuthenticationAccessCodeDetails.cs +++ b/src/BoldSign/Model/AddAuthenticationAccessCodeDetails.cs @@ -34,12 +34,14 @@ public class AddAuthenticationAccessCodeDetails /// Gets or sets the access code. /// Gets or sets the authentication type. /// The on behalf of email. + /// The phone number. public AddAuthenticationAccessCodeDetails( string emailId, int? order, string accessCode = "", AuthenticationType authenticationType = default, - string onBehalfOf = default) + string onBehalfOf = default, + PhoneNumber phoneNumber = default) { // to ensure "accessCode" is required (not null) for AuthenticationType AccessCode. if (string.IsNullOrEmpty(accessCode) && authenticationType == AuthenticationType.AccessCode) @@ -58,6 +60,7 @@ public AddAuthenticationAccessCodeDetails( this.AccessCode = accessCode; this.AuthenticationType = authenticationType; this.OnBehalfOf = onBehalfOf; + this.PhoneNumber = phoneNumber; } /// @@ -94,10 +97,16 @@ public AddAuthenticationAccessCodeDetails( [DataMember(Name = "onBehalfOf", EmitDefaultValue = true)] public string OnBehalfOf { get; set; } + /// + /// Gets or sets the phone number. + /// + [DataMember(Name = "phoneNumber", EmitDefaultValue = true)] + public PhoneNumber PhoneNumber { get; set; } + /// /// Returns the JSON string presentation of the object. /// /// JSON string presentation of the object. public virtual string ToJson() => JsonConvert.SerializeObject(this, Formatting.Indented); } -} \ No newline at end of file +} diff --git a/src/BoldSign/Model/ApiRequest.cs b/src/BoldSign/Model/ApiRequest.cs index 456c6bc..06aee21 100644 --- a/src/BoldSign/Model/ApiRequest.cs +++ b/src/BoldSign/Model/ApiRequest.cs @@ -29,7 +29,6 @@ public class ApiRequest /// The header params. /// The form params. /// The file params. - /// The path params. /// The content type. /// The file url params. public ApiRequest( @@ -39,7 +38,6 @@ public ApiRequest( Dictionary localVarHeaderParams = default, Dictionary localVarFormParams = default, Dictionary> localVarFileParams = default, - Dictionary localVarPathParams = default, string localVarHttpContentType = default, Dictionary localVarFileUrlParams = default) { @@ -49,7 +47,6 @@ public ApiRequest( this.LocalVarHeaderParams = localVarHeaderParams; this.LocalVarFormParams = localVarFormParams; this.LocalVarFileParams = localVarFileParams; - this.LocalVarPathParams = localVarPathParams; this.LocalVarHttpContentType = localVarHttpContentType; this.LocalVarFileUrlParams = localVarFileUrlParams; } @@ -95,12 +92,6 @@ public ApiRequest( [DataMember(Name = "localVarFileParams", EmitDefaultValue = true)] public Dictionary> LocalVarFileParams { get; set; } - /// - /// Gets or sets the path params. - /// - [DataMember(Name = "localVarPathParams", EmitDefaultValue = true)] - public Dictionary LocalVarPathParams { get; set; } - /// /// Gets or sets the content type. /// @@ -119,4 +110,4 @@ public ApiRequest( /// JSON string presentation of the object. public virtual string ToJson() => JsonConvert.SerializeObject(this, Formatting.Indented); } -} \ No newline at end of file +} diff --git a/src/BoldSign/Model/AuditAction.cs b/src/BoldSign/Model/AuditAction.cs index 67de943..cb7d566 100644 --- a/src/BoldSign/Model/AuditAction.cs +++ b/src/BoldSign/Model/AuditAction.cs @@ -241,5 +241,143 @@ public enum AuditAction /// [EnumMember(Value = "AutoReminderOFF")] AutoReminderOFF = 37, + + /// + /// Resume document signing by user. + /// + [EnumMember(Value = "ResumeDocumentSigning")] + ResumeDocumentSigning = 38, + + /// + /// Email otp authentication added. + /// + [EnumMember(Value = "EmailOTPAuthenticationAdded")] + EmailOTPAuthenticationAdded = 39, + + /// + /// Email otp authentication removed. + /// + [EnumMember(Value = "EmailOTPAuthenticationRemoved")] + EmailOTPAuthenticationRemoved = 40, + + /// + /// Email otp verified. + /// + [EnumMember(Value = "EmailOTPVerified")] + EmailOTPVerified = 41, + + /// + /// Email otp authentication failed. + /// + [EnumMember(Value = "EmailOTPAuthenticationFailed")] + EmailOTPAuthenticationFailed = 42, + + /// + /// Email otp resend. + /// + [EnumMember(Value = "EmailOTPResend")] + EmailOTPResend = 43, + + /// + /// Unlock Email OTP by user. + /// + [EnumMember(Value = "UnlockEmailOTP")] + UnlockEmailOTP = 44, + + /// + /// Email authentication added. + /// + [EnumMember(Value = "EmailAuthenticationAdded")] + EmailAuthenticationAdded = 45, + + /// + /// Email authentication removed. + /// + [EnumMember(Value = "EmailAuthenticationRemoved")] + EmailAuthenticationRemoved = 46, + + /// + /// Email otp verify. + /// + [EnumMember(Value = "EmailOtpVerify")] + EmailOtpVerify = 47, + + /// + /// Email authentication failed. + /// + [EnumMember(Value = "EmailAuthenticationFailed")] + EmailAuthenticationFailed = 48, + + /// + /// SMS OTP. + /// + [EnumMember(Value = "SMSOTP")] + SMSOTP = 49, + + /// + /// Phone number changes. + /// + [EnumMember(Value = "PhoneNumberChanged")] + PhoneNumberChanged = 50, + + /// + /// Unlocked sms otp. + /// + [EnumMember(Value = "UnlockedSMSOTP")] + UnlockedSMSOTP = 51, + + /// + /// Sms authentication added. + /// + [EnumMember(Value = "SMSAuthenticationAdded")] + SMSAuthenticationAdded = 52, + + /// + /// Sms authentication removed. + /// + [EnumMember(Value = "SMSAuthenticationRemoved")] + SMSAuthenticationRemoved = 53, + + /// + /// Sms otp verify. + /// + [EnumMember(Value = "SMSOTPVerified")] + SMSOTPVerified = 54, + + /// + /// Sms authentication failed. + /// + [EnumMember(Value = "SMSAuthenticationFailed")] + SMSAuthenticationFailed = 55, + + /// + /// SMS otp resend. + /// + [EnumMember(Value = "SMSOTPResend")] + SMSOTPResend = 56, + + /// + /// Generated Signing Link. + /// + [EnumMember(Value = "GeneratedSigningLink")] + GeneratedSigningLink = 57, + + /// + /// Document Editing Initiated. + /// + [EnumMember(Value = "EditingInitiated")] + EditingInitiated = 58, + + /// + /// Document Editing Cancelled. + /// + [EnumMember(Value = "EditingCancelled")] + EditingCancelled = 59, + + /// + /// Document Editing Completed. + /// + [EnumMember(Value = "EditingCompleted")] + EditingCompleted = 60, } } diff --git a/src/BoldSign/Model/AuthenticationType.cs b/src/BoldSign/Model/AuthenticationType.cs index 14e573d..8cfebd0 100644 --- a/src/BoldSign/Model/AuthenticationType.cs +++ b/src/BoldSign/Model/AuthenticationType.cs @@ -14,6 +14,12 @@ namespace BoldSign.Model [JsonConverter(typeof(StringEnumConverter))] public enum AuthenticationType { + /// + /// Represents None. + /// + [EnumMember(Value = "None")] + None = 0, + /// /// Represents EmailOTP only. /// @@ -25,5 +31,11 @@ public enum AuthenticationType /// [EnumMember(Value = "AccessCode")] AccessCode = 2, + + /// + /// Represents SmsOTP only. + /// + [EnumMember(Value = "SMSOTP")] + SMSOTP = 3, } -} \ No newline at end of file +} diff --git a/src/BoldSign/Model/Brand/IImageFile.cs b/src/BoldSign/Model/Brand/IImageFile.cs new file mode 100644 index 0000000..ab8c4ee --- /dev/null +++ b/src/BoldSign/Model/Brand/IImageFile.cs @@ -0,0 +1,14 @@ +// +// Copyright (c) Syncfusion Inc. All rights reserved. +// + +namespace BoldSign.Model +{ + /// + /// Image File. + /// + public interface IImageFile + { + string ContentType { get; set; } + } +} diff --git a/src/BoldSign/Model/Brand/ImageFileBytes.cs b/src/BoldSign/Model/Brand/ImageFileBytes.cs new file mode 100644 index 0000000..88541b7 --- /dev/null +++ b/src/BoldSign/Model/Brand/ImageFileBytes.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Syncfusion Inc. All rights reserved. +// + +namespace BoldSign.Model +{ + /// + /// The image file bytes. + /// + public class ImageFileBytes : IImageFile + { + /// + /// Gets or sets the file bytes. + /// + public byte[] FileBytes { get; set; } + + /// + /// Gets or sets the content type. + /// + public string ContentType { get; set; } + } +} diff --git a/src/BoldSign/Model/Brand/ImageFilePath.cs b/src/BoldSign/Model/Brand/ImageFilePath.cs new file mode 100644 index 0000000..5dfe273 --- /dev/null +++ b/src/BoldSign/Model/Brand/ImageFilePath.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Syncfusion Inc. All rights reserved. +// + +namespace BoldSign.Model +{ + /// + /// The image file path. + /// + public class ImageFilePath : IImageFile + { + /// + /// Gets or sets the file path. + /// + public string FilePath { get; set; } + + /// + /// Gets or sets the content type. + /// + public string ContentType { get; set; } + } +} diff --git a/src/BoldSign/Model/Brand/ImageFileStream.cs b/src/BoldSign/Model/Brand/ImageFileStream.cs new file mode 100644 index 0000000..595de23 --- /dev/null +++ b/src/BoldSign/Model/Brand/ImageFileStream.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Syncfusion Inc. All rights reserved. +// + +namespace BoldSign.Model +{ + using System.IO; + + /// + /// The image file stream. + /// + public class ImageFileStream : IImageFile + { + /// + /// Gets or sets the file stream. + /// + public Stream FileStream { get; set; } + + /// + /// Gets or sets the content type. + /// + public string ContentType { get; set; } + } +} diff --git a/src/BoldSign/Model/BrandCustomFieldDetails.cs b/src/BoldSign/Model/BrandCustomFieldDetails.cs new file mode 100644 index 0000000..069b478 --- /dev/null +++ b/src/BoldSign/Model/BrandCustomFieldDetails.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Syncfusion Inc. All rights reserved. +// + +/* +* 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; + + /// + /// The custom form field details. + /// + [DataContract] + public class BrandCustomFieldDetails + { + /// + /// Gets or sets the custom form field name. + /// + [DataMember(Name = "fieldName", EmitDefaultValue = true)] + public string FieldName { get; set; } + + /// + /// Gets or sets the custom form field description. + /// + [DataMember(Name = "fieldDescription", EmitDefaultValue = true)] + public string FieldDescription { get; set; } + + /// + /// Gets or sets the custom form field order. + /// + [DataMember(Name = "fieldOrder", EmitDefaultValue = true)] + public int FieldOrder { get; set; } = 1; + + /// + /// Gets or sets the brand id. + /// + [DataMember(Name = "brandId", EmitDefaultValue = true)] + public string BrandId { get; set; } + + /// + /// Gets or sets a value indicating whether its a sharable custom form field. + /// + [DataMember(Name = "sharedField", EmitDefaultValue = true)] + public bool SharedField { get; set; } + + /// + /// Gets or sets the custom form field. + /// + [DataMember(Name = "formField", EmitDefaultValue = true)] + public CustomFormField FormField { get; set; } + } +} diff --git a/src/BoldSign/Model/BrandDetails.cs b/src/BoldSign/Model/BrandDetails.cs new file mode 100644 index 0000000..aad4f54 --- /dev/null +++ b/src/BoldSign/Model/BrandDetails.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Syncfusion Inc. All rights reserved. +// + +/* + * 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 +{ + /// + /// The branding details model. + /// + public class BrandDetails : ViewBrandDetails + { + + } +} diff --git a/src/BoldSign/Model/BrandSettings.cs b/src/BoldSign/Model/BrandSettings.cs index 31a4771..f32c704 100644 --- a/src/BoldSign/Model/BrandSettings.cs +++ b/src/BoldSign/Model/BrandSettings.cs @@ -34,7 +34,7 @@ public class BrandSettings /// Gets or sets the brand logo. /// [DataMember(Name = "brandLogo", EmitDefaultValue = true)] - public IDocumentFile BrandLogo { get; set; } + public IImageFile BrandLogo { get; set; } /// /// Gets or sets the background color. @@ -97,6 +97,12 @@ public class BrandSettings [DataMember(Name = "combineAuditTrail", EmitDefaultValue = true)] public bool CombineAuditTrail { get; set; } + /// + /// Gets or sets a value indicating whether exclude audit trail from email can be enabled or not. + /// + [DataMember(Name = "excludeAuditTrailFromEmail", EmitDefaultValue = true)] + public bool ExcludeAuditTrailFromEmail { get; set; } + /// /// Gets or sets a value indicating delivery of the signed document in email as attachment or link to view and download the document. /// @@ -109,6 +115,36 @@ public class BrandSettings [DataMember(Name = "documentTimeZone", EmitDefaultValue = true)] public string DocumentTimeZone { get; set; } + /// + /// Gets or sets a value indicating whether standard fields can be viewed or not. + /// + [DataMember(Name = "showBuiltInFormFields", EmitDefaultValue = true)] + public bool ShowBuiltInFormFields { get; set; } + + /// + /// Gets or sets a value indicating whether custom fields are allowed to create. + /// + [DataMember(Name = "allowCustomFieldCreation", EmitDefaultValue = true)] + public bool AllowCustomFieldCreation { get; set; } + + /// + /// Gets or sets a value indicating whether shared fields can be viewed or not. + /// + [DataMember(Name = "showSharedCustomFields", EmitDefaultValue = false)] + public bool ShowSharedCustomFields { get; set; } + + /// + /// Gets or sets a value indicating whether to hide decline. + /// + [DataMember(Name = "hideDecline", EmitDefaultValue = true)] + public bool? HideDecline { get; set; } + + /// + /// Gets or sets a value indicating whether to hide save. + /// + [DataMember(Name = "hideSave", EmitDefaultValue = true)] + public bool? HideSave { get; set; } + /// /// Returns the JSON string presentation of the object. /// diff --git a/src/BoldSign/Model/ChangeRecipient.cs b/src/BoldSign/Model/ChangeRecipient.cs index 783b222..b95e4bd 100644 --- a/src/BoldSign/Model/ChangeRecipient.cs +++ b/src/BoldSign/Model/ChangeRecipient.cs @@ -11,6 +11,7 @@ namespace BoldSign.Api.Model using System.Runtime.Serialization; using System.Text; using BoldSign.Api.Resources; + using BoldSign.Model; using Newtonsoft.Json; /// @@ -31,10 +32,12 @@ public class ChangeRecipient /// used to target that particular order with given signer email. (optional). /// /// The on behalfof email. - public ChangeRecipient(string newSignerName, string reason, string oldSignerEmail, string newSignerEmail, int? signerOrder = default, string onBehalfOf = default) + /// The signer phone number. + /// The Old Signer phone number. + public ChangeRecipient(string newSignerName, string reason, string oldSignerEmail, string newSignerEmail, int? signerOrder = default, string onBehalfOf = default, PhoneNumber phoneNumber = default, PhoneNumber oldPhoneNumber = default) { // to ensure "signer name" is required (not null) - if (string.IsNullOrEmpty(newSignerName)) + if (string.IsNullOrEmpty(newSignerName) && phoneNumber == null) { throw new InvalidDataException(ApiValidationMessages.SignerNameRequired); } @@ -50,7 +53,7 @@ public ChangeRecipient(string newSignerName, string reason, string oldSignerEmai this.Reason = reason; // to ensure "oldsignermail" is required (not null) - if (string.IsNullOrEmpty(oldSignerEmail)) + if (string.IsNullOrEmpty(oldSignerEmail) && oldPhoneNumber == null) { throw new InvalidDataException(ApiValidationMessages.OldSignerEmailRequired); } @@ -58,7 +61,7 @@ public ChangeRecipient(string newSignerName, string reason, string oldSignerEmai this.OldSignerEmail = oldSignerEmail; // to ensure "newmailid" is required (not null) - if (string.IsNullOrEmpty(newSignerEmail)) + if (string.IsNullOrEmpty(newSignerEmail) && oldPhoneNumber == null) { throw new InvalidDataException(ApiValidationMessages.NewSignerEmailAddressRequired); } @@ -66,7 +69,7 @@ public ChangeRecipient(string newSignerName, string reason, string oldSignerEmai this.NewSignerEmail = newSignerEmail; // to ensure "oldSignermail"and "newSignermail" are not as same - if (oldSignerEmail.ToUpperInvariant() == newSignerEmail.ToUpperInvariant()) + if (!string.IsNullOrEmpty(oldSignerEmail) && !string.IsNullOrEmpty(newSignerEmail) && oldSignerEmail.ToUpperInvariant() == newSignerEmail.ToUpperInvariant()) { throw new InvalidDataException(ApiValidationMessages.SameSignerEmailNotAllowed); } @@ -79,6 +82,8 @@ public ChangeRecipient(string newSignerName, string reason, string oldSignerEmai this.Order = signerOrder; this.OnBehalfOf = onBehalfOf; + this.PhoneNumber = phoneNumber; + this.OldPhoneNumber = oldPhoneNumber; } /// @@ -126,10 +131,22 @@ public ChangeRecipient(string newSignerName, string reason, string oldSignerEmai [DataMember(Name = "onBehalfOf", EmitDefaultValue = true)] public string OnBehalfOf { get; set; } + /// + /// Gets or sets the signer phone number. + /// + [DataMember(Name = "phoneNumber", EmitDefaultValue = true)] + public PhoneNumber PhoneNumber { get; set; } + + /// + /// Gets or sets the signer phone number. + /// + [DataMember(Name = "oldPhoneNumber", EmitDefaultValue = true)] + public PhoneNumber OldPhoneNumber { get; set; } + /// /// Returns the JSON string presentation of the object. /// /// JSON string presentation of the object. public virtual string ToJson() => JsonConvert.SerializeObject(this, Formatting.Indented); } -} +} \ No newline at end of file diff --git a/src/BoldSign/Model/ContactDetails.cs b/src/BoldSign/Model/ContactDetails.cs new file mode 100644 index 0000000..cc078d5 --- /dev/null +++ b/src/BoldSign/Model/ContactDetails.cs @@ -0,0 +1,58 @@ +// +// Copyright (c) Syncfusion Inc. All rights reserved. +// + +/* + * 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.Runtime.Serialization; + + /// + /// The current page templates view model. + /// + [DataContract] + public class ContactDetails + { + /// + /// Gets or sets the contact id. + /// + [DataMember(Name = "email")] + [Required(ErrorMessage = "Email is required")] + public string Email { get; set; } + + /// + /// Gets or sets the contact id. + /// + [DataMember(Name = "name")] + [Required(ErrorMessage = "Name is required")] + public string Name { get; set; } + + /// + /// Gets or sets the contact id. + /// + [DataMember(Name = "companyName")] + public string CompanyName { get; set; } + + /// + /// Gets or sets the contact id. + /// + [DataMember(Name = "jobTitle")] + public string JobTitle { get; set; } + + /// + /// Gets or sets the contact id. + /// + [DataMember(Name = "phoneNumber")] + public PhoneNumber PhoneNumber { get; set; } + } +} diff --git a/src/BoldSign/Model/ContactPageDetails.cs b/src/BoldSign/Model/ContactPageDetails.cs new file mode 100644 index 0000000..e0dd6f1 --- /dev/null +++ b/src/BoldSign/Model/ContactPageDetails.cs @@ -0,0 +1,57 @@ +// +// Copyright (c) Syncfusion Inc. All rights reserved. +// + +/* + * 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; + + /// + /// The page details properties include page size, total number pages, and so on. + /// + [DataContract] + public class ContactPageDetails + { + /// + /// Initializes a new instance of the class. + /// + /// Gets or sets the page size.. + /// Gets or sets the page.. + public ContactPageDetails(int pageSize = default, int page = default) + { + this.PageSize = pageSize; + this.Page = page; + } + + /// + /// Gets or sets the page size. + /// + /// Gets the value of page size. + [DataMember(Name = "pageSize", EmitDefaultValue = false)] + public int PageSize { get; set; } + + /// + /// Gets or sets the page. + /// + /// Gets the value of page. + [DataMember(Name = "page", EmitDefaultValue = false)] + public int Page { get; set; } + + /// + /// Returns the JSON string presentation of the object. + /// + /// JSON string presentation of the object. + public virtual string ToJson() => JsonConvert.SerializeObject(this, Formatting.Indented); + } +} diff --git a/src/BoldSign/Model/CompletedEmailType.cs b/src/BoldSign/Model/ContactType.cs similarity index 64% rename from src/BoldSign/Model/CompletedEmailType.cs rename to src/BoldSign/Model/ContactType.cs index 92804dc..d832452 100644 --- a/src/BoldSign/Model/CompletedEmailType.cs +++ b/src/BoldSign/Model/ContactType.cs @@ -1,4 +1,4 @@ -// +// // Copyright (c) Syncfusion Inc. All rights reserved. // @@ -19,20 +19,21 @@ namespace BoldSign.Model using Newtonsoft.Json.Converters; /// - /// Represents completed email type. + /// Defines DocumentList as Sent, Received and Both. /// - /// Represents the completed email type. [JsonConverter(typeof(StringEnumConverter))] - public enum CompletedEmailType + public enum ContactType { /// - /// Attachment with link type. + /// Enum for AllContacts /// - AttachmentsWithLink = 1, + [EnumMember(Value = "MyContacts")] + MyContacts, /// - /// Document link in email type. + /// Enum for AllContacts /// - LinkOnly = 2, + [EnumMember(Value = "AllContacts")] + AllContacts, } } diff --git a/src/BoldSign/Model/ContactsDetails.cs b/src/BoldSign/Model/ContactsDetails.cs new file mode 100644 index 0000000..c25b53b --- /dev/null +++ b/src/BoldSign/Model/ContactsDetails.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Syncfusion Inc. All rights reserved. +// + +/* + * 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; + + /// + /// The current page templates view model. + /// + [DataContract] + public class ContactsDetails + { + /// + /// Gets or sets the contact id. + /// + [DataMember(Name = "id")] + public string Id { get; set; } + + /// + /// Gets or sets the contact name. + /// + [DataMember(Name = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the contact email. + /// + [DataMember(Name = "email")] + public string Email { get; set; } + + /// + /// Gets or sets the contact company. + /// + [DataMember(Name = "companyName")] + public string CompanyName { get; set; } + + /// + /// Gets or sets the contact role. + /// + [DataMember(Name = "jobTitle")] + public string JobTitle { get; set; } + + /// + /// Gets or sets the contact phoneNumber. + /// + [DataMember(Name = "phoneNumber")] + public PhoneNumber PhoneNumber { get; set; } + } +} diff --git a/src/BoldSign/Model/ContactsList.cs b/src/BoldSign/Model/ContactsList.cs new file mode 100644 index 0000000..05208b6 --- /dev/null +++ b/src/BoldSign/Model/ContactsList.cs @@ -0,0 +1,58 @@ +// +// Copyright (c) Syncfusion Inc. All rights reserved. +// + +/* + * 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.Collections.Generic; + using System.Runtime.Serialization; + using Newtonsoft.Json; + using BoldSign.Api.Model; + + /// + /// The current page records view model. + /// + [DataContract] + public class ContactsList + { + /// + /// Initializes a new instance of the class. + /// + /// pageDetails. + /// Gets or sets the documents result.. + public ContactsList(ContactPageDetails pageDetails = default, List result = default) + { + this.PageDetails = pageDetails; + this.Result = result; + } + + /// + /// Gets or sets the page details. + /// + [DataMember(Name = "pageDetails", EmitDefaultValue = false)] + public ContactPageDetails PageDetails { get; set; } + + /// + /// Gets or sets the contacts results. + /// + /// Gets or sets the contacts result. + [DataMember(Name = "contactsDetails", EmitDefaultValue = false)] + public List Result { get; set; } + + /// + /// Returns the JSON string presentation of the object. + /// + /// JSON string presentation of the object. + public virtual string ToJson() => JsonConvert.SerializeObject(this, Formatting.Indented); + } +} diff --git a/src/BoldSign/Model/CreateContact.cs b/src/BoldSign/Model/CreateContact.cs new file mode 100644 index 0000000..89f7aa2 --- /dev/null +++ b/src/BoldSign/Model/CreateContact.cs @@ -0,0 +1,27 @@ +// +// Copyright (c) Syncfusion Inc. All rights reserved. +// + +namespace BoldSign.Api.Model +{ + using System.Runtime.Serialization; + + /// + /// The create Contact details. + /// + [DataContract] + public class CreateContact + { + /// + /// Gets or sets the Id. + /// + [DataMember(Name = "id", EmitDefaultValue = true)] + public string Id { get; set; } + + /// + /// Gets or sets the Email. + /// + [DataMember(Name = "email", EmitDefaultValue = true)] + public string Email { get; set; } + } +} diff --git a/src/BoldSign/Model/CreateTemplateRequest.cs b/src/BoldSign/Model/CreateTemplateRequest.cs index 884776c..313bfb5 100644 --- a/src/BoldSign/Model/CreateTemplateRequest.cs +++ b/src/BoldSign/Model/CreateTemplateRequest.cs @@ -73,6 +73,12 @@ public class CreateTemplateRequest : ITextTags, IDocumentUpload [JsonProperty("brandId")] public string BrandId { get; set; } + /// + /// Gets or sets a value indicating whether to allow senders to replace or delete files. + /// + [JsonProperty("allowModifyFiles")] + public bool AllowModifyFiles { get; set; } = true; + /// /// Gets or sets a value indicating whether the allow message editing option is enabled or disabled. /// @@ -85,6 +91,12 @@ public class CreateTemplateRequest : ITextTags, IDocumentUpload [JsonProperty("allowNewRoles")] public bool AllowNewRoles { get; set; } = true; + /// + /// Gets or sets list of allow new files. + /// + [JsonProperty("allowNewFiles")] + public bool AllowNewFiles { get; set; } = true; + /// /// Gets or sets a value indicating whether the enable reassign value option is enabled or disabled. /// @@ -119,5 +131,36 @@ public class CreateTemplateRequest : ITextTags, IDocumentUpload /// [JsonProperty("textTagDefinitions")] public List TextTagDefinitions { get; set; } + + /// + /// Gets or sets a value indicating whether to AutoDetect Fields for the document signer. + /// + [JsonProperty("autoDetectFields")] + public bool AutoDetectFields { get; set; } + + /// + /// Gets or sets the on behalf of email. + /// + [JsonProperty("onBehalfOf")] + public string OnBehalfOf { get; set; } + + /// + /// Gets or sets the document labels. + /// + [JsonProperty("labels")] + public IEnumerable Labels { get; set; } + + /// + /// Gets or sets the template labels. + /// + [JsonProperty("templateLabels")] + public IEnumerable TemplateLabels { get; set; } + + /// + /// Gets or sets the Recipient Notification Settings. + /// + [JsonProperty("recipientNotificationSettings")] + [Display(Description = "Recipient Notification Settings of the Template.")] + public RecipientNotificationSettings RecipientNotificationSettings { get; set; } } } diff --git a/src/BoldSign/Model/CreatedContact.cs b/src/BoldSign/Model/CreatedContact.cs new file mode 100644 index 0000000..5d5e102 --- /dev/null +++ b/src/BoldSign/Model/CreatedContact.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Syncfusion Inc. All rights reserved. +// + +namespace BoldSign.Api.Model +{ + using System.Collections.Generic; + using System.Runtime.Serialization; + + /// + /// The Create Contact Details. + /// + [DataContract] + public class CreatedContact + { + /// + /// Gets or sets the contacts. + /// + /// Gets or sets the contacts response. + [DataMember(Name = "createdContacts", EmitDefaultValue = true)] + public List CreatedContacts { get; set; } + } +} diff --git a/src/BoldSign/Model/CustomFieldCollection.cs b/src/BoldSign/Model/CustomFieldCollection.cs new file mode 100644 index 0000000..27ef923 --- /dev/null +++ b/src/BoldSign/Model/CustomFieldCollection.cs @@ -0,0 +1,32 @@ +// +// Copyright (c) Syncfusion Inc. All rights reserved. +// + +/* +* 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.Collections.Generic; + using System.Runtime.Serialization; + + /// + /// The custom field collection. + /// + [DataContract] + public class CustomFieldCollection + { + /// + /// Gets or sets the custom field collection result. + /// + [DataMember(Name = "result", EmitDefaultValue = true)] + public List Result { get; set; } + } +} diff --git a/src/BoldSign/Model/CustomFieldMessage.cs b/src/BoldSign/Model/CustomFieldMessage.cs new file mode 100644 index 0000000..126b185 --- /dev/null +++ b/src/BoldSign/Model/CustomFieldMessage.cs @@ -0,0 +1,36 @@ +// +// Copyright (c) Syncfusion Inc. All rights reserved. +// + +/* +* 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; + + /// + /// The custom field message view model. + /// + public class CustomFieldMessage + { + /// + /// Gets or sets the custom field message. + /// + [DataMember(Name = "message", EmitDefaultValue = true)] + public string Message { get; set; } + + /// + /// Gets or sets the custom field message. + /// + [DataMember(Name = "customFieldId", EmitDefaultValue = true)] + public string CustomFieldId { get; set; } + } +} diff --git a/src/BoldSign/Model/CustomFormField.cs b/src/BoldSign/Model/CustomFormField.cs new file mode 100644 index 0000000..93255b3 --- /dev/null +++ b/src/BoldSign/Model/CustomFormField.cs @@ -0,0 +1,309 @@ +/* + * BoldSign API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: 1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +namespace BoldSign.Model +{ + using System.Collections.Generic; + using System.Runtime.Serialization; + using Newtonsoft.Json; + using BoldSign.Api.Model; + + /// + /// The document form fields properties include, font, font color, font size and so on. + /// + [DataContract] + public partial class CustomFormField + { + /// + /// Initializes a new instance of the class. + /// + /// Gets or sets the element type.. + /// Gets or sets the element type.. + /// Gets or sets the element type.. + /// Gets or sets a value indicating whether is required.. + /// Gets or sets the character limit.. + /// Gets or sets the line height.. + /// Gets or sets the font size.. + /// Gets or sets the font hex color.. + /// Gets or sets a value indicating whether is Underline font.. + /// Gets or sets a value indicating whether is Italic font.. + /// Gets or sets a value indicating whether isBold font.. + /// Gets or sets the placeHolder value.. + /// Gets or sets the dateFormat value.. + /// Gets or sets the textbox ValidationType value.. + /// Gets or sets the textbox ValidationCustomRegex value.. + /// Gets or sets the textbox ValidationCustomRegexMessage value.. + /// Gets or sets the imageField. + /// Gets or sets the attachmentField. + /// Gets or sets the editableDateFieldSettings. + /// Gets or sets the dropdownOptions. + /// Gets or sets the hyperlinkText. + /// Gets or sets the dataSyncTag. + /// Gets or sets a value indicating whether is read only mode. + /// Gets or sets the textAlign. + /// Gets or sets the direction of the text. + /// Gets or sets the width. + /// Gets or sets the height. + /// Gets or sets the space of the character. + public CustomFormField(FieldType type = default, string value = default, string font = default, bool? isRequired = default(bool?), int characterLimit = default, float? lineHeight = default(float?), float? fontSize = default(float?), string fontHexColor = default(string), bool? isUnderLineFont = default(bool?), bool? isItalicFont = default(bool?), bool? isBoldFont = 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), string dataSyncTag = default(string), List dropdownOptions = default(List), bool? isReadOnly = default(bool?), TextAlign textAlign = TextAlign.Left, TextDirection textDirection = TextDirection.LTR, float? width = default(float?), float? height = default(float?), float characterSpacing = default) + { + this.Type = type; + this.Value = value; + this.Font = font; + this.IsRequired = isRequired; + this.CharacterLimit = characterLimit; + this.LineHeight = lineHeight; + this.FontSize = fontSize; + this.FontHexColor = fontHexColor; + this.IsUnderLineFont = isUnderLineFont; + this.IsItalicFont = isItalicFont; + this.IsBoldFont = isBoldFont; + this.Placeholder = placeholder; + this.DateFormat = dateFormat; + this.ValidationType = validationType; + this.ValidationCustomRegex = validationCustomRegex; + this.ValidationCustomRegexMessage = validationCustomRegexMessage; + this.ImageInfo = imageInfo; + this.AttachmentInfo = attachmentInfo; + this.EditableDateFieldSettings = editableDateFieldSettings; + this.HyperlinkText = hyperlinkText; + this.IsReadOnly = isReadOnly; + this.DataSyncTag = dataSyncTag; + this.DropdownOptions = dropdownOptions; + this.TextAlign = textAlign; + this.TextDirection = textDirection; + this.Width = width; + this.Height = height; + this.CharacterSpacing = characterSpacing; + } + + /// + /// Gets or sets the element type. + /// + /// Gets or sets the element type. + [DataMember(Name = "fieldType", EmitDefaultValue = false)] + public FieldType Type { get; set; } + + /// + /// Gets or sets the element type. + /// + /// Gets or sets the element type. + [DataMember(Name = "value", EmitDefaultValue = false)] + public string Value { get; set; } + + /// + /// Gets or sets the Font type among the three available types courier, helvetica, times new roman. + /// + /// Gets or sets the element type. + [DataMember(Name = "font", EmitDefaultValue = false)] + public string Font { get; set; } + + /// + /// Gets or sets a value indicating whether is required. + /// + /// Gets or sets a value indicating whether is required. + [DataMember(Name = "isRequired", EmitDefaultValue = false)] + public bool? IsRequired { get; set; } + + /// + /// Gets or sets the character limit. + /// + /// Gets or sets the line height. + [DataMember(Name = "characterLimit", EmitDefaultValue = true)] + public int CharacterLimit { get; set; } + + /// + /// Gets or sets a value indicating whether is read only mode. + /// + /// Gets or sets a value indicating whether is read only mode. + [DataMember(Name = "isReadOnly", EmitDefaultValue = false)] + public bool? IsReadOnly { get; set; } + + /// + /// Gets or sets the line height for the content in form fields such as text box. + /// + /// Gets or sets the line height. + [DataMember(Name = "lineHeight", EmitDefaultValue = false)] + public float? LineHeight { get; set; } + + /// + /// Gets or sets the font size. + /// + /// Gets or sets the font size. + [DataMember(Name = "fontSize", EmitDefaultValue = false)] + public float? FontSize { get; set; } + + /// + /// Gets or sets the font color. + /// + /// Gets or sets the font color. + [DataMember(Name = "fontHexColor", EmitDefaultValue = false)] + public string FontHexColor { get; set; } + + /// + /// Gets or sets a value indicating whether isUnderline. + /// + /// Gets or sets a value indicating whether isUnderline. + [DataMember(Name = "isUnderLineFont", EmitDefaultValue = false)] + public bool? IsUnderLineFont { get; set; } + + /// + /// Gets or sets a value indicating whether isItalic. + /// + /// Gets or sets a value indicating whether isItalic. + [DataMember(Name = "isItalicFont", EmitDefaultValue = false)] + public bool? IsItalicFont { get; set; } + + /// + /// Gets or sets a value indicating whether isBold. + /// + /// Gets or sets a value indicating whether isBold. + [DataMember(Name = "isBoldFont", EmitDefaultValue = false)] + public bool? IsBoldFont { get; set; } + + /// + /// Gets or sets the placeHolder value. + /// + /// Gets or sets the element type. + [DataMember(Name = "placeholder", EmitDefaultValue = false)] + public string Placeholder { get; set; } + + /// + /// Gets or sets the DateFormat value. + /// + /// Gets or sets the DateFormat value. + [DataMember(Name = "dateFormat", EmitDefaultValue = false)] + public string DateFormat { get; set; } + + /// + /// Gets or sets the time format value. + /// + /// Gets or sets the value of the time format. + [DataMember(Name = "timeFormat", EmitDefaultValue = false)] + public string TimeFormat { get; set; } + + /// + /// Gets or sets the textbox ValidationType value. + /// + [DataMember(Name = "validationType", EmitDefaultValue = false)] + public ValidationType ValidationType { get; set; } + + /// + /// Gets or sets the text ValidationCustomRegex value. + /// + [DataMember(Name = "validationCustomRegex", EmitDefaultValue = false)] + public string ValidationCustomRegex { get; set; } + + /// + /// Gets or sets the text ValidationCustomRegexMessage value. + /// + [DataMember(Name = "validationCustomRegexMessage", EmitDefaultValue = false)] + public string ValidationCustomRegexMessage { get; set; } + + /// + /// Gets or sets the Image Information. . + /// + [DataMember(Name = "imageInfo", EmitDefaultValue = false)] + public ImageInfo ImageInfo { get; set; } + + /// + /// Gets or sets the Attachment Information. . + /// + [DataMember(Name = "attachmentInfo", EmitDefaultValue = false)] + public AttachmentInfo AttachmentInfo { get; set; } + + /// + /// Gets or sets the EditableDateFieldSettings Information. . + /// + [DataMember(Name = "editableDateFieldSettings", EmitDefaultValue = false)] + public EditableDateFieldSettings EditableDateFieldSettings { get; set; } + + /// + /// Gets or sets the element HyperlinkText. + /// + /// Gets the value of element HyperlinkText. + [DataMember(Name = "hyperlinkText", EmitDefaultValue = false)] + public string HyperlinkText { get; set; } + + /// + /// Gets or sets the data sync tag value, this property helps to group the similar element types and it's only applicable for textbox, image, dropdown, checkbox fields, it won't affect the other fields. + /// + [DataMember(Name = "dataSyncTag", EmitDefaultValue = false)] + public string DataSyncTag { get; set; } + + /// + /// Gets or sets the Dropdown Options. + /// + [DataMember(Name = "dropdownOptions", EmitDefaultValue = false)] + public List DropdownOptions { get; set; } + + /// + /// Gets or sets the textAlign. + /// + [DataMember(Name = "textAlign", EmitDefaultValue = true)] + public TextAlign TextAlign { get; set; } + + /// + /// Gets or sets the direction of the text. + /// + [DataMember(Name = "textDirection", EmitDefaultValue = true)] + public TextDirection TextDirection { get; set; } + + /// + /// Gets or sets the width. + /// + [DataMember(Name = "width", EmitDefaultValue = false)] + + public float? Width { get; set; } + + /// + /// Gets or sets the height. + /// + [DataMember(Name = "height", EmitDefaultValue = false)] + public float? Height { get; set; } + + /// + /// Gets or sets the character spacing. + /// + /// Gets the value of character spacing. + [DataMember(Name = "characterSpacing", EmitDefaultValue = false)] + public float CharacterSpacing { get; set; } + + /// + /// Gets or sets the id format. + /// + [DataMember(Name= "idPrefix", EmitDefaultValue = false)] + public string IdPrefix { get; set; } + + /// + /// Gets or sets a value indicating whether gets or sets the value indicating whether change id format. + /// + [DataMember(Name = "restrictIdPrefixChange", EmitDefaultValue = true)] + public bool RestrictIdPrefixChange { get; set; } + + /// + /// Gets or sets the background hex color. + /// The BackgroundHexColor property allows you to set the background color of a label field using hexadecimal color codes ("#FF5733"). The default color is transparent or no background color. + /// Default value is null. + /// + /// Gets the value of background hex Color. + [DataMember(Name = "backgroundHexColor", EmitDefaultValue = false)] + public string BackgroundHexColor { get; set; } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + } +} diff --git a/src/BoldSign/Model/DateSignedField.cs b/src/BoldSign/Model/DateSignedField.cs index fa0c844..bc2e84c 100644 --- a/src/BoldSign/Model/DateSignedField.cs +++ b/src/BoldSign/Model/DateSignedField.cs @@ -40,10 +40,12 @@ protected DateSignedField() /// Gets or sets a value indicating whether the font style is underline. /// Gets or sets the lineHeight. /// Gets or sets the dateFormat. + /// Gets or sets the timeFormat. [Obsolete("Name is deprecated, please use Id instead")] - public DateSignedField(string name = 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, string dateFormat = default) : base(name: name, type: FieldType.DateSigned, pageNumber: pageNumber,bounds: bounds, isRequired: isRequired, value: value, font: font, fontSize: fontSize, fontHexColor: fontHexColor, isBoldFont: isBoldFont, isItalicFont: isItalicFont, isUnderLineFont: isUnderLineFont, lineHeight: lineHeight) + public DateSignedField(string name = 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, string dateFormat = default, string timeFormat = default) : base(name: name, type: FieldType.DateSigned, pageNumber: pageNumber,bounds: bounds, isRequired: isRequired, value: value, font: font, fontSize: fontSize, fontHexColor: fontHexColor, isBoldFont: isBoldFont, isItalicFont: isItalicFont, isUnderLineFont: isUnderLineFont, lineHeight: lineHeight) { this.DateFormat = dateFormat; + this.TimeFormat = timeFormat; } /// @@ -62,10 +64,12 @@ public DateSignedField(string name = default, int pageNumber = default, Rectangl /// Gets or sets the lineHeight. /// Gets or sets the dateFormat. /// Gets or sets the id. - public DateSignedField(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, string dateFormat = default, string id = default) + /// Gets or sets the timeFormat. + public DateSignedField(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, string dateFormat = default, string id = default, string timeFormat = default) : base(type: FieldType.DateSigned, pageNumber: pageNumber, bounds: bounds, isRequired: isRequired, value: value, font: font, fontSize: fontSize, fontHexColor: fontHexColor, isBoldFont: isBoldFont, isItalicFont: isItalicFont, isUnderLineFont: isUnderLineFont, lineHeight: lineHeight, id: id) { this.DateFormat = dateFormat; + this.TimeFormat = timeFormat; } /// @@ -79,6 +83,12 @@ public DateSignedField(int pageNumber = default, Rectangle bounds = default, boo [DataMember(Name = "dateFormat", EmitDefaultValue = false)] public string DateFormat { get; set; } + /// + /// Gets or sets the TimeFormat and it's only applicable for DateSigned field. + /// + [DataMember(Name = "timeFormat", EmitDefaultValue = false)] + public string TimeFormat { get; set; } + /// /// Gets the form field type.It is a read only property. /// diff --git a/src/BoldSign/Model/DeliveryMode.cs b/src/BoldSign/Model/DeliveryMode.cs new file mode 100644 index 0000000..6174231 --- /dev/null +++ b/src/BoldSign/Model/DeliveryMode.cs @@ -0,0 +1,35 @@ +// +// Copyright (c) Syncfusion Inc. All rights reserved. +// + +namespace BoldSign.Model +{ + using System.Runtime.Serialization; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + + /// + /// Signature request delivery mode. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum DeliveryMode + { + /// + /// The enum for Email sign request type. + /// + [EnumMember(Value = "Email")] + Email = 0, + + /// + /// The enum for SMS sign request type. + /// + [EnumMember(Value = "SMS")] + SMS = 1, + + /// + /// The enum for Email and SMS sign request type. + /// + [EnumMember(Value = "EmailAndSMS")] + EmailAndSMS = 2, + } +} diff --git a/src/BoldSign/Model/Document.cs b/src/BoldSign/Model/Document.cs index c6bfe88..8991fed 100644 --- a/src/BoldSign/Model/Document.cs +++ b/src/BoldSign/Model/Document.cs @@ -39,7 +39,9 @@ public class Document /// Gets or sets the expiryDate.. /// Gets or sets a value indicating whether to enable signing order.. /// Gets or sets the labels. - public Document(string documentId = default, DocumentSenderDetail senderDetail = default, List ccDetails = default, long createdDate = default, long? activityDate = default, string activityBy = default, string messageTitle = default, DocumentStatus? status = default, List signerDetails = default, long? expiryDate = default, bool enableSigningOrder = default, List labels = default) + /// Gets or sets the cursor. + /// Gets or sets the brandId. + public Document(string documentId = default, DocumentSenderDetail senderDetail = default, List ccDetails = default, long createdDate = default, long? activityDate = default, string activityBy = default, string messageTitle = default, DocumentStatus? status = default, List signerDetails = default, long? expiryDate = default, bool enableSigningOrder = default, List labels = default, long? cursor = default, string brandId = default) { this.DocumentId = documentId; this.CcDetails = ccDetails; @@ -60,6 +62,8 @@ public Document(string documentId = default, DocumentSenderDetail senderDetail = this.ExpiryDate = expiryDate; this.EnableSigningOrder = enableSigningOrder; this.Labels = labels; + this.Cursor = cursor; + this.BrandId = brandId; } /// @@ -143,6 +147,18 @@ public Document(string documentId = default, DocumentSenderDetail senderDetail = [DataMember(Name = "labels", EmitDefaultValue = false)] public List Labels { get; set; } + /// + /// Gets or sets the cursor. + /// + [DataMember(Name = "cursor", EmitDefaultValue = false)] + public long? Cursor { get; set; } + + /// + /// Gets or sets a brandId. + /// + [DataMember(Name = "brandId", EmitDefaultValue = false)] + public string BrandId { get; set; } + /// /// Returns the JSON string presentation of the object /// diff --git a/src/BoldSign/Model/DocumentDownloadOption.cs b/src/BoldSign/Model/DocumentDownloadOption.cs new file mode 100644 index 0000000..6d7e5df --- /dev/null +++ b/src/BoldSign/Model/DocumentDownloadOption.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Syncfusion Inc. All rights reserved. +// + +namespace BoldSign.Api.Model +{ + /// + /// Document download option. + /// + public enum DocumentDownloadOption + { + /// + /// Represents Combined. + /// + Combined = 0, + + /// + /// Represents Individually. + /// + Individually = 1, + } +} diff --git a/src/BoldSign/Model/DocumentFormFields.cs b/src/BoldSign/Model/DocumentFormFields.cs index bd4a17a..6cb6382 100644 --- a/src/BoldSign/Model/DocumentFormFields.cs +++ b/src/BoldSign/Model/DocumentFormFields.cs @@ -1,10 +1,10 @@ -/* +/* * BoldSign API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * OpenAPI spec version: 1 - * + * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ @@ -35,7 +35,6 @@ public partial class DocumentFormFields /// /// Gets or sets the id.. /// Gets or sets the element type.. - /// Gets or sets the element type.. /// Gets or sets the element type.. /// Gets or sets the element type.. /// Gets or sets a value indicating whether is required.. @@ -61,7 +60,10 @@ public partial class DocumentFormFields /// Gets or sets the conditionalRules. /// Gets or sets the textAlign. /// Gets or sets the direction of the text. - 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), string dataSyncTag = default(string), Api.Model.FileInfo fileInfo = default(Api.Model.FileInfo), List dropdownOptions = default(List), bool? isReadOnly = default(bool?), List conditionalRules = default(List), TextAlign textAlign = TextAlign.Left, TextDirection textDirection = TextDirection.LTR) + /// Gets or sets the space of the character. + /// Gets or sets the label value. + /// Gets or sets the timeFormat value.. + 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), string dataSyncTag = default(string), Api.Model.FileInfo fileInfo = default(Api.Model.FileInfo), List dropdownOptions = default(List), bool? isReadOnly = default(bool?), List conditionalRules = default(List), TextAlign textAlign = TextAlign.Left, TextDirection textDirection = TextDirection.LTR, float characterSpacing = default, string label = default(string), string timeFormat = default(string)) { this.Id = id; this.Type = type; @@ -90,6 +92,9 @@ public partial class DocumentFormFields this.ConditionalRules = conditionalRules; this.TextAlign = textAlign; this.TextDirection = textDirection; + this.CharacterSpacing = characterSpacing; + this.Label = label; + this.TimeFormat = timeFormat; } /// @@ -183,6 +188,12 @@ public partial class DocumentFormFields [DataMember(Name = "groupName", EmitDefaultValue = true)] public string GroupName { get; set; } + /// + /// Gets or sets the Label for radio button fields. + /// + [DataMember(Name = "label", EmitDefaultValue = true)] + public string Label { get; set; } + /// /// Gets or sets the placeHolder value. /// @@ -197,6 +208,13 @@ public partial class DocumentFormFields [DataMember(Name = "dateFormat", EmitDefaultValue = false)] public string DateFormat { get; set; } + /// + /// Gets or sets the TimeFormat value. + /// + /// Gets the value of TimeFormat. + [DataMember(Name = "timeFormat", EmitDefaultValue = false)] + public string TimeFormat { get; set; } + /// /// Gets or sets the textbox ValidationType value. /// @@ -288,6 +306,28 @@ public partial class DocumentFormFields [DataMember(Name = "textDirection", EmitDefaultValue = true)] public TextDirection TextDirection { get; set; } + /// + /// Gets or sets the character spacing. + /// + /// Gets the value of character spacing. + [DataMember(Name = "characterSpacing", EmitDefaultValue = false)] + public float CharacterSpacing { get; set; } + + /// + /// Gets or sets the background hex color. + /// The BackgroundHexColor property allows you to set the background color of a label field using hexadecimal color codes ("#FF5733"). The default color is transparent or no background color. + /// Default value is null. + /// + /// Gets the value of backgroundColor. + [DataMember(Name = "backgroundHexColor", EmitDefaultValue = false)] + public string BackgroundHexColor { get; set; } + + /// + /// Gets or sets the tab index position . + /// + [DataMember(Name = "tabIndex", EmitDefaultValue = true)] + public int TabIndex { get; set; } + /// /// Returns the JSON string presentation of the object /// diff --git a/src/BoldSign/Model/DocumentInfo.cs b/src/BoldSign/Model/DocumentInfo.cs index 565c2a0..97c1da9 100644 --- a/src/BoldSign/Model/DocumentInfo.cs +++ b/src/BoldSign/Model/DocumentInfo.cs @@ -14,6 +14,7 @@ namespace BoldSign.Model { + using System; using System.Runtime.Serialization; using Newtonsoft.Json; @@ -26,22 +27,51 @@ public class DocumentInfo /// /// Initializes a new instance of the class. /// - /// Gets or sets the language. (required). + /// Gets or sets the language. /// Gets or sets the title. /// Gets or sets the descriptiondescription. - public DocumentInfo(Languages language = Languages.English, string title = default, string description = default) + [Obsolete("The language-based constructor is deprecated. Please use the new constructor: DocumentInfo(string documentTitle, string documentDescription = default)")] + public DocumentInfo(Languages language = Languages.None, string title = default, string description = default) { this.Language = language; this.Title = title; this.Description = description; } + /// + /// Initializes a new instance of the class. + /// + /// Gets or sets the documentTitle.(required). + /// Gets or sets the documentDescription. + /// Gets or sets the locale. + public DocumentInfo(string documentTitle, string documentDescription = default, Locales locale = Locales.EN) + { + this.Title = documentTitle; + this.Description = documentDescription; + this.Locale = locale; + } + + /// + /// Initializes a new instance of the class. + /// + public DocumentInfo() + { + + } + /// /// Gets or sets the language of the document. /// [DataMember(Name = "language", EmitDefaultValue = true)] + [Obsolete("Language is deprecated, please use Locale instead.")] public Languages Language { get; set; } + /// + /// Gets or sets locale such as EN, FR, ES. + /// + [DataMember(Name = "locale", EmitDefaultValue = true)] + public Locales Locale { get; set; } + /// /// Gets or sets the title. /// diff --git a/src/BoldSign/Model/DocumentProperties.cs b/src/BoldSign/Model/DocumentProperties.cs index 233a861..9f51a79 100644 --- a/src/BoldSign/Model/DocumentProperties.cs +++ b/src/BoldSign/Model/DocumentProperties.cs @@ -10,6 +10,7 @@ namespace BoldSign.Model { + using BoldSign.Api.Model; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -56,6 +57,7 @@ public class DocumentProperties /// Gets or sets the behalf details. /// Gets or sets the expiry data type of the document.. /// Gets or sets the expiry value of the document.. + /// Gets or sets the document download option. public DocumentProperties( string documentId = default(string), string messageTitle = default(string), @@ -88,7 +90,8 @@ public DocumentProperties( bool enableReassign = default(bool), BehalfOf behalfOf = default(BehalfOf), ExpiryDateType expiryDateType = default(ExpiryDateType), - long? expiryValue = default(long?)) + long? expiryValue = default(long?), + DocumentDownloadOption documentDownloadOption = default(DocumentDownloadOption)) { this.DocumentId = documentId; this.MessageTitle = messageTitle; @@ -122,6 +125,7 @@ public DocumentProperties( this.BehalfOf = behalfOf; this.ExpiryDateType = expiryDateType; this.ExpiryValue = expiryValue; + this.DocumentDownloadOption = documentDownloadOption; } /// @@ -349,6 +353,19 @@ public DocumentProperties( [DataMember(Name = "expiryValue", EmitDefaultValue = false)] public long? ExpiryValue { get; set; } + /// + /// Gets or sets a value indicating whether to enable individual document downloads. + /// + [DataMember(Name = "documentDownloadOption", EmitDefaultValue = true)] + public DocumentDownloadOption DocumentDownloadOption { get; set; } + + /// + /// Gets or sets the Recipient Notification Settings. + /// + /// Gets or sets the Recipient Notification Settings of the signer. + [DataMember(Name = "recipientNotificationSettings", EmitDefaultValue = false)] + public RecipientNotificationSettings RecipientNotificationSettings { get; set; } + /// /// Returns the JSON string presentation of the object /// diff --git a/src/BoldSign/Model/DocumentSigner.cs b/src/BoldSign/Model/DocumentSigner.cs index 0e40570..ddabc08 100644 --- a/src/BoldSign/Model/DocumentSigner.cs +++ b/src/BoldSign/Model/DocumentSigner.cs @@ -1,10 +1,10 @@ -/* +/* * 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 */ @@ -39,7 +39,10 @@ public class DocumentSigner /// Gets or sets the formFields.. /// Gets or sets the hostEmail. /// Gets or sets the Language. - 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 formFields = default(List), string hostEmail = default, Languages language = Languages.English) + /// Gets or sets the authentication type. + /// Gets or sets the phone number. + [Obsolete("The language-based constructor is deprecated. Please use the new constructor: DocumentSigner(string signerName, SignerType signerType = BoldSign.Model.SignerType.Signer, string signerEmail = default, string privateMessage = default, string authenticationCode = default, int signerOrder = default, bool enableEmailOTP = default, List formFields = default(List), string hostEmail = default, Locales locale = Locales.EN)")] + 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 formFields = default(List), string hostEmail = default, Languages language = Languages.None, AuthenticationType authenticationType = AuthenticationType.None, PhoneNumber phoneNumber = default) { // to ensure "name" is required (not null) if (string.IsNullOrEmpty(name)) @@ -65,6 +68,53 @@ public class DocumentSigner this.FormFields = formFields; this.HostEmail = hostEmail; this.Language = language; + this.AuthenticationType = authenticationType; + this.PhoneNumber = phoneNumber; + } + + /// + /// Initializes a new instance of the class. + /// + /// Gets or sets the signer Name. (required). + /// signerType. + /// Gets or sets the signer Email. + /// Gets or sets the private message. + /// Gets or sets the authentication code. + /// Gets or sets the signer order. + /// Gets or sets a value indicating whether to enable email OTP. + /// Gets or sets the formFields. + /// Gets or sets the hostEmail. + /// Gets or sets the locale. + /// Gets or sets the authentication type. + /// Gets or sets the phone number. + public DocumentSigner(string signerName, SignerType signerType = BoldSign.Model.SignerType.Signer, string signerEmail = default, string privateMessage = default, string authenticationCode = default, int signerOrder = default, bool enableEmailOTP = default, List formFields = default(List), string hostEmail = default, Locales locale = Locales.EN, AuthenticationType authenticationType = AuthenticationType.None, PhoneNumber phoneNumber = default) + { + // to ensure "name" is required (not null) + if (string.IsNullOrEmpty(signerName)) + { + throw new InvalidDataException("signerName is a required property for DocumentSigner and cannot be null"); + } + + this.Name = signerName; + this.SignerType = signerType; + this.EmailAddress = signerEmail; + this.PrivateMessage = privateMessage; + this.AuthenticationCode = authenticationCode; + this.SignerOrder = signerOrder; + this.EnableEmailOTP = enableEmailOTP; + this.FormFields = formFields; + this.HostEmail = hostEmail; + this.Locale = locale; + this.AuthenticationType = authenticationType; + this.PhoneNumber = phoneNumber; + } + + /// + /// Initializes a new instance of the class. + /// + public DocumentSigner() + { + } /// @@ -122,6 +172,12 @@ public class DocumentSigner [DataMember(Name = "enableEmailOTP", EmitDefaultValue = false)] public bool EnableEmailOTP { get; set; } + /// + /// Gets or sets a value indicating whether gets or sets the allow field configuration. + /// + [DataMember(Name = "allowFieldConfiguration", EmitDefaultValue = false)] + public bool AllowFieldConfiguration { get; set; } + /// /// Gets or sets form fields assigned to signer. /// @@ -134,8 +190,42 @@ public class DocumentSigner /// /// Gets or sets the language of the signer. [DataMember(Name = "language", EmitDefaultValue = true)] + [Obsolete("Language is deprecated, please use Locale instead.")] public Languages Language { get; set; } + /// + /// Gets or sets signer locale. + /// Gets or sets the locale of the signer. + /// + [DataMember(Name = "locale", EmitDefaultValue = false)] + public Locales Locale { get; set; } + + /// + /// Gets or Sets the delivery mode of the signer. + /// + [DataMember(Name = "deliveryMode", EmitDefaultValue = true)] + public DeliveryMode DeliveryMode { get; set; } = DeliveryMode.Email; + + /// + /// Gets or sets the authentication type. + /// Defaults to None. + /// + [DataMember(Name = "authenticationType", EmitDefaultValue = true)] + public AuthenticationType AuthenticationType { get; set; } = AuthenticationType.None; + + /// + /// Gets or sets the phone number. + /// + [DataMember(Name = "phoneNumber", EmitDefaultValue = false)] + public PhoneNumber PhoneNumber { get; set; } + + /// + /// Gets or sets the Recipient Notification Settings. + /// + /// Gets or sets the Recipient Notification Settings of the signer. + [DataMember(Name = "recipientNotificationSettings", EmitDefaultValue = false)] + public RecipientNotificationSettings RecipientNotificationSettings { get; set; } + /// /// Returns the JSON string presentation of the object /// diff --git a/src/BoldSign/Model/DocumentSignerDetails.cs b/src/BoldSign/Model/DocumentSignerDetails.cs index 231b2e0..d43a8ac 100644 --- a/src/BoldSign/Model/DocumentSignerDetails.cs +++ b/src/BoldSign/Model/DocumentSignerDetails.cs @@ -1,10 +1,10 @@ -/* +/* * 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 */ @@ -42,7 +42,11 @@ public class DocumentSignerDetails /// Gets or sets the form fields.. /// Gets or sets the host email. /// Gets or sets the host name. - public DocumentSignerDetails(string signerName = default(string), string signerRole = default(string), string signerEmail = default(string), SignerStatus status = default(SignerStatus), bool? isAuthenticationFailed = false, bool? enableEmailOTP = default(bool?), bool? isDeliveryFailed = false, bool? isViewed = false, int? order = 0, SignerType signerType = default(SignerType), bool? isReassigned = default(bool?), string privateMessage = default(string), List formFields = default(List), string hostEmail = default(string), string hostName = default(string)) + /// Gets or sets the Language. + /// Gets or sets the locale. + /// Authentication type. + /// The phone number. + public DocumentSignerDetails(string signerName = default(string), string signerRole = default(string), string signerEmail = default(string), SignerStatus status = default(SignerStatus), bool? isAuthenticationFailed = false, bool? enableEmailOTP = default(bool?), bool? isDeliveryFailed = false, bool? isViewed = false, int? order = 0, SignerType signerType = default(SignerType), bool? isReassigned = default(bool?), string privateMessage = default(string), List formFields = default(List), string hostEmail = default(string), string hostName = default(string), Languages language = Languages.English, string locale = default(string), AuthenticationType authenticationType = AuthenticationType.None, PhoneNumber phoneNumber = default) { this.SignerName = signerName; this.SignerRole = signerRole; @@ -91,6 +95,10 @@ public class DocumentSignerDetails this.FormFields = formFields; this.HostEmail = hostEmail; this.HostName = hostName; + this.Language = language; + this.Locale = locale; + this.AuthenticationType = authenticationType; + this.PhoneNumber = phoneNumber; } /// @@ -196,6 +204,13 @@ public class DocumentSignerDetails [DataMember(Name = "privateMessage", EmitDefaultValue = false)] public string PrivateMessage { get; set; } + /// + /// Gets or sets a value indicating whether gets or sets the allow field configuration. + /// + /// Gets or sets a value indicating whether gets or sets the allow field configuration. + [DataMember(Name = "allowFieldConfiguration", EmitDefaultValue = false)] + public bool AllowFieldConfiguration { get; set; } + /// /// Gets or sets the form fields in the document. /// @@ -203,6 +218,41 @@ public class DocumentSignerDetails [DataMember(Name = "formFields", EmitDefaultValue = false)] public List FormFields { get; set; } + /// + /// Gets or sets Languages such as English, French, Spanish, German. + /// + [DataMember(Name = "language", EmitDefaultValue = true)] + [Obsolete("language is deprecated, please use locale instead")] + public Languages Language { get; set; } + + /// + /// Gets or sets the locale. + /// + /// Gets the value of locale. + [DataMember(Name = "locale", EmitDefaultValue = false)] + public string Locale { get; set; } + + /// + /// Gets or sets a value of authentication type. + /// + /// Gets or sets the authentication type. + [DataMember(Name = "authenticationType", EmitDefaultValue = false)] + public AuthenticationType AuthenticationType { get; set; } + + /// + /// Gets or sets the phone number. + /// + /// Gets or sets phone number. + [DataMember(Name = "phoneNumber", EmitDefaultValue = false)] + public PhoneNumber PhoneNumber { get; set; } + + /// + /// Gets or sets the Recipient Notification Settings. + /// + /// Gets or sets the Recipient Notification Settings of the signer. + [DataMember(Name = "recipientNotificationSettings", EmitDefaultValue = false)] + public RecipientNotificationSettings RecipientNotificationSettings { get; set; } + /// /// Returns the JSON string presentation of the object /// @@ -212,4 +262,4 @@ public virtual string ToJson() return JsonConvert.SerializeObject(this, Formatting.Indented); } } -} +} \ No newline at end of file diff --git a/src/BoldSign/Model/EditTemplateRequest.cs b/src/BoldSign/Model/EditTemplateRequest.cs new file mode 100644 index 0000000..b91f4a2 --- /dev/null +++ b/src/BoldSign/Model/EditTemplateRequest.cs @@ -0,0 +1,145 @@ +// +// Copyright (c) Syncfusion Inc. All rights reserved. +// + +namespace BoldSign.Api.Model +{ + using System; + using System.Collections.Generic; + using System.ComponentModel.DataAnnotations; + using System.Runtime.Serialization; + using BoldSign.Model; + using Newtonsoft.Json; + + /// + /// Edit template request DTO. + /// + [DataContract(Name = "EditTemplateRequest")] + public class EditTemplateRequest + { + /// + /// Initializes a new instance of the class. + /// + /// Gets or sets the template id. + public EditTemplateRequest(string templateId) + { + this.TemplateId = templateId; + } + + /// + /// Gets or sets the template Id. + /// + /// Gets or sets the templateId id. + [DataMember(Name = "templateId", EmitDefaultValue = true)] + public string TemplateId { get; set; } + + /// + /// Gets or sets title for the Template request. + /// + [JsonProperty("title")] + public string Title { get; set; } + + /// + /// Gets or sets template description. + /// + [JsonProperty("description")] + public string Description { get; set; } + + /// + /// Gets or sets the Roles details. + /// + [JsonProperty("roles")] + public IEnumerable Roles { get; set; } + + /// + /// Gets or sets Template CC. + /// + [JsonProperty("cc")] + public IEnumerable CC { get; set; } + + /// + /// Gets or sets document title. + /// + [JsonProperty("documentTitle")] + public string DocumentTitle { get; set; } + + /// + /// Gets or sets document message or description. + /// + [JsonProperty("documentMessage")] + public string DocumentMessage { get; set; } + + /// + /// Gets or sets the brandId. + /// + [JsonProperty("brandId")] + public string BrandId { get; set; } + + /// + /// Gets or sets a value indicating whether the allow message editing option is enabled or disabled. + /// + [JsonProperty("allowMessageEditing")] + public bool? AllowMessageEditing { get; set; } + + /// + /// Gets or sets a value indicating whether the allow message allow new role option is enabled or disabled. + /// + [JsonProperty("allowNewRoles")] + public bool? AllowNewRoles { get; set; } + + /// + /// Gets or sets a value indicating whether the allow message allow new file option is enabled or disabled. + /// + [JsonProperty("allowNewFiles")] + public bool? AllowNewFiles { get; set; } + + /// + /// Gets or sets a value indicating whether the enable reassign value option is enabled or disabled. + /// + [JsonProperty("enableReassign")] + public bool? EnableReassign { get; set; } + + /// + /// Gets or sets a value indicating whether the enable print and sign value option is enabled or disabled. + /// + [JsonProperty("enablePrintAndSign")] + public bool? EnablePrintAndSign { get; set; } + + /// + /// Gets or sets a value indicating whether the enable signing order value option is enabled or disabled. + /// + [JsonProperty("enableSigningOrder")] + public bool? EnableSigningOrder { get; set; } + + /// + /// Gets or sets a documentInfo. + /// + [JsonProperty("documentInfo")] + public IEnumerable DocumentInfo { get; set; } + + /// + /// Gets or sets the on behalf of email. + /// + [JsonProperty("onBehalfOf")] + public string OnBehalfOf { get; set; } + + /// + /// Gets or sets the document labels. + /// + [JsonProperty("labels")] + public IEnumerable Labels { get; set; } + + /// + /// Gets or sets the template labels. + /// + [JsonProperty("templateLabels")] + public IEnumerable TemplateLabels { get; set; } + + /// + /// Gets or sets the Recipient Notification Settings values. + /// + [DataMember(Name = "recipientNotificationSettings", EmitDefaultValue = true)] + public RecipientNotificationSettings RecipientNotificationSettings { get; set; } + } +} + diff --git a/src/BoldSign/Model/EmbeddedCustomFieldCreated.cs b/src/BoldSign/Model/EmbeddedCustomFieldCreated.cs new file mode 100644 index 0000000..76c8707 --- /dev/null +++ b/src/BoldSign/Model/EmbeddedCustomFieldCreated.cs @@ -0,0 +1,33 @@ +// +// Copyright (c) Syncfusion Inc. All rights reserved. +// + +/* +* 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; + using System.Runtime.Serialization; + using Newtonsoft.Json; + + /// + /// The Embedded Custom Field Url. + /// + [DataContract] + public class EmbeddedCustomFieldCreated + { + /// + /// Gets or sets the embedded custom field url. + /// + [JsonProperty("createUrl")] + public Uri CreateUrl { get; set; } + } +} diff --git a/src/BoldSign/Model/EmbeddedCustomFieldDetails.cs b/src/BoldSign/Model/EmbeddedCustomFieldDetails.cs new file mode 100644 index 0000000..28ab9e6 --- /dev/null +++ b/src/BoldSign/Model/EmbeddedCustomFieldDetails.cs @@ -0,0 +1,41 @@ +// +// Copyright (c) Syncfusion Inc. All rights reserved. +// + +/* +* 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; + using System.Runtime.Serialization; + using Newtonsoft.Json; + + /// + /// Embedded custom field details. + /// + [DataContract] + public class EmbeddedCustomFieldDetails + { + /// + /// Gets or sets the brand id. + /// + [JsonProperty("brandId")] + public string BrandId { get; set; } + + /// + /// Gets or sets the custom field manipulation link expiration date (valid till). + /// Maximum valid till is 30 days. + /// Default is 1 day. + /// + [JsonProperty("linkValidTill")] + public DateTime? LinkValidTill { get; set; } + } +} diff --git a/src/BoldSign/Model/EmbeddedTemplateEditRequest.cs b/src/BoldSign/Model/EmbeddedTemplateEditRequest.cs index 294ef19..08df257 100644 --- a/src/BoldSign/Model/EmbeddedTemplateEditRequest.cs +++ b/src/BoldSign/Model/EmbeddedTemplateEditRequest.cs @@ -83,6 +83,12 @@ public class EmbeddedTemplateEditRequest [JsonProperty("showTooltip")] public bool ShowTooltip { get; set; } + /// + /// Gets or sets the on behalf of email. + /// + [JsonProperty("onBehalfOf")] + public string OnBehalfOf { get; set; } + /// /// Returns the JSON string presentation of the object. /// diff --git a/src/BoldSign/Model/FormField.cs b/src/BoldSign/Model/FormField.cs index 94da175..614c103 100644 --- a/src/BoldSign/Model/FormField.cs +++ b/src/BoldSign/Model/FormField.cs @@ -114,7 +114,8 @@ public FormField(string name = default, FieldType type = default, int pageNumber /// Gets or sets the conditionalRules. /// Gets or sets the textAlign. /// Gets or sets the direction of the text. - 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, string dataSyncTag = default, bool isReadOnly = default, List conditionalRules = default, TextAlign textAlign = Api.Model.TextAlign.Left, TextDirection textDirection = TextDirection.LTR) + /// Gets or sets the space of the character. + 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, string dataSyncTag = default, bool isReadOnly = default, List conditionalRules = default, TextAlign textAlign = Api.Model.TextAlign.Left, TextDirection textDirection = TextDirection.LTR, float characterSpacing = default) { // to ensure "fieldType" is required (not null) if (type == null) @@ -156,6 +157,7 @@ public FormField(string name = default, FieldType type = default, int pageNumber this.ConditionalRules = conditionalRules; this.TextAlign = textAlign; this.TextDirection = textDirection; + this.CharacterSpacing = characterSpacing; if (type == FieldType.Attachment && attachmentInfo == null) { throw new InvalidDataException(ApiValidationMessages.AttachmentInformationRequired); @@ -368,11 +370,34 @@ public virtual FieldType Type /// Gets or sets the direction of the text. [DataMember(Name = "textDirection", EmitDefaultValue = true)] public TextDirection TextDirection { get; set; } - + + /// + /// Gets or sets the space of the character. + /// + /// Gets or sets the characterSpacing. + [DataMember(Name = "characterSpacing", EmitDefaultValue = true)] + public float CharacterSpacing { get; set; } + /// /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object public virtual string ToJson() => JsonConvert.SerializeObject(this, Formatting.Indented); + + /// + /// Gets or sets the background hex color. + /// The BackgroundHexColor property allows you to set the background color of a label field using hexadecimal color codes ("#FF5733"). The default color is transparent or no background color. + /// Default value is null. + /// + /// Gets or sets the Backgroundcolor Value. + [DataMember(Name = "backgroundHexColor", EmitDefaultValue = true)] + public string BackgroundHexColor { get; set; } + + /// + /// Gets or sets the Tab Index. + /// + [DataMember(Name = "tabIndex", EmitDefaultValue = false)] + [Range(-1, int.MaxValue, ErrorMessage = "The minimum value must be -1 or higher")] + public int? TabIndex { get; set; } } } diff --git a/src/BoldSign/Model/ImposeAuthentication.cs b/src/BoldSign/Model/ImposeAuthentication.cs index bb71e13..0b45620 100644 --- a/src/BoldSign/Model/ImposeAuthentication.cs +++ b/src/BoldSign/Model/ImposeAuthentication.cs @@ -34,5 +34,11 @@ public enum ImposeAuthentication /// [EnumMember(Value = "AccessCode")] AccessCode = 3, + + /// + /// Represents SMSOTP only. + /// + [EnumMember(Value = "SMSOTP")] + SMSOTP = 4, } } diff --git a/src/BoldSign/Model/Languages.cs b/src/BoldSign/Model/Languages.cs index 752488f..4322d4b 100644 --- a/src/BoldSign/Model/Languages.cs +++ b/src/BoldSign/Model/Languages.cs @@ -9,6 +9,11 @@ namespace BoldSign.Model /// public enum Languages { + /// + /// None. + /// + None = 0, + /// /// English. /// diff --git a/src/BoldSign/Model/Locales.cs b/src/BoldSign/Model/Locales.cs index b48401f..1ab8050 100644 --- a/src/BoldSign/Model/Locales.cs +++ b/src/BoldSign/Model/Locales.cs @@ -103,5 +103,11 @@ public enum Locales /// [EnumMember(Value = "SV")] SV, + + /// + /// Inherit from template. + /// + [EnumMember(Value = "Default")] + Default, } } diff --git a/src/BoldSign/Model/MergeAndSendForSign.cs b/src/BoldSign/Model/MergeAndSendForSign.cs new file mode 100644 index 0000000..1fc6224 --- /dev/null +++ b/src/BoldSign/Model/MergeAndSendForSign.cs @@ -0,0 +1,231 @@ +// +// Copyright (c) Syncfusion Inc. All rights reserved. +// + +namespace BoldSign.Api.Model +{ + using System.Collections.Generic; + using System.Runtime.Serialization; + using BoldSign.Model; + using Newtonsoft.Json; + + /// + /// The merge and send for sign. + /// + [DataContract] + public class MergeAndSendForSign + { + /// + /// Initializes a new instance of the class. + /// + /// Gets or sets the template ids. + /// Gets or sets the title.. + /// Gets or sets the message.. + /// Gets or sets the roles.. + /// Gets or sets the brandId.. + /// Gets or sets the labels. + /// Gets or sets the disableEmails. + /// Gets or sets the hideDocumentId. + /// Gets or sets the reminderSettings. + /// Gets or sets the cc. + /// Gets or sets the expiryDays. + /// Gets or sets the expiry value based on expiry date type. + /// Gets or sets the expiry date type. + /// Gets or sets the disableExpiryAlert. + /// Gets or sets the enablePrintAndSign. + /// Gets or sets the enableReassign. + /// Gets or sets the enableSigningOrder. + /// Gets or sets the documentInfo. + /// Gets or sets the on behalf of email id. + /// Gets or sets the role removal indices. + public MergeAndSendForSign( + string[] templateIds = default, + string title = default, + string message = default, + List roles = default, + string brandId = default, + List labels = default, + bool disableEmails = default, + bool? hideDocumentId = default, + ReminderSettings reminderSettings = default, + IEnumerable cc = default, + int expiryDays = default, + long expiryValue = 60, + ExpiryDateType expiryDateType = default(ExpiryDateType), + bool disableExpiryAlert = default, + bool enablePrintAndSign = default, + bool enableReassign = true, + bool? enableSigningOrder = default, + IEnumerable documentInfo = default, + string onBehalfOf = default, + int[] roleRemovalIndices = default) + { + this.TemplateIds = templateIds; + this.Title = title; + this.Message = message; + this.Roles = roles; + this.BrandId = brandId; + this.Labels = labels; + this.DisableEmails = disableEmails; + this.HideDocumentId = hideDocumentId; + this.ReminderSettings = reminderSettings; + this.CC = cc; + this.ExpiryDays = expiryDays; + this.ExpiryValue = expiryValue; + this.ExpiryDateType = expiryDateType; + this.DisableExpiryAlert = disableExpiryAlert; + this.EnablePrintAndSign = enablePrintAndSign; + this.EnableReassign = enableReassign; + this.EnableSigningOrder = enableSigningOrder; + this.DocumentInfo = documentInfo; + this.OnBehalfOf = onBehalfOf; + this.RoleRemovalIndices = roleRemovalIndices; + } + + /// + /// Gets or sets the template Ids. + /// + /// Gets or sets the template ids. + [DataMember(Name = "templateIds", EmitDefaultValue = true)] + public string[] TemplateIds { get; set; } + + /// + /// Gets or sets title for the signature request. + /// + /// Gets or sets the title. + [DataMember(Name = "title", EmitDefaultValue = true)] + public string Title { get; set; } + + /// + /// Gets or sets common message for all the document recipients. + /// + /// Gets or sets the message. + [DataMember(Name = "message", EmitDefaultValue = true)] + public string Message { get; set; } + + /// + /// Gets or sets the signer roles in a template of the document. + /// + /// Gets or sets the roles. + [DataMember(Name = "roles", EmitDefaultValue = true)] + public List Roles { get; set; } + + /// + /// Gets or sets the brand id. + /// + [DataMember(Name = "brandId", EmitDefaultValue = true)] + public string BrandId { get; set; } + + /// + /// Gets or sets the labels. + /// + [DataMember(Name = "labels", EmitDefaultValue = true)] + public List Labels { get; set; } + + /// + /// Gets or sets a value indicating whether to enable or disable emails.When disable emails is set to true, all the status emails and completed document email will be stopped, and reminder is also automatically ignored. + /// + [DataMember(Name = "disableEmails", EmitDefaultValue = true)] + public bool DisableEmails { get; set; } + + /// + /// Gets or sets a value indicating whether to remove the document ID watermark from all the PDF pages of the document. + /// Default is false. + /// + [DataMember(Name = "hideDocumentId", EmitDefaultValue = true)] + public bool? HideDocumentId { get; set; } + + /// + /// Gets or sets the reminder settings for the signature request. + /// + [DataMember(Name = "reminderSettings", EmitDefaultValue = true)] + public ReminderSettings ReminderSettings { get; set; } + + /// + /// Gets or sets document CC details. + /// + [DataMember(Name = "cc", EmitDefaultValue = true)] + public IEnumerable CC { get; set; } + + /// + /// Gets or sets the expiry date type. + /// + [DataMember(Name = "expiryDateType", EmitDefaultValue = false)] + public ExpiryDateType ExpiryDateType { get; set; } + + /// + /// Gets or sets number of days after which the document will expire. + /// + [DataMember(Name = "expiryDays", EmitDefaultValue = true)] + public int ExpiryDays { get; set; } + + /// + /// Gets or sets the value when the document should get expired. + /// + [DataMember(Name = "expiryValue", EmitDefaultValue = false)] + public long ExpiryValue { get; set; } = 60; + + /// + /// Gets or sets a value indicating whether Disableexpiryalert is true or false. + /// This property will send the expiry alert email before the day of expiry for the pending signers. + /// If the document expires in one day, the email will be sent before 2 hours of the expiry. + /// + [DataMember(Name = "disableExpiryAlert", EmitDefaultValue = true)] + public bool DisableExpiryAlert { get; set; } + + /// + /// Gets or sets a value indicating whether to enable print and sign mode. + /// + [DataMember(Name = "enablePrintAndSign", EmitDefaultValue = true)] + public bool EnablePrintAndSign { get; set; } + + /// + /// Gets or sets a value indicating whether to enable reassign mode. + /// By Default True. + /// + [DataMember(Name = "enableReassign", EmitDefaultValue = true)] + public bool EnableReassign { get; set; } = true; + + /// + /// Gets or sets a value indicating whether to enable signing order for the document signer. + /// + [DataMember(Name = "enableSigningOrder", EmitDefaultValue = true)] + public bool? EnableSigningOrder { get; set; } + + /// + /// Gets or sets a documentInfo. + /// + [JsonProperty("documentInfo")] + public IEnumerable DocumentInfo { get; set; } + + /// + /// Gets or sets the on behalf of mail id. + /// + [DataMember(Name = "onBehalfOf", EmitDefaultValue = true)] + public string OnBehalfOf { get; set; } + + /// + /// Gets or sets the role removal indices which starts from 1. For example, if you want to remove role 2 and 3 the input should be new []{2,3}. + /// + [DataMember(Name = "roleRemovalIndices", EmitDefaultValue = false)] + public int[] RoleRemovalIndices { get; set; } + + /// + /// Gets or sets a value to customize how the documents are downloaded. + /// + [DataMember(Name = "documentDownloadOption", EmitDefaultValue = true)] + public DocumentDownloadOption? DocumentDownloadOption { get; set; } + + /// + /// Gets or sets remove form fields id. + /// + [DataMember(Name = "removeFormFields", EmitDefaultValue = false)] + public List RemoveFormFields { get; set; } + + /// + /// Returns the JSON string presentation of the object. + /// + /// JSON string presentation of the object. + public virtual string ToJson() => JsonConvert.SerializeObject(this, Formatting.Indented); + } +} diff --git a/src/BoldSign/Model/PhoneNumber.cs b/src/BoldSign/Model/PhoneNumber.cs new file mode 100644 index 0000000..9a63130 --- /dev/null +++ b/src/BoldSign/Model/PhoneNumber.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Syncfusion Inc. All rights reserved. +// + +/* + * 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; + + /// + /// The phone number include the number and country code. + /// + [DataContract] + public class PhoneNumber + { + /// + /// Initializes a new instance of the class. + /// + /// Gets or sets the number. + /// Gets or sets the country code. + public PhoneNumber(string countryCode = default, string number = default) + { + this.Number = number; + this.CountryCode = countryCode; + } + + /// + /// Gets or sets the number. + /// + [DataMember(Name = "number", EmitDefaultValue = true)] + public string Number { get; set; } + + /// + /// Gets or sets the country code. + /// + [DataMember(Name = "countryCode", EmitDefaultValue = true)] + public string CountryCode { get; set; } + + /// + /// Returns the JSON string presentation of the object. + /// + /// JSON string presentation of the object. + public virtual string ToJson() => JsonConvert.SerializeObject(this, Formatting.Indented); + } +} diff --git a/src/BoldSign/Model/PrefillField.cs b/src/BoldSign/Model/PrefillField.cs new file mode 100644 index 0000000..cdb9f63 --- /dev/null +++ b/src/BoldSign/Model/PrefillField.cs @@ -0,0 +1,27 @@ +// +// Copyright (c) Syncfusion Inc. All rights reserved. +// + +namespace BoldSign.Api.Model +{ + using System.Runtime.Serialization; + + /// + /// Pre fill field. + /// + public class PrefillField + { + /// + /// Gets or sets the form field ID. + /// + [DataMember(Name = "id", EmitDefaultValue = true)] + public string Id { get; set; } + + /// + /// Gets or sets the form field value. + /// + [DataMember(Name = "value", EmitDefaultValue = true)] + public string Value { get; set; } + } +} + diff --git a/src/BoldSign/Model/PrefillFieldRequest.cs b/src/BoldSign/Model/PrefillFieldRequest.cs new file mode 100644 index 0000000..e84291a --- /dev/null +++ b/src/BoldSign/Model/PrefillFieldRequest.cs @@ -0,0 +1,44 @@ +// +// Copyright (c) Syncfusion Inc. All rights reserved. +// + +namespace BoldSign.Api.Model +{ + using System.Collections.Generic; + using System.Runtime.Serialization; + + /// + /// Pre fill field request. + /// + [DataContract] + public class PrefillFieldRequest + { + /// + /// Initializes a new instance of the class. + /// + /// Gets or sets the document id. + public PrefillFieldRequest(string documentId) + { + this.DocumentId = documentId; + } + + /// + /// Gets or sets the document Id. + /// + /// Gets or sets the document id. + [DataMember(Name = "documentId", EmitDefaultValue = true)] + public string DocumentId { get; set; } + + /// + /// Gets or sets the form field ID. + /// + [DataMember(Name = "fields", EmitDefaultValue = true)] + public List Fields { get; set; } + + /// + /// Gets or sets the on behalf of user. + /// + [DataMember(Name = "onBehalfOf", EmitDefaultValue = true)] + public string OnBehalfOf { get; set; } + } +} diff --git a/src/BoldSign/Model/RadioButtonField.cs b/src/BoldSign/Model/RadioButtonField.cs index 1a9f508..b161fe1 100644 --- a/src/BoldSign/Model/RadioButtonField.cs +++ b/src/BoldSign/Model/RadioButtonField.cs @@ -54,10 +54,12 @@ public RadioButtonField(string name = default,int pageNumber = default, Rectangl /// Gets or sets the id. /// Gets or sets a value indicating whether is read only mode. /// Gets or sets the conditionalRules. - public RadioButtonField(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 groupName = default, string id = default, bool isReadOnly = default, List conditionalRules = default) + /// Gets or sets the label value. + public RadioButtonField(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 groupName = default, string id = default, bool isReadOnly = default, List conditionalRules = default, string label = default) : base(type: FieldType.RadioButton, pageNumber: pageNumber, bounds: bounds, isRequired: isRequired, value: value, font: font, fontSize: fontSize, fontHexColor: fontHexColor, isBoldFont: isBoldFont, isItalicFont: isItalicFont, isUnderLineFont: isUnderLineFont, lineHeight: lineHeight, characterLimit: characterLimit, id: id, isReadOnly: isReadOnly, conditionalRules: conditionalRules) { this.GroupName = groupName; + this.Label = label; } /// @@ -75,5 +77,11 @@ public override FieldType Type /// [DataMember(Name = "groupName", EmitDefaultValue = true)] public new string GroupName { get; set; } + + /// + /// Gets or sets the Label for radio button fields. + /// + [DataMember(Name = "label", EmitDefaultValue = true)] + public new string Label { get; set; } } } diff --git a/src/BoldSign/Model/RecipientNotificationSettings.cs b/src/BoldSign/Model/RecipientNotificationSettings.cs new file mode 100644 index 0000000..21c4bba --- /dev/null +++ b/src/BoldSign/Model/RecipientNotificationSettings.cs @@ -0,0 +1,94 @@ +// +// Copyright (c) Syncfusion Inc. All rights reserved. +// + +/* + * 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; + + /// + /// The Recipient Notification Settings. + /// + [DataContract] + public class RecipientNotificationSettings + { + /// + /// Gets or sets a value indicating whether document SignatureRequest. + /// + [DataMember(Name = "signatureRequest", EmitDefaultValue = true)] + public bool SignatureRequest { get; set; } = true; + + /// + /// Gets or sets a value indicating whether decline document. + /// + [DataMember(Name = "declined", EmitDefaultValue = true)] + public bool Declined { get; set; } = true; + + /// + /// Gets or sets a value indicating whether revoke document. + /// + [DataMember(Name = "revoked", EmitDefaultValue = true)] + public bool Revoked { get; set; } = true; + + /// + /// Gets or sets a value indicating whether document Individual Sign Complete. + /// + [DataMember(Name = "signed", EmitDefaultValue = true)] +#pragma warning disable CA1720 // Identifier contains type name + public bool Signed { get; set; } = true; +#pragma warning restore CA1720 // Identifier contains type name + + /// + /// Gets or sets a value indicating whether complete document. + /// + [DataMember(Name = "completed", EmitDefaultValue = true)] + public bool Completed { get; set; } = true; + + /// + /// Gets or sets a value indicating whether document expired. + /// + [DataMember(Name = "expired", EmitDefaultValue = true)] + public bool Expired { get; set; } = true; + + /// + /// Gets or sets a value indicating whether reassign document. + /// + [DataMember(Name = "reassigned", EmitDefaultValue = true)] + public bool Reassigned { get; set; } = true; + + /// + /// Gets or sets a value indicating whether deleted document. + /// + [DataMember(Name = "deleted", EmitDefaultValue = true)] + public bool Deleted { get; set; } = true; + + /// + /// Gets or sets a value indicating whether sender reminder. + /// + [DataMember(Name = "reminders", EmitDefaultValue = true)] + public bool Reminders { get; set; } = true; + + /// + /// Gets or sets a value indicating whether sender edited a recipient. + /// + [DataMember(Name = "editRecipient", EmitDefaultValue = true)] + public bool EditRecipient { get; set; } = true; + + /// + /// Gets or sets a value indicating whether sender edited a document. + /// + [DataMember(Name = "editDocument", EmitDefaultValue = true)] + public bool EditDocument { get; set; } = true; + } +} diff --git a/src/BoldSign/Model/ReminderMessage.cs b/src/BoldSign/Model/ReminderMessage.cs index 50d5b0c..81a6304 100644 --- a/src/BoldSign/Model/ReminderMessage.cs +++ b/src/BoldSign/Model/ReminderMessage.cs @@ -28,10 +28,12 @@ public class ReminderMessage /// /// Gets or sets reminder message.. /// The on behalfof email. - public ReminderMessage(string message = default, string onBehalfOf = default) + /// The reminder phone number. + public ReminderMessage(string message = default, string onBehalfOf = default, List reminderPhoneNumbers = default) { this.Message = message; this.OnBehalfOf = onBehalfOf; + this.ReminderPhoneNumbers = reminderPhoneNumbers; } /// @@ -47,6 +49,12 @@ public ReminderMessage(string message = default, string onBehalfOf = default) [DataMember(Name = "onBehalfOf", EmitDefaultValue = true)] public string OnBehalfOf { get; set; } + /// + /// Gets or sets the on behalf of email. + /// + [DataMember(Name = "reminderPhoneNumbers", EmitDefaultValue = true)] + public List ReminderPhoneNumbers { get; set; } + /// /// Returns the JSON string presentation of the object /// diff --git a/src/BoldSign/Model/RemoveAuthentication.cs b/src/BoldSign/Model/RemoveAuthentication.cs index 006acba..88f4435 100644 --- a/src/BoldSign/Model/RemoveAuthentication.cs +++ b/src/BoldSign/Model/RemoveAuthentication.cs @@ -16,6 +16,7 @@ namespace BoldSign.Api.Model using System.IO; using System.Runtime.Serialization; using BoldSign.Api.Resources; + using BoldSign.Model; using Newtonsoft.Json; /// @@ -30,11 +31,13 @@ public class RemoveAuthentication /// The User Service. /// The emailHandler. /// The on behalfof email. - public RemoveAuthentication(string emailId, int? zorder, string onBehalfOf = default) + /// The phone number. + public RemoveAuthentication(string emailId, int? zorder, string onBehalfOf = default, PhoneNumber phoneNumber = default) { this.EmailId = emailId; this.ZOrder = zorder; this.OnBehalfOf = onBehalfOf; + this.PhoneNumber = phoneNumber; } /// @@ -56,5 +59,11 @@ public RemoveAuthentication(string emailId, int? zorder, string onBehalfOf = def /// [DataMember(Name = "onBehalfOf", EmitDefaultValue = true)] public string OnBehalfOf { get; set; } + + /// + /// Gets or sets the on behalf of email. + /// + [DataMember(Name = "phoneNumber", EmitDefaultValue = true)] + public PhoneNumber PhoneNumber { get; set; } } } diff --git a/src/BoldSign/Model/RoleProperties.cs b/src/BoldSign/Model/RoleProperties.cs index 7d292ac..34b904f 100644 --- a/src/BoldSign/Model/RoleProperties.cs +++ b/src/BoldSign/Model/RoleProperties.cs @@ -34,6 +34,7 @@ public class RoleProperties /// Gets or sets the authentication type of template. /// Gets or sets the allow permission to role delete option of template. /// Gets or sets the allow permission to role edit option of template. + /// Gets or sets the locale. public RoleProperties( string name, int index, @@ -48,7 +49,8 @@ public RoleProperties( bool enableEmailOTP = default, ImposeAuthentication imposeAuthentication = ImposeAuthentication.None, bool allowRoleEdit = true, - bool allowRoleDelete = true) + bool allowRoleDelete = true, + Locales locale = Locales.EN) { this.Name = name; this.Index = index; @@ -67,6 +69,7 @@ public RoleProperties( this.ImposeAuthentication = imposeAuthentication; this.AllowRoleDelete = allowRoleDelete; this.AllowRoleEdit = allowRoleEdit; + this.Locale = locale; } /// @@ -93,6 +96,12 @@ public RoleProperties( [DataMember(Name = "defaultSignerEmail", EmitDefaultValue = false)] public string DefaultSignerEmail { get; set; } + /// + /// Gets or sets the phone number. + /// + [DataMember(Name = "phoneNumber", EmitDefaultValue = false)] + public PhoneNumber PhoneNumber { get; set; } + /// /// Gets or sets the signer order value. /// @@ -116,8 +125,15 @@ public RoleProperties( /// Gets or sets Languages such as English, French, Spanish, German. /// [DataMember(Name = "language", EmitDefaultValue = true)] + [Obsolete("language is deprecated, please use locale instead")] public Languages Language { get; set; } + /// + /// Gets or sets locale such as EN, FR, ES. + /// + [DataMember(Name = "locale", EmitDefaultValue = true)] + public Locales Locale { get; set; } + /// /// Gets or sets a value indicating whether enable access code recipients. /// @@ -136,6 +152,19 @@ public RoleProperties( [DataMember(Name = "imposeAuthentication", EmitDefaultValue = true)] public ImposeAuthentication ImposeAuthentication { get; set; } + /// + /// Gets or Sets a delivery mode. + /// + /// Gets or sets the delivery mode. + [DataMember(Name = "deliveryMode", EmitDefaultValue = true)] + public DeliveryMode DeliveryMode { get; set; } + + /// + /// Gets or sets a value indicating whether gets or sets the allow field configuration. + /// + [DataMember(Name = "allowFieldConfiguration", EmitDefaultValue = false)] + public bool AllowFieldConfiguration { get; set; } + /// /// Gets or sets document Form fields such as Sign, Checkbox, Radio buttons etc. /// @@ -154,6 +183,13 @@ public RoleProperties( [DataMember(Name = "allowRoleDelete", EmitDefaultValue = true)] public bool AllowRoleDelete { get; set; } = true; + /// + /// Gets or sets the Recipient Notification Settings. + /// + /// Gets or sets the Recipient Notification Settings of the signer. + [DataMember(Name = "recipientNotificationSettings", EmitDefaultValue = false)] + public RecipientNotificationSettings RecipientNotificationSettings { get; set; } + /// /// Returns the JSON string presentation of the object. /// diff --git a/src/BoldSign/Model/Roles.cs b/src/BoldSign/Model/Roles.cs index 0cd65b7..98517c6 100644 --- a/src/BoldSign/Model/Roles.cs +++ b/src/BoldSign/Model/Roles.cs @@ -1,10 +1,10 @@ -/* +/* * 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 */ @@ -39,14 +39,15 @@ public class Roles /// Gets or sets document Form fields such as Sign, Checkbox, Radio buttons etc.. /// Gets or sets value for the existing Form fields.. /// Gets or sets the Language. - 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, string hostEmail = default, bool enableEmailOTP = default, List formFields = default(List), List existingFormFields = default(List), Languages language = Languages.English) + /// Gets or sets the authentication Type. + /// Gets or sets the phone number. + [Obsolete("The language-based constructor is deprecated. Please use the new constructor: Roles(string roleSignerName = default, string roleSignerEmailAddress = default, int roleSignerIndex = default, int signerOrder = default(int), string signerRole = default, string privateMessage = default, string authenticationCode = default, SignerType? signerType = default, string hostEmail = default, bool enableEmailOTP = default, List formFields = default(List), List existingFormFields = default(List), Locales locale = Locales.EN)")] + 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, string hostEmail = default, bool enableEmailOTP = default, List formFields = default(List), List existingFormFields = default(List), Languages language = Languages.None, AuthenticationType authenticationType = AuthenticationType.None, PhoneNumber phoneNumber = default) { this.SignerName = signerName; this.SignerEmail = signerEmail; - this.SignerOrder = SignerOrder; + this.SignerOrder = signerOrder; this.RoleIndex = roleIndex; - this.SignerName = signerName; - this.SignerEmail = signerEmail; this.SignerRole = signerRole; this.PrivateMessage = privateMessage; this.AuthenticationCode = authenticationCode; @@ -56,6 +57,53 @@ public class Roles this.FormFields = formFields; this.ExistingFormFields = existingFormFields; this.Language = language; + this.AuthenticationType = authenticationType; + this.PhoneNumber = phoneNumber; + } + + /// + /// Initializes a new instance of the class. + /// + /// Gets or sets the roleSignerName. + /// Gets or sets the roleSignerEmailAddress. + /// Gets or sets the roleSignerIndex. + /// Gets or sets the signer order. + /// Gets or sets the role. + /// Gets or sets the private message. + /// Gets or sets the authentication code. + /// Gets or sets a value indicating whether to enable email OTP. <br>Email OTP takes higher precedence over AuthenticationCode.. + /// signerType. + /// Gets or sets the hostEmail. + /// Gets or sets document Form fields such as Sign, Checkbox, Radio buttons etc.. + /// Gets or sets value for the existing Form fields.. + /// Gets or sets the locale. + /// Gets or sets the authentication Type. + /// Gets or sets the phone number. + public Roles(string roleSignerName = default, string roleSignerEmailAddress = default, int roleSignerIndex = default, int signerOrder = default(int), string signerRole = default, string privateMessage = default, string authenticationCode = default, SignerType? signerType = default, string hostEmail = default, bool enableEmailOTP = default, List formFields = default(List), List existingFormFields = default(List), Locales locale = Locales.Default, AuthenticationType authenticationType = AuthenticationType.None, PhoneNumber phoneNumber = default) + { + this.SignerName = roleSignerName; + this.SignerEmail = roleSignerEmailAddress; + this.RoleIndex = roleSignerIndex; + this.SignerOrder = signerOrder; + this.SignerRole = signerRole; + this.PrivateMessage = privateMessage; + this.AuthenticationCode = authenticationCode; + this.EnableEmailOTP = enableEmailOTP; + this.SignerType = signerType; + this.HostEmail = hostEmail; + this.FormFields = formFields; + this.ExistingFormFields = existingFormFields; + this.Locale = locale; + this.AuthenticationType = authenticationType; + this.PhoneNumber = phoneNumber; + } + + /// + /// Initializes a new instance of the class. + /// + public Roles() + { + } /// @@ -93,6 +141,19 @@ public class Roles [DataMember(Name = "privateMessage", EmitDefaultValue = true)] public string PrivateMessage { get; set; } + /// + /// Gets or sets the authentication type. + /// Defaults to None. + /// + [DataMember(Name = "authenticationType", EmitDefaultValue = true)] + public AuthenticationType AuthenticationType { get; set; } = AuthenticationType.None; + + /// + /// Gets or sets the phone number. + /// + [DataMember(Name = "phoneNumber", EmitDefaultValue = false)] + public PhoneNumber PhoneNumber { get; set; } + /// /// Gets or sets the authentication code. /// @@ -128,6 +189,12 @@ public class Roles [DataMember(Name = "signerRole", EmitDefaultValue = true)] public string SignerRole { get; set; } + /// + /// Gets or sets a value indicating whether gets or sets the allow field configuration. + /// + [DataMember(Name = "allowFieldConfiguration", EmitDefaultValue = true)] + public bool? AllowFieldConfiguration { get; set; } + /// /// Gets or sets form fields assigned to signer. /// @@ -147,8 +214,29 @@ public class Roles /// /// Gets or sets the language of the signer. [DataMember(Name = "language", EmitDefaultValue = true)] + [Obsolete("language is deprecated, please use locale instead")] public Languages Language { get; set; } + /// + /// Gets or sets the Locale. + /// + /// Gets or sets the Locale of the signer. + [DataMember(Name = "locale", EmitDefaultValue = true)] + public Locales Locale { get; set; } = Locales.Default; + + /// + /// Gets or Sets the delivery mode of the signer. + /// + [DataMember(Name = "deliveryMode", EmitDefaultValue = true)] + public DeliveryMode DeliveryMode { get; set; } = DeliveryMode.Email; + + /// + /// Gets or sets the Recipient Notification Settings. + /// + /// Gets or sets the Recipient Notification Settings of the signer. + [DataMember(Name = "recipientNotificationSettings", EmitDefaultValue = false)] + public RecipientNotificationSettings RecipientNotificationSettings { get; set; } + /// /// Returns the JSON string presentation of the object /// diff --git a/src/BoldSign/Model/SendForSign.cs b/src/BoldSign/Model/SendForSign.cs index 9a53ceb..a31a76e 100644 --- a/src/BoldSign/Model/SendForSign.cs +++ b/src/BoldSign/Model/SendForSign.cs @@ -105,6 +105,13 @@ public class SendForSign : IDocumentUpload [JsonProperty("disableEmails")] public bool DisableEmails { get; set; } + /// + /// Gets or sets a value indicating whether to enable SMS notification. + /// When DisableSMS is enabled, Reminder is automatically ignored. + /// + [JsonProperty("disableSMS")] + public bool DisableSMS { get; set; } + /// /// Gets or sets the brand id. /// @@ -173,5 +180,18 @@ public class SendForSign : IDocumentUpload /// Gets or sets a value indicating whether to AutoDetect Fields for the document signer. /// public bool AutoDetectFields { get; set; } + + /// + /// Gets or sets a value to customize how the documents are downloaded. + /// + [JsonProperty("documentDownloadOption")] + public DocumentDownloadOption? DocumentDownloadOption { get; set; } + + /// + /// Gets or sets the Recipient Notification Settings. + /// + [JsonProperty("recipientNotificationSettings")] + [Display(Description = "Recipient Notification Settings of the document.")] + public RecipientNotificationSettings RecipientNotificationSettings { get; set; } } } diff --git a/src/BoldSign/Model/SendForSignFromTemplate.cs b/src/BoldSign/Model/SendForSignFromTemplate.cs index 0b38f16..1bdc043 100644 --- a/src/BoldSign/Model/SendForSignFromTemplate.cs +++ b/src/BoldSign/Model/SendForSignFromTemplate.cs @@ -10,6 +10,7 @@ namespace BoldSign.Model { + using BoldSign.Api.Model; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -46,6 +47,7 @@ public class SendForSignFromTemplate /// Gets or sets the enableSigningOrder. /// Gets or sets the documentInfo. /// Gets or sets the role removal indices. + /// Gets or sets the document download option. public SendForSignFromTemplate( string templateId = default, string title = default, @@ -59,14 +61,15 @@ public SendForSignFromTemplate( IEnumerable cc = default, int expiryDays = default, long expiryValue = 60, - ExpiryDateType expiryDateType = default(ExpiryDateType), - bool disableExpiryAlert = default, + ExpiryDateType? expiryDateType = default, + bool? disableExpiryAlert = default, bool enablePrintAndSign = default, - bool enableReassign = true, + bool? enableReassign = default, bool? enableSigningOrder = default, IEnumerable documentInfo = default, string onBehalfOf = default, - int[] roleRemovalIndices = default) + int[] roleRemovalIndices = default, + DocumentDownloadOption? documentDownloadOption = default) { this.TemplateId = templateId; this.Title = title; @@ -92,6 +95,7 @@ public SendForSignFromTemplate( this.DocumentInfo = documentInfo; this.OnBehalfOf = onBehalfOf; this.RoleRemovalIndices = roleRemovalIndices; + this.DocumentDownloadOption = documentDownloadOption; } /// @@ -140,6 +144,12 @@ public SendForSignFromTemplate( [DataMember(Name = "disableEmails", EmitDefaultValue = true)] public bool DisableEmails { get; set; } + /// + /// Gets or sets a value indicating whether to enable SMS notification.When disable sms is set to true, all the status sms and completed document sms will be stopped, and reminder is also automatically ignored. + /// + [DataMember(Name ="disableSMS", EmitDefaultValue = true)] + public bool DisableSMS { get; set; } + /// /// Gets or sets a value indicating whether to remove the document ID watermark from all the PDF pages of the document. /// Default is false. @@ -163,7 +173,7 @@ public SendForSignFromTemplate( /// Gets or sets the expiry date type. /// [DataMember(Name = "expiryDateType", EmitDefaultValue = false)] - public ExpiryDateType ExpiryDateType { get; set; } + public ExpiryDateType? ExpiryDateType { get; set; } /// /// Gets or sets number of days after which the document will expire. @@ -184,7 +194,7 @@ public SendForSignFromTemplate( /// If the document expires in one day, the email will be sent before 2 hours of the expiry. /// [DataMember(Name = "disableExpiryAlert", EmitDefaultValue = true)] - public bool DisableExpiryAlert { get; set; } + public bool? DisableExpiryAlert { get; set; } /// /// Gets or sets a value indicating whether to enable print and sign mode. @@ -197,7 +207,7 @@ public SendForSignFromTemplate( /// By Default True. /// [DataMember(Name = "enableReassign", EmitDefaultValue = true)] - public bool EnableReassign { get; set; } = true; + public bool? EnableReassign { get; set; } /// /// Gets or sets a value indicating whether to enable signing order for the document signer. @@ -223,6 +233,25 @@ public SendForSignFromTemplate( [DataMember(Name = "roleRemovalIndices", EmitDefaultValue = false)] public int[] RoleRemovalIndices { get; set; } + /// + /// Gets or sets a value to customize how the documents are downloaded. + /// + [DataMember(Name = "documentDownloadOption", EmitDefaultValue = true)] + public DocumentDownloadOption? DocumentDownloadOption { get; set; } + + /// + /// Gets or sets the Recipient Notification Settings. + /// + [JsonProperty("recipientNotificationSettings")] + [Display(Description = "Recipient Notification Settings of the Template.")] + public RecipientNotificationSettings RecipientNotificationSettings { get; set; } + + /// + /// Gets or sets remove form fields id. + /// + [DataMember(Name = "removeFormFields", EmitDefaultValue = false)] + public List RemoveFormFields { get; set; } + /// /// Returns the JSON string presentation of the object. /// diff --git a/src/BoldSign/Model/SenderIdentityRequest.cs b/src/BoldSign/Model/SenderIdentityRequest.cs index cc9f311..a336d5b 100644 --- a/src/BoldSign/Model/SenderIdentityRequest.cs +++ b/src/BoldSign/Model/SenderIdentityRequest.cs @@ -4,6 +4,7 @@ namespace BoldSign.Model { + using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using Newtonsoft.Json; @@ -20,11 +21,15 @@ public class SenderIdentityRequest /// Gets or sets name. /// Gets or sets email. /// Gets or sets notification settings. - public SenderIdentityRequest(string name, string email, NotificationSettings notificationSettings) + /// Gets or sets brand Id. + /// Gets or sets redirect url. + public SenderIdentityRequest(string name, string email, NotificationSettings notificationSettings, string brandId = null, Uri redirectUrl = null) { this.Name = name; this.Email = email; this.NotificationSettings = notificationSettings; + this.BrandId = brandId; + this.RedirectUrl = redirectUrl; } /// @@ -47,6 +52,18 @@ public SenderIdentityRequest(string name, string email, NotificationSettings not [DataMember(Name = "notificationSettings")] public NotificationSettings NotificationSettings { get; set; } + /// + /// Gets or sets the brand Id. + /// + [DataMember(Name = "brandId", EmitDefaultValue = true)] + public string BrandId { get; set; } + + /// + /// Gets or sets the redirect URL. + /// + [DataMember(Name = "redirectUrl", EmitDefaultValue = true)] + public Uri RedirectUrl { get; set; } + /// /// Returns the JSON string presentation of the object. /// diff --git a/src/BoldSign/Model/SenderIdentityViewModel.cs b/src/BoldSign/Model/SenderIdentityViewModel.cs index c75ea98..5085d28 100644 --- a/src/BoldSign/Model/SenderIdentityViewModel.cs +++ b/src/BoldSign/Model/SenderIdentityViewModel.cs @@ -64,5 +64,17 @@ public class SenderIdentityViewModel /// [DataMember(Name = "notificationSettings")] public NotificationSettings NotificationSettings { get; set; } + + /// + /// Gets or sets the brand Id. + /// + [DataMember(Name = "brandId")] + public string BrandId { get; set; } + + /// + /// Gets or sets the redirect URL. + /// + [DataMember(Name = "redirectUrl")] + public string RedirectUrl { get; set; } } } diff --git a/src/BoldSign/Model/Template.cs b/src/BoldSign/Model/Template.cs index 46c9e23..969aca7 100644 --- a/src/BoldSign/Model/Template.cs +++ b/src/BoldSign/Model/Template.cs @@ -1,10 +1,10 @@ -/* +/* * 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 */ @@ -45,7 +45,11 @@ public class Template /// template shared to.. /// /// Gets or sets a value indicating whether get or Set the isTemplate. (default to false). - public Template(string documentId = default, TemplateSenderDetails senderDetail = default, List ccDetails = default, long createdDate = default, long? activityDate = default, string activityBy = default, string messageTitle = default, DocumentStatus? status = default, List signerDetails = default, bool enableSigningOrder = default, string templateName = default, string templateDescription = default, TemplateAccessType? accessType = default, string accessTid = default, bool isTemplate = false) + /// Gets or sets the behalf of details.. + /// Gets or sets the template labels. + /// Gets or sets the labels. + /// Gets or sets the brandId. + public Template(string documentId = default, TemplateSenderDetails senderDetail = default, List ccDetails = default, long createdDate = default, long? activityDate = default, string activityBy = default, string messageTitle = default, DocumentStatus? status = default, List signerDetails = default, bool enableSigningOrder = default, string templateName = default, string templateDescription = default, TemplateAccessType? accessType = default, string accessTid = default, bool isTemplate = false, BehalfOf behalfOf = default, List templateLabels = default, List labels = default, string brandId = default) { this.DocumentId = documentId; this.CcDetails = ccDetails; @@ -70,6 +74,10 @@ public Template(string documentId = default, TemplateSenderDetails senderDetail this.TemplateDescription = templateDescription; this.AccessType = accessType; this.AccessTid = accessTid; + this.BehalfOf = behalfOf; + this.TemplateLabels = templateLabels; + this.Labels = labels; + this.BrandId = brandId; // use default value if no "isTemplate" provided if (isTemplate == null) @@ -187,6 +195,30 @@ public Template(string documentId = default, TemplateSenderDetails senderDetail [DataMember(Name = "isTemplate", EmitDefaultValue = false)] public bool IsTemplate { get; set; } + /// + /// Gets or sets the behalf of details. + /// + [DataMember(Name = "behalfOf", EmitDefaultValue = false)] + public BehalfOf BehalfOf { get; set; } + + /// + /// Gets or sets the template labels. + /// + [DataMember(Name = "templateLabels", EmitDefaultValue = false)] + public List TemplateLabels { get; set; } + + /// + /// Gets or sets the labels. + /// + [DataMember(Name = "labels", EmitDefaultValue = false)] + public List Labels { get; set; } + + /// + /// Gets or sets the brandId. + /// + [DataMember(Name = "brandId", EmitDefaultValue = false)] + public string BrandId { get; set; } + /// /// Returns the JSON string presentation of the object /// diff --git a/src/BoldSign/Model/TemplateFormField.cs b/src/BoldSign/Model/TemplateFormField.cs index c4f62d2..1a499b2 100644 --- a/src/BoldSign/Model/TemplateFormField.cs +++ b/src/BoldSign/Model/TemplateFormField.cs @@ -28,7 +28,7 @@ public class TemplateFormField /// /// Initializes a new instance of the class. /// - /// fieldType. + /// fieldType. /// Gets or sets the page number. (required). /// bounds (required). /// Gets or sets a value indicating whether is required.. @@ -57,9 +57,14 @@ public class TemplateFormField /// Gets or sets the conditionalRules. /// Gets or sets the textAlign. /// Gets or sets the direction of the text. - public TemplateFormField(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 groupName = default, List dropdownOptions = default(List), string placeholder = default(string), string dateFormat = default, BoldSign.Model.ValidationType validationType = default(BoldSign.Model.ValidationType), string validationCustomRegex = default(string), string validationCustomRegexMessage = default(string), string dataSyncTag = default, bool isReadOnly = default, List conditionalRules = default(List), TextAlign textAlign = TextAlign.Left, TextDirection textDirection = TextDirection.LTR) + /// Gets or sets the space of the character. + /// Gets or sets the fieldType. + /// Gets or sets the hyperlinkText. + /// Gets or sets the label value. + /// Gets or sets the timeFormat. + public TemplateFormField(FieldType fieldType = 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 groupName = default, List dropdownOptions = default(List), string placeholder = default(string), string dateFormat = default, BoldSign.Model.ValidationType validationType = default(BoldSign.Model.ValidationType), string validationCustomRegex = default(string), string validationCustomRegexMessage = default(string), string dataSyncTag = default, bool isReadOnly = default, List conditionalRules = default(List), TextAlign textAlign = TextAlign.Left, TextDirection textDirection = TextDirection.LTR, float characterSpacing = default, string type = default, string hyperlinkText = default, string label = default, string timeFormat = default) { - this.mType = type; + this.mType = fieldType; this.PageNumber = pageNumber; this.Bounds = bounds; this.Value = value; @@ -88,6 +93,11 @@ public class TemplateFormField this.ConditionalRules = conditionalRules; this.TextAlign = textAlign; this.TextDirection = textDirection; + this.CharacterSpacing = characterSpacing; + this.FieldType = type; + this.HyperlinkText = hyperlinkText; + this.Label = label; + this.TimeFormat = timeFormat; } /// @@ -235,6 +245,17 @@ public class TemplateFormField [DataMember(Name = "dateFormat", EmitDefaultValue = false)] public string DateFormat { get; set; } + /// + /// Gets or sets the TimeFormat and it's only applicable for DateSigned field. + /// Please use the pre-defined TimeFormat. + /// Supported formats: + /// hh:mm tt, h:mm tt, HH:mm, H:mm. + /// + /// The default value is time format specified in the business profile. + /// + [DataMember(Name = "timeFormat", EmitDefaultValue = false)] + public string TimeFormat { get; set; } + /// /// Gets or Sets Placeholder value. /// @@ -251,6 +272,7 @@ public class TemplateFormField /// Gets or sets the form field type. /// [DataMember(Name = "fieldType", EmitDefaultValue = true)] + [Obsolete("Type is deprecated, please use FieldType instead.")] public virtual FieldType Type { get { return this.mType; } @@ -263,6 +285,12 @@ public virtual FieldType Type [DataMember(Name = "groupName", EmitDefaultValue = true)] public string GroupName { get; set; } + /// + /// Gets or sets the Label for radio button fields. + /// + [DataMember(Name = "label", EmitDefaultValue = true)] + public string Label { get; set; } + /// /// Gets or sets the data sync tag value and it's only applicable for textbox, image, dropdown, checkbox fields, it won't affect the other fields. /// @@ -295,5 +323,41 @@ public virtual FieldType Type [DataMember(Name = "textDirection", EmitDefaultValue = true)] public TextDirection TextDirection { get; set; } + /// + /// Gets or sets the character spacing. + /// + /// Gets the value of character spacing. + [DataMember(Name = "characterSpacing", EmitDefaultValue = true)] + public float CharacterSpacing { get; set; } + + /// + /// Gets or sets the field type. + /// + /// Gets the value of field type. + [DataMember(Name = "type", EmitDefaultValue = true)] + public string FieldType { get; set; } + + /// + /// Gets or sets the hyperlink text. + /// + /// Gets the value of hyperlink text. + [DataMember(Name = "hyperlinkText", EmitDefaultValue = true)] + public string HyperlinkText { get; set; } + + /// + /// Gets or sets the background hex color. + /// The BackgroundHexColor property allows you to set the background color of a label field using hexadecimal color codes ("#FF5733"). The default color is transparent or no background color. + /// Default value is null. + /// + /// Gets the value of backgroundColor. + [DataMember(Name = "backgroundHexColor", EmitDefaultValue = false)] + public string BackgroundHexColor { get; set; } + + /// + /// Gets or sets the tab index position . + /// + [DataMember(Name = "tabIndex", EmitDefaultValue = true)] + public int TabIndex { get; set; } + } } diff --git a/src/BoldSign/Model/TemplateProperties.cs b/src/BoldSign/Model/TemplateProperties.cs index 451d90e..5cae06a 100644 --- a/src/BoldSign/Model/TemplateProperties.cs +++ b/src/BoldSign/Model/TemplateProperties.cs @@ -40,6 +40,8 @@ public class TemplateProperties /// Gets or sets the brand id.. /// Gets or sets the allowMessageEditing..> /// Gets or sets the allowNewRoles.. + /// Gets or sets the allowNewFiles.. + /// Gets or sets the allowModifyFiles.. /// Gets or sets a value indicating whether to Enable Reassign.By Default True.. /// Gets or sets a value indicating whether to Enable Print And Sign. /// Gets or sets a value indicating whether to enable signing order.. @@ -47,6 +49,10 @@ public class TemplateProperties /// createdBy. /// sharedTemplateDetail.. /// Gets or sets the documentInfo..> + /// Gets or sets the documentDownloadOption. + /// Gets or sets the documentLabels. + /// Gets or sets the templateLabels. + /// Gets or sets the behalf of details.. public TemplateProperties( string templateId = default(string), string title = default(string), @@ -60,13 +66,19 @@ public TemplateProperties( string brandId = default(string), bool allowMessageEditing = default(bool), bool allowNewRoles = default(bool), + bool allowNewFiles = default(bool), + bool allowModifyFiles = default(bool), bool enableReassign = default(bool), bool enablePrintAndSign = default(bool), bool enableSigningOrder = default(bool), long? createdDate = default(long?), TemplateSenderDetail createdBy = default(TemplateSenderDetail), List sharedTemplateDetail = default(List), - IEnumerable documentInfo = default(IEnumerable)) + IEnumerable documentInfo = default(IEnumerable), + DocumentDownloadOption documentDownloadOption = default(DocumentDownloadOption), + List labels = default(List), + List templateLabels = default(List), + BehalfOf behalfOf = default(BehalfOf)) { this.TemplateId = templateId; this.MessageTitle = title; @@ -80,6 +92,8 @@ public TemplateProperties( this.BrandId = brandId; this.AllowMessageEditing = allowMessageEditing; this.AllowNewRoles = allowNewRoles; + this.AllowNewFiles = allowNewFiles; + this.AllowModifyFiles = allowModifyFiles; this.EnableReassign = enableReassign; this.EnablePrintAndSign = enablePrintAndSign; this.EnableSigningOrder = enableSigningOrder; @@ -87,6 +101,10 @@ public TemplateProperties( this.CreatedBy = createdBy; this.SharedTemplateDetail = sharedTemplateDetail; this.DocumentInfo = documentInfo; + this.DocumentDownloadOption = documentDownloadOption; + this.Labels = labels; + this.TemplateLabels = templateLabels; + this.BehalfOf = behalfOf; } /// @@ -170,6 +188,20 @@ public TemplateProperties( [DataMember(Name = "allowNewRoles", EmitDefaultValue = false)] public bool? AllowNewRoles { get; set; } + /// + /// Gets or sets a value indicating whether allow new files is enabled. + /// + /// Gets or sets a value of indicating whether to enable allow new files. + [DataMember(Name = "allowNewFiles", EmitDefaultValue = false)] + public bool? AllowNewFiles { get; set; } + + /// + /// Gets or sets a value indicating whether allow modify files is enabled. + /// + /// Gets or sets a value of indicating whether to enable modify files. + [DataMember(Name = "allowModifyFiles", EmitDefaultValue = false)] + public bool? AllowModifyFiles { get; set; } + /// /// Gets or sets a value indicating whether reassign is enabled. /// @@ -218,6 +250,40 @@ public TemplateProperties( [JsonProperty("documentInfo")] public IEnumerable DocumentInfo { get; set; } + /// + /// Gets or sets a value indicating whether to enable individual document downloads. + /// + [DataMember(Name = "documentDownloadOption", EmitDefaultValue = true)] + public DocumentDownloadOption DocumentDownloadOption { get; set; } + + /// + /// Gets or sets the Tag's Name. + /// + [DataMember(Name = "labels", EmitDefaultValue = false)] + [JsonProperty("labels")] + public List Labels { get; set; } + + /// + /// Gets or sets the Tag's Name. + /// + [DataMember(Name = "templateLabels", EmitDefaultValue = false)] + [JsonProperty("templateLabels")] + public List TemplateLabels { get; set; } + + /// + /// Gets or sets the behalf of details. + /// + /// Gets the value of behalf of details. + [DataMember(Name = "behalfOf", EmitDefaultValue = false)] + public BehalfOf BehalfOf { get; set; } + + /// + /// Gets or sets the Recipient Notification Settings. + /// + /// Gets or sets the Recipient Notification Settings of the signer. + [DataMember(Name = "recipientNotificationSettings", EmitDefaultValue = false)] + public RecipientNotificationSettings RecipientNotificationSettings { get; set; } + /// /// Returns the JSON string presentation of the object. /// diff --git a/src/BoldSign/Model/TemplateRole.cs b/src/BoldSign/Model/TemplateRole.cs index 0a4c91d..1c8edac 100644 --- a/src/BoldSign/Model/TemplateRole.cs +++ b/src/BoldSign/Model/TemplateRole.cs @@ -36,6 +36,7 @@ public class TemplateRole /// Gets or sets the authentication type of template. /// Gets or sets the allow permission to role delete option of template. /// Gets or sets the allow permission to role edit option of template. + [Obsolete("The language-based constructor is deprecated. Please use the new constructor: TemplateRole(int roleIndex, string name, string defaultSignerName = default, string defaultSignerEmail = default, int signerOrder = default, SignerType signerType = SignerType.Signer, List formFields = default, string hostEmail = default, ImposeAuthentication imposeAuthentication = ImposeAuthentication.None, bool allowRoleEdit = true, bool allowRoleDelete = true, Locales locale = Locales.EN)")] public TemplateRole( string name, int index, @@ -45,7 +46,7 @@ public TemplateRole( SignerType signerType = SignerType.Signer, List formFields = default, string hostEmail = default, - Languages language = Languages.English, + Languages language = Languages.None, ImposeAuthentication imposeAuthentication = ImposeAuthentication.None, bool allowRoleEdit = true, bool allowRoleDelete = true) @@ -74,6 +75,62 @@ public TemplateRole( } /// + /// Initializes a new instance of the class. + /// + /// Gets or sets the role index. (required). + /// Gets or sets the name. (required). + /// Gets or sets the role signer name. + /// Gets or sets the role signer email address. + /// Gets or sets the signer order. + /// signerType. + /// Gets or sets the formFields. + /// Gets or sets the hostEmail. + /// Gets or sets the authentication type of template. + /// Gets or sets the allow permission to role delete option of template. + /// Gets or sets the allow permission to role edit option of template. + /// Gets or sets the locale. + public TemplateRole( + int roleIndex, + string name, + string defaultSignerName = default, + string defaultSignerEmail = default, + int signerOrder = default, + SignerType signerType = SignerType.Signer, + List formFields = default, + string hostEmail = default, + ImposeAuthentication imposeAuthentication = ImposeAuthentication.None, + bool allowRoleEdit = true, + bool allowRoleDelete = true, + Locales locale = Locales.EN) + { + // to ensure "name" is required (not null) + if (string.IsNullOrEmpty(name)) + { + throw new InvalidDataException(ApiValidationMessages.RoleName); + } + this.Index = roleIndex; + this.Name = name; + this.DefaultSignerName = defaultSignerName; + this.DefaultSignerEmail = defaultSignerEmail; + this.SignerOrder = signerOrder; + this.SignerType = signerType; + this.FormFields = formFields; + this.HostEmail = hostEmail; + this.ImposeAuthentication = imposeAuthentication; + this.AllowRoleDelete = allowRoleDelete; + this.AllowRoleEdit = allowRoleEdit; + this.Locale = locale; + } + + /// + /// Initializes a new instance of the class. + /// + public TemplateRole() + { + + } + + /// /// Gets or sets the role Name. /// [DataMember(Name = "name", EmitDefaultValue = false)] @@ -120,14 +177,27 @@ public TemplateRole( /// Gets or sets Languages such as English, French, Spanish, German. /// [DataMember(Name = "language", EmitDefaultValue = true)] + [Obsolete("language is deprecated, please use locale instead")] public Languages Language { get; set; } + /// + /// Gets or sets locale such as EN, FR, ES. + /// + [DataMember(Name = "locale", EmitDefaultValue = true)] + public Locales Locale { get; set; } + /// /// Gets or sets the Authentication Type such as None ,Access Code, EmailOTP. /// [DataMember(Name = "imposeAuthentication", EmitDefaultValue = true)] public ImposeAuthentication ImposeAuthentication { get; set; } + /// + /// Gets or sets a value indicating whether gets or sets the allow field configuration. + /// + [DataMember(Name = "allowFieldConfiguration", EmitDefaultValue = false)] + public bool AllowFieldConfiguration { get; set; } + /// /// Gets or sets document Form fields such as Sign, Checkbox, Radio buttons etc. /// @@ -146,6 +216,24 @@ public TemplateRole( [DataMember(Name = "allowRoleDelete", EmitDefaultValue = true)] public bool AllowRoleDelete { get; set; } = true; + /// + /// Gets or sets the phone number. + /// + [DataMember(Name = "phoneNumber", EmitDefaultValue = false)] + public PhoneNumber PhoneNumber { get; set; } + + /// + /// Gets or Sets the delivery mode of the signer. + /// + [DataMember(Name = "deliveryMode", EmitDefaultValue = true)] + public DeliveryMode DeliveryMode { get; set; } = DeliveryMode.Email; + + /// + /// Gets or sets the Recipient Notification Settings. + /// + [DataMember(Name = "recipientNotificationSettings", EmitDefaultValue = false)] + public RecipientNotificationSettings RecipientNotificationSettings { get; set; } + /// /// Returns the JSON string presentation of the object. /// diff --git a/src/BoldSign/Model/TemplateSignerDetails.cs b/src/BoldSign/Model/TemplateSignerDetails.cs index c41e22a..5f3b261 100644 --- a/src/BoldSign/Model/TemplateSignerDetails.cs +++ b/src/BoldSign/Model/TemplateSignerDetails.cs @@ -1,10 +1,10 @@ -/* +/* * 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 */ @@ -15,6 +15,7 @@ namespace BoldSign.Model using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; + using BoldSign.Api.Model; using Newtonsoft.Json; /// @@ -38,7 +39,8 @@ public class TemplateSignerDetails /// Gets or sets the host user email.. /// Gets or sets the host user name.. /// Gets or sets the host user id.. - public TemplateSignerDetails(string signerName = default, string signerRole = default, string signerEmail = default, SignerStatus? status = default, bool enableAccessCode = default, bool enableEmailOTP = default, string userId = default, int order = default, SignerType? signerType = default, string hostEmail = default, string hostName = default, string hostUserId = default) + /// impose Authentication. + public TemplateSignerDetails(string signerName = default, string signerRole = default, string signerEmail = default, SignerStatus? status = default, bool enableAccessCode = default, bool enableEmailOTP = default, string userId = default, int order = default, SignerType? signerType = default, string hostEmail = default, string hostName = default, string hostUserId = default, ImposeAuthentication imposeAuthentication = ImposeAuthentication.None) { this.SignerName = signerName; this.SignerRole = signerRole; @@ -59,6 +61,7 @@ public TemplateSignerDetails(string signerName = default, string signerRole = de this.HostEmail = hostEmail; this.HostName = hostName; this.HostUserId = hostUserId; + this.ImposeAuthentication = imposeAuthentication; } /// @@ -108,6 +111,13 @@ public TemplateSignerDetails(string signerName = default, string signerRole = de [DataMember(Name = "enableEmailOTP", EmitDefaultValue = false)] public bool EnableEmailOTP { get; set; } + /// + /// Gets or sets a value of impose authentication. + /// + /// Gets or sets the impose authentication. + [DataMember(Name = "imposeAuthentication", EmitDefaultValue = false)] + public ImposeAuthentication ImposeAuthentication { get; set; } + /// /// Gets or sets the user Id. /// @@ -143,6 +153,26 @@ public TemplateSignerDetails(string signerName = default, string signerRole = de [DataMember(Name = "hostUserId", EmitDefaultValue = true)] public string HostUserId { get; set; } + /// + /// Gets or Sets a delivery mode. + /// + /// Gets or sets the delivery mode. + [DataMember(Name = "deliveryMode", EmitDefaultValue = true)] + public DeliveryMode DeliveryMode { get; set; } + + /// + /// Gets or sets the phone number. + /// + /// Gets or sets a phone number. + [DataMember(Name = "phoneNumber", EmitDefaultValue = false)] + public PhoneNumber PhoneNumber { get; set; } + + /// + /// Gets or sets a value indicating whether gets or sets the allow field configuration. + /// + [DataMember(Name = "allowFieldConfiguration", EmitDefaultValue = false)] + public bool AllowFieldConfiguration { get; set; } + /// /// Returns the JSON string presentation of the object /// diff --git a/src/BoldSign/Model/TemplateTag.cs b/src/BoldSign/Model/TemplateTag.cs new file mode 100644 index 0000000..9aafe75 --- /dev/null +++ b/src/BoldSign/Model/TemplateTag.cs @@ -0,0 +1,39 @@ +// +// Copyright (c) Syncfusion Inc. All rights reserved. +// +namespace BoldSign.Api.Model +{ + using System.Collections.Generic; + using System.Runtime.Serialization; + + /// + /// The Add and Delete tag model. + /// + [DataContract] + public class TemplateTag + { + /// + /// Gets or sets the template id. + /// + [DataMember(Name = "templateId", EmitDefaultValue = false)] + public string TemplateId { get; set; } + + /// + /// Gets or sets the Tag's Name. + /// + [DataMember(Name = "documentLabels", EmitDefaultValue = false)] + public List DocumentLabels { get; set; } + + /// + /// Gets or sets the Tag's Name. + /// + [DataMember(Name = "templateLabels", EmitDefaultValue = false)] + public List TemplateLabels { get; set; } + + /// + /// Gets or sets the on behalf of email. + /// + [DataMember(Name = "onBehalfOf", EmitDefaultValue = false)] + public string OnBehalfOf { get; set; } + } +} \ No newline at end of file diff --git a/src/BoldSign/Model/TextTags/TextTagDefinition.cs b/src/BoldSign/Model/TextTags/TextTagDefinition.cs index 788afdc..85a2b8d 100644 --- a/src/BoldSign/Model/TextTags/TextTagDefinition.cs +++ b/src/BoldSign/Model/TextTags/TextTagDefinition.cs @@ -45,6 +45,7 @@ public class TextTagDefinition /// Gets or sets the imageInfo. /// Gets or sets the hyperlinkText. /// Gets or sets the attachmentInfo. + /// Gets or sets the timeFormat. public TextTagDefinition( string definitionId, FieldType type, @@ -61,7 +62,8 @@ public TextTagDefinition( List dropdownOptions = default, ImageInfo imageInfo = default, string hyperlinkText = default, - AttachmentInfo attachmentInfo = default) + AttachmentInfo attachmentInfo = default, + string timeFormat = default) { this.DefinitionId = definitionId; this.Type = type; @@ -79,6 +81,7 @@ public TextTagDefinition( this.ImageInfo = imageInfo; this.HyperlinkText = hyperlinkText; this.AttachmentInfo = attachmentInfo; + this.TimeFormat = timeFormat; } /// @@ -142,6 +145,12 @@ public TextTagDefinition( [DataMember(Name = "dateFormat", EmitDefaultValue = false)] public string DateFormat { get; set; } + /// + /// Gets or sets timeFormat. + /// + [DataMember(Name = "timeFormat", EmitDefaultValue = false)] + public string TimeFormat { get; set; } + /// /// Gets or sets RadioGroupName. /// @@ -178,5 +187,18 @@ public TextTagDefinition( /// [DataMember(Name = "attachmentInfo", EmitDefaultValue = false)] public AttachmentInfo AttachmentInfo { get; set; } + + /// + /// Gets or sets the Tab Index. + /// + [DataMember(Name = "tabIndex", EmitDefaultValue = false)] + [Range(-1, int.MaxValue, ErrorMessage = "The minimum value must be -1 or higher")] + public int? TabIndex { get; set; } + + /// + /// Gets or sets the label. + /// + [DataMember(Name = "label", EmitDefaultValue = false)] + public string Label { get; set; } } } diff --git a/src/BoldSign/Model/ViewBrandDetails.cs b/src/BoldSign/Model/ViewBrandDetails.cs index 87a1d46..ec579e3 100644 --- a/src/BoldSign/Model/ViewBrandDetails.cs +++ b/src/BoldSign/Model/ViewBrandDetails.cs @@ -103,6 +103,12 @@ public class ViewBrandDetails [DataMember(Name = "combineAuditTrail", EmitDefaultValue = true)] public bool CombineAuditTrail { get; set; } + /// + /// Gets or sets a value indicating whether exclude audit trial from email enable or not. + /// + [DataMember(Name = "excludeAuditTrailFromEmail", EmitDefaultValue = true)] + public bool ExcludeAuditTrailFromEmail { get; set; } + /// /// Gets or sets a value indicating delivery of the signed document in email as attachment or link to view and download the document. /// @@ -115,6 +121,36 @@ public class ViewBrandDetails [DataMember(Name = "documentTimeZone", EmitDefaultValue = true)] public string DocumentTimeZone { get; set; } + /// + /// Gets or sets a value indicating whether standard fields can be viewed or not. + /// + [DataMember(Name = "showBuiltInFormFields", EmitDefaultValue = true)] + public bool ShowBuiltInFormFields { get; set; } + + /// + /// Gets or sets a value indicating whether custom fields are allowed to create. + /// + [DataMember(Name = "allowCustomFieldCreation", EmitDefaultValue = true)] + public bool AllowCustomFieldCreation { get; set; } + + /// + /// Gets or sets a value indicating whether shared fields can be viewed or not. + /// + [DataMember(Name = "showSharedCustomFields", EmitDefaultValue = true)] + public bool ShowSharedCustomFields { get; set; } + + /// + /// Gets or sets a value indicating whether to hide decline. + /// + [DataMember(Name = "hideDecline", EmitDefaultValue = true)] + public bool HideDecline { get; set; } + + /// + /// Gets or sets a value indicating whether to hide save. + /// + [DataMember(Name = "hideSave", EmitDefaultValue = true)] + public bool HideSave { get; set; } + /// /// Returns the JSON string presentation of the object. /// diff --git a/src/BoldSign/Model/ViewCustomFieldDetails.cs b/src/BoldSign/Model/ViewCustomFieldDetails.cs new file mode 100644 index 0000000..3b83fe5 --- /dev/null +++ b/src/BoldSign/Model/ViewCustomFieldDetails.cs @@ -0,0 +1,67 @@ +// +// Copyright (c) Syncfusion Inc. All rights reserved. +// + +/* +* 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; + + /// + /// The custom field details. + /// + [DataContract] + public class ViewCustomFieldDetails + { + /// + /// Gets or sets the custom form field. + /// + [DataMember(Name = "customFieldId", EmitDefaultValue = true)] + public string CustomFieldId { get; set; } + + /// + /// Gets or sets the custom form field name. + /// + [DataMember(Name = "fieldName", EmitDefaultValue = true)] + public string FieldName { get; set; } + + /// + /// Gets or sets the custom form field description. + /// + [DataMember(Name = "fieldDescription", EmitDefaultValue = true)] + public string FieldDescription { get; set; } + + /// + /// Gets or sets the custom form field order. + /// + [DataMember(Name = "fieldOrder", EmitDefaultValue = true)] + public int FieldOrder { get; set; } + + /// + /// Gets or sets the brand id. + /// + [DataMember(Name = "brandId", EmitDefaultValue = true)] + public string BrandId { get; set; } + + /// + /// Gets or sets a value indicating whether its a sharable custom form field. + /// + [DataMember(Name = "sharedField", EmitDefaultValue = true)] + public bool SharedField { get; set; } + + /// + /// Gets or sets the custom form field. + /// + [DataMember(Name = "formField", EmitDefaultValue = true)] + public CustomFormField FormField { get; set; } + } +} diff --git a/src/BoldSign/Model/Webhook/DocumentEvent.cs b/src/BoldSign/Model/Webhook/DocumentEvent.cs index a22dbc0..2c79eed 100644 --- a/src/BoldSign/Model/Webhook/DocumentEvent.cs +++ b/src/BoldSign/Model/Webhook/DocumentEvent.cs @@ -10,6 +10,7 @@ namespace BoldSign.Model.Webhook { + using BoldSign.Api.Model; using System; using System.Linq; using System.IO; @@ -156,5 +157,19 @@ public class DocumentEvent : IWebhookData [DataMember(Name = "isCombinedAudit", EmitDefaultValue = false)] [JsonProperty("isCombinedAudit")] public bool? IsCombinedAudit { get; set; } + + /// + /// Gets or sets the selected brand. + /// + [DataMember(Name = "brandId", EmitDefaultValue = false)] + [JsonProperty("brandId")] + public string BrandId { get; set; } + + /// + /// Gets or sets the document download option. + /// + [DataMember(Name = "documentDownloadOption", EmitDefaultValue = true)] + [JsonProperty("documentDownloadOption")] + public DocumentDownloadOption? DocumentDownloadOption { get; set; } } } diff --git a/src/BoldSign/Model/Webhook/SenderIdentityEvent.cs b/src/BoldSign/Model/Webhook/SenderIdentityEvent.cs index e3d05b2..516b4cb 100644 --- a/src/BoldSign/Model/Webhook/SenderIdentityEvent.cs +++ b/src/BoldSign/Model/Webhook/SenderIdentityEvent.cs @@ -63,5 +63,17 @@ public class SenderIdentityEvent : IWebhookData [JsonProperty("approvedDateTime")] [JsonConverter(typeof(UnixDateTimeConverter))] public DateTime? ApprovedDate { get; set; } + + /// + /// Gets or sets the brand id. + /// + [JsonProperty("brandId")] + public string BrandId { get; set; } + + /// + /// Gets or sets the RedirectUrl. + /// + [JsonProperty("redirectUrl")] + public string RedirectUrl { get; set; } } } diff --git a/src/BoldSign/Model/Webhook/SignerDetails.cs b/src/BoldSign/Model/Webhook/SignerDetails.cs index d988a09..322504f 100644 --- a/src/BoldSign/Model/Webhook/SignerDetails.cs +++ b/src/BoldSign/Model/Webhook/SignerDetails.cs @@ -146,5 +146,20 @@ public class SignerDetails [DataMember(Name = "lastActivityDate", EmitDefaultValue = false)] [JsonProperty("lastActivityDate")] public long? LastActivityDate { get; set; } + + /// + /// Gets or sets a authentication type. + /// + [DataMember(Name = "authenticationType", EmitDefaultValue = true)] + [JsonProperty("authenticationType")] + public string AuthenticationType { get; set; } = "None"; + + /// + /// Gets or sets a value indicating whether gets or sets the allow field configuration. + /// + /// Gets or sets a value indicating whether gets or sets the allow field configuration. + [DataMember(Name = "allowFieldConfiguration", EmitDefaultValue = false)] + [JsonProperty("allowFieldConfiguration")] + public bool AllowFieldConfiguration { get; set; } } } diff --git a/src/BoldSign/Model/Webhook/Template/TemplateEvent.cs b/src/BoldSign/Model/Webhook/Template/TemplateEvent.cs index 0d04770..9d15753 100644 --- a/src/BoldSign/Model/Webhook/Template/TemplateEvent.cs +++ b/src/BoldSign/Model/Webhook/Template/TemplateEvent.cs @@ -5,6 +5,7 @@ namespace BoldSign.Api.Model.Webhook.Template { using System; + using System.Collections.Generic; using System.ComponentModel; using BoldSign.Model; using BoldSign.Model.Webhook; @@ -70,6 +71,18 @@ public class TemplateEvent : IWebhookData [JsonProperty("status")] public DocumentStatus Status { get; set; } + /// + /// Gets or sets a value indicating whether to allow new files while using this template to send a document. + /// + [JsonProperty("allowNewFiles")] + public bool? AllowNewFiles { get; set; } + + /// + /// Gets or sets a value indicating whether to allow senders to replace or delete files. + /// + [JsonProperty("allowModifyFiles")] + public bool? AllowModifyFiles { get; set; } + /// /// Gets or sets the signerDetails. /// @@ -107,5 +120,29 @@ public class TemplateEvent : IWebhookData [JsonProperty("isTemplate")] [DefaultValue(false)] public bool IsTemplate { get; set; } + + /// + /// Gets or sets the selected brand. + /// + [JsonProperty("brandId")] + public string BrandId { get; set; } + + /// + /// Gets or sets the on behalf of email. + /// + [JsonProperty("onBehalfOf")] + public string OnBehalfOf { get; set; } + + /// + /// Gets or sets the document labels. + /// + [JsonProperty("labels")] + public IEnumerable Labels { get; set; } + + /// + /// Gets or sets the template labels. + /// + [JsonProperty("templateLabels")] + public IEnumerable TemplateLabels { get; set; } } } diff --git a/src/BoldSign/Model/Webhook/Template/TemplateSigner.cs b/src/BoldSign/Model/Webhook/Template/TemplateSigner.cs index aead2ae..ee69f80 100644 --- a/src/BoldSign/Model/Webhook/Template/TemplateSigner.cs +++ b/src/BoldSign/Model/Webhook/Template/TemplateSigner.cs @@ -4,6 +4,7 @@ namespace BoldSign.Api.Model.Webhook.Template { + using System.Runtime.Serialization; using BoldSign.Model; using Newtonsoft.Json; @@ -83,5 +84,18 @@ public class TemplateSigner /// [JsonProperty("hostUserId")] public string HostUserId { get; set; } + + /// + /// Gets or sets a impose authentication type. + /// + [DataMember(Name = "imposeAuthentication", EmitDefaultValue = true)] + [JsonProperty("imposeAuthentication")] + public string ImposeAuthentication { get; set; } = "None"; + + /// + /// Gets or sets a value indicating whether gets or sets the allow field configuration. + /// + [JsonProperty("allowFieldConfiguration")] + public bool AllowFieldConfiguration { get; set; } } } diff --git a/src/BoldSign/Resources/ApiValidationMessages.Designer.cs b/src/BoldSign/Resources/ApiValidationMessages.Designer.cs index 5e61605..6df77fd 100644 --- a/src/BoldSign/Resources/ApiValidationMessages.Designer.cs +++ b/src/BoldSign/Resources/ApiValidationMessages.Designer.cs @@ -77,6 +77,15 @@ internal static string AccessCodePropertyRequired { } } + /// + /// Looks up a localized string similar to The 'AllowFieldConfiguration' property is unsupported for the Reviewer role.. + /// + internal static string AllowConfigureFieldsError { + get { + return ResourceManager.GetString("AllowConfigureFieldsError", resourceCulture); + } + } + /// /// Looks up a localized string similar to The Attachment Information is required.. /// @@ -140,6 +149,15 @@ internal static string BrandIdDelete { } } + /// + /// Looks up a localized string similar to Missing required parameter 'brandId' when calling BrandingApi-&gt;GetBrand. + /// + internal static string BrandIdGet { + get { + return ResourceManager.GetString("BrandIdGet", resourceCulture); + } + } + /// /// Looks up a localized string similar to Missing required parameter 'brandId' when calling BrandingApi-&gt;ResetDefaultBrand. /// @@ -167,6 +185,24 @@ internal static string BrandNameRequired { } } + /// + /// Looks up a localized string similar to Missing required parameter 'contactId' when calling ContactingApi->DeleteContact. + /// + internal static string ContactIdDelete { + get { + return ResourceManager.GetString("ContactIdDelete", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Missing required parameter 'id' when calling ContactingApi->UpdateContact. + /// + internal static string ContactIdMissing { + get { + return ResourceManager.GetString("ContactIdMissing", resourceCulture); + } + } + /// /// Looks up a localized string similar to The new expiry date must not be less than the current date and time. /// @@ -203,6 +239,15 @@ internal static string DocumentIdRequiredAPI { } } + /// + /// Looks up a localized string similar to The document info locale does not match the signer’s locale {0}.. + /// + internal static string DocumentInfoLocaleMissing { + get { + return ResourceManager.GetString("DocumentInfoLocaleMissing", resourceCulture); + } + } + /// /// Looks up a localized string similar to document info is missing for the signer’s language {0}.. /// @@ -284,6 +329,15 @@ internal static string EmbeddedTemplateIdNull { } } + /// + /// Looks up a localized string similar to {0} cannot be null or empty.. + /// + internal static string EmptyFields { + get { + return ResourceManager.GetString("EmptyFields", resourceCulture); + } + } + /// /// Looks up a localized string similar to Label cannot be null or empty. /// @@ -302,6 +356,15 @@ internal static string EnterValidURL { } } + /// + /// Looks up a localized string similar to Multicast delegate for ExceptionFactory is unsupported. + /// + internal static string ExceptionFactoryUnsupported { + get { + return ResourceManager.GetString("ExceptionFactoryUnsupported", resourceCulture); + } + } + /// /// Looks up a localized string similar to Provided expiry days should be within the range 1 - 180. /// @@ -338,6 +401,42 @@ internal static string ExtraLanguageValues { } } + /// + /// Looks up a localized string similar to Only one document info is allowed per signer locale.. + /// + internal static string ExtraLocaleValues { + get { + return ResourceManager.GetString("ExtraLocaleValues", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Field description is required. + /// + internal static string FieldDescriptionRequired { + get { + return ResourceManager.GetString("FieldDescriptionRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Field id is required. + /// + internal static string FieldIdRequired { + get { + return ResourceManager.GetString("FieldIdRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Field name is required. + /// + internal static string FieldNameRequired { + get { + return ResourceManager.GetString("FieldNameRequired", resourceCulture); + } + } + /// /// Looks up a localized string similar to fieldType is a required property for FormField and cannot be null. /// @@ -347,6 +446,15 @@ internal static string FieldTypeRequired { } } + /// + /// Looks up a localized string similar to Missing required parameter 'files' when calling DocumentApi->SendDocument. + /// + internal static string FilesIsSet { + get { + return ResourceManager.GetString("FilesIsSet", resourceCulture); + } + } + /// /// Looks up a localized string similar to Document's size exceeds the limit of 100 MB. Please replace it. (all files combined). /// @@ -428,6 +536,15 @@ internal static string ImageTitleRequired { } } + /// + /// Looks up a localized string similar to The IImageFile parameter must be an instance of ImageFileStream, ImageFileBytes, or ImageFilePath.. + /// + internal static string InvalidBrandFileInstance { + get { + return ResourceManager.GetString("InvalidBrandFileInstance", resourceCulture); + } + } + /// /// Looks up a localized string similar to Provide a valid brand ID. /// @@ -500,6 +617,15 @@ internal static string InvalidLanguage { } } + /// + /// Looks up a localized string similar to The document info locale {0} does not match the one used in roles.. + /// + internal static string InvalidLocale { + get { + return ResourceManager.GetString("InvalidLocale", resourceCulture); + } + } + /// /// Looks up a localized string similar to Signer order should be between 1 and 50.. /// @@ -554,6 +680,15 @@ internal static string MaxLabelsCount { } } + /// + /// Looks up a localized string similar to A document or template can only contain a maximum of 50 labels. + /// + internal static string MaxTemplateOrDocumentLabelsCount { + get { + return ResourceManager.GetString("MaxTemplateOrDocumentLabelsCount", resourceCulture); + } + } + /// /// Looks up a localized string similar to The message exceeds the limit of 5000 characters. /// @@ -662,6 +797,15 @@ internal static string RequiredName { } } + /// + /// Looks up a localized string similar to Either name or redirectUrl is required to update sender identity.. + /// + internal static string RequiredNameOrRedirectUrl { + get { + return ResourceManager.GetString("RequiredNameOrRedirectUrl", resourceCulture); + } + } + /// /// Looks up a localized string similar to Reviewer should not have any form fields.. /// @@ -743,6 +887,15 @@ internal static string SignersIsSet { } } + /// + /// Looks up a localized string similar to Custom field creation should only be allowed when built-in form fields are enabled. If not, shared custom fields can be enabled.. + /// + internal static string StandardFieldVisibilityErr { + get { + return ResourceManager.GetString("StandardFieldVisibilityErr", resourceCulture); + } + } + /// /// Looks up a localized string similar to Missing required parameter 'teamId' when calling TeamApi-&gt;GetTeamDetails. /// @@ -806,6 +959,15 @@ internal static string TemplateIdNull { } } + /// + /// Looks up a localized string similar to Template ID is required or not in GUID type. + /// + internal static string TemplateIdRequired { + get { + return ResourceManager.GetString("TemplateIdRequired", resourceCulture); + } + } + /// /// Looks up a localized string similar to Template title is required for create template.. /// @@ -851,6 +1013,33 @@ internal static string TitleOrDocumentInfoIsRequired { } } + /// + /// Looks up a localized string similar to Unsupported file. Supported file formats are PNG, JPEG, JPG and SVG.. + /// + internal static string UnsupportedBrandLogoType { + get { + return ResourceManager.GetString("UnsupportedBrandLogoType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unsupported file(s). Supported file formats are PDF, Word, PNG, JPEG, JPG and XLSX. + /// + internal static string UnsupportedFileType { + get { + return ResourceManager.GetString("UnsupportedFileType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unsupported Media Type. + /// + internal static string UnsupportedMediaType { + get { + return ResourceManager.GetString("UnsupportedMediaType", resourceCulture); + } + } + /// /// Looks up a localized string similar to User ID is a required property and cannot be null or empty. /// diff --git a/src/BoldSign/Resources/ApiValidationMessages.resx b/src/BoldSign/Resources/ApiValidationMessages.resx index 3fba0f3..f6341ce 100644 --- a/src/BoldSign/Resources/ApiValidationMessages.resx +++ b/src/BoldSign/Resources/ApiValidationMessages.resx @@ -1,17 +1,17 @@ - @@ -129,6 +129,9 @@ Document ID is required + + Template ID is required or not in GUID type + fieldType is a required property for FormField and cannot be null @@ -279,6 +282,9 @@ A document can only contain a maximum of 50 labels + + A document or template can only contain a maximum of 50 labels + The Brand logo is required @@ -393,4 +399,58 @@ Role Name is Required. + + Custom field creation should only be allowed when built-in form fields are enabled. If not, shared custom fields can be enabled. + + + The document info locale does not match the signer’s locale {0}. + + + Field name is required + + + The document info locale {0} does not match the one used in roles. + + + Field description is required + + + Field id is required + + + Unsupported file(s). Supported file formats are PDF, Word, PNG, JPEG, JPG and XLSX + + + Unsupported Media Type + + + {0} cannot be null or empty. + + + Only one document info is allowed per signer locale. + + + The 'AllowFieldConfiguration' property is unsupported for the Reviewer role. + + + Either name or redirectUrl is required to update sender identity. + + + Unsupported file. Supported file formats are PNG, JPEG, JPG and SVG. + + + The IImageFile parameter must be an instance of ImageFileStream, ImageFileBytes, or ImageFilePath. + + + Missing required parameter 'brandId' when calling BrandingApi-&gt;GetBrand + + + Multicast delegate for ExceptionFactory is unsupported + + + Missing required parameter 'contactId' when calling ContactingApi->DeleteContact + + + Missing required parameter 'id' when calling ContactingApi->UpdateContact + diff --git a/src/BoldSign/icon.png b/src/BoldSign/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..590341640d0fabb265603b89ccf514591cb6bfc9 GIT binary patch literal 3394 zcmY*bc{tO78{cMgOy)=$Nkn5MjpQiDau3aH$Q7H&5t^HvvoKeY6&14FA>=Ga3`x!+ zqU20;xFS@(`|0`p{`o!6=Xu`u^S+9F;JG>GJRDnLjwS#9#Q$BoXWX;=o501vadGfG96Wrl z0_=4;901P)m_dQvT_DjO7-#}M4geQL0U`qUvjbQQ1MhnP_G7>v34EOaX2*ceCxE9C zK$ZcfhJn}h!1ga-`3o@I4!n8_RHXrhG$0ZO1ZV-5B!TrGKxqPS#~Vm<12)%z=efXx zK!8pJK7RmO3xP0wz*QdbRRvfPKs{m@g&fnouSR8%A{cE2$&a`{=g>N z3i~4cTb~v^@-Q*Lo;`y>A47<(%yz$Q%DzD&$Vo)c-NQ$KK>QDJ2Is9pC+6RK20tPQ z!KQonK~&}#G315Lf?q?ui@VqIqeHcDA?^g%l7uM{jjqTBcw|8Rw>DL&py=62FZIWA zrRozE>T8?E9s5Qdc=FwRI*Pk;jC6;V#Vlq<*(Dlb&#hd~(#sWxBP55b!j+fZybM~^ zoq~n#)hVL_S&7xc8_}VcmX6oyy}MW`WG?bYsqWS09F)zlIh|?$Wxz(*pvvymh;Udn zIN;oHK0XZfC4}W@I-==m7hAl^wK-1_2rkF6q|o3>e{zDOlka)ccN{gmrhD7`&|!aM5$8o9 zPfls1NQ`s7EMM9B)|q4H<&Tf9ZM~`06#N-BT}pf} zQ{OyN7a2Nazds|*rB+VV7ZCg?RPhSh`y#|YUQAT4B|4hK?^rHU!ue}aMr9df0e_x( z#wL%%e%Ey-c{#QTyKr`MSMrn{V*Ydw1|GU_PZf@mczth*gFp7!Lr&x`I8;4#D5ifK zh<>6eVd7~(%&tJdOPRL9lfkxWHsQpC*kn0Un9LY-!bcx?J9pTCZ= z4e`#F*U%>Ohaw6iA|TF%CB>P148_W)mfF|a%@Q+5diOJ+a4MxKCm|u1AZQ^IXx&z_ zlEc=uK)>}6Ar{5FQCOJ1H?Ls0!~2X(>!tkVei2c?n=h`xD~jo8gxqp9LVuLYhVo}o z{(_^;i6tA*@7XX!pD6Fw?b9jyJ?k>2;Xkh+)GHiMO@F~$L7Q{iw5}aVPKPy1zLbm0 zO30DeQkwpZ86btMkUh^7U=sz7B&;0{+Jw~q8ZU~mObSOj6Vz*}>Y9%!wmGaJ<`jdJ zg9Jwr%rfghmIvuwx}r?c}wx%f_-IUX!s~B*45aLvo)oj!q?nqqjVh2wLcEX+~AiC;-?0%u)6O(?9phzzNw1XM&Y!TT^zBX}Fae5H*shIOtpGtlC8kSNS zqM4%a+3*c?x#LNUdWXjo9wK!;!t`>D6esLMh9Mg>C|*LCQ3yYeDm=ne4g_0_;eShXz^hKHE19f!lpRJ-f!3#vxPjd zhb_BYs*bUIqRNs}HaeKwF^T$caFvXFSk@vjb;S<6gQ*XoZoStM_Gea_!8>(QY64~W zVBv~rp)Cw*=~f^Fj<>UtUZ9v4Bzl04OFV@r3(i4=FX(mYY&qwVbahUNC7-)0jR+qDi(D24LRQ_)k7u7wou^Rx6Y)WY|)eE5yCO9}#W^{%2<7>fdd+12G(-<%-P ziK<`mjChu-zAY%BJl~OCL3yO?q3N>Zp4WNy7uhF8EYGb}@g(7c+kxb&dhAaEiQ-9f z@dhuT`OjRqEB0z^?l;`k6MFrz!!>HXZLPs{fZTDB~ts6<3n1@^vK4_eBYVJRjRn!Mms)IsoJ;QAF)^;mVZ zL%+p;pF8N}Q(Hehso<7J?D%$M^#kFOqJA%7DMp67%El-Y4KEDV$|Xsnx?X?D$ghPK zDj7rvZM>UF4EHw^r4b#@yqS`D{>nv~(}}yGSaNh~5I@xYySh~H^WAmbY4eS(vcykH zDRri{$1`KJvVY_kGbWL#Cz{8bCT=*9RCy3naq?qBJ~xTeL+duPj&xu2 zBL$@Q#W)^;MX@>uSLV9yf=-O@wI3*S*95yoz+>yJZwAT7qH#1f_y|KmP%MO9@l~z1 zcmLXVx>M`+irx#&COi9QvNOa(6LBKJP0jve>>TaIgY`TptAMHPK*+9Bbt~$PkS|k^ zHPxuC+LbrQ>b9s65BI*Qf2ol`i()agHF{>)7x=sdez(*ZyW71#E$Y98A$LmUF8HA( zo8rI^zpsT!H4KN0v9uobnV|#wkjGpQkVcUKD|Jd6@9s}-bG0&ddSupW(Km_1 zh$ePA2`Pm02z6Mt((r3WaJjgK3n+y<$!l-7EI&6-?M|fTas7C%M9NpplDr#dbr|Kk zRDHBDLYR0E!+IZCh{{OP5}b&Qn!M=s7MfMQD=LzSp~QMO|H0~;WVhcKyPbUJou&{y zlFrA11cmV_ozv-~uio}<-iay4SOM_;pN95}SEcn47)LNN`J1KVX3=Njv>3yrWU;L5 z9VNl1Vxxhl$ANiZq> zT%0PiCS!ITtZH`fRpD(Iw|w**`G>@PyJP-7l9C9C&HM~h;30WI)S9>XTjy3@E>r>k zd{0W8d;5KvTeG2Jv-8#}@$S-hLLMBgdxWE8_L6!`2xiQXCl#6n1I|A-V%ix|A_T^4j8KH5%VA}fv2tg*XkYTB^{PQg9fQ3k< zxN`z~V_)@&?d|Y(SDLEH%|C(SwsW|*`SZPQX-es8up`Ud)sUt61~+nQ#+91Zvtse? zxF&;->N^y%Eawe9cYmO2T%Ha!RiI3d(fHT zTy7Qc(XziXv^8z8!%wMI0r+a@^QYL$#er#Hzo3CCS;a~UuhD1Km!n<7{!n^)YDVL` z->&9SzXyE_S12d6UNpB$m)e{BO&2}Wp24B@TT3FN;tqEPadEIGQE|OGULnandhO19 z4>qz_G+W!Zb~JtBTYhI+k?vu${~CNfJazr%oX-xvw^KK<%_=oEcM`m)aGmq9tjlcg P(FfrS@di)y$g%$c8o*Wo literal 0 HcmV?d00001 From efc3633cb4ae1cd0afd40df285038adfb474dda5 Mon Sep 17 00:00:00 2001 From: MukeshV Date: Fri, 4 Oct 2024 12:15:21 +0530 Subject: [PATCH 2/3] Removed_Nugspec --- src/BoldSign/BoldSign.Api.nuspec | 45 -------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 src/BoldSign/BoldSign.Api.nuspec diff --git a/src/BoldSign/BoldSign.Api.nuspec b/src/BoldSign/BoldSign.Api.nuspec deleted file mode 100644 index af75dfa..0000000 --- a/src/BoldSign/BoldSign.Api.nuspec +++ /dev/null @@ -1,45 +0,0 @@ - - - - BoldSign.Api - #VERSION# - Syncfusion Inc. - false - MIT - https://licenses.nuget.org/MIT - https://github.com/boldsign/api-csharp-sdk - This client library lets you initiate and track e-signature requests through Syncfusion's BoldSign API service. BoldSign is an e-signature app for getting your documents signed online on any device. - -For more information visit https://boldsign.com/?utm_source=nuget&utm_medium=referral&utm_campaign=boldsign. - -Getting Started: https://developers.boldsign.com/api-overview/getting-started/?utm_source=nuget&utm_medium=referral&utm_campaign=boldsign. - - - https://developers.boldsign.com/release-notes/#RELEASENOTES#/?utm_source=nuget&utm_medium=referral&utm_campaign=boldsign - icon.png - Copyright 2001 - 2024 Syncfusion Inc. - boldsign;syncfusion;e-sign;e-signature;boldsign-sdk;document-workflow;api-client - - - - - - - - - - - - - - - - - - - - - - - - From 621f28e4093d758a0c63eb32164ce68a31953086 Mon Sep 17 00:00:00 2001 From: MukeshV Date: Fri, 4 Oct 2024 12:32:22 +0530 Subject: [PATCH 3/3] Updated_Version --- src/BoldSign/BoldSign.Api.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BoldSign/BoldSign.Api.csproj b/src/BoldSign/BoldSign.Api.csproj index 9b6dbd3..634534d 100644 --- a/src/BoldSign/BoldSign.Api.csproj +++ b/src/BoldSign/BoldSign.Api.csproj @@ -1,8 +1,8 @@ netstandard2.0;net452 - 1.0.1 - 1.0.1 + 6.0.7 + 6.0.7 Copyright 2001-2024 Syncfusion Inc BoldSign.Api BoldSign.Api