From 91ba35905aa7e1f1d78d074906f6bf8a0df02314 Mon Sep 17 00:00:00 2001 From: aayush-sib Date: Tue, 30 Aug 2022 22:06:34 +0530 Subject: [PATCH] TRAN-1532 added statistics and recipients object in response of getEmailCampaign --- package-lock.json | 4 +- package.json | 2 +- src/api.ts | 22287 +++++++++++++++++++++++++------------------- 3 files changed, 12786 insertions(+), 9507 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0dcad3d..7215dad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@sendinblue/client", - "version": "3.2.1", + "version": "3.2.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@sendinblue/client", - "version": "3.2.1", + "version": "3.2.2", "license": "MIT", "dependencies": { "bluebird": "^3.5.0", diff --git a/package.json b/package.json index 49aad7c..8f5e74f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sendinblue/client", - "version": "3.2.1", + "version": "3.2.2", "description": "NodeJS client for Sendinblue V3 api", "main": "dist/api.js", "types": "dist/api.d.ts", diff --git a/src/api.ts b/src/api.ts index ee5bfa9..2147de8 100644 --- a/src/api.ts +++ b/src/api.ts @@ -14,7 +14,7 @@ import * as localVarRequest from 'request'; import * as http from 'http'; const defaultBasePath = 'https://api.sendinblue.com/v3'; -const version = '3.2.0'; +const version = '3.2.2'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== @@ -137,28 +137,28 @@ class ObjectSerializer { export class AbTestCampaignResult { /** - * Winning Campaign Info. pending = Campaign has been picked for sending and winning version is yet to be decided, tie = A tie happened between both the versions, notAvailable = Campaign has not yet been picked for sending. - */ + * Winning Campaign Info. pending = Campaign has been picked for sending and winning version is yet to be decided, tie = A tie happened between both the versions, notAvailable = Campaign has not yet been picked for sending. + */ 'winningVersion'?: AbTestCampaignResult.WinningVersionEnum; /** - * Criteria choosen for winning version (Open/Click) - */ +* Criteria choosen for winning version (Open/Click) +*/ 'winningCriteria'?: AbTestCampaignResult.WinningCriteriaEnum; /** - * Subject Line of current winning version - */ + * Subject Line of current winning version + */ 'winningSubjectLine'?: string; /** - * Open rate for current winning version - */ + * Open rate for current winning version + */ 'openRate'?: string; /** - * Click rate for current winning version - */ + * Click rate for current winning version + */ 'clickRate'?: string; /** - * Open/Click rate for the winner version - */ + * Open/Click rate for the winner version + */ 'winningVersionRate'?: string; 'statistics'?: AbTestCampaignResultStatistics; 'clickedLinks'?: AbTestCampaignResultClickedLinks; @@ -296,8 +296,8 @@ export class AbTestCampaignResultStatistics { } /** - * Information on clicked links for a particular version - */ +* Information on clicked links for a particular version +*/ export class AbTestVersionClicks extends Array { static discriminator: string | undefined = undefined; @@ -306,16 +306,16 @@ export class AbTestVersionClicks extends Array { export class AbTestVersionClicksInner { /** - * URL of the link - */ +* URL of the link +*/ 'link': string; /** - * Number of times a link is clicked - */ + * Number of times a link is clicked + */ 'clicksCount': number; /** - * Percentage of clicks of link with respect to total clicks - */ + * Percentage of clicks of link with respect to total clicks + */ 'clickRate': string; static discriminator: string | undefined = undefined; @@ -343,16 +343,16 @@ export class AbTestVersionClicksInner { } /** - * Percentage of a particular event for both versions - */ + * Percentage of a particular event for both versions + */ export class AbTestVersionStats { /** - * percentage of an event for version A - */ + * percentage of an event for version A + */ 'versionA': string; /** - * percentage of an event for version B - */ + * percentage of an event for version B + */ 'versionB': string; static discriminator: string | undefined = undefined; @@ -376,8 +376,8 @@ export class AbTestVersionStats { export class AddChildDomain { /** - * Sender domain to add for a specific child account - */ + * Sender domain to add for a specific child account + */ 'domain'?: string; static discriminator: string | undefined = undefined; @@ -396,12 +396,12 @@ export class AddChildDomain { export class AddContactToList { /** - * Mandatory if IDs are not passed, ignored otherwise. Emails to add to a list. You can pass a maximum of 150 emails for addition in one request. If you need to add the emails in bulk, please prefer /contacts/import api. - */ + * Mandatory if IDs are not passed, ignored otherwise. Emails to add to a list. You can pass a maximum of 150 emails for addition in one request. If you need to add the emails in bulk, please prefer /contacts/import api. + */ 'emails'?: Array; /** - * Mandatory if Emails are not passed, ignored otherwise. Emails to add to a list. You can pass a maximum of 150 emails for addition in one request. If you need to add the emails in bulk, please prefer /contacts/import api. - */ + * Mandatory if Emails are not passed, ignored otherwise. Emails to add to a list. You can pass a maximum of 150 emails for addition in one request. If you need to add the emails in bulk, please prefer /contacts/import api. + */ 'ids'?: Array; static discriminator: string | undefined = undefined; @@ -425,12 +425,12 @@ export class AddContactToList { export class AddCredits { /** - * Required if email credits are empty. SMS credits to be added to the child account - */ + * Required if email credits are empty. SMS credits to be added to the child account + */ 'sms'?: number; /** - * Required if sms credits are empty. Email credits to be added to the child account - */ + * Required if sms credits are empty. Email credits to be added to the child account + */ 'email'?: number; static discriminator: string | undefined = undefined; @@ -454,8 +454,8 @@ export class AddCredits { export class BlockDomain { /** - * name of the domain to be blocked - */ + * name of the domain to be blocked + */ 'domain': string; static discriminator: string | undefined = undefined; @@ -474,151 +474,386 @@ export class BlockDomain { export class Body { /** - * Name of task - */ + * Name of company + */ 'name': string; /** - * Duration of task in milliseconds [1 minute = 60000 ms] - */ - 'duration'?: number; + * Attributes for company creation + */ + 'attributes'?: any; /** - * Id for type of task e.g Call / Email / Meeting etc. - */ - 'taskTypeId': string; + * Country code if phone_number is passed in attributes. + */ + 'countryCode'?: number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "attributes", + "baseName": "attributes", + "type": "any" + }, + { + "name": "countryCode", + "baseName": "countryCode", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return Body.attributeTypeMap; + } + } + + export class Body1 { /** - * Task due date and time - */ - 'date': Date; + * Name of company + */ + 'name'?: string; /** - * Notes added to a task - */ - 'notes'?: string; + * Attributes for company update + */ + 'attributes'?: any; /** - * Task marked as done - */ - 'done'?: boolean; + * Country code if phone_number is passed in attributes. + */ + 'countryCode'?: number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "attributes", + "baseName": "attributes", + "type": "any" + }, + { + "name": "countryCode", + "baseName": "countryCode", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return Body1.attributeTypeMap; + } + } + + export class Body10 { /** - * User id to whom task is assigned - */ - 'assignToId'?: string; + * visitor’s ID received from a webhook or generated by you to bind existing user account to Conversations + */ + 'visitorId': string; /** - * Contact ids for contacts linked to this task - */ - 'contactsIds'?: Array; + * message text + */ + 'text': string; /** - * Deal ids for deals a task is linked to - */ - 'dealsIds'?: Array; + * agent ID. It can be found on agent’s page or received from a webhook. Optional if `groupId` is set. + */ + 'agentId'?: string; /** - * Companies ids for companies a task is linked to - */ - 'companiesIds'?: Array; - 'reminder'?: TaskReminder; + * group ID. It can be found on group’s page. Optional if `agentId` is set. + */ + 'groupId'?: string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "name", - "baseName": "name", + "name": "visitorId", + "baseName": "visitorId", "type": "string" }, { - "name": "duration", - "baseName": "duration", - "type": "number" + "name": "text", + "baseName": "text", + "type": "string" }, { - "name": "taskTypeId", - "baseName": "taskTypeId", + "name": "agentId", + "baseName": "agentId", "type": "string" }, { - "name": "date", - "baseName": "date", - "type": "Date" + "name": "groupId", + "baseName": "groupId", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return Body10.attributeTypeMap; + } + } + + export class Body11 { + /** + * edited message text + */ + 'text': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "text", + "baseName": "text", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return Body11.attributeTypeMap; + } + } + + export class Body12 { + /** + * agent ID. It can be found on agent’s page or received from a webhook. Alternatively, you can use `agentEmail` + `agentName` + `receivedFrom` instead (all 3 fields required). + */ + 'agentId'?: string; + /** + * mark your messages to distinguish messages created by you from the others. + */ + 'receivedFrom'?: string; + /** + * agent email. When sending online pings from a standalone system, it’s hard to maintain a 1-to-1 relationship between the users of both systems. In this case, an agent can be specified by their email address. If there’s no agent with the specified email address in your Sendinblue organization, a dummy agent will be created automatically. + */ + 'agentEmail'?: string; + /** + * agent name. + */ + 'agentName'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "agentId", + "baseName": "agentId", + "type": "string" }, { - "name": "notes", - "baseName": "notes", + "name": "receivedFrom", + "baseName": "receivedFrom", "type": "string" }, { - "name": "done", - "baseName": "done", - "type": "boolean" + "name": "agentEmail", + "baseName": "agentEmail", + "type": "string" }, { - "name": "assignToId", - "baseName": "assignToId", + "name": "agentName", + "baseName": "agentName", "type": "string" + } ]; + + static getAttributeTypeMap() { + return Body12.attributeTypeMap; + } + } + + export class Body2 { + /** + * Contact ids for contacts to be linked with company + */ + 'linkContactIds'?: Array; + /** + * Contact ids for contacts to be unlinked from company + */ + 'unlinkContactIds'?: Array; + /** + * Deals ids for deals to be linked with company + */ + 'linkDealsIds'?: Array; + /** + * Deals ids for deals to be unlinked from company + */ + 'unlinkDealsIds'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "linkContactIds", + "baseName": "linkContactIds", + "type": "Array" }, { - "name": "contactsIds", - "baseName": "contactsIds", + "name": "unlinkContactIds", + "baseName": "unlinkContactIds", "type": "Array" }, { - "name": "dealsIds", - "baseName": "dealsIds", + "name": "linkDealsIds", + "baseName": "linkDealsIds", "type": "Array" }, { - "name": "companiesIds", - "baseName": "companiesIds", + "name": "unlinkDealsIds", + "baseName": "unlinkDealsIds", "type": "Array" + } ]; + + static getAttributeTypeMap() { + return Body2.attributeTypeMap; + } + } + + export class Body3 { + /** + * Name of deal + */ + 'name': string; + /** + * Attributes fo\\r deal creation + */ + 'attributes'?: any; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "name", + "baseName": "name", + "type": "string" }, { - "name": "reminder", - "baseName": "reminder", - "type": "TaskReminder" + "name": "attributes", + "baseName": "attributes", + "type": "any" } ]; static getAttributeTypeMap() { - return Body.attributeTypeMap; + return Body3.attributeTypeMap; + } + } + + export class Body4 { + /** + * Name of deal + */ + 'name'?: string; + /** + * Attributes for deal update + */ + 'attributes'?: any; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "attributes", + "baseName": "attributes", + "type": "any" + } ]; + + static getAttributeTypeMap() { + return Body4.attributeTypeMap; + } + } + + export class Body5 { + /** + * Contact ids for contacts to be linked with deal + */ + 'linkContactIds'?: Array; + /** + * Contact ids for contacts to be unlinked from deal + */ + 'unlinkContactIds'?: Array; + /** + * Company ids to be linked with deal + */ + 'linkCompanyIds'?: Array; + /** + * Company ids to be unlinked from deal + */ + 'unlinkCompanyIds'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "linkContactIds", + "baseName": "linkContactIds", + "type": "Array" + }, + { + "name": "unlinkContactIds", + "baseName": "unlinkContactIds", + "type": "Array" + }, + { + "name": "linkCompanyIds", + "baseName": "linkCompanyIds", + "type": "Array" + }, + { + "name": "unlinkCompanyIds", + "baseName": "unlinkCompanyIds", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return Body5.attributeTypeMap; } } -export class Body1 { +export class Body6 { /** - * Name of task - */ + * Name of task + */ 'name': string; /** - * Duration of task in milliseconds [1 minute = 60000 ms] - */ + * Duration of task in milliseconds [1 minute = 60000 ms] + */ 'duration'?: number; /** - * Id for type of task e.g Call / Email / Meeting etc. - */ + * Id for type of task e.g Call / Email / Meeting etc. + */ 'taskTypeId': string; /** - * Task date/time - */ + * Task due date and time + */ 'date': Date; /** - * Notes added to a task - */ + * Notes added to a task + */ 'notes'?: string; /** - * Task marked as done - */ + * Task marked as done + */ 'done'?: boolean; /** - * User id to whom task is assigned - */ + * User id to whom task is assigned + */ 'assignToId'?: string; /** - * Contact ids for contacts linked to this task - */ + * Contact ids for contacts linked to this task + */ 'contactsIds'?: Array; /** - * Deal ids for deals a task is linked to - */ + * Deal ids for deals a task is linked to + */ 'dealsIds'?: Array; /** - * Companies ids for companies a task is linked to - */ + * Companies ids for companies a task is linked to + */ 'companiesIds'?: Array; 'reminder'?: TaskReminder; @@ -682,198 +917,246 @@ export class Body1 { } ]; static getAttributeTypeMap() { - return Body1.attributeTypeMap; + return Body6.attributeTypeMap; } } -export class CreateAttribute { + export class Body7 { /** - * Value of the attribute. Use only if the attribute's category is 'calculated' or 'global' - */ - 'value'?: string; + * Name of task + */ + 'name'?: string; /** - * List of values and labels that the attribute can take. Use only if the attribute's category is \"category\". For example, [{\"value\":1, \"label\":\"male\"}, {\"value\":2, \"label\":\"female\"}] - */ - 'enumeration'?: Array; + * Duration of task in milliseconds [1 minute = 60000 ms] + */ + 'duration'?: number; /** - * Type of the attribute. Use only if the attribute's category is 'normal', 'category' or 'transactional' ( type 'boolean' is only available if the category is 'normal' attribute, type 'id' is only available if the category is 'transactional' attribute & type 'category' is only available if the category is 'category' attribute ) - */ - 'type'?: CreateAttribute.TypeEnum; + * Id for type of task e.g Call / Email / Meeting etc. + */ + 'taskTypeId'?: string; + /** + * Task date/time + */ + 'date'?: Date; + /** + * Notes added to a task + */ + 'notes'?: string; + /** + * Task marked as done + */ + 'done'?: boolean; + /** + * User id to whom task is assigned + */ + 'assignToId'?: string; + /** + * Contact ids for contacts linked to this task + */ + 'contactsIds'?: Array; + /** + * Deal ids for deals a task is linked to + */ + 'dealsIds'?: Array; + /** + * Companies ids for companies a task is linked to + */ + 'companiesIds'?: Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "value", - "baseName": "value", + "name": "name", + "baseName": "name", "type": "string" }, { - "name": "enumeration", - "baseName": "enumeration", - "type": "Array" + "name": "duration", + "baseName": "duration", + "type": "number" }, { - "name": "type", - "baseName": "type", - "type": "CreateAttribute.TypeEnum" - } ]; - - static getAttributeTypeMap() { - return CreateAttribute.attributeTypeMap; - } -} - -export namespace CreateAttribute { - export enum TypeEnum { - Text = 'text', - Date = 'date', - Float = 'float', - Boolean = 'boolean', - Id = 'id', - Category = 'category' - } -} -export class CreateAttributeEnumeration { - /** - * Id of the value - */ - 'value': number; - /** - * Label of the value - */ - 'label': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + "name": "taskTypeId", + "baseName": "taskTypeId", + "type": "string" + }, { - "name": "value", - "baseName": "value", - "type": "number" + "name": "date", + "baseName": "date", + "type": "Date" }, { - "name": "label", - "baseName": "label", + "name": "notes", + "baseName": "notes", + "type": "string" + }, + { + "name": "done", + "baseName": "done", + "type": "boolean" + }, + { + "name": "assignToId", + "baseName": "assignToId", "type": "string" + }, + { + "name": "contactsIds", + "baseName": "contactsIds", + "type": "Array" + }, + { + "name": "dealsIds", + "baseName": "dealsIds", + "type": "Array" + }, + { + "name": "companiesIds", + "baseName": "companiesIds", + "type": "Array" } ]; static getAttributeTypeMap() { - return CreateAttributeEnumeration.attributeTypeMap; + return Body7.attributeTypeMap; + } } -} -export class CreateChild { + export class Body8 { /** - * Email address to create the child account - */ - 'email': string; + * visitor’s ID received from a webhook or generated by you to bind existing user account to Conversations + */ + 'visitorId': string; /** - * First name to use to create the child account - */ - 'firstName': string; + * message text + */ + 'text': string; /** - * Last name to use to create the child account - */ - 'lastName': string; + * agent ID. It can be found on agent’s page or received from a webhook. Alternatively, you can use `agentEmail` + `agentName` + `receivedFrom` instead (all 3 fields required). + */ + 'agentId'?: string; /** - * Company name to use to create the child account - */ - 'companyName': string; + * mark your messages to distinguish messages created by you from the others. + */ + 'receivedFrom'?: string; /** - * Password for the child account to login - */ - 'password': string; + * agent email. When sending messages from a standalone system, it’s hard to maintain a 1-to-1 relationship between the users of both systems. In this case, an agent can be specified by their email address. + */ + 'agentEmail'?: string; /** - * Language of the child account - */ - 'language'?: CreateChild.LanguageEnum; + * agent name + */ + 'agentName'?: string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "email", - "baseName": "email", + "name": "visitorId", + "baseName": "visitorId", "type": "string" }, { - "name": "firstName", - "baseName": "firstName", + "name": "text", + "baseName": "text", "type": "string" }, { - "name": "lastName", - "baseName": "lastName", + "name": "agentId", + "baseName": "agentId", "type": "string" }, { - "name": "companyName", - "baseName": "companyName", + "name": "receivedFrom", + "baseName": "receivedFrom", "type": "string" }, { - "name": "password", - "baseName": "password", + "name": "agentEmail", + "baseName": "agentEmail", "type": "string" }, { - "name": "language", - "baseName": "language", - "type": "CreateChild.LanguageEnum" + "name": "agentName", + "baseName": "agentName", + "type": "string" } ]; static getAttributeTypeMap() { - return CreateChild.attributeTypeMap; + return Body8.attributeTypeMap; + } } -} -export namespace CreateChild { - export enum LanguageEnum { - Fr = 'fr', - Es = 'es', - Pt = 'pt', - It = 'it', - De = 'de', - En = 'en' + export class Body9 { + /** + * edited message text + */ + 'text': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "text", + "baseName": "text", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return Body9.attributeTypeMap; } -} -export class CreateContact { + } + /** - * Email address of the user. Mandatory if \"SMS\" field is not passed in \"attributes\" parameter. Mobile Number in \"SMS\" field should be passed with proper country code. For example {\"SMS\":\"+91xxxxxxxxxx\"} or {\"SMS\":\"0091xxxxxxxxxx\"} - */ - 'email'?: string; + * List of companies + */ + export class CompaniesList { /** - * Pass the set of attributes and their values. The attribute's parameter should be passed in capital letter while creating a contact. These attributes must be present in your SendinBlue account. For eg. {\"FNAME\":\"Elly\", \"LNAME\":\"Roger\"} - */ - 'attributes'?: any; + * List of compaies + */ + 'items'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "items", + "baseName": "items", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return CompaniesList.attributeTypeMap; + } + } + /** - * Set this field to blacklist the contact for emails (emailBlacklisted = true) - */ - 'emailBlacklisted'?: boolean; + * Company Details + */ + export class Company { /** - * Set this field to blacklist the contact for SMS (smsBlacklisted = true) - */ - 'smsBlacklisted'?: boolean; + * Unique company id + */ + 'id'?: string; /** - * Ids of the lists to add the contact to - */ - 'listIds'?: Array; + * Company attributes with values + */ + 'attributes'?: any; /** - * Facilitate to update the existing contact in the same request (updateEnabled = true) - */ - 'updateEnabled'?: boolean; + * Contact ids for contacts linked to this company + */ + 'linkedContactsIds'?: Array; /** - * transactional email forbidden sender for contact. Use only for email Contact ( only available if updateEnabled = true ) - */ - 'smtpBlacklistSender'?: Array; + * Deals ids for companies linked to this company + */ + 'linkedDealsIds'?: Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "email", - "baseName": "email", + "name": "id", + "baseName": "id", "type": "string" }, { @@ -882,784 +1165,673 @@ export class CreateContact { "type": "any" }, { - "name": "emailBlacklisted", - "baseName": "emailBlacklisted", - "type": "boolean" - }, - { - "name": "smsBlacklisted", - "baseName": "smsBlacklisted", - "type": "boolean" - }, - { - "name": "listIds", - "baseName": "listIds", + "name": "linkedContactsIds", + "baseName": "linkedContactsIds", "type": "Array" }, { - "name": "updateEnabled", - "baseName": "updateEnabled", - "type": "boolean" - }, - { - "name": "smtpBlacklistSender", - "baseName": "smtpBlacklistSender", + "name": "linkedDealsIds", + "baseName": "linkedDealsIds", "type": "Array" } ]; static getAttributeTypeMap() { - return CreateContact.attributeTypeMap; + return Company.attributeTypeMap; + } } -} -export class CreateDoiContact { - /** - * Email address where the confirmation email will be sent. This email address will be the identifier for all other contact attributes. - */ - 'email': string; - /** - * Pass the set of attributes and their values. These attributes must be present in your SendinBlue account. For eg. {'FNAME':'Elly', 'LNAME':'Roger'} - */ - 'attributes'?: any; - /** - * Lists under user account where contact should be added - */ - 'includeListIds': Array; - /** - * Lists under user account where contact should not be added - */ - 'excludeListIds'?: Array; /** - * Id of the Double opt-in (DOI) template - */ - 'templateId': number; + * List of company attributes + */ + export class CompanyAttributes extends Array { + + static discriminator: string | undefined = undefined; + + } + /** - * URL of the web page that user will be redirected to after clicking on the double opt in URL. When editing your DOI template you can reference this URL by using the tag {{ params.DOIurl }}. - */ - 'redirectionUrl': string; + * List of attributes + */ + export class CompanyAttributesInner { + 'internalName'?: string; + 'label'?: string; + 'attributeTypeName'?: string; + 'attributeOptions'?: Array; + 'isRequired'?: boolean; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "email", - "baseName": "email", + "name": "internalName", + "baseName": "internalName", "type": "string" }, { - "name": "attributes", - "baseName": "attributes", - "type": "any" + "name": "label", + "baseName": "label", + "type": "string" }, { - "name": "includeListIds", - "baseName": "includeListIds", - "type": "Array" + "name": "attributeTypeName", + "baseName": "attributeTypeName", + "type": "string" }, { - "name": "excludeListIds", - "baseName": "excludeListIds", - "type": "Array" + "name": "attributeOptions", + "baseName": "attributeOptions", + "type": "Array" }, { - "name": "templateId", - "baseName": "templateId", - "type": "number" - }, - { - "name": "redirectionUrl", - "baseName": "redirectionUrl", - "type": "string" + "name": "isRequired", + "baseName": "isRequired", + "type": "boolean" } ]; static getAttributeTypeMap() { - return CreateDoiContact.attributeTypeMap; + return CompanyAttributesInner.attributeTypeMap; + } } -} -export class CreateEmailCampaign { - /** - * Tag of the campaign - */ - 'tag'?: string; - 'sender': CreateEmailCampaignSender; - /** - * Name of the campaign - */ - 'name': string; - /** - * Mandatory if htmlUrl and templateId are empty. Body of the message (HTML) - */ - 'htmlContent'?: string; - /** - * Mandatory if htmlContent and templateId are empty. Url to the message (HTML) - */ - 'htmlUrl'?: string; - /** - * Mandatory if htmlContent and htmlUrl are empty. Id of the transactional email template with status 'active'. Used to copy only its content fetched from htmlContent/htmlUrl to an email campaign for RSS feature. - */ - 'templateId'?: number; - /** - * Sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. If sendAtBestTime is set to true, your campaign will be sent according to the date passed (ignoring the time part). - */ - 'scheduledAt'?: string; - /** - * Subject of the campaign. Mandatory if abTesting is false. Ignored if abTesting is true. - */ - 'subject'?: string; /** - * Email on which the campaign recipients will be able to reply to - */ - 'replyTo'?: string; - /** - * To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization - */ - 'toField'?: string; - 'recipients'?: CreateEmailCampaignRecipients; - /** - * Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps - */ - 'attachmentUrl'?: string; - /** - * Use true to embedded the images in your email. Final size of the email should be less than 4MB. Campaigns with embedded images can not be sent to more than 5000 contacts - */ - 'inlineImageActivation'?: boolean; - /** - * Use true to enable the mirror link - */ - 'mirrorActive'?: boolean; - /** - * Footer of the email campaign - */ - 'footer'?: string; - /** - * Header of the email campaign - */ - 'header'?: string; - /** - * Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed - */ - 'utmCampaign'?: string; + * a Conversations message + */ + export class ConversationsMessage { /** - * Pass the set of attributes to customize the type classic campaign. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}. Only available if 'type' is 'classic'. It's considered only if campaign is in New Template Language format. The New Template Language is dependent on the values of 'subject', 'htmlContent/htmlUrl', 'sender.name' & 'toField' - */ - 'params'?: any; - /** - * Set this to true if you want to send your campaign at best time. - */ - 'sendAtBestTime'?: boolean; - /** - * Status of A/B Test. abTesting = false means it is disabled, & abTesting = true means it is enabled. 'subjectA', 'subjectB', 'splitRule', 'winnerCriteria' & 'winnerDelay' will be considered when abTesting is set to true. 'subjectA' & 'subjectB' are mandatory together & 'subject' if passed is ignored. Can be set to true only if 'sendAtBestTime' is 'false'. You will be able to set up two subject lines for your campaign and send them to a random sample of your total recipients. Half of the test group will receive version A, and the other half will receive version B - */ - 'abTesting'?: boolean; + * Message ID. It can be used for further manipulations with the message. + */ + 'id'?: string; /** - * Subject A of the campaign. Mandatory if abTesting = true. subjectA & subjectB should have unique value - */ - 'subjectA'?: string; + * `\"agent\"` for agents’ messages, `\"visitor\"` for visitors’ messages. + */ + 'type'?: ConversationsMessage.TypeEnum; /** - * Subject B of the campaign. Mandatory if abTesting = true. subjectA & subjectB should have unique value - */ - 'subjectB'?: string; + * Message text or name of the attached file + */ + 'text'?: string; /** - * Add the size of your test groups. Mandatory if abTesting = true & 'recipients' is passed. We'll send version A and B to a random sample of recipients, and then the winning version to everyone else - */ - 'splitRule'?: number; + * visitor’s ID + */ + 'visitorId'?: string; /** - * Choose the metrics that will determinate the winning version. Mandatory if 'splitRule' >= 1 and < 50. If splitRule = 50, 'winnerCriteria' is ignored if passed - */ - 'winnerCriteria'?: CreateEmailCampaign.WinnerCriteriaEnum; + * ID of the agent on whose behalf the message was sent (only in messages sent by an agent). + */ + 'agentId'?: string; /** - * Choose the duration of the test in hours. Maximum is 7 days, pass 24*7 = 168 hours. The winning version will be sent at the end of the test. Mandatory if 'splitRule' >= 1 and < 50. If splitRule = 50, 'winnerDelay' is ignored if passed - */ - 'winnerDelay'?: number; + * Agent’s name as displayed to the visitor. Only in the messages sent by an agent. + */ + 'agentName'?: string; /** - * Available for dedicated ip clients. Set this to true if you wish to warm up your ip. - */ - 'ipWarmupEnable'?: boolean; + * Timestamp in milliseconds. + */ + 'createdAt'?: number; /** - * Mandatory if ipWarmupEnable is set to true. Set an initial quota greater than 1 for warming up your ip. We recommend you set a value of 3000. - */ - 'initialQuota'?: number; + * `true` for pushed messages + */ + 'isPushed'?: boolean; /** - * Mandatory if ipWarmupEnable is set to true. Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%. - */ - 'increaseRate'?: number; + * In two-way integrations, messages sent via REST API can be marked with receivedFrom property and then filtered out when received in a webhook to avoid infinite loop. + */ + 'receivedFrom'?: string; + 'file'?: ConversationsMessageFile; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "tag", - "baseName": "tag", - "type": "string" - }, - { - "name": "sender", - "baseName": "sender", - "type": "CreateEmailCampaignSender" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "htmlContent", - "baseName": "htmlContent", - "type": "string" - }, - { - "name": "htmlUrl", - "baseName": "htmlUrl", + "name": "id", + "baseName": "id", "type": "string" }, { - "name": "templateId", - "baseName": "templateId", - "type": "number" - }, - { - "name": "scheduledAt", - "baseName": "scheduledAt", - "type": "string" + "name": "type", + "baseName": "type", + "type": "ConversationsMessage.TypeEnum" }, { - "name": "subject", - "baseName": "subject", + "name": "text", + "baseName": "text", "type": "string" }, { - "name": "replyTo", - "baseName": "replyTo", + "name": "visitorId", + "baseName": "visitorId", "type": "string" }, { - "name": "toField", - "baseName": "toField", + "name": "agentId", + "baseName": "agentId", "type": "string" }, { - "name": "recipients", - "baseName": "recipients", - "type": "CreateEmailCampaignRecipients" - }, - { - "name": "attachmentUrl", - "baseName": "attachmentUrl", + "name": "agentName", + "baseName": "agentName", "type": "string" }, { - "name": "inlineImageActivation", - "baseName": "inlineImageActivation", - "type": "boolean" + "name": "createdAt", + "baseName": "createdAt", + "type": "number" }, { - "name": "mirrorActive", - "baseName": "mirrorActive", + "name": "isPushed", + "baseName": "isPushed", "type": "boolean" }, { - "name": "footer", - "baseName": "footer", - "type": "string" - }, - { - "name": "header", - "baseName": "header", - "type": "string" - }, - { - "name": "utmCampaign", - "baseName": "utmCampaign", + "name": "receivedFrom", + "baseName": "receivedFrom", "type": "string" }, { - "name": "params", - "baseName": "params", - "type": "any" - }, - { - "name": "sendAtBestTime", - "baseName": "sendAtBestTime", - "type": "boolean" - }, - { - "name": "abTesting", - "baseName": "abTesting", - "type": "boolean" - }, - { - "name": "subjectA", - "baseName": "subjectA", - "type": "string" - }, + "name": "file", + "baseName": "file", + "type": "ConversationsMessageFile" + } ]; + + static getAttributeTypeMap() { + return ConversationsMessage.attributeTypeMap; + } + } + + export namespace ConversationsMessage { + export enum TypeEnum { + Agent = 'agent', + Visitor = 'visitor' + } + } + export class ConversationsMessageFile { + /** + * Name of the file + */ + 'filename'?: string; + /** + * Size in bytes + */ + 'size'?: number; + /** + * Whether the file is an image + */ + 'isImage'?: boolean; + /** + * URL of the file + */ + 'url'?: string; + 'imageInfo'?: ConversationsMessageFileImageInfo; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "subjectB", - "baseName": "subjectB", + "name": "filename", + "baseName": "filename", "type": "string" }, { - "name": "splitRule", - "baseName": "splitRule", - "type": "number" - }, - { - "name": "winnerCriteria", - "baseName": "winnerCriteria", - "type": "CreateEmailCampaign.WinnerCriteriaEnum" - }, - { - "name": "winnerDelay", - "baseName": "winnerDelay", + "name": "size", + "baseName": "size", "type": "number" }, { - "name": "ipWarmupEnable", - "baseName": "ipWarmupEnable", + "name": "isImage", + "baseName": "isImage", "type": "boolean" }, { - "name": "initialQuota", - "baseName": "initialQuota", - "type": "number" + "name": "url", + "baseName": "url", + "type": "string" }, { - "name": "increaseRate", - "baseName": "increaseRate", - "type": "number" + "name": "imageInfo", + "baseName": "imageInfo", + "type": "ConversationsMessageFileImageInfo" } ]; static getAttributeTypeMap() { - return CreateEmailCampaign.attributeTypeMap; + return ConversationsMessageFile.attributeTypeMap; } -} - -export namespace CreateEmailCampaign { - export enum WinnerCriteriaEnum { - Open = 'open', - Click = 'click' } -} -/** - * List ids to include/exclude from campaign - */ -export class CreateEmailCampaignRecipients { + /** - * List ids to exclude from the campaign - */ - 'exclusionListIds'?: Array; + * image info is passed in case the file is an image + */ + export class ConversationsMessageFileImageInfo { /** - * Mandatory if scheduledAt is not empty. List Ids to send the campaign to - */ - 'listIds'?: Array; + * Width of the image + */ + 'width'?: number; + /** + * height of the image + */ + 'height'?: number; + /** + * URL of the preview + */ + 'previewUrl'?: string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "exclusionListIds", - "baseName": "exclusionListIds", - "type": "Array" + "name": "width", + "baseName": "width", + "type": "number" }, { - "name": "listIds", - "baseName": "listIds", - "type": "Array" + "name": "height", + "baseName": "height", + "type": "number" + }, + { + "name": "previewUrl", + "baseName": "previewUrl", + "type": "string" } ]; static getAttributeTypeMap() { - return CreateEmailCampaignRecipients.attributeTypeMap; + return ConversationsMessageFileImageInfo.attributeTypeMap; + } } -} -/** - * Sender details including id or email and name (optional). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example `{\"name\":\"xyz\", \"email\":\"example@abc.com\"}` , `{\"name\":\"xyz\", \"id\":123}` - */ -export class CreateEmailCampaignSender { +export class CreateAttribute { /** - * Sender Name - */ - 'name'?: string; + * Value of the attribute. Use only if the attribute's category is 'calculated' or 'global' + */ + 'value'?: string; /** - * Sender email - */ - 'email': string; + * List of values and labels that the attribute can take. Use only if the attribute's category is \"category\". For example, [{\"value\":1, \"label\":\"male\"}, {\"value\":2, \"label\":\"female\"}] + */ + 'enumeration'?: Array; /** - * Select the sender for the campaign on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). - */ - 'id'?: number; + * Type of the attribute. Use only if the attribute's category is 'normal', 'category' or 'transactional' ( type 'boolean' is only available if the category is 'normal' attribute, type 'id' is only available if the category is 'transactional' attribute & type 'category' is only available if the category is 'category' attribute ) + */ + 'type'?: CreateAttribute.TypeEnum; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "name", - "baseName": "name", + "name": "value", + "baseName": "value", "type": "string" }, { - "name": "email", - "baseName": "email", - "type": "string" + "name": "enumeration", + "baseName": "enumeration", + "type": "Array" }, { - "name": "id", - "baseName": "id", - "type": "number" + "name": "type", + "baseName": "type", + "type": "CreateAttribute.TypeEnum" } ]; static getAttributeTypeMap() { - return CreateEmailCampaignSender.attributeTypeMap; + return CreateAttribute.attributeTypeMap; } } -export class CreateList { +export namespace CreateAttribute { + export enum TypeEnum { + Text = 'text', + Date = 'date', + Float = 'float', + Boolean = 'boolean', + Id = 'id', + Category = 'category' + } +} +export class CreateAttributeEnumeration { /** - * Name of the list - */ - 'name': string; + * Id of the value + */ + 'value': number; /** - * Id of the parent folder in which this list is to be created - */ - 'folderId': number; + * Label of the value + */ + 'label': string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "name", - "baseName": "name", - "type": "string" + "name": "value", + "baseName": "value", + "type": "number" }, { - "name": "folderId", - "baseName": "folderId", - "type": "number" + "name": "label", + "baseName": "label", + "type": "string" } ]; static getAttributeTypeMap() { - return CreateList.attributeTypeMap; + return CreateAttributeEnumeration.attributeTypeMap; } } -export class CreateModel { +export class CreateChild { /** - * ID of the object created - */ - 'id': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return CreateModel.attributeTypeMap; - } -} - -export class CreateReseller { + * Email address to create the child account + */ + 'email': string; /** - * AuthKey of Reseller child created - */ - 'authKey': string; + * First name to use to create the child account + */ + 'firstName': string; /** - * Id of Reseller child created - */ - 'id'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "authKey", - "baseName": "authKey", - "type": "string" - }, - { - "name": "id", - "baseName": "id", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return CreateReseller.attributeTypeMap; - } -} - -export class CreateSender { + * Last name to use to create the child account + */ + 'lastName': string; /** - * From Name to use for the sender - */ - 'name': string; + * Company name to use to create the child account + */ + 'companyName': string; /** - * From email to use for the sender. A verification email will be sent to this address. - */ - 'email': string; + * Password for the child account to login + */ + 'password': string; /** - * Mandatory in case of dedicated IP, IPs to associate to the sender - */ - 'ips'?: Array; + * Language of the child account + */ + 'language'?: CreateChild.LanguageEnum; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "name", - "baseName": "name", + "name": "email", + "baseName": "email", "type": "string" }, { - "name": "email", - "baseName": "email", + "name": "firstName", + "baseName": "firstName", "type": "string" }, { - "name": "ips", - "baseName": "ips", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return CreateSender.attributeTypeMap; - } -} - -export class CreateSenderIps { - /** - * Dedicated IP available in your account - */ - 'ip': string; - /** - * Domain of the IP - */ - 'domain': string; - /** - * Weight to apply to the IP. Sum of all IP weights must be 100. Should be passed for either ALL or NONE of the IPs. If it's not passed, the sending will be equally balanced on all IPs. - */ - 'weight'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + "name": "lastName", + "baseName": "lastName", + "type": "string" + }, { - "name": "ip", - "baseName": "ip", + "name": "companyName", + "baseName": "companyName", "type": "string" }, { - "name": "domain", - "baseName": "domain", + "name": "password", + "baseName": "password", "type": "string" }, { - "name": "weight", - "baseName": "weight", - "type": "number" + "name": "language", + "baseName": "language", + "type": "CreateChild.LanguageEnum" } ]; static getAttributeTypeMap() { - return CreateSenderIps.attributeTypeMap; + return CreateChild.attributeTypeMap; } } -export class CreateSenderModel { +export namespace CreateChild { + export enum LanguageEnum { + Fr = 'fr', + Es = 'es', + Pt = 'pt', + It = 'it', + De = 'de', + En = 'en' + } +} +export class CreateContact { /** - * ID of the Sender created - */ - 'id': number; + * Email address of the user. Mandatory if \"SMS\" field is not passed in \"attributes\" parameter. Mobile Number in \"SMS\" field should be passed with proper country code. For example {\"SMS\":\"+91xxxxxxxxxx\"} or {\"SMS\":\"0091xxxxxxxxxx\"} + */ + 'email'?: string; /** - * Status of SPF configuration for the sender (true = SPF not well configured, false = SPF well configured) - */ - 'spfError'?: boolean; + * Pass the set of attributes and their values. The attribute's parameter should be passed in capital letter while creating a contact. These attributes must be present in your SendinBlue account. For eg. {\"FNAME\":\"Elly\", \"LNAME\":\"Roger\"} + */ + 'attributes'?: any; /** - * Status of DKIM configuration for the sender (true = DKIM not well configured, false = DKIM well configured) - */ - 'dkimError'?: boolean; + * Set this field to blacklist the contact for emails (emailBlacklisted = true) + */ + 'emailBlacklisted'?: boolean; + /** + * Set this field to blacklist the contact for SMS (smsBlacklisted = true) + */ + 'smsBlacklisted'?: boolean; + /** + * Ids of the lists to add the contact to + */ + 'listIds'?: Array; + /** + * Facilitate to update the existing contact in the same request (updateEnabled = true) + */ + 'updateEnabled'?: boolean; + /** + * transactional email forbidden sender for contact. Use only for email Contact ( only available if updateEnabled = true ) + */ + 'smtpBlacklistSender'?: Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "id", - "baseName": "id", - "type": "number" + "name": "email", + "baseName": "email", + "type": "string" }, { - "name": "spfError", - "baseName": "spfError", + "name": "attributes", + "baseName": "attributes", + "type": "any" + }, + { + "name": "emailBlacklisted", + "baseName": "emailBlacklisted", "type": "boolean" }, { - "name": "dkimError", - "baseName": "dkimError", + "name": "smsBlacklisted", + "baseName": "smsBlacklisted", "type": "boolean" + }, + { + "name": "listIds", + "baseName": "listIds", + "type": "Array" + }, + { + "name": "updateEnabled", + "baseName": "updateEnabled", + "type": "boolean" + }, + { + "name": "smtpBlacklistSender", + "baseName": "smtpBlacklistSender", + "type": "Array" } ]; static getAttributeTypeMap() { - return CreateSenderModel.attributeTypeMap; + return CreateContact.attributeTypeMap; } } -export class CreateSmsCampaign { +export class CreateDoiContact { /** - * Name of the campaign - */ - 'name': string; + * Email address where the confirmation email will be sent. This email address will be the identifier for all other contact attributes. + */ + 'email': string; /** - * Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** - */ - 'sender': string; + * Pass the set of attributes and their values. These attributes must be present in your SendinBlue account. For eg. {'FNAME':'Elly', 'LNAME':'Roger'} + */ + 'attributes'?: any; /** - * Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS - */ - 'content': string; - 'recipients'?: CreateSmsCampaignRecipients; + * Lists under user account where contact should be added + */ + 'includeListIds': Array; /** - * UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. - */ - 'scheduledAt'?: string; + * Lists under user account where contact should not be added + */ + 'excludeListIds'?: Array; /** - * Format of the message. It indicates whether the content should be treated as unicode or not. - */ - 'unicodeEnabled'?: boolean; + * Id of the Double opt-in (DOI) template + */ + 'templateId': number; + /** + * URL of the web page that user will be redirected to after clicking on the double opt in URL. When editing your DOI template you can reference this URL by using the tag {{ params.DOIurl }}. + */ + 'redirectionUrl': string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "name", - "baseName": "name", + "name": "email", + "baseName": "email", "type": "string" }, { - "name": "sender", - "baseName": "sender", - "type": "string" + "name": "attributes", + "baseName": "attributes", + "type": "any" }, { - "name": "content", - "baseName": "content", - "type": "string" - }, - { - "name": "recipients", - "baseName": "recipients", - "type": "CreateSmsCampaignRecipients" - }, - { - "name": "scheduledAt", - "baseName": "scheduledAt", - "type": "string" - }, - { - "name": "unicodeEnabled", - "baseName": "unicodeEnabled", - "type": "boolean" - } ]; - - static getAttributeTypeMap() { - return CreateSmsCampaign.attributeTypeMap; - } -} - -export class CreateSmsCampaignRecipients { - /** - * Lists Ids to send the campaign to. REQUIRED if scheduledAt is not empty - */ - 'listIds': Array; - /** - * List ids which have to be excluded from a campaign - */ - 'exclusionListIds'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "listIds", - "baseName": "listIds", + "name": "includeListIds", + "baseName": "includeListIds", "type": "Array" }, { - "name": "exclusionListIds", - "baseName": "exclusionListIds", + "name": "excludeListIds", + "baseName": "excludeListIds", "type": "Array" - } ]; - - static getAttributeTypeMap() { - return CreateSmsCampaignRecipients.attributeTypeMap; - } -} - -export class CreateSmtpEmail { - /** - * Message ID of the transactional email sent - */ - 'messageId'?: string; - 'messageIds'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + }, { - "name": "messageId", - "baseName": "messageId", - "type": "string" + "name": "templateId", + "baseName": "templateId", + "type": "number" }, { - "name": "messageIds", - "baseName": "messageIds", - "type": "Array" + "name": "redirectionUrl", + "baseName": "redirectionUrl", + "type": "string" } ]; static getAttributeTypeMap() { - return CreateSmtpEmail.attributeTypeMap; + return CreateDoiContact.attributeTypeMap; } } -export class CreateSmtpTemplate { + export class CreateEmailCampaign { /** - * Tag of the template - */ + * Tag of the campaign + */ 'tag'?: string; - 'sender': CreateSmtpTemplateSender; + 'sender': CreateEmailCampaignSender; /** - * Name of the template - */ - 'templateName': string; + * Name of the campaign + */ + 'name': string; /** - * Body of the message (HTML version). The field must have more than 10 characters. REQUIRED if htmlUrl is empty - */ + * Mandatory if htmlUrl and templateId are empty. Body of the message (HTML) + */ 'htmlContent'?: string; /** - * Url which contents the body of the email message. REQUIRED if htmlContent is empty - */ + * Mandatory if htmlContent and templateId are empty. Url to the message (HTML) + */ 'htmlUrl'?: string; /** - * Subject of the template - */ - 'subject': string; + * Mandatory if htmlContent and htmlUrl are empty. Id of the transactional email template with status 'active'. Used to copy only its content fetched from htmlContent/htmlUrl to an email campaign for RSS feature. + */ + 'templateId'?: number; /** - * Email on which campaign recipients will be able to reply to - */ + * Sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. If sendAtBestTime is set to true, your campaign will be sent according to the date passed (ignoring the time part). + */ + 'scheduledAt'?: string; + /** + * Subject of the campaign. Mandatory if abTesting is false. Ignored if abTesting is true. + */ + 'subject'?: string; + /** + * Email on which the campaign recipients will be able to reply to + */ 'replyTo'?: string; /** - * To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization - */ + * To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization + */ 'toField'?: string; + 'recipients'?: CreateEmailCampaignRecipients; /** - * Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps - */ + * Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps + */ 'attachmentUrl'?: string; /** - * Status of template. isActive = true means template is active and isActive = false means template is inactive - */ - 'isActive'?: boolean; + * Use true to embedded the images in your email. Final size of the email should be less than 4MB. Campaigns with embedded images can not be sent to more than 5000 contacts + */ + 'inlineImageActivation'?: boolean; + /** + * Use true to enable the mirror link + */ + 'mirrorActive'?: boolean; + /** + * Footer of the email campaign + */ + 'footer'?: string; + /** + * Header of the email campaign + */ + 'header'?: string; + /** + * Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed + */ + 'utmCampaign'?: string; + /** + * Pass the set of attributes to customize the type classic campaign. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}. Only available if 'type' is 'classic'. It's considered only if campaign is in New Template Language format. The New Template Language is dependent on the values of 'subject', 'htmlContent/htmlUrl', 'sender.name' & 'toField' + */ + 'params'?: any; + /** + * Set this to true if you want to send your campaign at best time. + */ + 'sendAtBestTime'?: boolean; + /** + * Status of A/B Test. abTesting = false means it is disabled, & abTesting = true means it is enabled. 'subjectA', 'subjectB', 'splitRule', 'winnerCriteria' & 'winnerDelay' will be considered when abTesting is set to true. 'subjectA' & 'subjectB' are mandatory together & 'subject' if passed is ignored. Can be set to true only if 'sendAtBestTime' is 'false'. You will be able to set up two subject lines for your campaign and send them to a random sample of your total recipients. Half of the test group will receive version A, and the other half will receive version B + */ + 'abTesting'?: boolean; + /** + * Subject A of the campaign. Mandatory if abTesting = true. subjectA & subjectB should have unique value + */ + 'subjectA'?: string; + /** + * Subject B of the campaign. Mandatory if abTesting = true. subjectA & subjectB should have unique value + */ + 'subjectB'?: string; + /** + * Add the size of your test groups. Mandatory if abTesting = true & 'recipients' is passed. We'll send version A and B to a random sample of recipients, and then the winning version to everyone else + */ + 'splitRule'?: number; + /** + * Choose the metrics that will determinate the winning version. Mandatory if 'splitRule' >= 1 and < 50. If splitRule = 50, 'winnerCriteria' is ignored if passed + */ + 'winnerCriteria'?: CreateEmailCampaign.WinnerCriteriaEnum; + /** + * Choose the duration of the test in hours. Maximum is 7 days, pass 24*7 = 168 hours. The winning version will be sent at the end of the test. Mandatory if 'splitRule' >= 1 and < 50. If splitRule = 50, 'winnerDelay' is ignored if passed + */ + 'winnerDelay'?: number; + /** + * Available for dedicated ip clients. Set this to true if you wish to warm up your ip. + */ + 'ipWarmupEnable'?: boolean; + /** + * Mandatory if ipWarmupEnable is set to true. Set an initial quota greater than 1 for warming up your ip. We recommend you set a value of 3000. + */ + 'initialQuota'?: number; + /** + * Mandatory if ipWarmupEnable is set to true. Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%. + */ + 'increaseRate'?: number; static discriminator: string | undefined = undefined; @@ -1672,11 +1844,11 @@ export class CreateSmtpTemplate { { "name": "sender", "baseName": "sender", - "type": "CreateSmtpTemplateSender" + "type": "CreateEmailCampaignSender" }, { - "name": "templateName", - "baseName": "templateName", + "name": "name", + "baseName": "name", "type": "string" }, { @@ -1689,6 +1861,16 @@ export class CreateSmtpTemplate { "baseName": "htmlUrl", "type": "string" }, + { + "name": "templateId", + "baseName": "templateId", + "type": "number" + }, + { + "name": "scheduledAt", + "baseName": "scheduledAt", + "type": "string" + }, { "name": "subject", "baseName": "subject", @@ -1704,165 +1886,156 @@ export class CreateSmtpTemplate { "baseName": "toField", "type": "string" }, + { + "name": "recipients", + "baseName": "recipients", + "type": "CreateEmailCampaignRecipients" + }, { "name": "attachmentUrl", "baseName": "attachmentUrl", "type": "string" }, { - "name": "isActive", - "baseName": "isActive", + "name": "inlineImageActivation", + "baseName": "inlineImageActivation", "type": "boolean" - } ]; - - static getAttributeTypeMap() { - return CreateSmtpTemplate.attributeTypeMap; - } -} - -/** - * Sender details including id or email and name (optional). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example `{\"name\":\"xyz\", \"email\":\"example@abc.com\"}` , `{\"name\":\"xyz\", \"id\":123}` - */ -export class CreateSmtpTemplateSender { - /** - * Name of the sender. If not passed, will be set to default - */ - 'name'?: string; - /** - * Email of the sender - */ - 'email'?: string; - /** - * Select the sender for the template on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). - */ - 'id'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + }, { - "name": "name", - "baseName": "name", + "name": "mirrorActive", + "baseName": "mirrorActive", + "type": "boolean" + }, + { + "name": "footer", + "baseName": "footer", "type": "string" }, { - "name": "email", - "baseName": "email", + "name": "header", + "baseName": "header", "type": "string" }, { - "name": "id", - "baseName": "id", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return CreateSmtpTemplateSender.attributeTypeMap; - } -} - -export class CreateSubAccount { - /** - * Set the name of the sub-account company - */ - 'companyName': string; - /** - * Email address for the organization - */ - 'email': string; - /** - * Set the language of the sub-account - */ - 'language'?: CreateSubAccount.LanguageEnum; - /** - * Set the timezone of the sub-account - */ - 'timezone'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + "name": "utmCampaign", + "baseName": "utmCampaign", + "type": "string" + }, { - "name": "companyName", - "baseName": "companyName", + "name": "params", + "baseName": "params", + "type": "any" + }, + { + "name": "sendAtBestTime", + "baseName": "sendAtBestTime", + "type": "boolean" + }, + { + "name": "abTesting", + "baseName": "abTesting", + "type": "boolean" + }, + { + "name": "subjectA", + "baseName": "subjectA", "type": "string" }, { - "name": "email", - "baseName": "email", + "name": "subjectB", + "baseName": "subjectB", "type": "string" }, { - "name": "language", - "baseName": "language", - "type": "CreateSubAccount.LanguageEnum" + "name": "splitRule", + "baseName": "splitRule", + "type": "number" }, { - "name": "timezone", - "baseName": "timezone", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return CreateSubAccount.attributeTypeMap; - } -} - -export namespace CreateSubAccount { - export enum LanguageEnum { - En = 'en', - Fr = 'fr', - It = 'it', - Es = 'es', - Pt = 'pt', - De = 'de' - } -} -export class CreateSubAccountResponse { - /** - * ID of the sub-account created - */ - 'id': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + "name": "winnerCriteria", + "baseName": "winnerCriteria", + "type": "CreateEmailCampaign.WinnerCriteriaEnum" + }, { - "name": "id", - "baseName": "id", + "name": "winnerDelay", + "baseName": "winnerDelay", + "type": "number" + }, + { + "name": "ipWarmupEnable", + "baseName": "ipWarmupEnable", + "type": "boolean" + }, + { + "name": "initialQuota", + "baseName": "initialQuota", + "type": "number" + }, + { + "name": "increaseRate", + "baseName": "increaseRate", "type": "number" } ]; static getAttributeTypeMap() { - return CreateSubAccountResponse.attributeTypeMap; + return CreateEmailCampaign.attributeTypeMap; } } -export class CreateUpdateContactModel { +export namespace CreateEmailCampaign { + export enum WinnerCriteriaEnum { + Open = 'open', + Click = 'click' + } +} /** - * ID of the contact when a new contact is created - */ - 'id'?: number; + * List ids to include/exclude from campaign + */ +export class CreateEmailCampaignRecipients { + /** + * List ids to exclude from the campaign + */ + 'exclusionListIds'?: Array; + /** + * Mandatory if scheduledAt is not empty. List Ids to send the campaign to + */ + 'listIds'?: Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "id", - "baseName": "id", - "type": "number" + "name": "exclusionListIds", + "baseName": "exclusionListIds", + "type": "Array" + }, + { + "name": "listIds", + "baseName": "listIds", + "type": "Array" } ]; static getAttributeTypeMap() { - return CreateUpdateContactModel.attributeTypeMap; + return CreateEmailCampaignRecipients.attributeTypeMap; } } -export class CreateUpdateFolder { +/** + * Sender details including id or email and name (optional). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example `{\"name\":\"xyz\", \"email\":\"example@abc.com\"}` , `{\"name\":\"xyz\", \"id\":123}` + */ +export class CreateEmailCampaignSender { /** - * Name of the folder - */ + * Sender Name + */ 'name'?: string; + /** + * Sender email + */ + 'email': string; + /** + * Select the sender for the campaign on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). + */ + 'id'?: number; static discriminator: string | undefined = undefined; @@ -1871,1798 +2044,1562 @@ export class CreateUpdateFolder { "name": "name", "baseName": "name", "type": "string" + }, + { + "name": "email", + "baseName": "email", + "type": "string" + }, + { + "name": "id", + "baseName": "id", + "type": "number" } ]; static getAttributeTypeMap() { - return CreateUpdateFolder.attributeTypeMap; + return CreateEmailCampaignSender.attributeTypeMap; } } -export class CreateWebhook { - /** - * URL of the webhook - */ - 'url': string; - /** - * Description of the webhook - */ - 'description'?: string; - /** - * - Events triggering the webhook. Possible values for **Transactional** type webhook: #### `sent` OR `request`, `delivered`, `hardBounce`, `softBounce`, `blocked`, `spam`, `invalid`, `deferred`, `click`, `opened`, `uniqueOpened` and `unsubscribed` - Possible values for **Marketing** type webhook: #### `spam`, `opened`, `click`, `hardBounce`, `softBounce`, `unsubscribed`, `listAddition` & `delivered` - Possible values for **Inbound** type webhook: #### `inboundEmailProcessed` - */ - 'events': Array; +export class CreateList { /** - * Type of the webhook - */ - 'type'?: CreateWebhook.TypeEnum; + * Name of the list + */ + 'name': string; /** - * Inbound domain of webhook, required in case of event type `inbound` - */ - 'domain'?: string; + * Id of the parent folder in which this list is to be created + */ + 'folderId': number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "url", - "baseName": "url", - "type": "string" - }, - { - "name": "description", - "baseName": "description", + "name": "name", + "baseName": "name", "type": "string" }, { - "name": "events", - "baseName": "events", - "type": "Array" - }, - { - "name": "type", - "baseName": "type", - "type": "CreateWebhook.TypeEnum" - }, - { - "name": "domain", - "baseName": "domain", - "type": "string" + "name": "folderId", + "baseName": "folderId", + "type": "number" } ]; static getAttributeTypeMap() { - return CreateWebhook.attributeTypeMap; + return CreateList.attributeTypeMap; } } -export namespace CreateWebhook { - export enum EventsEnum { - Sent = 'sent', - HardBounce = 'hardBounce', - SoftBounce = 'softBounce', - Blocked = 'blocked', - Spam = 'spam', - Delivered = 'delivered', - Request = 'request', - Click = 'click', - Invalid = 'invalid', - Deferred = 'deferred', - Opened = 'opened', - UniqueOpened = 'uniqueOpened', - Unsubscribed = 'unsubscribed', - ListAddition = 'listAddition', - ContactUpdated = 'contactUpdated', - ContactDeleted = 'contactDeleted', - InboundEmailProcessed = 'inboundEmailProcessed' - } - export enum TypeEnum { - Transactional = 'transactional', - Marketing = 'marketing', - Inbound = 'inbound' - } -} -export class CreatedProcessId { +export class CreateModel { /** - * Id of the process created - */ - 'processId': number; + * ID of the object created + */ + 'id': number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "processId", - "baseName": "processId", + "name": "id", + "baseName": "id", "type": "number" } ]; static getAttributeTypeMap() { - return CreatedProcessId.attributeTypeMap; + return CreateModel.attributeTypeMap; } } -export class DeleteHardbounces { - /** - * Starting date (YYYY-MM-DD) of the time period for deletion. The hardbounces occurred after this date will be deleted. Must be less than or equal to the endDate - */ - 'startDate'?: string; +export class CreateReseller { /** - * Ending date (YYYY-MM-DD) of the time period for deletion. The hardbounces until this date will be deleted. Must be greater than or equal to the startDate - */ - 'endDate'?: string; + * AuthKey of Reseller child created + */ + 'authKey': string; /** - * Target a specific email address - */ - 'contactEmail'?: string; + * Id of Reseller child created + */ + 'id'?: number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "startDate", - "baseName": "startDate", - "type": "string" - }, - { - "name": "endDate", - "baseName": "endDate", + "name": "authKey", + "baseName": "authKey", "type": "string" }, { - "name": "contactEmail", - "baseName": "contactEmail", - "type": "string" + "name": "id", + "baseName": "id", + "type": "number" } ]; static getAttributeTypeMap() { - return DeleteHardbounces.attributeTypeMap; + return CreateReseller.attributeTypeMap; } } -export class EmailExportRecipients { +export class CreateSender { /** - * Webhook called once the export process is finished. For reference, https://help.sendinblue.com/hc/en-us/articles/360007666479 - */ - 'notifyURL'?: string; + * From Name to use for the sender + */ + 'name': string; /** - * Type of recipients to export for a campaign - */ - 'recipientsType': EmailExportRecipients.RecipientsTypeEnum; + * From email to use for the sender. A verification email will be sent to this address. + */ + 'email': string; + /** + * Mandatory in case of dedicated IP, IPs to associate to the sender + */ + 'ips'?: Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "notifyURL", - "baseName": "notifyURL", + "name": "name", + "baseName": "name", "type": "string" }, { - "name": "recipientsType", - "baseName": "recipientsType", - "type": "EmailExportRecipients.RecipientsTypeEnum" + "name": "email", + "baseName": "email", + "type": "string" + }, + { + "name": "ips", + "baseName": "ips", + "type": "Array" } ]; static getAttributeTypeMap() { - return EmailExportRecipients.attributeTypeMap; + return CreateSender.attributeTypeMap; } } -export namespace EmailExportRecipients { - export enum RecipientsTypeEnum { - All = 'all', - NonClickers = 'nonClickers', - NonOpeners = 'nonOpeners', - Clickers = 'clickers', - Openers = 'openers', - SoftBounces = 'softBounces', - HardBounces = 'hardBounces', - Unsubscribed = 'unsubscribed' - } -} -export class ErrorModel { +export class CreateSenderIps { /** - * Error code displayed in case of a failure - */ - 'code': ErrorModel.CodeEnum; + * Dedicated IP available in your account + */ + 'ip': string; /** - * Readable message associated to the failure - */ - 'message': string; + * Domain of the IP + */ + 'domain': string; + /** + * Weight to apply to the IP. Sum of all IP weights must be 100. Should be passed for either ALL or NONE of the IPs. If it's not passed, the sending will be equally balanced on all IPs. + */ + 'weight'?: number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "code", - "baseName": "code", - "type": "ErrorModel.CodeEnum" + "name": "ip", + "baseName": "ip", + "type": "string" }, { - "name": "message", - "baseName": "message", + "name": "domain", + "baseName": "domain", "type": "string" + }, + { + "name": "weight", + "baseName": "weight", + "type": "number" } ]; static getAttributeTypeMap() { - return ErrorModel.attributeTypeMap; + return CreateSenderIps.attributeTypeMap; } } -export namespace ErrorModel { - export enum CodeEnum { - InvalidParameter = 'invalid_parameter', - MissingParameter = 'missing_parameter', - OutOfRange = 'out_of_range', - CampaignProcessing = 'campaign_processing', - CampaignSent = 'campaign_sent', - DocumentNotFound = 'document_not_found', - ResellerPermissionDenied = 'reseller_permission_denied', - NotEnoughCredits = 'not_enough_credits', - PermissionDenied = 'permission_denied', - DuplicateParameter = 'duplicate_parameter', - DuplicateRequest = 'duplicate_request', - MethodNotAllowed = 'method_not_allowed', - Unauthorized = 'unauthorized', - AccountUnderValidation = 'account_under_validation', - NotAcceptable = 'not_acceptable' - } -} - -export class GetAccountMarketingAutomation { +export class CreateSenderModel { /** - * Marketing Automation Tracker ID - */ - 'key'?: string; + * ID of the Sender created + */ + 'id': number; /** - * Status of Marketing Automation Plateform activation for your account (true=enabled, false=disabled) - */ - 'enabled': boolean; + * Status of SPF configuration for the sender (true = SPF not well configured, false = SPF well configured) + */ + 'spfError'?: boolean; + /** + * Status of DKIM configuration for the sender (true = DKIM not well configured, false = DKIM well configured) + */ + 'dkimError'?: boolean; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "key", - "baseName": "key", - "type": "string" + "name": "id", + "baseName": "id", + "type": "number" }, { - "name": "enabled", - "baseName": "enabled", + "name": "spfError", + "baseName": "spfError", + "type": "boolean" + }, + { + "name": "dkimError", + "baseName": "dkimError", "type": "boolean" } ]; static getAttributeTypeMap() { - return GetAccountMarketingAutomation.attributeTypeMap; + return CreateSenderModel.attributeTypeMap; } } -export class GetAccountPlan { - /** - * Displays the plan type of the user - */ - 'type': GetAccountPlan.TypeEnum; +export class CreateSmsCampaign { /** - * This is the type of the credit, \"Send Limit\" is one of the possible types of credit of a user. \"Send Limit\" implies the total number of emails you can send to the subscribers in your account. - */ - 'creditsType': GetAccountPlan.CreditsTypeEnum; + * Name of the campaign + */ + 'name': string; /** - * Remaining credits of the user - */ - 'credits': number; + * Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** + */ + 'sender': string; /** - * Date of the period from which the plan will start (only available for \"subscription\" and \"reseller\" plan type) - */ - 'startDate'?: string; + * Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS + */ + 'content': string; + 'recipients'?: CreateSmsCampaignRecipients; /** - * Date of the period from which the plan will end (only available for \"subscription\" and \"reseller\" plan type) - */ - 'endDate'?: string; + * UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. + */ + 'scheduledAt'?: string; /** - * Only in case of reseller account. It implies the total number of child accounts you can add to your account. - */ - 'userLimit'?: number; + * Format of the message. It indicates whether the content should be treated as unicode or not. + */ + 'unicodeEnabled'?: boolean; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "type", - "baseName": "type", - "type": "GetAccountPlan.TypeEnum" + "name": "name", + "baseName": "name", + "type": "string" }, { - "name": "creditsType", - "baseName": "creditsType", - "type": "GetAccountPlan.CreditsTypeEnum" + "name": "sender", + "baseName": "sender", + "type": "string" }, { - "name": "credits", - "baseName": "credits", - "type": "number" + "name": "content", + "baseName": "content", + "type": "string" }, { - "name": "startDate", - "baseName": "startDate", - "type": "string" + "name": "recipients", + "baseName": "recipients", + "type": "CreateSmsCampaignRecipients" }, { - "name": "endDate", - "baseName": "endDate", + "name": "scheduledAt", + "baseName": "scheduledAt", "type": "string" }, { - "name": "userLimit", - "baseName": "userLimit", - "type": "number" + "name": "unicodeEnabled", + "baseName": "unicodeEnabled", + "type": "boolean" } ]; static getAttributeTypeMap() { - return GetAccountPlan.attributeTypeMap; - } -} - -export namespace GetAccountPlan { - export enum TypeEnum { - PayAsYouGo = 'payAsYouGo', - Free = 'free', - Subscription = 'subscription', - Sms = 'sms', - Reseller = 'reseller' + return CreateSmsCampaign.attributeTypeMap; } - export enum CreditsTypeEnum { - SendLimit = 'sendLimit' } -} -/** - * Information about your transactional email account - */ -export class GetAccountRelay { + + export class CreateSmsCampaignRecipients { /** - * Status of your transactional email Account (true=Enabled, false=Disabled) - */ - 'enabled': boolean; - 'data': GetAccountRelayData; + * Lists Ids to send the campaign to. REQUIRED if scheduledAt is not empty + */ + 'listIds': Array; + /** + * List ids which have to be excluded from a campaign + */ + 'exclusionListIds'?: Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "enabled", - "baseName": "enabled", - "type": "boolean" + "name": "listIds", + "baseName": "listIds", + "type": "Array" }, { - "name": "data", - "baseName": "data", - "type": "GetAccountRelayData" + "name": "exclusionListIds", + "baseName": "exclusionListIds", + "type": "Array" } ]; static getAttributeTypeMap() { - return GetAccountRelay.attributeTypeMap; + return CreateSmsCampaignRecipients.attributeTypeMap; } } -/** - * Data regarding the transactional email account - */ -export class GetAccountRelayData { - /** - * Email to use as login on transactional platform - */ - 'userName': string; - /** - * URL of the SMTP Relay - */ - 'relay': string; +export class CreateSmtpEmail { /** - * Port used for SMTP Relay - */ - 'port': number; + * Message ID of the transactional email sent + */ + 'messageId'?: string; + 'messageIds'?: Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "userName", - "baseName": "userName", - "type": "string" - }, - { - "name": "relay", - "baseName": "relay", + "name": "messageId", + "baseName": "messageId", "type": "string" }, { - "name": "port", - "baseName": "port", - "type": "number" + "name": "messageIds", + "baseName": "messageIds", + "type": "Array" } ]; static getAttributeTypeMap() { - return GetAccountRelayData.attributeTypeMap; + return CreateSmtpEmail.attributeTypeMap; + } } -} -export class GetAggregatedReport { - /** - * Time frame of the report - */ - 'range'?: string; - /** - * Number of requests for the timeframe - */ - 'requests'?: number; - /** - * Number of delivered emails for the timeframe - */ - 'delivered'?: number; - /** - * Number of hardbounces for the timeframe - */ - 'hardBounces'?: number; + export class CreateSmtpTemplate { /** - * Number of softbounces for the timeframe - */ - 'softBounces'?: number; + * Tag of the template + */ + 'tag'?: string; + 'sender': CreateSmtpTemplateSender; /** - * Number of clicks for the timeframe - */ - 'clicks'?: number; + * Name of the template + */ + 'templateName': string; /** - * Number of unique clicks for the timeframe - */ - 'uniqueClicks'?: number; + * Body of the message (HTML version). The field must have more than 10 characters. REQUIRED if htmlUrl is empty + */ + 'htmlContent'?: string; /** - * Number of openings for the timeframe - */ - 'opens'?: number; + * Url which contents the body of the email message. REQUIRED if htmlContent is empty + */ + 'htmlUrl'?: string; /** - * Number of unique openings for the timeframe - */ - 'uniqueOpens'?: number; + * Subject of the template + */ + 'subject': string; /** - * Number of complaint (spam report) for the timeframe - */ - 'spamReports'?: number; + * Email on which campaign recipients will be able to reply to + */ + 'replyTo'?: string; /** - * Number of blocked contact emails for the timeframe - */ - 'blocked'?: number; + * To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization + */ + 'toField'?: string; /** - * Number of invalid emails for the timeframe - */ - 'invalid'?: number; + * Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps + */ + 'attachmentUrl'?: string; /** - * Number of unsubscribed emails for the timeframe - */ - 'unsubscribed'?: number; + * Status of template. isActive = true means template is active and isActive = false means template is inactive + */ + 'isActive'?: boolean; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "range", - "baseName": "range", + "name": "tag", + "baseName": "tag", "type": "string" }, { - "name": "requests", - "baseName": "requests", - "type": "number" + "name": "sender", + "baseName": "sender", + "type": "CreateSmtpTemplateSender" }, { - "name": "delivered", - "baseName": "delivered", - "type": "number" + "name": "templateName", + "baseName": "templateName", + "type": "string" }, { - "name": "hardBounces", - "baseName": "hardBounces", - "type": "number" + "name": "htmlContent", + "baseName": "htmlContent", + "type": "string" }, { - "name": "softBounces", - "baseName": "softBounces", - "type": "number" + "name": "htmlUrl", + "baseName": "htmlUrl", + "type": "string" }, { - "name": "clicks", - "baseName": "clicks", - "type": "number" + "name": "subject", + "baseName": "subject", + "type": "string" }, { - "name": "uniqueClicks", - "baseName": "uniqueClicks", - "type": "number" + "name": "replyTo", + "baseName": "replyTo", + "type": "string" }, { - "name": "opens", - "baseName": "opens", - "type": "number" + "name": "toField", + "baseName": "toField", + "type": "string" }, { - "name": "uniqueOpens", - "baseName": "uniqueOpens", - "type": "number" - }, - { - "name": "spamReports", - "baseName": "spamReports", - "type": "number" - }, - { - "name": "blocked", - "baseName": "blocked", - "type": "number" - }, - { - "name": "invalid", - "baseName": "invalid", - "type": "number" + "name": "attachmentUrl", + "baseName": "attachmentUrl", + "type": "string" }, { - "name": "unsubscribed", - "baseName": "unsubscribed", - "type": "number" + "name": "isActive", + "baseName": "isActive", + "type": "boolean" } ]; static getAttributeTypeMap() { - return GetAggregatedReport.attributeTypeMap; + return CreateSmtpTemplate.attributeTypeMap; + } } -} -export class GetAttributes { /** - * Listing of available contact attributes in your account - */ - 'attributes': Array; + * Sender details including id or email and name (optional). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example `{\"name\":\"xyz\", \"email\":\"example@abc.com\"}` , `{\"name\":\"xyz\", \"id\":123}` + */ + export class CreateSmtpTemplateSender { + /** + * Name of the sender. If not passed, will be set to default + */ + 'name'?: string; + /** + * Email of the sender + */ + 'email'?: string; + /** + * Select the sender for the template on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). + */ + 'id'?: number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "attributes", - "baseName": "attributes", - "type": "Array" + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "email", + "baseName": "email", + "type": "string" + }, + { + "name": "id", + "baseName": "id", + "type": "number" } ]; static getAttributeTypeMap() { - return GetAttributes.attributeTypeMap; + return CreateSmtpTemplateSender.attributeTypeMap; + } } -} -export class GetAttributesAttributes { - /** - * Name of the attribute - */ - 'name': string; + export class CreateSubAccount { /** - * Category of the attribute - */ - 'category': GetAttributesAttributes.CategoryEnum; + * Set the name of the sub-account company + */ + 'companyName': string; /** - * Type of the attribute - */ - 'type'?: GetAttributesAttributes.TypeEnum; + * Email address for the organization + */ + 'email': string; /** - * Parameter only available for \"category\" type attributes. - */ - 'enumeration'?: Array; + * Set the language of the sub-account + */ + 'language'?: CreateSubAccount.LanguageEnum; /** - * Calculated value formula - */ - 'calculatedValue'?: string; + * Set the timezone of the sub-account + */ + 'timezone'?: string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "name", - "baseName": "name", + "name": "companyName", + "baseName": "companyName", "type": "string" }, { - "name": "category", - "baseName": "category", - "type": "GetAttributesAttributes.CategoryEnum" - }, - { - "name": "type", - "baseName": "type", - "type": "GetAttributesAttributes.TypeEnum" + "name": "email", + "baseName": "email", + "type": "string" }, { - "name": "enumeration", - "baseName": "enumeration", - "type": "Array" + "name": "language", + "baseName": "language", + "type": "CreateSubAccount.LanguageEnum" }, { - "name": "calculatedValue", - "baseName": "calculatedValue", + "name": "timezone", + "baseName": "timezone", "type": "string" } ]; static getAttributeTypeMap() { - return GetAttributesAttributes.attributeTypeMap; + return CreateSubAccount.attributeTypeMap; + } } -} -export namespace GetAttributesAttributes { - export enum CategoryEnum { - Normal = 'normal', - Transactional = 'transactional', - Category = 'category', - Calculated = 'calculated', - Global = 'global' + export namespace CreateSubAccount { + export enum LanguageEnum { + En = 'en', + Fr = 'fr', + It = 'it', + Es = 'es', + Pt = 'pt', + De = 'de' } - export enum TypeEnum { - Text = 'text', - Date = 'date', - Float = 'float', - Id = 'id', - Boolean = 'boolean' } -} -export class GetAttributesEnumeration { - /** - * ID of Value of the \"category\" type attribute - */ - 'value': number; + export class CreateSubAccountResponse { /** - * Label of the \"category\" type attribute - */ - 'label': string; + * ID of the sub-account created + */ + 'id': number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "value", - "baseName": "value", + "name": "id", + "baseName": "id", "type": "number" - }, - { - "name": "label", - "baseName": "label", - "type": "string" } ]; static getAttributeTypeMap() { - return GetAttributesEnumeration.attributeTypeMap; + return CreateSubAccountResponse.attributeTypeMap; + } } -} -/** - * list of blocked domains - */ -export class GetBlockedDomains { + export class CreateUpdateContactModel { /** - * List of all blocked domains - */ - 'domains': Array; + * ID of the contact when a new contact is created + */ + 'id'?: number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "domains", - "baseName": "domains", - "type": "Array" + "name": "id", + "baseName": "id", + "type": "number" } ]; static getAttributeTypeMap() { - return GetBlockedDomains.attributeTypeMap; + return CreateUpdateContactModel.attributeTypeMap; + } } -} -export class GetCampaignOverview { - /** - * ID of the campaign - */ - 'id': number; - /** - * Name of the campaign - */ - 'name': string; - /** - * Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` - */ - 'subject'?: string; - /** - * Type of campaign - */ - 'type': GetCampaignOverview.TypeEnum; - /** - * Status of the campaign - */ - 'status': GetCampaignOverview.StatusEnum; + export class CreateUpdateFolder { /** - * UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'scheduledAt'?: string; - /** - * Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. - */ - 'abTesting'?: boolean; - /** - * Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` - */ - 'subjectA'?: string; + * Name of the folder + */ + 'name'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "name", + "baseName": "name", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return CreateUpdateFolder.attributeTypeMap; + } + } + + export class CreateWebhook { /** - * Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` - */ - 'subjectB'?: string; + * URL of the webhook + */ + 'url': string; /** - * The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` - */ - 'splitRule'?: number; + * Description of the webhook + */ + 'description'?: string; /** - * Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` - */ - 'winnerCriteria'?: string; + * - Events triggering the webhook. Possible values for **Transactional** type webhook: #### `sent` OR `request`, `delivered`, `hardBounce`, `softBounce`, `blocked`, `spam`, `invalid`, `deferred`, `click`, `opened`, `uniqueOpened` and `unsubscribed` - Possible values for **Marketing** type webhook: #### `spam`, `opened`, `click`, `hardBounce`, `softBounce`, `unsubscribed`, `listAddition` & `delivered` - Possible values for **Inbound** type webhook: #### `inboundEmailProcessed` + */ + 'events': Array; /** - * The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` - */ - 'winnerDelay'?: number; + * Type of the webhook + */ + 'type'?: CreateWebhook.TypeEnum; /** - * It is true if you have chosen to send your campaign at best time, otherwise it is false - */ - 'sendAtBestTime'?: boolean; + * Inbound domain of webhook, required in case of event type `inbound` + */ + 'domain'?: string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "id", - "baseName": "id", - "type": "number" + "name": "url", + "baseName": "url", + "type": "string" }, { - "name": "name", - "baseName": "name", + "name": "description", + "baseName": "description", "type": "string" }, { - "name": "subject", - "baseName": "subject", - "type": "string" + "name": "events", + "baseName": "events", + "type": "Array" }, { "name": "type", "baseName": "type", - "type": "GetCampaignOverview.TypeEnum" - }, - { - "name": "status", - "baseName": "status", - "type": "GetCampaignOverview.StatusEnum" - }, - { - "name": "scheduledAt", - "baseName": "scheduledAt", - "type": "string" - }, - { - "name": "abTesting", - "baseName": "abTesting", - "type": "boolean" - }, - { - "name": "subjectA", - "baseName": "subjectA", - "type": "string" + "type": "CreateWebhook.TypeEnum" }, { - "name": "subjectB", - "baseName": "subjectB", + "name": "domain", + "baseName": "domain", "type": "string" - }, - { - "name": "splitRule", - "baseName": "splitRule", - "type": "number" - }, - { - "name": "winnerCriteria", - "baseName": "winnerCriteria", - "type": "string" - }, - { - "name": "winnerDelay", - "baseName": "winnerDelay", - "type": "number" - }, - { - "name": "sendAtBestTime", - "baseName": "sendAtBestTime", - "type": "boolean" } ]; static getAttributeTypeMap() { - return GetCampaignOverview.attributeTypeMap; + return CreateWebhook.attributeTypeMap; + } } -} -export namespace GetCampaignOverview { + export namespace CreateWebhook { + export enum EventsEnum { + Sent = 'sent', + HardBounce = 'hardBounce', + SoftBounce = 'softBounce', + Blocked = 'blocked', + Spam = 'spam', + Delivered = 'delivered', + Request = 'request', + Click = 'click', + Invalid = 'invalid', + Deferred = 'deferred', + Opened = 'opened', + UniqueOpened = 'uniqueOpened', + Unsubscribed = 'unsubscribed', + ListAddition = 'listAddition', + ContactUpdated = 'contactUpdated', + ContactDeleted = 'contactDeleted', + InboundEmailProcessed = 'inboundEmailProcessed' + } export enum TypeEnum { - Classic = 'classic', - Trigger = 'trigger' + Transactional = 'transactional', + Marketing = 'marketing', + Inbound = 'inbound' } - export enum StatusEnum { - Draft = 'draft', - Sent = 'sent', - Archive = 'archive', - Queued = 'queued', - Suspended = 'suspended', - InProcess = 'in_process' } -} -export class GetCampaignRecipients { - 'lists': Array; - 'exclusionLists': Array; + export class CreatedProcessId { + /** + * Id of the process created + */ + 'processId': number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "lists", - "baseName": "lists", - "type": "Array" - }, - { - "name": "exclusionLists", - "baseName": "exclusionLists", - "type": "Array" + "name": "processId", + "baseName": "processId", + "type": "number" } ]; static getAttributeTypeMap() { - return GetCampaignRecipients.attributeTypeMap; + return CreatedProcessId.attributeTypeMap; + } } -} -export class GetCampaignStats { - /** - * List Id of email campaign (only in case of get email campaign(s)(not for global stats)) - */ - 'listId'?: number; - /** - * Number of unique clicks for the campaign - */ - 'uniqueClicks': number; - /** - * Number of total clicks for the campaign - */ - 'clickers': number; - /** - * Number of complaints (Spam reports) for the campaign - */ - 'complaints': number; /** - * Number of delivered emails for the campaign - */ - 'delivered': number; - /** - * Number of sent emails for the campaign - */ - 'sent': number; - /** - * Number of softbounce for the campaign - */ - 'softBounces': number; - /** - * Number of harbounce for the campaign - */ - 'hardBounces': number; - /** - * Number of unique openings for the campaign - */ - 'uniqueViews': number; - /** - * Recipients without any privacy protection option enabled in their email client - */ - 'trackableViews': number; + * Deal Details + */ + export class Deal { /** - * Number of unsubscription for the campaign - */ - 'unsubscriptions': number; + * Unique deal id + */ + 'id'?: string; /** - * Number of openings for the campaign - */ - 'viewed': number; + * Deal attributes with values + */ + 'attributes'?: any; /** - * Number of deferred emails for the campaign - */ - 'deferred'?: number; + * Contact ids for contacts linked to this deal + */ + 'linkedContactsIds'?: Array; /** - * Total number of non-delivered campaigns for a particular campaign id. - */ - 'returnBounce'?: number; + * Companies ids for companies linked to this deal + */ + 'linkedCompaniesIds'?: Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "listId", - "baseName": "listId", - "type": "number" - }, - { - "name": "uniqueClicks", - "baseName": "uniqueClicks", - "type": "number" - }, - { - "name": "clickers", - "baseName": "clickers", - "type": "number" - }, - { - "name": "complaints", - "baseName": "complaints", - "type": "number" - }, - { - "name": "delivered", - "baseName": "delivered", - "type": "number" - }, - { - "name": "sent", - "baseName": "sent", - "type": "number" - }, - { - "name": "softBounces", - "baseName": "softBounces", - "type": "number" - }, - { - "name": "hardBounces", - "baseName": "hardBounces", - "type": "number" - }, - { - "name": "uniqueViews", - "baseName": "uniqueViews", - "type": "number" - }, - { - "name": "trackableViews", - "baseName": "trackableViews", - "type": "number" - }, - { - "name": "unsubscriptions", - "baseName": "unsubscriptions", - "type": "number" + "name": "id", + "baseName": "id", + "type": "string" }, { - "name": "viewed", - "baseName": "viewed", - "type": "number" + "name": "attributes", + "baseName": "attributes", + "type": "any" }, { - "name": "deferred", - "baseName": "deferred", - "type": "number" + "name": "linkedContactsIds", + "baseName": "linkedContactsIds", + "type": "Array" }, { - "name": "returnBounce", - "baseName": "returnBounce", - "type": "number" + "name": "linkedCompaniesIds", + "baseName": "linkedCompaniesIds", + "type": "Array" } ]; static getAttributeTypeMap() { - return GetCampaignStats.attributeTypeMap; + return Deal.attributeTypeMap; + } } -} -export class GetChildAccountCreationStatus { /** - * Status of child account creation whether it is successfully created (exists) or not. - */ - 'childAccountCreated': boolean; + * List of deal attributes + */ + export class DealAttributes extends Array { static discriminator: string | undefined = undefined; - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "childAccountCreated", - "baseName": "childAccountCreated", - "type": "boolean" - } ]; - - static getAttributeTypeMap() { - return GetChildAccountCreationStatus.attributeTypeMap; } -} -export class GetChildDomain { /** - * Sender domain - */ - 'domain'?: string; - /** - * indicates whether a domain is verified or not - */ - 'active'?: boolean; + * List of attributes + */ + export class DealAttributesInner { + 'internalName'?: string; + 'label'?: string; + 'attributeTypeName'?: string; + 'attributeOptions'?: Array; + 'isRequired'?: boolean; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "domain", - "baseName": "domain", + "name": "internalName", + "baseName": "internalName", "type": "string" }, { - "name": "active", - "baseName": "active", + "name": "label", + "baseName": "label", + "type": "string" + }, + { + "name": "attributeTypeName", + "baseName": "attributeTypeName", + "type": "string" + }, + { + "name": "attributeOptions", + "baseName": "attributeOptions", + "type": "Array" + }, + { + "name": "isRequired", + "baseName": "isRequired", "type": "boolean" } ]; static getAttributeTypeMap() { - return GetChildDomain.attributeTypeMap; + return DealAttributesInner.attributeTypeMap; + } } -} - -export class GetChildDomains extends Array { - - static discriminator: string | undefined = undefined; - -} -/** - * API Keys associated to child account - */ -export class GetChildInfoApiKeys { - 'v2': Array; - 'v3'?: Array; + /** + * List of Deals + */ + export class DealsList { + /** + * List of deals + */ + 'items'?: Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "v2", - "baseName": "v2", - "type": "Array" - }, - { - "name": "v3", - "baseName": "v3", - "type": "Array" + "name": "items", + "baseName": "items", + "type": "Array" } ]; static getAttributeTypeMap() { - return GetChildInfoApiKeys.attributeTypeMap; + return DealsList.attributeTypeMap; + } } -} -export class GetChildInfoApiKeysV2 { + export class DeleteHardbounces { /** - * Name of the key for version 2 - */ - 'name': string; + * Starting date (YYYY-MM-DD) of the time period for deletion. The hardbounces occurred after this date will be deleted. Must be less than or equal to the endDate + */ + 'startDate'?: string; /** - * API Key for version 2 - */ - 'key': string; + * Ending date (YYYY-MM-DD) of the time period for deletion. The hardbounces until this date will be deleted. Must be greater than or equal to the startDate + */ + 'endDate'?: string; + /** + * Target a specific email address + */ + 'contactEmail'?: string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "name", - "baseName": "name", + "name": "startDate", + "baseName": "startDate", "type": "string" }, { - "name": "key", - "baseName": "key", + "name": "endDate", + "baseName": "endDate", "type": "string" - } ]; + }, + { + "name": "contactEmail", + "baseName": "contactEmail", + "type": "string" + } ]; static getAttributeTypeMap() { - return GetChildInfoApiKeysV2.attributeTypeMap; + return DeleteHardbounces.attributeTypeMap; + } } -} -export class GetChildInfoApiKeysV3 { + export class EmailExportRecipients { /** - * Name of the key for version 3 - */ - 'name': string; + * Webhook called once the export process is finished. For reference, https://help.sendinblue.com/hc/en-us/articles/360007666479 + */ + 'notifyURL'?: string; /** - * API Key for version 3 - */ - 'key': string; + * Type of recipients to export for a campaign + */ + 'recipientsType': EmailExportRecipients.RecipientsTypeEnum; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "name", - "baseName": "name", + "name": "notifyURL", + "baseName": "notifyURL", "type": "string" }, { - "name": "key", - "baseName": "key", - "type": "string" + "name": "recipientsType", + "baseName": "recipientsType", + "type": "EmailExportRecipients.RecipientsTypeEnum" } ]; static getAttributeTypeMap() { - return GetChildInfoApiKeysV3.attributeTypeMap; + return EmailExportRecipients.attributeTypeMap; + } } -} -/** - * Credits available for your child - */ -export class GetChildInfoCredits { + export namespace EmailExportRecipients { + export enum RecipientsTypeEnum { + All = 'all', + NonClickers = 'nonClickers', + NonOpeners = 'nonOpeners', + Clickers = 'clickers', + Openers = 'openers', + SoftBounces = 'softBounces', + HardBounces = 'hardBounces', + Unsubscribed = 'unsubscribed' + } + } + export class ErrorModel { /** - * Email credits available for your child - */ - 'emailCredits'?: number; + * Error code displayed in case of a failure + */ + 'code': ErrorModel.CodeEnum; /** - * SMS credits available for your child - */ - 'smsCredits'?: number; + * Readable message associated to the failure + */ + 'message': string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "emailCredits", - "baseName": "emailCredits", - "type": "number" + "name": "code", + "baseName": "code", + "type": "ErrorModel.CodeEnum" }, { - "name": "smsCredits", - "baseName": "smsCredits", - "type": "number" + "name": "message", + "baseName": "message", + "type": "string" } ]; static getAttributeTypeMap() { - return GetChildInfoCredits.attributeTypeMap; + return ErrorModel.attributeTypeMap; + } } -} -/** - * Statistics about your child account activity - */ -export class GetChildInfoStatistics { + export namespace ErrorModel { + export enum CodeEnum { + InvalidParameter = 'invalid_parameter', + MissingParameter = 'missing_parameter', + OutOfRange = 'out_of_range', + CampaignProcessing = 'campaign_processing', + CampaignSent = 'campaign_sent', + DocumentNotFound = 'document_not_found', + ResellerPermissionDenied = 'reseller_permission_denied', + NotEnoughCredits = 'not_enough_credits', + PermissionDenied = 'permission_denied', + DuplicateParameter = 'duplicate_parameter', + DuplicateRequest = 'duplicate_request', + MethodNotAllowed = 'method_not_allowed', + Unauthorized = 'unauthorized', + AccountUnderValidation = 'account_under_validation', + NotAcceptable = 'not_acceptable' + } + } /** - * Overall emails sent for the previous month - */ - 'previousMonthTotalSent'?: number; + * File data that is uploaded + */ + export class FileData { /** - * Overall emails sent for current month - */ - 'currentMonthTotalSent'?: number; + * Name of uploaded file + */ + 'name'?: string; /** - * Overall emails sent for since the account exists - */ - 'totalSent'?: number; + * Account id of user which created the file + */ + 'authorId'?: string; + /** + * Contact id of contact on which file is uploaded + */ + 'contactId'?: number; + /** + * Deal id linked to a file + */ + 'dealId'?: string; + /** + * Company id linked to a file + */ + 'companyId'?: string; + /** + * Size of file in bytes + */ + 'size'?: number; + /** + * File created date/time + */ + 'createdAt'?: Date; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "previousMonthTotalSent", - "baseName": "previousMonthTotalSent", - "type": "number" + "name": "name", + "baseName": "name", + "type": "string" }, { - "name": "currentMonthTotalSent", - "baseName": "currentMonthTotalSent", + "name": "authorId", + "baseName": "authorId", + "type": "string" + }, + { + "name": "contactId", + "baseName": "contactId", "type": "number" }, { - "name": "totalSent", - "baseName": "totalSent", + "name": "dealId", + "baseName": "dealId", + "type": "string" + }, + { + "name": "companyId", + "baseName": "companyId", + "type": "string" + }, + { + "name": "size", + "baseName": "size", "type": "number" + }, + { + "name": "createdAt", + "baseName": "createdAt", + "type": "Date" } ]; static getAttributeTypeMap() { - return GetChildInfoStatistics.attributeTypeMap; + return FileData.attributeTypeMap; + } } -} -export class GetChildrenList { - /** - * Your children's account information - */ - 'children'?: Array; + export class FileDownloadableLink { /** - * Number of child accounts - */ - 'count'?: number; + * A unique link to download the requested file. + */ + 'fileUrl': string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "children", - "baseName": "children", - "type": "Array" - }, - { - "name": "count", - "baseName": "count", - "type": "number" + "name": "fileUrl", + "baseName": "fileUrl", + "type": "string" } ]; static getAttributeTypeMap() { - return GetChildrenList.attributeTypeMap; + return FileDownloadableLink.attributeTypeMap; + } } -} -export class GetClient { - /** - * Login Email - */ - 'email': string; /** - * First Name - */ - 'firstName': string; + * List of files + */ + export class FileList extends Array { + + static discriminator: string | undefined = undefined; + + } + + export class GetAccountMarketingAutomation { /** - * Last Name - */ - 'lastName': string; + * Marketing Automation Tracker ID + */ + 'key'?: string; /** - * Name of the company - */ - 'companyName': string; + * Status of Marketing Automation Plateform activation for your account (true=enabled, false=disabled) + */ + 'enabled': boolean; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "firstName", - "baseName": "firstName", - "type": "string" - }, - { - "name": "lastName", - "baseName": "lastName", + "name": "key", + "baseName": "key", "type": "string" }, { - "name": "companyName", - "baseName": "companyName", - "type": "string" + "name": "enabled", + "baseName": "enabled", + "type": "boolean" } ]; static getAttributeTypeMap() { - return GetClient.attributeTypeMap; + return GetAccountMarketingAutomation.attributeTypeMap; + } } -} -export class GetChildInfo extends GetClient { - 'credits'?: GetChildInfoCredits; - 'statistics'?: GetChildInfoStatistics; + export class GetAccountPlan { /** - * The encrypted password of child account - */ - 'password': string; + * Displays the plan type of the user + */ + 'type': GetAccountPlan.TypeEnum; /** - * IP(s) associated to a child account user - */ - 'ips'?: Array; - 'apiKeys'?: GetChildInfoApiKeys; + * This is the type of the credit, \"Send Limit\" is one of the possible types of credit of a user. \"Send Limit\" implies the total number of emails you can send to the subscribers in your account. + */ + 'creditsType': GetAccountPlan.CreditsTypeEnum; + /** + * Remaining credits of the user + */ + 'credits': number; + /** + * Date of the period from which the plan will start (only available for \"subscription\" and \"reseller\" plan type) + */ + 'startDate'?: string; + /** + * Date of the period from which the plan will end (only available for \"subscription\" and \"reseller\" plan type) + */ + 'endDate'?: string; + /** + * Only in case of reseller account. It implies the total number of child accounts you can add to your account. + */ + 'userLimit'?: number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "credits", - "baseName": "credits", - "type": "GetChildInfoCredits" + "name": "type", + "baseName": "type", + "type": "GetAccountPlan.TypeEnum" }, { - "name": "statistics", - "baseName": "statistics", - "type": "GetChildInfoStatistics" + "name": "creditsType", + "baseName": "creditsType", + "type": "GetAccountPlan.CreditsTypeEnum" }, { - "name": "password", - "baseName": "password", + "name": "credits", + "baseName": "credits", + "type": "number" + }, + { + "name": "startDate", + "baseName": "startDate", "type": "string" }, { - "name": "ips", - "baseName": "ips", - "type": "Array" + "name": "endDate", + "baseName": "endDate", + "type": "string" }, { - "name": "apiKeys", - "baseName": "apiKeys", - "type": "GetChildInfoApiKeys" + "name": "userLimit", + "baseName": "userLimit", + "type": "number" } ]; static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(GetChildInfo.attributeTypeMap); + return GetAccountPlan.attributeTypeMap; + } } -} -/** - * Campaign Statistics for the contact - */ -export class GetContactCampaignStats { - 'messagesSent'?: Array; - 'hardBounces'?: Array; - 'softBounces'?: Array; - 'complaints'?: Array; - 'unsubscriptions'?: GetContactCampaignStatsUnsubscriptions; - 'opened'?: Array; - 'clicked'?: Array; - 'transacAttributes'?: Array; - 'delivered'?: Array; - - static discriminator: string | undefined = undefined; - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "messagesSent", - "baseName": "messagesSent", - "type": "Array" - }, - { - "name": "hardBounces", - "baseName": "hardBounces", - "type": "Array" - }, - { - "name": "softBounces", - "baseName": "softBounces", - "type": "Array" - }, - { - "name": "complaints", - "baseName": "complaints", - "type": "Array" - }, - { - "name": "unsubscriptions", - "baseName": "unsubscriptions", - "type": "GetContactCampaignStatsUnsubscriptions" - }, - { - "name": "opened", - "baseName": "opened", - "type": "Array" - }, - { - "name": "clicked", - "baseName": "clicked", - "type": "Array" - }, - { - "name": "transacAttributes", - "baseName": "transacAttributes", - "type": "Array" - }, - { - "name": "delivered", - "baseName": "delivered", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetContactCampaignStats.attributeTypeMap; + export namespace GetAccountPlan { + export enum TypeEnum { + PayAsYouGo = 'payAsYouGo', + Free = 'free', + Subscription = 'subscription', + Sms = 'sms', + Reseller = 'reseller' + } + export enum CreditsTypeEnum { + SendLimit = 'sendLimit' + } } -} - -export class GetContactCampaignStatsClicked { /** - * ID of the campaign which generated the event - */ - 'campaignId': number; - 'links': Array; + * Information about your transactional email account + */ + export class GetAccountRelay { + /** + * Status of your transactional email Account (true=Enabled, false=Disabled) + */ + 'enabled': boolean; + 'data': GetAccountRelayData; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "campaignId", - "baseName": "campaignId", - "type": "number" + "name": "enabled", + "baseName": "enabled", + "type": "boolean" }, { - "name": "links", - "baseName": "links", - "type": "Array" + "name": "data", + "baseName": "data", + "type": "GetAccountRelayData" } ]; static getAttributeTypeMap() { - return GetContactCampaignStatsClicked.attributeTypeMap; + return GetAccountRelay.attributeTypeMap; + } } -} -export class GetContactCampaignStatsOpened { /** - * ID of the campaign which generated the event - */ - 'campaignId': number; + * Data regarding the transactional email account + */ + export class GetAccountRelayData { /** - * Number of openings of the campaign - */ - 'count': number; + * Email to use as login on transactional platform + */ + 'userName': string; /** - * UTC date-time of the event - */ - 'eventTime': string; + * URL of the SMTP Relay + */ + 'relay': string; /** - * IP from which the user has opened the campaign - */ - 'ip': string; + * Port used for SMTP Relay + */ + 'port': number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "campaignId", - "baseName": "campaignId", - "type": "number" - }, - { - "name": "count", - "baseName": "count", - "type": "number" + "name": "userName", + "baseName": "userName", + "type": "string" }, { - "name": "eventTime", - "baseName": "eventTime", + "name": "relay", + "baseName": "relay", "type": "string" }, { - "name": "ip", - "baseName": "ip", - "type": "string" + "name": "port", + "baseName": "port", + "type": "number" } ]; static getAttributeTypeMap() { - return GetContactCampaignStatsOpened.attributeTypeMap; + return GetAccountRelayData.attributeTypeMap; + } } -} -export class GetContactCampaignStatsTransacAttributes { + export class GetAggregatedReport { /** - * Date of the order - */ - 'orderDate': string; + * Time frame of the report + */ + 'range'?: string; /** - * Price of the order - */ - 'orderPrice': number; + * Number of requests for the timeframe + */ + 'requests'?: number; /** - * ID of the order - */ - 'orderId': number; + * Number of delivered emails for the timeframe + */ + 'delivered'?: number; + /** + * Number of hardbounces for the timeframe + */ + 'hardBounces'?: number; + /** + * Number of softbounces for the timeframe + */ + 'softBounces'?: number; + /** + * Number of clicks for the timeframe + */ + 'clicks'?: number; + /** + * Number of unique clicks for the timeframe + */ + 'uniqueClicks'?: number; + /** + * Number of openings for the timeframe + */ + 'opens'?: number; + /** + * Number of unique openings for the timeframe + */ + 'uniqueOpens'?: number; + /** + * Number of complaint (spam report) for the timeframe + */ + 'spamReports'?: number; + /** + * Number of blocked contact emails for the timeframe + */ + 'blocked'?: number; + /** + * Number of invalid emails for the timeframe + */ + 'invalid'?: number; + /** + * Number of unsubscribed emails for the timeframe + */ + 'unsubscribed'?: number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "orderDate", - "baseName": "orderDate", + "name": "range", + "baseName": "range", "type": "string" }, { - "name": "orderPrice", - "baseName": "orderPrice", + "name": "requests", + "baseName": "requests", "type": "number" }, { - "name": "orderId", - "baseName": "orderId", + "name": "delivered", + "baseName": "delivered", + "type": "number" + }, + { + "name": "hardBounces", + "baseName": "hardBounces", + "type": "number" + }, + { + "name": "softBounces", + "baseName": "softBounces", + "type": "number" + }, + { + "name": "clicks", + "baseName": "clicks", + "type": "number" + }, + { + "name": "uniqueClicks", + "baseName": "uniqueClicks", + "type": "number" + }, + { + "name": "opens", + "baseName": "opens", + "type": "number" + }, + { + "name": "uniqueOpens", + "baseName": "uniqueOpens", + "type": "number" + }, + { + "name": "spamReports", + "baseName": "spamReports", + "type": "number" + }, + { + "name": "blocked", + "baseName": "blocked", + "type": "number" + }, + { + "name": "invalid", + "baseName": "invalid", + "type": "number" + }, + { + "name": "unsubscribed", + "baseName": "unsubscribed", "type": "number" } ]; static getAttributeTypeMap() { - return GetContactCampaignStatsTransacAttributes.attributeTypeMap; + return GetAggregatedReport.attributeTypeMap; + } } -} -export class GetContactCampaignStatsUnsubscriptions { - /** - * Contact has unsubscribed via the unsubscription link in the email - */ - 'userUnsubscription': Array; + export class GetAttributes { /** - * Contact has been unsubscribed from the administrator - */ - 'adminUnsubscription': Array; + * Listing of available contact attributes in your account + */ + 'attributes': Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "userUnsubscription", - "baseName": "userUnsubscription", - "type": "Array" - }, - { - "name": "adminUnsubscription", - "baseName": "adminUnsubscription", - "type": "Array" + "name": "attributes", + "baseName": "attributes", + "type": "Array" } ]; static getAttributeTypeMap() { - return GetContactCampaignStatsUnsubscriptions.attributeTypeMap; + return GetAttributes.attributeTypeMap; + } } -} -export class GetContactDetails { - /** - * Email address of the contact for which you requested the details - */ - 'email': string; - /** - * ID of the contact for which you requested the details - */ - 'id': number; + export class GetAttributesAttributes { /** - * Blacklist status for email campaigns (true=blacklisted, false=not blacklisted) - */ - 'emailBlacklisted': boolean; + * Name of the attribute + */ + 'name': string; /** - * Blacklist status for SMS campaigns (true=blacklisted, false=not blacklisted) - */ - 'smsBlacklisted': boolean; + * Category of the attribute + */ + 'category': GetAttributesAttributes.CategoryEnum; /** - * Creation UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'createdAt': string; + * Type of the attribute + */ + 'type'?: GetAttributesAttributes.TypeEnum; /** - * Last modification UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'modifiedAt': string; - 'listIds': Array; - 'listUnsubscribed'?: Array; + * Parameter only available for \"category\" type attributes. + */ + 'enumeration'?: Array; /** - * Set of attributes of the contact - */ - 'attributes': any; + * Calculated value formula + */ + 'calculatedValue'?: string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "email", - "baseName": "email", + "name": "name", + "baseName": "name", "type": "string" }, { - "name": "id", - "baseName": "id", - "type": "number" + "name": "category", + "baseName": "category", + "type": "GetAttributesAttributes.CategoryEnum" }, { - "name": "emailBlacklisted", - "baseName": "emailBlacklisted", - "type": "boolean" - }, - { - "name": "smsBlacklisted", - "baseName": "smsBlacklisted", - "type": "boolean" + "name": "type", + "baseName": "type", + "type": "GetAttributesAttributes.TypeEnum" }, { - "name": "createdAt", - "baseName": "createdAt", - "type": "string" + "name": "enumeration", + "baseName": "enumeration", + "type": "Array" }, { - "name": "modifiedAt", - "baseName": "modifiedAt", + "name": "calculatedValue", + "baseName": "calculatedValue", "type": "string" - }, - { - "name": "listIds", - "baseName": "listIds", - "type": "Array" - }, - { - "name": "listUnsubscribed", - "baseName": "listUnsubscribed", - "type": "Array" - }, - { - "name": "attributes", - "baseName": "attributes", - "type": "any" } ]; static getAttributeTypeMap() { - return GetContactDetails.attributeTypeMap; + return GetAttributesAttributes.attributeTypeMap; } -} - -export class GetContacts { - 'contacts': Array; - /** - * Number of contacts - */ - 'count': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "contacts", - "baseName": "contacts", - "type": "Array" - }, - { - "name": "count", - "baseName": "count", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetContacts.attributeTypeMap; } -} -export class GetDeviceBrowserStats { - /** - * Number of total clicks for the campaign using the particular browser - */ - 'clickers': number; - /** - * Number of unique clicks for the campaign using the particular browser - */ - 'uniqueClicks': number; + export namespace GetAttributesAttributes { + export enum CategoryEnum { + Normal = 'normal', + Transactional = 'transactional', + Category = 'category', + Calculated = 'calculated', + Global = 'global' + } + export enum TypeEnum { + Text = 'text', + Date = 'date', + Float = 'float', + Id = 'id', + Boolean = 'boolean' + } + } + export class GetAttributesEnumeration { /** - * Number of openings for the campaign using the particular browser - */ - 'viewed': number; + * ID of Value of the \"category\" type attribute + */ + 'value': number; /** - * Number of unique openings for the campaign using the particular browser - */ - 'uniqueViews': number; + * Label of the \"category\" type attribute + */ + 'label': string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "clickers", - "baseName": "clickers", - "type": "number" - }, - { - "name": "uniqueClicks", - "baseName": "uniqueClicks", - "type": "number" - }, - { - "name": "viewed", - "baseName": "viewed", + "name": "value", + "baseName": "value", "type": "number" }, { - "name": "uniqueViews", - "baseName": "uniqueViews", - "type": "number" + "name": "label", + "baseName": "label", + "type": "string" } ]; static getAttributeTypeMap() { - return GetDeviceBrowserStats.attributeTypeMap; + return GetAttributesEnumeration.attributeTypeMap; + } } -} - - -export namespace GetEmailCampaign { -} -export class GetEmailCampaigns { - 'campaigns'?: Array; /** - * Number of Email campaigns retrieved - */ - 'count'?: number; + * list of blocked domains + */ + export class GetBlockedDomains { + /** + * List of all blocked domains + */ + 'domains': Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "campaigns", - "baseName": "campaigns", - "type": "Array" - }, - { - "name": "count", - "baseName": "count", - "type": "number" + "name": "domains", + "baseName": "domains", + "type": "Array" } ]; static getAttributeTypeMap() { - return GetEmailCampaigns.attributeTypeMap; + return GetBlockedDomains.attributeTypeMap; } -} - -export class GetEmailEventReport { - 'events'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "events", - "baseName": "events", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetEmailEventReport.attributeTypeMap; } -} -export class GetEmailEventReportEvents { + export class GetCampaignOverview { /** - * Email address which generates the event - */ - 'email': string; + * ID of the campaign + */ + 'id': number; /** - * UTC date-time on which the event has been generated - */ - 'date': string; + * Name of the campaign + */ + 'name': string; /** - * Subject of the event - */ + * Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` + */ 'subject'?: string; /** - * Message ID which generated the event - */ - 'messageId': string; + * Type of campaign + */ + 'type': GetCampaignOverview.TypeEnum; /** - * Event which occurred - */ - 'event': GetEmailEventReportEvents.EventEnum; + * Status of the campaign + */ + 'status': GetCampaignOverview.StatusEnum; /** - * Reason of bounce (only available if the event is hardbounce or softbounce) - */ - 'reason'?: string; + * UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) + */ + 'scheduledAt'?: string; /** - * Tag of the email which generated the event - */ - 'tag'?: string; + * Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. + */ + 'abTesting'?: boolean; /** - * IP from which the user has opened the email or clicked on the link (only available if the event is opened or clicks) - */ - 'ip'?: string; + * Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` + */ + 'subjectA'?: string; /** - * The link which is sent to the user (only available if the event is requests or opened or clicks) - */ - 'link'?: string; + * Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` + */ + 'subjectB'?: string; /** - * Sender email from which the emails are sent - */ - 'from'?: string; + * The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` + */ + 'splitRule'?: number; /** - * ID of the template (only available if the email is template based) - */ - 'templateId'?: number; + * Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` + */ + 'winnerCriteria'?: string; + /** + * The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` + */ + 'winnerDelay'?: number; + /** + * It is true if you have chosen to send your campaign at best time, otherwise it is false + */ + 'sendAtBestTime'?: boolean; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "email", - "baseName": "email", - "type": "string" + "name": "id", + "baseName": "id", + "type": "number" }, { - "name": "date", - "baseName": "date", + "name": "name", + "baseName": "name", "type": "string" }, { @@ -3671,209 +3608,241 @@ export class GetEmailEventReportEvents { "type": "string" }, { - "name": "messageId", - "baseName": "messageId", - "type": "string" + "name": "type", + "baseName": "type", + "type": "GetCampaignOverview.TypeEnum" }, { - "name": "event", - "baseName": "event", - "type": "GetEmailEventReportEvents.EventEnum" + "name": "status", + "baseName": "status", + "type": "GetCampaignOverview.StatusEnum" }, { - "name": "reason", - "baseName": "reason", + "name": "scheduledAt", + "baseName": "scheduledAt", "type": "string" }, { - "name": "tag", - "baseName": "tag", - "type": "string" + "name": "abTesting", + "baseName": "abTesting", + "type": "boolean" }, { - "name": "ip", - "baseName": "ip", + "name": "subjectA", + "baseName": "subjectA", "type": "string" }, { - "name": "link", - "baseName": "link", + "name": "subjectB", + "baseName": "subjectB", "type": "string" }, { - "name": "from", - "baseName": "from", + "name": "splitRule", + "baseName": "splitRule", + "type": "number" + }, + { + "name": "winnerCriteria", + "baseName": "winnerCriteria", "type": "string" }, { - "name": "templateId", - "baseName": "templateId", + "name": "winnerDelay", + "baseName": "winnerDelay", "type": "number" + }, + { + "name": "sendAtBestTime", + "baseName": "sendAtBestTime", + "type": "boolean" } ]; static getAttributeTypeMap() { - return GetEmailEventReportEvents.attributeTypeMap; + return GetCampaignOverview.attributeTypeMap; + } } -} -export namespace GetEmailEventReportEvents { - export enum EventEnum { - Bounces = 'bounces', - HardBounces = 'hardBounces', - SoftBounces = 'softBounces', - Delivered = 'delivered', - Spam = 'spam', - Requests = 'requests', - Opened = 'opened', - Clicks = 'clicks', - Invalid = 'invalid', - Deferred = 'deferred', - Blocked = 'blocked', - Unsubscribed = 'unsubscribed', - Error = 'error', - LoadedByProxy = 'loadedByProxy' + export namespace GetCampaignOverview { + export enum TypeEnum { + Classic = 'classic', + Trigger = 'trigger' } -} -export class GetExtendedCampaignOverview extends GetCampaignOverview { + export enum StatusEnum { + Draft = 'draft', + Sent = 'sent', + Archive = 'archive', + Queued = 'queued', + Suspended = 'suspended', + InProcess = 'in_process' + } + } + export class GetCampaignRecipients { + 'lists': Array; + 'exclusionLists': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "lists", + "baseName": "lists", + "type": "Array" + }, + { + "name": "exclusionLists", + "baseName": "exclusionLists", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return GetCampaignRecipients.attributeTypeMap; + } + } + + export class GetCampaignStats { /** - * Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) - */ - 'testSent': boolean; + * List Id of email campaign (only in case of get email campaign(s)(not for global stats)) + */ + 'listId'?: number; /** - * Header of the campaign - */ - 'header': string; + * Number of unique clicks for the campaign + */ + 'uniqueClicks': number; /** - * Footer of the campaign - */ - 'footer': string; - 'sender': GetExtendedCampaignOverviewSender; + * Number of total clicks for the campaign + */ + 'clickers': number; /** - * Email defined as the \"Reply to\" of the campaign - */ - 'replyTo': string; + * Number of complaints (Spam reports) for the campaign + */ + 'complaints': number; /** - * Customisation of the \"to\" field of the campaign - */ - 'toField'?: string; + * Number of delivered emails for the campaign + */ + 'delivered': number; /** - * HTML content of the campaign - */ - 'htmlContent': string; + * Number of sent emails for the campaign + */ + 'sent': number; /** - * Link to share the campaign on social medias - */ - 'shareLink'?: string; + * Number of softbounce for the campaign + */ + 'softBounces': number; /** - * Tag of the campaign - */ - 'tag'?: string; + * Number of harbounce for the campaign + */ + 'hardBounces': number; /** - * Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'createdAt': string; + * Number of unique openings for the campaign + */ + 'uniqueViews': number; /** - * UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'modifiedAt': string; + * Recipients without any privacy protection option enabled in their email client + */ + 'trackableViews': number; /** - * Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. - */ - 'inlineImageActivation'?: boolean; + * Rate of recipients without any privacy protection option enabled in their email client + */ + 'trackableViewsRate'?: number; /** - * Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign - */ - 'mirrorActive'?: boolean; + * Rate of recipients without any privacy protection option enabled in their email client, applied to all delivered emails + */ + 'estimatedViews'?: number; /** - * FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times - */ - 'recurring'?: boolean; + * Number of unsubscription for the campaign + */ + 'unsubscriptions': number; /** - * Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' - */ - 'sentDate'?: string; + * Number of openings for the campaign + */ + 'viewed': number; /** - * Total number of non-delivered campaigns for a particular campaign id. - */ + * Number of deferred emails for the campaign + */ + 'deferred'?: number; + /** + * Total number of non-delivered campaigns for a particular campaign id. + */ 'returnBounce'?: number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "testSent", - "baseName": "testSent", - "type": "boolean" + "name": "listId", + "baseName": "listId", + "type": "number" }, { - "name": "header", - "baseName": "header", - "type": "string" + "name": "uniqueClicks", + "baseName": "uniqueClicks", + "type": "number" }, { - "name": "footer", - "baseName": "footer", - "type": "string" + "name": "clickers", + "baseName": "clickers", + "type": "number" }, { - "name": "sender", - "baseName": "sender", - "type": "GetExtendedCampaignOverviewSender" + "name": "complaints", + "baseName": "complaints", + "type": "number" }, { - "name": "replyTo", - "baseName": "replyTo", - "type": "string" + "name": "delivered", + "baseName": "delivered", + "type": "number" }, { - "name": "toField", - "baseName": "toField", - "type": "string" + "name": "sent", + "baseName": "sent", + "type": "number" }, { - "name": "htmlContent", - "baseName": "htmlContent", - "type": "string" + "name": "softBounces", + "baseName": "softBounces", + "type": "number" }, { - "name": "shareLink", - "baseName": "shareLink", - "type": "string" + "name": "hardBounces", + "baseName": "hardBounces", + "type": "number" }, { - "name": "tag", - "baseName": "tag", - "type": "string" + "name": "uniqueViews", + "baseName": "uniqueViews", + "type": "number" }, { - "name": "createdAt", - "baseName": "createdAt", - "type": "string" + "name": "trackableViews", + "baseName": "trackableViews", + "type": "number" }, { - "name": "modifiedAt", - "baseName": "modifiedAt", - "type": "string" + "name": "trackableViewsRate", + "baseName": "trackableViewsRate", + "type": "number" }, { - "name": "inlineImageActivation", - "baseName": "inlineImageActivation", - "type": "boolean" + "name": "estimatedViews", + "baseName": "estimatedViews", + "type": "number" }, { - "name": "mirrorActive", - "baseName": "mirrorActive", - "type": "boolean" + "name": "unsubscriptions", + "baseName": "unsubscriptions", + "type": "number" }, { - "name": "recurring", - "baseName": "recurring", - "type": "boolean" + "name": "viewed", + "baseName": "viewed", + "type": "number" }, { - "name": "sentDate", - "baseName": "sentDate", - "type": "string" + "name": "deferred", + "baseName": "deferred", + "type": "number" }, { "name": "returnBounce", @@ -3882,317 +3851,311 @@ export class GetExtendedCampaignOverview extends GetCampaignOverview { } ]; static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(GetExtendedCampaignOverview.attributeTypeMap); + return GetCampaignStats.attributeTypeMap; + } } -} - -export namespace GetExtendedCampaignOverview { -} -export class GetEmailCampaign extends GetExtendedCampaignOverview { - 'recipients': GetSmsCampaignRecipients; - 'statistics': GetSmsCampaignRecipients; + export class GetChildAccountCreationStatus { + /** + * Status of child account creation whether it is successfully created (exists) or not. + */ + 'childAccountCreated': boolean; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "recipients", - "baseName": "recipients", - "type": "GetSmsCampaignRecipients" - }, - { - "name": "statistics", - "baseName": "statistics", - "type": "GetSmsCampaignRecipients" + "name": "childAccountCreated", + "baseName": "childAccountCreated", + "type": "boolean" } ]; static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(GetEmailCampaign.attributeTypeMap); + return GetChildAccountCreationStatus.attributeTypeMap; } -} -export class GetExtendedCampaignOverviewSender { - /** - * Sender name of the campaign - */ - 'name'?: string; + } + + export class GetChildDomain { /** - * Sender email of the campaign - */ - 'email'?: string; + * Sender domain + */ + 'domain'?: string; /** - * Sender id of the campaign - */ - 'id'?: string; + * indicates whether a domain is verified or not + */ + 'active'?: boolean; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "email", - "baseName": "email", + "name": "domain", + "baseName": "domain", "type": "string" }, { - "name": "id", - "baseName": "id", - "type": "string" + "name": "active", + "baseName": "active", + "type": "boolean" } ]; static getAttributeTypeMap() { - return GetExtendedCampaignOverviewSender.attributeTypeMap; + return GetChildDomain.attributeTypeMap; + } + } + + export class GetChildDomains extends Array { + + static discriminator: string | undefined = undefined; + } -} -export class GetExtendedCampaignStats { - 'globalStats': GetExtendedCampaignStatsGlobalStats; - /** - * List-wise statistics of the campaign. - */ - 'campaignStats': Array; - /** - * Number of clicks on mirror link - */ - 'mirrorClick': number; - /** - * Number of remaning emails to send - */ - 'remaining': number; - /** - * Statistics about the number of clicks for the links - */ - 'linksStats': any; - 'statsByDomain': GetStatsByDomain; - /** - * Statistics about the campaign on the basis of various devices - */ - 'statsByDevice': GetStatsByDevice; /** - * Statistics about the campaign on the basis of various browsers - */ - 'statsByBrowser': GetStatsByBrowser; + * API Keys associated to child account + */ + export class GetChildInfoApiKeys { + 'v2': Array; + 'v3'?: Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "globalStats", - "baseName": "globalStats", - "type": "GetExtendedCampaignStatsGlobalStats" - }, - { - "name": "campaignStats", - "baseName": "campaignStats", - "type": "Array" - }, - { - "name": "mirrorClick", - "baseName": "mirrorClick", - "type": "number" + "name": "v2", + "baseName": "v2", + "type": "Array" }, { - "name": "remaining", - "baseName": "remaining", - "type": "number" - }, + "name": "v3", + "baseName": "v3", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return GetChildInfoApiKeys.attributeTypeMap; + } + } + + export class GetChildInfoApiKeysV2 { + /** + * Name of the key for version 2 + */ + 'name': string; + /** + * API Key for version 2 + */ + 'key': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "linksStats", - "baseName": "linksStats", - "type": "any" + "name": "name", + "baseName": "name", + "type": "string" }, { - "name": "statsByDomain", - "baseName": "statsByDomain", - "type": "GetStatsByDomain" - }, + "name": "key", + "baseName": "key", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return GetChildInfoApiKeysV2.attributeTypeMap; + } + } + + export class GetChildInfoApiKeysV3 { + /** + * Name of the key for version 3 + */ + 'name': string; + /** + * API Key for version 3 + */ + 'key': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "statsByDevice", - "baseName": "statsByDevice", - "type": "GetStatsByDevice" + "name": "name", + "baseName": "name", + "type": "string" }, { - "name": "statsByBrowser", - "baseName": "statsByBrowser", - "type": "GetStatsByBrowser" + "name": "key", + "baseName": "key", + "type": "string" } ]; static getAttributeTypeMap() { - return GetExtendedCampaignStats.attributeTypeMap; + return GetChildInfoApiKeysV3.attributeTypeMap; + } } -} -/** - * Overall statistics of the campaign - */ -export class GetExtendedCampaignStatsGlobalStats { + /** + * Credits available for your child + */ + export class GetChildInfoCredits { + /** + * Email credits available for your child + */ + 'emailCredits'?: number; + /** + * SMS credits available for your child + */ + 'smsCredits'?: number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - ]; + { + "name": "emailCredits", + "baseName": "emailCredits", + "type": "number" + }, + { + "name": "smsCredits", + "baseName": "smsCredits", + "type": "number" + } ]; static getAttributeTypeMap() { - return GetExtendedCampaignStatsGlobalStats.attributeTypeMap; + return GetChildInfoCredits.attributeTypeMap; + } } -} -export class GetExtendedClient extends GetClient { - 'address': GetExtendedClientAddress; + /** + * Statistics about your child account activity + */ + export class GetChildInfoStatistics { + /** + * Overall emails sent for the previous month + */ + 'previousMonthTotalSent'?: number; + /** + * Overall emails sent for current month + */ + 'currentMonthTotalSent'?: number; + /** + * Overall emails sent for since the account exists + */ + 'totalSent'?: number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "address", - "baseName": "address", - "type": "GetExtendedClientAddress" + "name": "previousMonthTotalSent", + "baseName": "previousMonthTotalSent", + "type": "number" + }, + { + "name": "currentMonthTotalSent", + "baseName": "currentMonthTotalSent", + "type": "number" + }, + { + "name": "totalSent", + "baseName": "totalSent", + "type": "number" } ]; static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(GetExtendedClient.attributeTypeMap); + return GetChildInfoStatistics.attributeTypeMap; + } } -} -export class GetAccount extends GetExtendedClient { + export class GetChildrenList { /** - * Information about your plans and credits - */ - 'plan': Array; - 'relay': GetAccountRelay; - 'marketingAutomation'?: GetAccountMarketingAutomation; + * Your children's account information + */ + 'children'?: Array; + /** + * Number of child accounts + */ + 'count'?: number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "plan", - "baseName": "plan", - "type": "Array" - }, - { - "name": "relay", - "baseName": "relay", - "type": "GetAccountRelay" + "name": "children", + "baseName": "children", + "type": "Array" }, { - "name": "marketingAutomation", - "baseName": "marketingAutomation", - "type": "GetAccountMarketingAutomation" + "name": "count", + "baseName": "count", + "type": "number" } ]; static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(GetAccount.attributeTypeMap); + return GetChildrenList.attributeTypeMap; } -} -/** - * Address informations - */ -export class GetExtendedClientAddress { + } + + export class GetClient { /** - * Street information - */ - 'street': string; + * Login Email + */ + 'email': string; /** - * City information - */ - 'city': string; + * First Name + */ + 'firstName': string; /** - * Zip Code information - */ - 'zipCode': string; + * Last Name + */ + 'lastName': string; /** - * Country information - */ - 'country': string; + * Name of the company + */ + 'companyName': string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "street", - "baseName": "street", + "name": "email", + "baseName": "email", "type": "string" }, { - "name": "city", - "baseName": "city", + "name": "firstName", + "baseName": "firstName", "type": "string" }, { - "name": "zipCode", - "baseName": "zipCode", + "name": "lastName", + "baseName": "lastName", "type": "string" }, { - "name": "country", - "baseName": "country", + "name": "companyName", + "baseName": "companyName", "type": "string" } ]; static getAttributeTypeMap() { - return GetExtendedClientAddress.attributeTypeMap; + return GetClient.attributeTypeMap; } -} - -export class GetExtendedContactDetails extends GetContactDetails { - 'statistics': GetExtendedContactDetailsStatistics; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "statistics", - "baseName": "statistics", - "type": "GetExtendedContactDetailsStatistics" - } ]; - - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(GetExtendedContactDetails.attributeTypeMap); } -} -/** - * Campaign statistics of the contact - */ -export class GetExtendedContactDetailsStatistics { /** - * Listing of the sent campaign for the contact - */ + * Campaign Statistics for the contact + */ + export class GetContactCampaignStats { 'messagesSent'?: Array; - /** - * Listing of the hardbounes generated by the contact - */ 'hardBounces'?: Array; - /** - * Listing of the softbounes generated by the contact - */ 'softBounces'?: Array; - /** - * Listing of the complaints generated by the contact - */ 'complaints'?: Array; - 'unsubscriptions'?: GetExtendedContactDetailsStatisticsUnsubscriptions; - /** - * Listing of the openings generated by the contact - */ - 'opened'?: Array; - /** - * Listing of the clicks generated by the contact - */ - 'clicked'?: Array; - /** - * Listing of the transactional attributes for the contact - */ - 'transacAttributes'?: Array; - /** - * Listing of the delivered campaign for the contact - */ - 'delivered'?: Array; + 'unsubscriptions'?: GetContactCampaignStatsUnsubscriptions; + 'opened'?: Array; + 'clicked'?: Array; + 'transacAttributes'?: Array; + 'delivered'?: Array; static discriminator: string | undefined = undefined; @@ -4220,42 +4183,39 @@ export class GetExtendedContactDetailsStatistics { { "name": "unsubscriptions", "baseName": "unsubscriptions", - "type": "GetExtendedContactDetailsStatisticsUnsubscriptions" + "type": "GetContactCampaignStatsUnsubscriptions" }, { "name": "opened", "baseName": "opened", - "type": "Array" + "type": "Array" }, { "name": "clicked", "baseName": "clicked", - "type": "Array" + "type": "Array" }, { "name": "transacAttributes", "baseName": "transacAttributes", - "type": "Array" + "type": "Array" }, { "name": "delivered", "baseName": "delivered", - "type": "Array" + "type": "Array" } ]; static getAttributeTypeMap() { - return GetExtendedContactDetailsStatistics.attributeTypeMap; + return GetContactCampaignStats.attributeTypeMap; + } } -} -export class GetExtendedContactDetailsStatisticsClicked { + export class GetContactCampaignStatsClicked { /** - * ID of the campaign which generated the event - */ + * ID of the campaign which generated the event + */ 'campaignId': number; - /** - * Listing of the clicked links for the campaign - */ 'links': Array; static discriminator: string | undefined = undefined; @@ -4273,19 +4233,27 @@ export class GetExtendedContactDetailsStatisticsClicked { } ]; static getAttributeTypeMap() { - return GetExtendedContactDetailsStatisticsClicked.attributeTypeMap; + return GetContactCampaignStatsClicked.attributeTypeMap; + } } -} -export class GetExtendedContactDetailsStatisticsDelivered { + export class GetContactCampaignStatsOpened { /** - * ID of the campaign which generated the event - */ + * ID of the campaign which generated the event + */ 'campaignId': number; /** - * UTC date-time of the event - */ + * Number of openings of the campaign + */ + 'count': number; + /** + * UTC date-time of the event + */ 'eventTime': string; + /** + * IP from which the user has opened the campaign + */ + 'ip': string; static discriminator: string | undefined = undefined; @@ -4295,1292 +4263,1312 @@ export class GetExtendedContactDetailsStatisticsDelivered { "baseName": "campaignId", "type": "number" }, + { + "name": "count", + "baseName": "count", + "type": "number" + }, { "name": "eventTime", "baseName": "eventTime", "type": "string" + }, + { + "name": "ip", + "baseName": "ip", + "type": "string" } ]; static getAttributeTypeMap() { - return GetExtendedContactDetailsStatisticsDelivered.attributeTypeMap; + return GetContactCampaignStatsOpened.attributeTypeMap; + } } -} -export class GetExtendedContactDetailsStatisticsLinks { + export class GetContactCampaignStatsTransacAttributes { /** - * Number of clicks on this link for the campaign - */ - 'count': number; + * Date of the order + */ + 'orderDate': string; /** - * UTC date-time of the event - */ - 'eventTime': string; + * Price of the order + */ + 'orderPrice': number; /** - * IP from which the user has clicked on the link - */ - 'ip': string; - /** - * URL of the clicked link - */ - 'url': string; + * ID of the order + */ + 'orderId': number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "count", - "baseName": "count", - "type": "number" - }, - { - "name": "eventTime", - "baseName": "eventTime", + "name": "orderDate", + "baseName": "orderDate", "type": "string" }, { - "name": "ip", - "baseName": "ip", - "type": "string" + "name": "orderPrice", + "baseName": "orderPrice", + "type": "number" }, { - "name": "url", - "baseName": "url", - "type": "string" + "name": "orderId", + "baseName": "orderId", + "type": "number" } ]; static getAttributeTypeMap() { - return GetExtendedContactDetailsStatisticsLinks.attributeTypeMap; + return GetContactCampaignStatsTransacAttributes.attributeTypeMap; + } } -} -export class GetExtendedContactDetailsStatisticsMessagesSent { + export class GetContactCampaignStatsUnsubscriptions { /** - * ID of the campaign which generated the event - */ - 'campaignId': number; + * Contact has unsubscribed via the unsubscription link in the email + */ + 'userUnsubscription': Array; /** - * UTC date-time of the event - */ - 'eventTime': string; + * Contact has been unsubscribed from the administrator + */ + 'adminUnsubscription': Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "campaignId", - "baseName": "campaignId", - "type": "number" + "name": "userUnsubscription", + "baseName": "userUnsubscription", + "type": "Array" }, { - "name": "eventTime", - "baseName": "eventTime", - "type": "string" + "name": "adminUnsubscription", + "baseName": "adminUnsubscription", + "type": "Array" } ]; static getAttributeTypeMap() { - return GetExtendedContactDetailsStatisticsMessagesSent.attributeTypeMap; + return GetContactCampaignStatsUnsubscriptions.attributeTypeMap; + } } -} -export class GetExtendedContactDetailsStatisticsOpened { + export class GetContactDetails { /** - * ID of the campaign which generated the event - */ - 'campaignId': number; + * Email address of the contact for which you requested the details + */ + 'email': string; /** - * Number of openings for the campaign - */ - 'count': number; + * ID of the contact for which you requested the details + */ + 'id': number; /** - * UTC date-time of the event - */ - 'eventTime': string; + * Blacklist status for email campaigns (true=blacklisted, false=not blacklisted) + */ + 'emailBlacklisted': boolean; /** - * IP from which the user has opened the email - */ - 'ip': string; + * Blacklist status for SMS campaigns (true=blacklisted, false=not blacklisted) + */ + 'smsBlacklisted': boolean; + /** + * Creation UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) + */ + 'createdAt': string; + /** + * Last modification UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) + */ + 'modifiedAt': string; + 'listIds': Array; + 'listUnsubscribed'?: Array; + /** + * Set of attributes of the contact + */ + 'attributes': any; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "campaignId", - "baseName": "campaignId", - "type": "number" + "name": "email", + "baseName": "email", + "type": "string" }, { - "name": "count", - "baseName": "count", + "name": "id", + "baseName": "id", "type": "number" }, { - "name": "eventTime", - "baseName": "eventTime", + "name": "emailBlacklisted", + "baseName": "emailBlacklisted", + "type": "boolean" + }, + { + "name": "smsBlacklisted", + "baseName": "smsBlacklisted", + "type": "boolean" + }, + { + "name": "createdAt", + "baseName": "createdAt", "type": "string" }, { - "name": "ip", - "baseName": "ip", + "name": "modifiedAt", + "baseName": "modifiedAt", "type": "string" + }, + { + "name": "listIds", + "baseName": "listIds", + "type": "Array" + }, + { + "name": "listUnsubscribed", + "baseName": "listUnsubscribed", + "type": "Array" + }, + { + "name": "attributes", + "baseName": "attributes", + "type": "any" } ]; static getAttributeTypeMap() { - return GetExtendedContactDetailsStatisticsOpened.attributeTypeMap; + return GetContactDetails.attributeTypeMap; + } } -} -/** - * Listing of the unsubscription for the contact - */ -export class GetExtendedContactDetailsStatisticsUnsubscriptions { - /** - * Contact unsubscribe via unsubscription link in a campaign - */ - 'userUnsubscription': Array; + export class GetContacts { + 'contacts': Array; /** - * Contact has been unsubscribed from the administrator - */ - 'adminUnsubscription': Array; + * Number of contacts + */ + 'count': number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "userUnsubscription", - "baseName": "userUnsubscription", - "type": "Array" + "name": "contacts", + "baseName": "contacts", + "type": "Array" }, { - "name": "adminUnsubscription", - "baseName": "adminUnsubscription", - "type": "Array" + "name": "count", + "baseName": "count", + "type": "number" } ]; static getAttributeTypeMap() { - return GetExtendedContactDetailsStatisticsUnsubscriptions.attributeTypeMap; + return GetContacts.attributeTypeMap; + } } -} -export class GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription { + export class GetDeviceBrowserStats { /** - * UTC date-time of the event - */ - 'eventTime': string; + * Number of total clicks for the campaign using the particular browser + */ + 'clickers': number; /** - * IP from which the user has been unsubscribed - */ - 'ip'?: string; + * Number of unique clicks for the campaign using the particular browser + */ + 'uniqueClicks': number; + /** + * Number of openings for the campaign using the particular browser + */ + 'viewed': number; + /** + * Number of unique openings for the campaign using the particular browser + */ + 'uniqueViews': number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "eventTime", - "baseName": "eventTime", - "type": "string" + "name": "clickers", + "baseName": "clickers", + "type": "number" }, { - "name": "ip", - "baseName": "ip", - "type": "string" + "name": "uniqueClicks", + "baseName": "uniqueClicks", + "type": "number" + }, + { + "name": "viewed", + "baseName": "viewed", + "type": "number" + }, + { + "name": "uniqueViews", + "baseName": "uniqueViews", + "type": "number" } ]; static getAttributeTypeMap() { - return GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription.attributeTypeMap; + return GetDeviceBrowserStats.attributeTypeMap; + } } -} -export class GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription { - /** - * ID of the campaign which generated the event - */ - 'campaignId': number; - /** - * UTC date-time of the event - */ - 'eventTime': string; + export namespace GetEmailCampaign { + } + export class GetEmailCampaigns { + 'campaigns'?: Array; /** - * IP from which the user has unsubscribed - */ - 'ip'?: string; + * Number of Email campaigns retrieved + */ + 'count'?: number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "campaignId", - "baseName": "campaignId", - "type": "number" - }, - { - "name": "eventTime", - "baseName": "eventTime", - "type": "string" + "name": "campaigns", + "baseName": "campaigns", + "type": "Array" }, { - "name": "ip", - "baseName": "ip", - "type": "string" + "name": "count", + "baseName": "count", + "type": "number" } ]; static getAttributeTypeMap() { - return GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription.attributeTypeMap; + return GetEmailCampaigns.attributeTypeMap; + } } -} -export class GetExtendedListCampaignStats { - /** - * ID of the campaign - */ - 'campaignId': number; - 'stats': GetCampaignStats; + export class GetEmailEventReport { + 'events'?: Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "campaignId", - "baseName": "campaignId", - "type": "number" - }, - { - "name": "stats", - "baseName": "stats", - "type": "GetCampaignStats" + "name": "events", + "baseName": "events", + "type": "Array" } ]; static getAttributeTypeMap() { - return GetExtendedListCampaignStats.attributeTypeMap; + return GetEmailEventReport.attributeTypeMap; + } } -} -export class GetFolder { + export class GetEmailEventReportEvents { /** - * ID of the folder - */ - 'id': number; + * Email address which generates the event + */ + 'email': string; /** - * Name of the folder - */ - 'name': string; + * UTC date-time on which the event has been generated + */ + 'date': string; /** - * Number of blacklisted contacts in the folder - */ - 'totalBlacklisted': number; + * Subject of the event + */ + 'subject'?: string; /** - * Number of contacts in the folder - */ - 'totalSubscribers': number; + * Message ID which generated the event + */ + 'messageId': string; /** - * Number of unique contacts in the folder - */ - 'uniqueSubscribers': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "name", - "baseName": "name", + * Event which occurred + */ + 'event': GetEmailEventReportEvents.EventEnum; + /** + * Reason of bounce (only available if the event is hardbounce or softbounce) + */ + 'reason'?: string; + /** + * Tag of the email which generated the event + */ + 'tag'?: string; + /** + * IP from which the user has opened the email or clicked on the link (only available if the event is opened or clicks) + */ + 'ip'?: string; + /** + * The link which is sent to the user (only available if the event is requests or opened or clicks) + */ + 'link'?: string; + /** + * Sender email from which the emails are sent + */ + 'from'?: string; + /** + * ID of the template (only available if the email is template based) + */ + 'templateId'?: number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "email", + "baseName": "email", "type": "string" }, { - "name": "totalBlacklisted", - "baseName": "totalBlacklisted", - "type": "number" + "name": "date", + "baseName": "date", + "type": "string" }, { - "name": "totalSubscribers", - "baseName": "totalSubscribers", - "type": "number" + "name": "subject", + "baseName": "subject", + "type": "string" }, { - "name": "uniqueSubscribers", - "baseName": "uniqueSubscribers", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetFolder.attributeTypeMap; - } -} - -export class GetFolderLists { - 'lists'?: Array; - /** - * Number of lists in the folder - */ - 'count'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + "name": "messageId", + "baseName": "messageId", + "type": "string" + }, { - "name": "lists", - "baseName": "lists", - "type": "Array" + "name": "event", + "baseName": "event", + "type": "GetEmailEventReportEvents.EventEnum" }, { - "name": "count", - "baseName": "count", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetFolderLists.attributeTypeMap; - } -} - -export class GetFolders { - 'folders'?: Array; - /** - * Number of folders available in your account - */ - 'count'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + "name": "reason", + "baseName": "reason", + "type": "string" + }, { - "name": "folders", - "baseName": "folders", - "type": "Array" + "name": "tag", + "baseName": "tag", + "type": "string" }, { - "name": "count", - "baseName": "count", + "name": "ip", + "baseName": "ip", + "type": "string" + }, + { + "name": "link", + "baseName": "link", + "type": "string" + }, + { + "name": "from", + "baseName": "from", + "type": "string" + }, + { + "name": "templateId", + "baseName": "templateId", "type": "number" } ]; static getAttributeTypeMap() { - return GetFolders.attributeTypeMap; + return GetEmailEventReportEvents.attributeTypeMap; } -} - -export class GetInboundEmailEvents { - 'events'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "events", - "baseName": "events", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetInboundEmailEvents.attributeTypeMap; } -} -export class GetInboundEmailEventsByUuid { + export namespace GetEmailEventReportEvents { + export enum EventEnum { + Bounces = 'bounces', + HardBounces = 'hardBounces', + SoftBounces = 'softBounces', + Delivered = 'delivered', + Spam = 'spam', + Requests = 'requests', + Opened = 'opened', + Clicks = 'clicks', + Invalid = 'invalid', + Deferred = 'deferred', + Blocked = 'blocked', + Unsubscribed = 'unsubscribed', + Error = 'error', + LoadedByProxy = 'loadedByProxy' + } + } + export class GetExtendedCampaignOverview extends GetCampaignOverview { /** - * Date when email was received on SMTP relay - */ - 'receivedAt'?: Date; + * Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) + */ + 'testSent': boolean; /** - * Date when email was delivered successfully to client’s webhook - */ - 'deliveredAt'?: Date; + * Header of the campaign + */ + 'header': string; /** - * Recipient’s email address - */ - 'recipient'?: string; + * Footer of the campaign + */ + 'footer': string; + 'sender': GetExtendedCampaignOverviewSender; /** - * Sender’s email address - */ - 'sender'?: string; + * Email defined as the \"Reply to\" of the campaign + */ + 'replyTo': string; /** - * Value of the Message-ID header. This will be present only after the processing is done. - */ - 'messageId'?: string; + * Customisation of the \"to\" field of the campaign + */ + 'toField'?: string; /** - * Value of the Subject header. This will be present only after the processing is done. - */ - 'subject'?: string; + * HTML content of the campaign + */ + 'htmlContent': string; /** - * List of attachments of the email. This will be present only after the processing is done. - */ - 'attachments'?: Array; + * Link to share the campaign on social medias + */ + 'shareLink'?: string; /** - * List of events/logs that describe the lifecycle of the email on SIB platform - */ - 'logs'?: Array; + * Tag of the campaign + */ + 'tag'?: string; + /** + * Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + */ + 'createdAt': string; + /** + * UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + */ + 'modifiedAt': string; + /** + * Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. + */ + 'inlineImageActivation'?: boolean; + /** + * Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign + */ + 'mirrorActive'?: boolean; + /** + * FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times + */ + 'recurring'?: boolean; + /** + * Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' + */ + 'sentDate'?: string; + /** + * Total number of non-delivered campaigns for a particular campaign id. + */ + 'returnBounce'?: number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "receivedAt", - "baseName": "receivedAt", - "type": "Date" + "name": "testSent", + "baseName": "testSent", + "type": "boolean" }, { - "name": "deliveredAt", - "baseName": "deliveredAt", - "type": "Date" + "name": "header", + "baseName": "header", + "type": "string" }, { - "name": "recipient", - "baseName": "recipient", + "name": "footer", + "baseName": "footer", "type": "string" }, { "name": "sender", "baseName": "sender", - "type": "string" + "type": "GetExtendedCampaignOverviewSender" }, { - "name": "messageId", - "baseName": "messageId", + "name": "replyTo", + "baseName": "replyTo", "type": "string" }, { - "name": "subject", - "baseName": "subject", + "name": "toField", + "baseName": "toField", "type": "string" }, { - "name": "attachments", - "baseName": "attachments", - "type": "Array" + "name": "htmlContent", + "baseName": "htmlContent", + "type": "string" }, { - "name": "logs", - "baseName": "logs", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetInboundEmailEventsByUuid.attributeTypeMap; - } -} - -export class GetInboundEmailEventsByUuidAttachments { - /** - * filename specified in the Content-Disposition header of the attachment - */ - 'name'?: string; - /** - * value of the Content-Type header of the attachment - */ - 'contentType'?: string; - /** - * value of the Content-ID header of the attachment. - */ - 'contentId'?: string; - /** - * size of the attachment in bytes - */ - 'contentLength'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", + "name": "shareLink", + "baseName": "shareLink", "type": "string" }, { - "name": "contentType", - "baseName": "contentType", + "name": "tag", + "baseName": "tag", "type": "string" }, { - "name": "contentId", - "baseName": "contentId", + "name": "createdAt", + "baseName": "createdAt", "type": "string" }, { - "name": "contentLength", - "baseName": "contentLength", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetInboundEmailEventsByUuidAttachments.attributeTypeMap; - } -} - -export class GetInboundEmailEventsByUuidLogs { - /** - * Date of the event - */ - 'date'?: Date; - /** - * Type of the event - */ - 'type'?: GetInboundEmailEventsByUuidLogs.TypeEnum; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + "name": "modifiedAt", + "baseName": "modifiedAt", + "type": "string" + }, { - "name": "date", - "baseName": "date", - "type": "Date" + "name": "inlineImageActivation", + "baseName": "inlineImageActivation", + "type": "boolean" }, { - "name": "type", - "baseName": "type", - "type": "GetInboundEmailEventsByUuidLogs.TypeEnum" + "name": "mirrorActive", + "baseName": "mirrorActive", + "type": "boolean" + }, + { + "name": "recurring", + "baseName": "recurring", + "type": "boolean" + }, + { + "name": "sentDate", + "baseName": "sentDate", + "type": "string" + }, + { + "name": "returnBounce", + "baseName": "returnBounce", + "type": "number" } ]; static getAttributeTypeMap() { - return GetInboundEmailEventsByUuidLogs.attributeTypeMap; + return super.getAttributeTypeMap().concat(GetExtendedCampaignOverview.attributeTypeMap); + } } -} -export namespace GetInboundEmailEventsByUuidLogs { - export enum TypeEnum { - Received = 'received', - Processed = 'processed', - WebhookFailed = 'webhookFailed', - WebhookDelivered = 'webhookDelivered' + export class GetEmailCampaign extends GetExtendedCampaignOverview { + 'recipients': GetCampaignRecipients; + 'statistics': GetExtendedCampaignStats; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "recipients", + "baseName": "recipients", + "type": "GetCampaignRecipients" + }, + { + "name": "statistics", + "baseName": "statistics", + "type": "GetExtendedCampaignStats" + } ]; + + static getAttributeTypeMap() { + return super.getAttributeTypeMap().concat(GetEmailCampaign.attributeTypeMap); + } + } + export namespace GetExtendedCampaignOverview { } -} -export class GetInboundEmailEventsEvents { - /** - * UUID that can be used to fetch additional data - */ - 'uuid': string; + export class GetExtendedCampaignOverviewSender { /** - * Date when email was received on SMTP relay - */ - 'date': Date; + * Sender name of the campaign + */ + 'name'?: string; /** - * Sender’s email address - */ - 'sender': string; + * Sender email of the campaign + */ + 'email'?: string; /** - * Recipient’s email address - */ - 'recipient': string; + * Sender id of the campaign + */ + 'id'?: string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "uuid", - "baseName": "uuid", + "name": "name", + "baseName": "name", "type": "string" }, { - "name": "date", - "baseName": "date", - "type": "Date" - }, - { - "name": "sender", - "baseName": "sender", + "name": "email", + "baseName": "email", "type": "string" }, { - "name": "recipient", - "baseName": "recipient", + "name": "id", + "baseName": "id", "type": "string" } ]; static getAttributeTypeMap() { - return GetInboundEmailEventsEvents.attributeTypeMap; + return GetExtendedCampaignOverviewSender.attributeTypeMap; + } } -} -export class GetIp { + export class GetExtendedCampaignStats { + 'globalStats': any; /** - * ID of the dedicated IP - */ - 'id': number; + * List-wise statistics of the campaign. + */ + 'campaignStats': Array; /** - * Dedicated IP - */ - 'ip': string; + * Number of clicks on mirror link + */ + 'mirrorClick': number; /** - * Status of the IP (true=active, false=inactive) - */ - 'active': boolean; + * Number of remaning emails to send + */ + 'remaining': number; /** - * Domain associated to the IP - */ - 'domain': string; + * Statistics about the number of clicks for the links + */ + 'linksStats': any; + 'statsByDomain': any; + /** + * Statistics about the campaign on the basis of various devices + */ + 'statsByDevice': any; + /** + * Statistics about the campaign on the basis of various browsers + */ + 'statsByBrowser': any; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "id", - "baseName": "id", - "type": "number" + "name": "globalStats", + "baseName": "globalStats", + "type": "any" }, { - "name": "ip", - "baseName": "ip", - "type": "string" + "name": "campaignStats", + "baseName": "campaignStats", + "type": "Array" }, { - "name": "active", - "baseName": "active", - "type": "boolean" + "name": "mirrorClick", + "baseName": "mirrorClick", + "type": "number" }, { - "name": "domain", - "baseName": "domain", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetIp.attributeTypeMap; - } -} - -export class GetIpFromSender { - /** - * ID of the dedicated IP - */ - 'id': number; - /** - * Dedicated IP - */ - 'ip': string; - /** - * Domain associated to the IP - */ - 'domain': string; - /** - * Weight of the IP - */ - 'weight': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", + "name": "remaining", + "baseName": "remaining", "type": "number" }, { - "name": "ip", - "baseName": "ip", - "type": "string" + "name": "linksStats", + "baseName": "linksStats", + "type": "any" }, { - "name": "domain", - "baseName": "domain", - "type": "string" + "name": "statsByDomain", + "baseName": "statsByDomain", + "type": "any" }, { - "name": "weight", - "baseName": "weight", - "type": "number" + "name": "statsByDevice", + "baseName": "statsByDevice", + "type": "any" + }, + { + "name": "statsByBrowser", + "baseName": "statsByBrowser", + "type": "any" } ]; static getAttributeTypeMap() { - return GetIpFromSender.attributeTypeMap; + return GetExtendedCampaignStats.attributeTypeMap; + } } -} -export class GetIps { /** - * Dedicated IP(s) available on your account - */ - 'ips': Array; + * Overall statistics of the campaign + */ + export class GetExtendedCampaignStatsGlobalStats { static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "ips", - "baseName": "ips", - "type": "Array" - } ]; + ]; static getAttributeTypeMap() { - return GetIps.attributeTypeMap; + return GetExtendedCampaignStatsGlobalStats.attributeTypeMap; + } } -} -export class GetIpsFromSender { - /** - * Dedicated IP(s) linked to a sender - */ - 'ips': Array; + export class GetExtendedClient extends GetClient { + 'address': GetExtendedClientAddress; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "ips", - "baseName": "ips", - "type": "Array" + "name": "address", + "baseName": "address", + "type": "GetExtendedClientAddress" } ]; static getAttributeTypeMap() { - return GetIpsFromSender.attributeTypeMap; + return super.getAttributeTypeMap().concat(GetExtendedClient.attributeTypeMap); + } } -} -export class GetList { - /** - * ID of the list - */ - 'id': number; - /** - * Name of the list - */ - 'name': string; + export class GetChildInfo extends GetClient { + 'credits'?: GetChildInfoCredits; + 'statistics'?: GetChildInfoStatistics; + /** + * The encrypted password of child account + */ + 'password': string; + /** + * IP(s) associated to a child account user + */ + 'ips'?: Array; + 'apiKeys'?: GetChildInfoApiKeys; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "credits", + "baseName": "credits", + "type": "GetChildInfoCredits" + }, + { + "name": "statistics", + "baseName": "statistics", + "type": "GetChildInfoStatistics" + }, + { + "name": "password", + "baseName": "password", + "type": "string" + }, + { + "name": "ips", + "baseName": "ips", + "type": "Array" + }, + { + "name": "apiKeys", + "baseName": "apiKeys", + "type": "GetChildInfoApiKeys" + } ]; + + static getAttributeTypeMap() { + return super.getAttributeTypeMap().concat(GetChildInfo.attributeTypeMap); + } + } + export class GetAccount extends GetExtendedClient { + /** + * Information about your plans and credits + */ + 'plan': Array; + 'relay': GetAccountRelay; + 'marketingAutomation'?: GetAccountMarketingAutomation; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "plan", + "baseName": "plan", + "type": "Array" + }, + { + "name": "relay", + "baseName": "relay", + "type": "GetAccountRelay" + }, + { + "name": "marketingAutomation", + "baseName": "marketingAutomation", + "type": "GetAccountMarketingAutomation" + } ]; + + static getAttributeTypeMap() { + return super.getAttributeTypeMap().concat(GetAccount.attributeTypeMap); + } + } + /** + * Address informations + */ + export class GetExtendedClientAddress { + /** + * Street information + */ + 'street': string; /** - * Number of blacklisted contacts in the list - */ - 'totalBlacklisted': number; + * City information + */ + 'city': string; /** - * Number of contacts in the list - */ - 'totalSubscribers': number; + * Zip Code information + */ + 'zipCode': string; /** - * Number of unique contacts in the list - */ - 'uniqueSubscribers': number; + * Country information + */ + 'country': string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "name", - "baseName": "name", + "name": "street", + "baseName": "street", "type": "string" }, { - "name": "totalBlacklisted", - "baseName": "totalBlacklisted", - "type": "number" + "name": "city", + "baseName": "city", + "type": "string" }, { - "name": "totalSubscribers", - "baseName": "totalSubscribers", - "type": "number" + "name": "zipCode", + "baseName": "zipCode", + "type": "string" }, { - "name": "uniqueSubscribers", - "baseName": "uniqueSubscribers", - "type": "number" + "name": "country", + "baseName": "country", + "type": "string" } ]; static getAttributeTypeMap() { - return GetList.attributeTypeMap; + return GetExtendedClientAddress.attributeTypeMap; + } + } + + export class GetExtendedContactDetails extends GetContactDetails { + 'statistics': GetExtendedContactDetailsStatistics; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "statistics", + "baseName": "statistics", + "type": "GetExtendedContactDetailsStatistics" + } ]; + + static getAttributeTypeMap() { + return super.getAttributeTypeMap().concat(GetExtendedContactDetails.attributeTypeMap); + } } -} -export class GetExtendedList extends GetList { /** - * ID of the folder - */ - 'folderId': number; + * Campaign statistics of the contact + */ + export class GetExtendedContactDetailsStatistics { /** - * Creation UTC date-time of the list (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'createdAt': string; - 'campaignStats'?: Array; + * Listing of the sent campaign for the contact + */ + 'messagesSent'?: Array; /** - * Status telling if the list is dynamic or not (true=dynamic, false=not dynamic) - */ - 'dynamicList'?: boolean; + * Listing of the hardbounes generated by the contact + */ + 'hardBounces'?: Array; + /** + * Listing of the softbounes generated by the contact + */ + 'softBounces'?: Array; + /** + * Listing of the complaints generated by the contact + */ + 'complaints'?: Array; + 'unsubscriptions'?: GetExtendedContactDetailsStatisticsUnsubscriptions; + /** + * Listing of the openings generated by the contact + */ + 'opened'?: Array; + /** + * Listing of the clicks generated by the contact + */ + 'clicked'?: Array; + /** + * Listing of the transactional attributes for the contact + */ + 'transacAttributes'?: Array; + /** + * Listing of the delivered campaign for the contact + */ + 'delivered'?: Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "folderId", - "baseName": "folderId", - "type": "number" + "name": "messagesSent", + "baseName": "messagesSent", + "type": "Array" }, { - "name": "createdAt", - "baseName": "createdAt", - "type": "string" + "name": "hardBounces", + "baseName": "hardBounces", + "type": "Array" }, { - "name": "campaignStats", - "baseName": "campaignStats", - "type": "Array" + "name": "softBounces", + "baseName": "softBounces", + "type": "Array" }, { - "name": "dynamicList", - "baseName": "dynamicList", - "type": "boolean" + "name": "complaints", + "baseName": "complaints", + "type": "Array" + }, + { + "name": "unsubscriptions", + "baseName": "unsubscriptions", + "type": "GetExtendedContactDetailsStatisticsUnsubscriptions" + }, + { + "name": "opened", + "baseName": "opened", + "type": "Array" + }, + { + "name": "clicked", + "baseName": "clicked", + "type": "Array" + }, + { + "name": "transacAttributes", + "baseName": "transacAttributes", + "type": "Array" + }, + { + "name": "delivered", + "baseName": "delivered", + "type": "Array" } ]; static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(GetExtendedList.attributeTypeMap); + return GetExtendedContactDetailsStatistics.attributeTypeMap; + } } -} -export class GetLists { + export class GetExtendedContactDetailsStatisticsClicked { /** - * Listing of all the lists available in your account - */ - 'lists'?: Array; + * ID of the campaign which generated the event + */ + 'campaignId': number; /** - * Number of lists in your account - */ - 'count'?: number; + * Listing of the clicked links for the campaign + */ + 'links': Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "lists", - "baseName": "lists", - "type": "Array" + "name": "campaignId", + "baseName": "campaignId", + "type": "number" }, { - "name": "count", - "baseName": "count", - "type": "number" + "name": "links", + "baseName": "links", + "type": "Array" } ]; static getAttributeTypeMap() { - return GetLists.attributeTypeMap; + return GetExtendedContactDetailsStatisticsClicked.attributeTypeMap; + } } -} -export class GetProcess { - /** - * Id of the process - */ - 'id': number; - /** - * Status of the process - */ - 'status': GetProcess.StatusEnum; + export class GetExtendedContactDetailsStatisticsDelivered { /** - * Process name - */ - 'name': string; + * ID of the campaign which generated the event + */ + 'campaignId': number; /** - * URL on which send export the of contacts once the process is completed - */ - 'exportUrl'?: string; + * UTC date-time of the event + */ + 'eventTime': string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "id", - "baseName": "id", + "name": "campaignId", + "baseName": "campaignId", "type": "number" }, { - "name": "status", - "baseName": "status", - "type": "GetProcess.StatusEnum" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "exportUrl", - "baseName": "export_url", + "name": "eventTime", + "baseName": "eventTime", "type": "string" } ]; static getAttributeTypeMap() { - return GetProcess.attributeTypeMap; + return GetExtendedContactDetailsStatisticsDelivered.attributeTypeMap; } -} - -export namespace GetProcess { - export enum StatusEnum { - Queued = 'queued', - InProcess = 'in_process', - Completed = 'completed' } -} -export class GetProcesses { + + export class GetExtendedContactDetailsStatisticsLinks { /** - * List of processes available on your account - */ - 'processes'?: Array; + * Number of clicks on this link for the campaign + */ + 'count': number; /** - * Number of processes available on your account - */ - 'count'?: number; + * UTC date-time of the event + */ + 'eventTime': string; + /** + * IP from which the user has clicked on the link + */ + 'ip': string; + /** + * URL of the clicked link + */ + 'url': string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "processes", - "baseName": "processes", - "type": "Array" - }, { "name": "count", "baseName": "count", "type": "number" + }, + { + "name": "eventTime", + "baseName": "eventTime", + "type": "string" + }, + { + "name": "ip", + "baseName": "ip", + "type": "string" + }, + { + "name": "url", + "baseName": "url", + "type": "string" } ]; static getAttributeTypeMap() { - return GetProcesses.attributeTypeMap; + return GetExtendedContactDetailsStatisticsLinks.attributeTypeMap; + } } -} -export class GetReports { - 'reports'?: Array; + export class GetExtendedContactDetailsStatisticsMessagesSent { + /** + * ID of the campaign which generated the event + */ + 'campaignId': number; + /** + * UTC date-time of the event + */ + 'eventTime': string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "reports", - "baseName": "reports", - "type": "Array" + "name": "campaignId", + "baseName": "campaignId", + "type": "number" + }, + { + "name": "eventTime", + "baseName": "eventTime", + "type": "string" } ]; static getAttributeTypeMap() { - return GetReports.attributeTypeMap; + return GetExtendedContactDetailsStatisticsMessagesSent.attributeTypeMap; + } } -} -export class GetReportsReports { - /** - * Date of the statistics - */ - 'date': string; - /** - * Number of requests for the date - */ - 'requests': number; - /** - * Number of delivered emails for the date - */ - 'delivered': number; - /** - * Number of hardbounces for the date - */ - 'hardBounces': number; - /** - * Number of softbounces for the date - */ - 'softBounces': number; - /** - * Number of clicks for the date - */ - 'clicks': number; - /** - * Number of unique clicks for the date - */ - 'uniqueClicks': number; - /** - * Number of openings for the date - */ - 'opens': number; - /** - * Number of unique openings for the date - */ - 'uniqueOpens': number; + export class GetExtendedContactDetailsStatisticsOpened { /** - * Number of complaints (spam reports) for the date - */ - 'spamReports': number; + * ID of the campaign which generated the event + */ + 'campaignId': number; /** - * Number of blocked emails for the date - */ - 'blocked': number; + * Number of openings for the campaign + */ + 'count': number; /** - * Number of invalid emails for the date - */ - 'invalid': number; + * UTC date-time of the event + */ + 'eventTime': string; /** - * Number of unsubscribed emails for the date - */ - 'unsubscribed': number; + * IP from which the user has opened the email + */ + 'ip': string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "date", - "baseName": "date", - "type": "string" - }, - { - "name": "requests", - "baseName": "requests", + "name": "campaignId", + "baseName": "campaignId", "type": "number" }, { - "name": "delivered", - "baseName": "delivered", + "name": "count", + "baseName": "count", "type": "number" }, { - "name": "hardBounces", - "baseName": "hardBounces", - "type": "number" - }, - { - "name": "softBounces", - "baseName": "softBounces", - "type": "number" - }, - { - "name": "clicks", - "baseName": "clicks", - "type": "number" - }, - { - "name": "uniqueClicks", - "baseName": "uniqueClicks", - "type": "number" - }, - { - "name": "opens", - "baseName": "opens", - "type": "number" - }, - { - "name": "uniqueOpens", - "baseName": "uniqueOpens", - "type": "number" - }, - { - "name": "spamReports", - "baseName": "spamReports", - "type": "number" - }, - { - "name": "blocked", - "baseName": "blocked", - "type": "number" - }, - { - "name": "invalid", - "baseName": "invalid", - "type": "number" + "name": "eventTime", + "baseName": "eventTime", + "type": "string" }, { - "name": "unsubscribed", - "baseName": "unsubscribed", - "type": "number" + "name": "ip", + "baseName": "ip", + "type": "string" } ]; static getAttributeTypeMap() { - return GetReportsReports.attributeTypeMap; + return GetExtendedContactDetailsStatisticsOpened.attributeTypeMap; + } } -} -export class GetScheduledEmailByBatchId { /** - * Total number of batches - */ - 'count'?: number; - 'batches'?: Array; + * Listing of the unsubscription for the contact + */ + export class GetExtendedContactDetailsStatisticsUnsubscriptions { + /** + * Contact unsubscribe via unsubscription link in a campaign + */ + 'userUnsubscription': Array; + /** + * Contact has been unsubscribed from the administrator + */ + 'adminUnsubscription': Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "count", - "baseName": "count", - "type": "number" + "name": "userUnsubscription", + "baseName": "userUnsubscription", + "type": "Array" }, { - "name": "batches", - "baseName": "batches", - "type": "Array" + "name": "adminUnsubscription", + "baseName": "adminUnsubscription", + "type": "Array" } ]; static getAttributeTypeMap() { - return GetScheduledEmailByBatchId.attributeTypeMap; + return GetExtendedContactDetailsStatisticsUnsubscriptions.attributeTypeMap; + } } -} -export class GetScheduledEmailByBatchIdBatches { - /** - * Datetime for which the batch was scheduled - */ - 'scheduledAt': Date; + export class GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription { /** - * Datetime on which the batch was scheduled - */ - 'createdAt': Date; + * UTC date-time of the event + */ + 'eventTime': string; /** - * Current status of the scheduled batch - */ - 'status': GetScheduledEmailByBatchIdBatches.StatusEnum; + * IP from which the user has been unsubscribed + */ + 'ip'?: string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "scheduledAt", - "baseName": "scheduledAt", - "type": "Date" - }, - { - "name": "createdAt", - "baseName": "createdAt", - "type": "Date" + "name": "eventTime", + "baseName": "eventTime", + "type": "string" }, { - "name": "status", - "baseName": "status", - "type": "GetScheduledEmailByBatchIdBatches.StatusEnum" + "name": "ip", + "baseName": "ip", + "type": "string" } ]; static getAttributeTypeMap() { - return GetScheduledEmailByBatchIdBatches.attributeTypeMap; + return GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription.attributeTypeMap; } -} - -export namespace GetScheduledEmailByBatchIdBatches { - export enum StatusEnum { - InProgress = 'inProgress', - Queued = 'queued', - Processed = 'processed', - Error = 'error' } -} -export class GetScheduledEmailByMessageId { + + export class GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription { /** - * Datetime for which the email was scheduled - */ - 'scheduledAt': Date; + * ID of the campaign which generated the event + */ + 'campaignId': number; /** - * Datetime on which the email was scheduled - */ - 'createdAt': Date; + * UTC date-time of the event + */ + 'eventTime': string; /** - * Current status of the scheduled email - */ - 'status': GetScheduledEmailByMessageId.StatusEnum; + * IP from which the user has unsubscribed + */ + 'ip'?: string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "scheduledAt", - "baseName": "scheduledAt", - "type": "Date" + "name": "campaignId", + "baseName": "campaignId", + "type": "number" }, { - "name": "createdAt", - "baseName": "createdAt", - "type": "Date" + "name": "eventTime", + "baseName": "eventTime", + "type": "string" }, { - "name": "status", - "baseName": "status", - "type": "GetScheduledEmailByMessageId.StatusEnum" + "name": "ip", + "baseName": "ip", + "type": "string" } ]; static getAttributeTypeMap() { - return GetScheduledEmailByMessageId.attributeTypeMap; - } -} - -export namespace GetScheduledEmailByMessageId { - export enum StatusEnum { - InProgress = 'inProgress', - Queued = 'queued', - Processed = 'processed', - Error = 'error' + return GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription.attributeTypeMap; } -} -export class GetSendersList { - /** - * List of the senders available in your account - */ - 'senders'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "senders", - "baseName": "senders", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetSendersList.attributeTypeMap; } -} -export class GetSendersListIps { + export class GetExtendedListCampaignStats { /** - * Dedicated IP available in your account - */ - 'ip': string; - /** - * Domain of the IP - */ - 'domain': string; - /** - * Weight of the IP for this sender - */ - 'weight': number; + * ID of the campaign + */ + 'campaignId': number; + 'stats': GetCampaignStats; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "ip", - "baseName": "ip", - "type": "string" - }, - { - "name": "domain", - "baseName": "domain", - "type": "string" + "name": "campaignId", + "baseName": "campaignId", + "type": "number" }, { - "name": "weight", - "baseName": "weight", - "type": "number" + "name": "stats", + "baseName": "stats", + "type": "GetCampaignStats" } ]; static getAttributeTypeMap() { - return GetSendersListIps.attributeTypeMap; + return GetExtendedListCampaignStats.attributeTypeMap; + } } -} -export class GetSendersListSenders { + export class GetFolder { /** - * Id of the sender - */ + * ID of the folder + */ 'id': number; /** - * From Name associated to the sender - */ + * Name of the folder + */ 'name': string; /** - * From Email associated to the sender - */ - 'email': string; + * Number of blacklisted contacts in the folder + */ + 'totalBlacklisted': number; /** - * Status of sender (true=activated, false=deactivated) - */ - 'active': boolean; + * Number of contacts in the folder + */ + 'totalSubscribers': number; /** - * List of dedicated IP(s) available in the account. This data is displayed only for dedicated IPs - */ - 'ips'?: Array; + * Number of unique contacts in the folder + */ + 'uniqueSubscribers': number; static discriminator: string | undefined = undefined; @@ -5596,427 +5584,326 @@ export class GetSendersListSenders { "type": "string" }, { - "name": "email", - "baseName": "email", - "type": "string" + "name": "totalBlacklisted", + "baseName": "totalBlacklisted", + "type": "number" }, { - "name": "active", - "baseName": "active", - "type": "boolean" + "name": "totalSubscribers", + "baseName": "totalSubscribers", + "type": "number" }, { - "name": "ips", - "baseName": "ips", - "type": "Array" + "name": "uniqueSubscribers", + "baseName": "uniqueSubscribers", + "type": "number" } ]; static getAttributeTypeMap() { - return GetSendersListSenders.attributeTypeMap; + return GetFolder.attributeTypeMap; + } } -} -export class GetSharedTemplateUrl { + export class GetFolderLists { + 'lists'?: Array; /** - * A unique URL for the email campaign or transactional template. This URL can be shared with other Sendinblue users. - */ - 'sharedUrl': string; + * Number of lists in the folder + */ + 'count'?: number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "sharedUrl", - "baseName": "sharedUrl", - "type": "string" + "name": "lists", + "baseName": "lists", + "type": "Array" + }, + { + "name": "count", + "baseName": "count", + "type": "number" } ]; static getAttributeTypeMap() { - return GetSharedTemplateUrl.attributeTypeMap; + return GetFolderLists.attributeTypeMap; + } } -} -export namespace GetSmsCampaign { -} -export class GetSmsCampaignOverview { - /** - * ID of the SMS Campaign - */ - 'id': number; + export class GetFolders { + 'folders'?: Array; /** - * Name of the SMS Campaign - */ - 'name': string; - /** - * Status of the SMS Campaign - */ - 'status': GetSmsCampaignOverview.StatusEnum; - /** - * Content of the SMS Campaign - */ - 'content': string; - /** - * UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format - */ - 'scheduledAt'?: string; - /** - * Sender of the SMS Campaign - */ - 'sender': string; - /** - * Creation UTC date-time of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'createdAt': string; - /** - * UTC date-time of last modification of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'modifiedAt': string; + * Number of folders available in your account + */ + 'count'?: number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "status", - "baseName": "status", - "type": "GetSmsCampaignOverview.StatusEnum" - }, - { - "name": "content", - "baseName": "content", - "type": "string" - }, - { - "name": "scheduledAt", - "baseName": "scheduledAt", - "type": "string" - }, - { - "name": "sender", - "baseName": "sender", - "type": "string" - }, - { - "name": "createdAt", - "baseName": "createdAt", - "type": "string" + "name": "folders", + "baseName": "folders", + "type": "Array" }, { - "name": "modifiedAt", - "baseName": "modifiedAt", - "type": "string" + "name": "count", + "baseName": "count", + "type": "number" } ]; static getAttributeTypeMap() { - return GetSmsCampaignOverview.attributeTypeMap; + return GetFolders.attributeTypeMap; + } } -} -export class GetSmsCampaign extends GetSmsCampaignOverview { - 'recipients': GetSmsCampaignRecipients; - 'statistics': GetSmsCampaignRecipients; + export class GetInboundEmailEvents { + 'events'?: Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "recipients", - "baseName": "recipients", - "type": "GetSmsCampaignRecipients" - }, - { - "name": "statistics", - "baseName": "statistics", - "type": "GetSmsCampaignRecipients" + "name": "events", + "baseName": "events", + "type": "Array" } ]; static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(GetSmsCampaign.attributeTypeMap); - } -} - -export namespace GetSmsCampaignOverview { - export enum StatusEnum { - Draft = 'draft', - Sent = 'sent', - Archive = 'archive', - Queued = 'queued', - Suspended = 'suspended', - InProcess = 'inProcess' + return GetInboundEmailEvents.attributeTypeMap; } -} -export class GetSmsCampaignRecipients { - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - ]; - - static getAttributeTypeMap() { - return GetSmsCampaignRecipients.attributeTypeMap; } -} -export class GetSmsCampaignStats { + export class GetInboundEmailEventsByUuid { /** - * Number of delivered SMS - */ - 'delivered': number; + * Date when email was received on SMTP relay + */ + 'receivedAt'?: Date; /** - * Number of sent SMS - */ - 'sent': number; + * Date when email was delivered successfully to client’s webhook + */ + 'deliveredAt'?: Date; /** - * Number of processing SMS - */ - 'processing': number; + * Recipient’s email address + */ + 'recipient'?: string; /** - * Number of softbounced SMS - */ - 'softBounces': number; + * Sender’s email address + */ + 'sender'?: string; /** - * Number of hardbounced SMS - */ - 'hardBounces': number; + * Value of the Message-ID header. This will be present only after the processing is done. + */ + 'messageId'?: string; /** - * Number of unsubscription SMS - */ - 'unsubscriptions': number; + * Value of the Subject header. This will be present only after the processing is done. + */ + 'subject'?: string; /** - * Number of replies to the SMS - */ - 'answered': number; + * List of attachments of the email. This will be present only after the processing is done. + */ + 'attachments'?: Array; + /** + * List of events/logs that describe the lifecycle of the email on SIB platform + */ + 'logs'?: Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "delivered", - "baseName": "delivered", - "type": "number" + "name": "receivedAt", + "baseName": "receivedAt", + "type": "Date" }, { - "name": "sent", - "baseName": "sent", - "type": "number" + "name": "deliveredAt", + "baseName": "deliveredAt", + "type": "Date" }, { - "name": "processing", - "baseName": "processing", - "type": "number" + "name": "recipient", + "baseName": "recipient", + "type": "string" }, { - "name": "softBounces", - "baseName": "softBounces", - "type": "number" + "name": "sender", + "baseName": "sender", + "type": "string" }, { - "name": "hardBounces", - "baseName": "hardBounces", - "type": "number" + "name": "messageId", + "baseName": "messageId", + "type": "string" }, { - "name": "unsubscriptions", - "baseName": "unsubscriptions", - "type": "number" + "name": "subject", + "baseName": "subject", + "type": "string" }, { - "name": "answered", - "baseName": "answered", - "type": "number" + "name": "attachments", + "baseName": "attachments", + "type": "Array" + }, + { + "name": "logs", + "baseName": "logs", + "type": "Array" } ]; static getAttributeTypeMap() { - return GetSmsCampaignStats.attributeTypeMap; + return GetInboundEmailEventsByUuid.attributeTypeMap; + } } -} -export class GetSmsCampaigns { - 'campaigns'?: Array; + export class GetInboundEmailEventsByUuidAttachments { /** - * Number of SMS campaigns retrieved - */ - 'count'?: number; + * filename specified in the Content-Disposition header of the attachment + */ + 'name'?: string; + /** + * value of the Content-Type header of the attachment + */ + 'contentType'?: string; + /** + * value of the Content-ID header of the attachment. + */ + 'contentId'?: string; + /** + * size of the attachment in bytes + */ + 'contentLength'?: number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "campaigns", - "baseName": "campaigns", - "type": "Array" + "name": "name", + "baseName": "name", + "type": "string" }, { - "name": "count", - "baseName": "count", + "name": "contentType", + "baseName": "contentType", + "type": "string" + }, + { + "name": "contentId", + "baseName": "contentId", + "type": "string" + }, + { + "name": "contentLength", + "baseName": "contentLength", "type": "number" } ]; static getAttributeTypeMap() { - return GetSmsCampaigns.attributeTypeMap; + return GetInboundEmailEventsByUuidAttachments.attributeTypeMap; + } } -} -export class GetSmsEventReport { - 'events'?: Array; + export class GetInboundEmailEventsByUuidLogs { + /** + * Date of the event + */ + 'date'?: Date; + /** + * Type of the event + */ + 'type'?: GetInboundEmailEventsByUuidLogs.TypeEnum; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "events", - "baseName": "events", - "type": "Array" + "name": "date", + "baseName": "date", + "type": "Date" + }, + { + "name": "type", + "baseName": "type", + "type": "GetInboundEmailEventsByUuidLogs.TypeEnum" } ]; static getAttributeTypeMap() { - return GetSmsEventReport.attributeTypeMap; + return GetInboundEmailEventsByUuidLogs.attributeTypeMap; + } } -} -export class GetSmsEventReportEvents { - /** - * Phone number which has generated the event - */ - 'phoneNumber'?: string; - /** - * UTC date-time on which the event has been generated - */ - 'date'?: string; + export namespace GetInboundEmailEventsByUuidLogs { + export enum TypeEnum { + Received = 'received', + Processed = 'processed', + WebhookFailed = 'webhookFailed', + WebhookDelivered = 'webhookDelivered' + } + } + export class GetInboundEmailEventsEvents { /** - * Message ID which generated the event - */ - 'messageId'?: string; + * UUID that can be used to fetch additional data + */ + 'uuid': string; /** - * Event which occurred - */ - 'event'?: GetSmsEventReportEvents.EventEnum; + * Date when email was received on SMTP relay + */ + 'date': Date; /** - * Reason of bounce (only available if the event is hardbounce or softbounce) - */ - 'reason'?: string; - 'reply'?: string; + * Sender’s email address + */ + 'sender': string; /** - * Tag of the SMS which generated the event - */ - 'tag'?: string; + * Recipient’s email address + */ + 'recipient': string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "phoneNumber", - "baseName": "phoneNumber", + "name": "uuid", + "baseName": "uuid", "type": "string" }, { "name": "date", "baseName": "date", - "type": "string" - }, - { - "name": "messageId", - "baseName": "messageId", - "type": "string" - }, - { - "name": "event", - "baseName": "event", - "type": "GetSmsEventReportEvents.EventEnum" - }, - { - "name": "reason", - "baseName": "reason", - "type": "string" + "type": "Date" }, { - "name": "reply", - "baseName": "reply", + "name": "sender", + "baseName": "sender", "type": "string" }, { - "name": "tag", - "baseName": "tag", + "name": "recipient", + "baseName": "recipient", "type": "string" } ]; static getAttributeTypeMap() { - return GetSmsEventReportEvents.attributeTypeMap; + return GetInboundEmailEventsEvents.attributeTypeMap; } -} - -export namespace GetSmsEventReportEvents { - export enum EventEnum { - Bounces = 'bounces', - HardBounces = 'hardBounces', - SoftBounces = 'softBounces', - Delivered = 'delivered', - Sent = 'sent', - Accepted = 'accepted', - Unsubscription = 'unsubscription', - Replies = 'replies', - Blocked = 'blocked' } -} -export class GetSmtpTemplateOverview { + + export class GetIp { /** - * ID of the template - */ + * ID of the dedicated IP + */ 'id': number; /** - * Name of the template - */ - 'name': string; - /** - * Subject of the template - */ - 'subject': string; - /** - * Status of template (true=active, false=inactive) - */ - 'isActive': boolean; - /** - * Status of test sending for the template (true=test email has been sent, false=test email has not been sent) - */ - 'testSent': boolean; - 'sender': GetSmtpTemplateOverviewSender; - /** - * Email defined as the \"Reply to\" for the template - */ - 'replyTo': string; - /** - * Customisation of the \"to\" field for the template - */ - 'toField': string; - /** - * Tag of the template - */ - 'tag': string; - /** - * HTML content of the template - */ - 'htmlContent': string; - /** - * Creation UTC date-time of the template (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'createdAt': string; + * Dedicated IP + */ + 'ip': string; /** - * Last modification UTC date-time of the template (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'modifiedAt': string; + * Status of the IP (true=active, false=inactive) + */ + 'active': boolean; /** - * It is true if template is a valid Double opt-in (DOI) template, otherwise it is false. This field will be available only in case of single template detail call. - */ - 'doiTemplate'?: boolean; + * Domain associated to the IP + */ + 'domain': string; static discriminator: string | undefined = undefined; @@ -6027,274 +5914,401 @@ export class GetSmtpTemplateOverview { "type": "number" }, { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "subject", - "baseName": "subject", + "name": "ip", + "baseName": "ip", "type": "string" }, { - "name": "isActive", - "baseName": "isActive", - "type": "boolean" - }, - { - "name": "testSent", - "baseName": "testSent", + "name": "active", + "baseName": "active", "type": "boolean" }, { - "name": "sender", - "baseName": "sender", - "type": "GetSmtpTemplateOverviewSender" - }, - { - "name": "replyTo", - "baseName": "replyTo", - "type": "string" - }, - { - "name": "toField", - "baseName": "toField", - "type": "string" - }, - { - "name": "tag", - "baseName": "tag", - "type": "string" - }, - { - "name": "htmlContent", - "baseName": "htmlContent", - "type": "string" - }, - { - "name": "createdAt", - "baseName": "createdAt", - "type": "string" - }, - { - "name": "modifiedAt", - "baseName": "modifiedAt", + "name": "domain", + "baseName": "domain", "type": "string" - }, - { - "name": "doiTemplate", - "baseName": "doiTemplate", - "type": "boolean" } ]; static getAttributeTypeMap() { - return GetSmtpTemplateOverview.attributeTypeMap; + return GetIp.attributeTypeMap; + } } -} -export class GetSmtpTemplateOverviewSender { + export class GetIpFromSender { /** - * From email for the template - */ - 'name'?: string; + * ID of the dedicated IP + */ + 'id': number; /** - * From email for the template - */ - 'email'?: string; + * Dedicated IP + */ + 'ip': string; /** - * Sender id of the template - */ - 'id'?: string; + * Domain associated to the IP + */ + 'domain': string; + /** + * Weight of the IP + */ + 'weight': number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "name", - "baseName": "name", - "type": "string" + "name": "id", + "baseName": "id", + "type": "number" }, { - "name": "email", - "baseName": "email", + "name": "ip", + "baseName": "ip", "type": "string" }, { - "name": "id", - "baseName": "id", + "name": "domain", + "baseName": "domain", "type": "string" + }, + { + "name": "weight", + "baseName": "weight", + "type": "number" } ]; static getAttributeTypeMap() { - return GetSmtpTemplateOverviewSender.attributeTypeMap; + return GetIpFromSender.attributeTypeMap; + } } -} -export class GetSmtpTemplates { + export class GetIps { /** - * Count of transactional email templates - */ - 'count'?: number; - 'templates'?: Array; + * Dedicated IP(s) available on your account + */ + 'ips': Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "count", - "baseName": "count", - "type": "number" - }, - { - "name": "templates", - "baseName": "templates", - "type": "Array" + "name": "ips", + "baseName": "ips", + "type": "Array" } ]; static getAttributeTypeMap() { - return GetSmtpTemplates.attributeTypeMap; + return GetIps.attributeTypeMap; + } } -} -export class GetSsoToken { + export class GetIpsFromSender { /** - * Session token, it will remain valid for 15 days. - */ - 'token': string; + * Dedicated IP(s) linked to a sender + */ + 'ips': Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "token", - "baseName": "token", - "type": "string" + "name": "ips", + "baseName": "ips", + "type": "Array" } ]; static getAttributeTypeMap() { - return GetSsoToken.attributeTypeMap; + return GetIpsFromSender.attributeTypeMap; } -} - -export class GetStatsByBrowser extends null { - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - ]; - - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(GetStatsByBrowser.attributeTypeMap); } -} -export class GetStatsByDevice { + export class GetList { /** - * Statistics of the campaign on the basis of desktop devices - */ - 'desktop'?: { [key: string]: GetDeviceBrowserStats; }; + * ID of the list + */ + 'id': number; /** - * Statistics of the campaign on the basis of mobile devices - */ - 'mobile'?: { [key: string]: GetDeviceBrowserStats; }; + * Name of the list + */ + 'name': string; /** - * Statistics of the campaign on the basis of tablet devices - */ - 'tablet'?: { [key: string]: GetDeviceBrowserStats; }; + * Number of blacklisted contacts in the list + */ + 'totalBlacklisted': number; /** - * Statistics of the campaign on the basis of unknown devices - */ - 'unknown'?: { [key: string]: GetDeviceBrowserStats; }; + * Number of contacts in the list + */ + 'totalSubscribers': number; + /** + * Number of unique contacts in the list + */ + 'uniqueSubscribers': number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "desktop", - "baseName": "desktop", - "type": "{ [key: string]: GetDeviceBrowserStats; }" + "name": "id", + "baseName": "id", + "type": "number" }, { - "name": "mobile", - "baseName": "mobile", - "type": "{ [key: string]: GetDeviceBrowserStats; }" + "name": "name", + "baseName": "name", + "type": "string" }, { - "name": "tablet", - "baseName": "tablet", - "type": "{ [key: string]: GetDeviceBrowserStats; }" + "name": "totalBlacklisted", + "baseName": "totalBlacklisted", + "type": "number" }, { - "name": "unknown", - "baseName": "unknown", - "type": "{ [key: string]: GetDeviceBrowserStats; }" + "name": "totalSubscribers", + "baseName": "totalSubscribers", + "type": "number" + }, + { + "name": "uniqueSubscribers", + "baseName": "uniqueSubscribers", + "type": "number" } ]; static getAttributeTypeMap() { - return GetStatsByDevice.attributeTypeMap; + return GetList.attributeTypeMap; + } } -} -export class GetStatsByDomain extends null { + export class GetExtendedList extends GetList { + /** + * ID of the folder + */ + 'folderId': number; + /** + * Creation UTC date-time of the list (YYYY-MM-DDTHH:mm:ss.SSSZ) + */ + 'createdAt': string; + 'campaignStats'?: Array; + /** + * Status telling if the list is dynamic or not (true=dynamic, false=not dynamic) + */ + 'dynamicList'?: boolean; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "folderId", + "baseName": "folderId", + "type": "number" + }, + { + "name": "createdAt", + "baseName": "createdAt", + "type": "string" + }, + { + "name": "campaignStats", + "baseName": "campaignStats", + "type": "Array" + }, + { + "name": "dynamicList", + "baseName": "dynamicList", + "type": "boolean" + } ]; + + static getAttributeTypeMap() { + return super.getAttributeTypeMap().concat(GetExtendedList.attributeTypeMap); + } + } + export class GetLists { + /** + * Listing of all the lists available in your account + */ + 'lists'?: Array; + /** + * Number of lists in your account + */ + 'count'?: number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - ]; + { + "name": "lists", + "baseName": "lists", + "type": "Array" + }, + { + "name": "count", + "baseName": "count", + "type": "number" + } ]; static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(GetStatsByDomain.attributeTypeMap); + return GetLists.attributeTypeMap; + } } -} -export class GetTransacAggregatedSmsReport { + export class GetProcess { /** - * Time frame of the report - */ - 'range'?: string; + * Id of the process + */ + 'id': number; /** - * Number of requests for the timeframe - */ - 'requests'?: number; + * Status of the process + */ + 'status': GetProcess.StatusEnum; /** - * Number of delivered SMS for the timeframe - */ - 'delivered'?: number; + * Process name + */ + 'name': string; /** - * Number of hardbounces for the timeframe - */ - 'hardBounces'?: number; + * URL on which send export the of contacts once the process is completed + */ + 'exportUrl'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "status", + "baseName": "status", + "type": "GetProcess.StatusEnum" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "exportUrl", + "baseName": "export_url", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return GetProcess.attributeTypeMap; + } + } + + export namespace GetProcess { + export enum StatusEnum { + Queued = 'queued', + InProcess = 'in_process', + Completed = 'completed' + } + } + export class GetProcesses { /** - * Number of softbounces for the timeframe - */ - 'softBounces'?: number; + * List of processes available on your account + */ + 'processes'?: Array; /** - * Number of blocked contact for the timeframe - */ - 'blocked'?: number; + * Number of processes available on your account + */ + 'count'?: number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "processes", + "baseName": "processes", + "type": "Array" + }, + { + "name": "count", + "baseName": "count", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return GetProcesses.attributeTypeMap; + } + } + + export class GetReports { + 'reports'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "reports", + "baseName": "reports", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return GetReports.attributeTypeMap; + } + } + + export class GetReportsReports { /** - * Number of unsubscription for the timeframe - */ - 'unsubscribed'?: number; + * Date of the statistics + */ + 'date': string; /** - * Number of answered SMS for the timeframe - */ - 'replied'?: number; + * Number of requests for the date + */ + 'requests': number; /** - * Number of accepted for the timeframe - */ - 'accepted'?: number; + * Number of delivered emails for the date + */ + 'delivered': number; /** - * Number of rejected for the timeframe - */ - 'rejected'?: number; + * Number of hardbounces for the date + */ + 'hardBounces': number; + /** + * Number of softbounces for the date + */ + 'softBounces': number; + /** + * Number of clicks for the date + */ + 'clicks': number; + /** + * Number of unique clicks for the date + */ + 'uniqueClicks': number; + /** + * Number of openings for the date + */ + 'opens': number; + /** + * Number of unique openings for the date + */ + 'uniqueOpens': number; + /** + * Number of complaints (spam reports) for the date + */ + 'spamReports': number; + /** + * Number of blocked emails for the date + */ + 'blocked': number; + /** + * Number of invalid emails for the date + */ + 'invalid': number; + /** + * Number of unsubscribed emails for the date + */ + 'unsubscribed': number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "range", - "baseName": "range", + "name": "date", + "baseName": "date", "type": "string" }, { @@ -6318,42 +6332,57 @@ export class GetTransacAggregatedSmsReport { "type": "number" }, { - "name": "blocked", - "baseName": "blocked", + "name": "clicks", + "baseName": "clicks", "type": "number" }, { - "name": "unsubscribed", - "baseName": "unsubscribed", + "name": "uniqueClicks", + "baseName": "uniqueClicks", "type": "number" }, { - "name": "replied", - "baseName": "replied", + "name": "opens", + "baseName": "opens", "type": "number" }, { - "name": "accepted", - "baseName": "accepted", + "name": "uniqueOpens", + "baseName": "uniqueOpens", "type": "number" }, { - "name": "rejected", - "baseName": "rejected", + "name": "spamReports", + "baseName": "spamReports", + "type": "number" + }, + { + "name": "blocked", + "baseName": "blocked", + "type": "number" + }, + { + "name": "invalid", + "baseName": "invalid", + "type": "number" + }, + { + "name": "unsubscribed", + "baseName": "unsubscribed", "type": "number" } ]; static getAttributeTypeMap() { - return GetTransacAggregatedSmsReport.attributeTypeMap; + return GetReportsReports.attributeTypeMap; + } } -} -export class GetTransacBlockedContacts { + export class GetScheduledEmailByBatchId { /** - * Count of blocked or unsubscribed contact - */ + * Total number of batches + */ 'count'?: number; - 'contacts'?: Array; + 'batches'?: Array; static discriminator: string | undefined = undefined; @@ -6364,1122 +6393,1035 @@ export class GetTransacBlockedContacts { "type": "number" }, { - "name": "contacts", - "baseName": "contacts", - "type": "Array" + "name": "batches", + "baseName": "batches", + "type": "Array" } ]; static getAttributeTypeMap() { - return GetTransacBlockedContacts.attributeTypeMap; + return GetScheduledEmailByBatchId.attributeTypeMap; + } } -} -export class GetTransacBlockedContactsContacts { + export class GetScheduledEmailByBatchIdBatches { /** - * Email address of the blocked or unsubscribed contact - */ - 'email': string; + * Datetime for which the batch was scheduled + */ + 'scheduledAt': Date; /** - * Sender email address of the blocked or unsubscribed contact - */ - 'senderEmail': string; - 'reason': GetTransacBlockedContactsReason; + * Datetime on which the batch was scheduled + */ + 'createdAt': Date; /** - * Date when the contact was blocked or unsubscribed on - */ - 'blockedAt': string; + * Current status of the scheduled batch + */ + 'status': GetScheduledEmailByBatchIdBatches.StatusEnum; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "senderEmail", - "baseName": "senderEmail", - "type": "string" + "name": "scheduledAt", + "baseName": "scheduledAt", + "type": "Date" }, { - "name": "reason", - "baseName": "reason", - "type": "GetTransacBlockedContactsReason" + "name": "createdAt", + "baseName": "createdAt", + "type": "Date" }, { - "name": "blockedAt", - "baseName": "blockedAt", - "type": "string" + "name": "status", + "baseName": "status", + "type": "GetScheduledEmailByBatchIdBatches.StatusEnum" } ]; static getAttributeTypeMap() { - return GetTransacBlockedContactsContacts.attributeTypeMap; + return GetScheduledEmailByBatchIdBatches.attributeTypeMap; + } } -} -/** - * Reason for blocking / unsubscribing - */ -export class GetTransacBlockedContactsReason { + export namespace GetScheduledEmailByBatchIdBatches { + export enum StatusEnum { + InProgress = 'inProgress', + Queued = 'queued', + Processed = 'processed', + Error = 'error' + } + } + export class GetScheduledEmailByMessageId { /** - * Reason code for blocking / unsubscribing (This code is safe for comparison) - */ - 'code'?: GetTransacBlockedContactsReason.CodeEnum; + * Datetime for which the email was scheduled + */ + 'scheduledAt': Date; /** - * Reason for blocking / unsubscribing (This string is not safe for comparison) - */ - 'message'?: string; + * Datetime on which the email was scheduled + */ + 'createdAt': Date; + /** + * Current status of the scheduled email + */ + 'status': GetScheduledEmailByMessageId.StatusEnum; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "code", - "baseName": "code", - "type": "GetTransacBlockedContactsReason.CodeEnum" - }, - { - "name": "message", - "baseName": "message", - "type": "string" + "name": "scheduledAt", + "baseName": "scheduledAt", + "type": "Date" + }, + { + "name": "createdAt", + "baseName": "createdAt", + "type": "Date" + }, + { + "name": "status", + "baseName": "status", + "type": "GetScheduledEmailByMessageId.StatusEnum" } ]; static getAttributeTypeMap() { - return GetTransacBlockedContactsReason.attributeTypeMap; + return GetScheduledEmailByMessageId.attributeTypeMap; + } } -} -export namespace GetTransacBlockedContactsReason { - export enum CodeEnum { - UnsubscribedViaMA = 'unsubscribedViaMA', - UnsubscribedViaEmail = 'unsubscribedViaEmail', - AdminBlocked = 'adminBlocked', - UnsubscribedViaApi = 'unsubscribedViaApi', - HardBounce = 'hardBounce', - ContactFlaggedAsSpam = 'contactFlaggedAsSpam' + export namespace GetScheduledEmailByMessageId { + export enum StatusEnum { + InProgress = 'inProgress', + Queued = 'queued', + Processed = 'processed', + Error = 'error' } -} -export class GetTransacEmailContent { - /** - * Email address to which transactional email has been sent - */ - 'email': string; - /** - * Subject of the sent email - */ - 'subject': string; - /** - * Id of the template - */ - 'templateId'?: number; + } + export class GetSendersList { /** - * Date on which transactional email was sent - */ - 'date': string; + * List of the senders available in your account + */ + 'senders'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "senders", + "baseName": "senders", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return GetSendersList.attributeTypeMap; + } + } + + export class GetSendersListIps { /** - * Series of events which occurred on the transactional email - */ - 'events': Array; + * Dedicated IP available in your account + */ + 'ip': string; /** - * Actual content of the transactional email that has been sent - */ - 'body': string; + * Domain of the IP + */ + 'domain': string; /** - * Count of the attachments that were sent in the email - */ - 'attachmentCount': number; + * Weight of the IP for this sender + */ + 'weight': number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "subject", - "baseName": "subject", - "type": "string" - }, - { - "name": "templateId", - "baseName": "templateId", - "type": "number" - }, - { - "name": "date", - "baseName": "date", + "name": "ip", + "baseName": "ip", "type": "string" }, { - "name": "events", - "baseName": "events", - "type": "Array" - }, - { - "name": "body", - "baseName": "body", + "name": "domain", + "baseName": "domain", "type": "string" }, { - "name": "attachmentCount", - "baseName": "attachmentCount", + "name": "weight", + "baseName": "weight", "type": "number" } ]; static getAttributeTypeMap() { - return GetTransacEmailContent.attributeTypeMap; + return GetSendersListIps.attributeTypeMap; + } } -} -export class GetTransacEmailContentEvents { + export class GetSendersListSenders { /** - * Name of the event that occurred on the sent email - */ + * Id of the sender + */ + 'id': number; + /** + * From Name associated to the sender + */ 'name': string; /** - * Time at which the event occurred - */ - 'time': string; + * From Email associated to the sender + */ + 'email': string; + /** + * Status of sender (true=activated, false=deactivated) + */ + 'active': boolean; + /** + * List of dedicated IP(s) available in the account. This data is displayed only for dedicated IPs + */ + 'ips'?: Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "number" + }, { "name": "name", "baseName": "name", "type": "string" }, { - "name": "time", - "baseName": "time", + "name": "email", + "baseName": "email", "type": "string" + }, + { + "name": "active", + "baseName": "active", + "type": "boolean" + }, + { + "name": "ips", + "baseName": "ips", + "type": "Array" } ]; static getAttributeTypeMap() { - return GetTransacEmailContentEvents.attributeTypeMap; + return GetSendersListSenders.attributeTypeMap; + } } -} -export class GetTransacEmailsList { + export class GetSharedTemplateUrl { /** - * Total number of transactional emails available on your account according to the passed filter - */ - 'count'?: number; - 'transactionalEmails'?: Array; + * A unique URL for the email campaign or transactional template. This URL can be shared with other Sendinblue users. + */ + 'sharedUrl': string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "count", - "baseName": "count", - "type": "number" - }, - { - "name": "transactionalEmails", - "baseName": "transactionalEmails", - "type": "Array" + "name": "sharedUrl", + "baseName": "sharedUrl", + "type": "string" } ]; static getAttributeTypeMap() { - return GetTransacEmailsList.attributeTypeMap; + return GetSharedTemplateUrl.attributeTypeMap; + } } -} -export class GetTransacEmailsListTransactionalEmails { + export namespace GetSmsCampaign { + } + export class GetSmsCampaignOverview { /** - * Email address to which transactional email has been sent - */ - 'email': string; + * ID of the SMS Campaign + */ + 'id': number; /** - * Subject of the sent email - */ - 'subject': string; + * Name of the SMS Campaign + */ + 'name': string; /** - * Id of the template - */ - 'templateId'?: number; + * Status of the SMS Campaign + */ + 'status': GetSmsCampaignOverview.StatusEnum; /** - * Message Id of the sent email - */ - 'messageId': string; + * Content of the SMS Campaign + */ + 'content': string; /** - * Unique id of the email sent to a particular contact - */ - 'uuid': string; + * UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format + */ + 'scheduledAt'?: string; /** - * Date on which transactional email was sent - */ - 'date': string; + * Sender of the SMS Campaign + */ + 'sender': string; /** - * Email address of the sender from which the email was sent - */ - 'from'?: string; + * Creation UTC date-time of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + */ + 'createdAt': string; /** - * Tags used for your email - */ - 'tags'?: Array; + * UTC date-time of last modification of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + */ + 'modifiedAt': string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "email", - "baseName": "email", - "type": "string" + "name": "id", + "baseName": "id", + "type": "number" }, { - "name": "subject", - "baseName": "subject", + "name": "name", + "baseName": "name", "type": "string" }, { - "name": "templateId", - "baseName": "templateId", - "type": "number" + "name": "status", + "baseName": "status", + "type": "GetSmsCampaignOverview.StatusEnum" }, { - "name": "messageId", - "baseName": "messageId", + "name": "content", + "baseName": "content", "type": "string" }, { - "name": "uuid", - "baseName": "uuid", + "name": "scheduledAt", + "baseName": "scheduledAt", "type": "string" }, { - "name": "date", - "baseName": "date", + "name": "sender", + "baseName": "sender", "type": "string" }, { - "name": "from", - "baseName": "from", + "name": "createdAt", + "baseName": "createdAt", "type": "string" }, { - "name": "tags", - "baseName": "tags", - "type": "Array" + "name": "modifiedAt", + "baseName": "modifiedAt", + "type": "string" } ]; static getAttributeTypeMap() { - return GetTransacEmailsListTransactionalEmails.attributeTypeMap; + return GetSmsCampaignOverview.attributeTypeMap; + } } -} -export class GetTransacSmsReport { - 'reports'?: Array; + export class GetSmsCampaign extends GetSmsCampaignOverview { + 'recipients': GetSmsCampaignRecipients; + 'statistics': GetSmsCampaignRecipients; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "recipients", + "baseName": "recipients", + "type": "GetSmsCampaignRecipients" + }, + { + "name": "statistics", + "baseName": "statistics", + "type": "GetSmsCampaignRecipients" + } ]; + + static getAttributeTypeMap() { + return super.getAttributeTypeMap().concat(GetSmsCampaign.attributeTypeMap); + } + } + export namespace GetSmsCampaignOverview { + export enum StatusEnum { + Draft = 'draft', + Sent = 'sent', + Archive = 'archive', + Queued = 'queued', + Suspended = 'suspended', + InProcess = 'inProcess' + } + } + export class GetSmsCampaignRecipients { static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "reports", - "baseName": "reports", - "type": "Array" - } ]; + ]; static getAttributeTypeMap() { - return GetTransacSmsReport.attributeTypeMap; + return GetSmsCampaignRecipients.attributeTypeMap; + } } -} -export class GetTransacSmsReportReports { + export class GetSmsCampaignStats { /** - * Date for which statistics are retrieved - */ - 'date'?: string; + * Number of delivered SMS + */ + 'delivered': number; /** - * Number of requests for the date - */ - 'requests'?: number; + * Number of sent SMS + */ + 'sent': number; /** - * Number of delivered SMS for the date - */ - 'delivered'?: number; + * Number of processing SMS + */ + 'processing': number; /** - * Number of hardbounces for the date - */ - 'hardBounces'?: number; - /** - * Number of softbounces for the date - */ - 'softBounces'?: number; - /** - * Number of blocked contact for the date - */ - 'blocked'?: number; - /** - * Number of unsubscription for the date - */ - 'unsubscribed'?: number; + * Number of softbounced SMS + */ + 'softBounces': number; /** - * Number of answered SMS for the date - */ - 'replied'?: number; + * Number of hardbounced SMS + */ + 'hardBounces': number; /** - * Number of accepted for the date - */ - 'accepted'?: number; + * Number of unsubscription SMS + */ + 'unsubscriptions': number; /** - * Number of rejected for the date - */ - 'rejected'?: number; + * Number of replies to the SMS + */ + 'answered': number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "date", - "baseName": "date", - "type": "string" - }, - { - "name": "requests", - "baseName": "requests", - "type": "number" - }, { "name": "delivered", "baseName": "delivered", "type": "number" }, { - "name": "hardBounces", - "baseName": "hardBounces", - "type": "number" - }, - { - "name": "softBounces", - "baseName": "softBounces", + "name": "sent", + "baseName": "sent", "type": "number" }, { - "name": "blocked", - "baseName": "blocked", + "name": "processing", + "baseName": "processing", "type": "number" }, { - "name": "unsubscribed", - "baseName": "unsubscribed", + "name": "softBounces", + "baseName": "softBounces", "type": "number" }, { - "name": "replied", - "baseName": "replied", + "name": "hardBounces", + "baseName": "hardBounces", "type": "number" }, { - "name": "accepted", - "baseName": "accepted", + "name": "unsubscriptions", + "baseName": "unsubscriptions", "type": "number" }, { - "name": "rejected", - "baseName": "rejected", + "name": "answered", + "baseName": "answered", "type": "number" } ]; static getAttributeTypeMap() { - return GetTransacSmsReportReports.attributeTypeMap; + return GetSmsCampaignStats.attributeTypeMap; + } } -} -export class GetWebhook { - /** - * URL of the webhook - */ - 'url': string; - /** - * ID of the webhook - */ - 'id': number; - /** - * Description of the webhook - */ - 'description': string; - 'events': Array; - /** - * Type of webhook (marketing or transac) - */ - 'type': GetWebhook.TypeEnum; - /** - * Creation UTC date-time of the webhook (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'createdAt': string; + export class GetSmsCampaigns { + 'campaigns'?: Array; /** - * Last modification UTC date-time of the webhook (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'modifiedAt': string; + * Number of SMS campaigns retrieved + */ + 'count'?: number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "url", - "baseName": "url", - "type": "string" + "name": "campaigns", + "baseName": "campaigns", + "type": "Array" }, { - "name": "id", - "baseName": "id", + "name": "count", + "baseName": "count", "type": "number" - }, - { - "name": "description", - "baseName": "description", - "type": "string" - }, - { - "name": "events", - "baseName": "events", - "type": "Array" - }, - { - "name": "type", - "baseName": "type", - "type": "GetWebhook.TypeEnum" - }, - { - "name": "createdAt", - "baseName": "createdAt", - "type": "string" - }, - { - "name": "modifiedAt", - "baseName": "modifiedAt", - "type": "string" } ]; static getAttributeTypeMap() { - return GetWebhook.attributeTypeMap; - } -} - -export namespace GetWebhook { - export enum TypeEnum { - Marketing = 'marketing', - Transac = 'transac' + return GetSmsCampaigns.attributeTypeMap; } -} -export class GetWebhooks { - 'webhooks': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "webhooks", - "baseName": "webhooks", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetWebhooks.attributeTypeMap; } -} -/** - * Task Details - */ -export class InlineResponse201 { - /** - * Unique task id - */ - 'id': string; + export class GetSmsEventReport { + 'events'?: Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "id", - "baseName": "id", - "type": "string" + "name": "events", + "baseName": "events", + "type": "Array" } ]; static getAttributeTypeMap() { - return InlineResponse201.attributeTypeMap; + return GetSmsEventReport.attributeTypeMap; } -} - -export class ManageIp { - /** - * Dedicated ID - */ - 'ip'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "ip", - "baseName": "ip", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return ManageIp.attributeTypeMap; } -} -export class MasterDetailsResponse { + export class GetSmsEventReportEvents { /** - * Email id of master account - */ - 'email'?: string; + * Phone number which has generated the event + */ + 'phoneNumber'?: string; /** - * Company name of master account organization - */ - 'companyName'?: string; + * UTC date-time on which the event has been generated + */ + 'date'?: string; /** - * Unique identifier of the master account organization - */ - 'id'?: number; + * Message ID which generated the event + */ + 'messageId'?: string; /** - * Currency code of the master account organization - */ - 'currencyCode'?: string; + * Event which occurred + */ + 'event'?: GetSmsEventReportEvents.EventEnum; /** - * Timezone of the master account organization - */ - 'timezone'?: string; - 'billingInfo'?: MasterDetailsResponseBillingInfo; - 'planInfo'?: MasterDetailsResponsePlanInfo; + * Reason of bounce (only available if the event is hardbounce or softbounce) + */ + 'reason'?: string; + 'reply'?: string; + /** + * Tag of the SMS which generated the event + */ + 'tag'?: string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "email", - "baseName": "email", + "name": "phoneNumber", + "baseName": "phoneNumber", "type": "string" }, { - "name": "companyName", - "baseName": "companyName", + "name": "date", + "baseName": "date", "type": "string" }, { - "name": "id", - "baseName": "id", - "type": "number" + "name": "messageId", + "baseName": "messageId", + "type": "string" }, { - "name": "currencyCode", - "baseName": "currencyCode", - "type": "string" + "name": "event", + "baseName": "event", + "type": "GetSmsEventReportEvents.EventEnum" }, { - "name": "timezone", - "baseName": "timezone", + "name": "reason", + "baseName": "reason", "type": "string" }, { - "name": "billingInfo", - "baseName": "billingInfo", - "type": "MasterDetailsResponseBillingInfo" + "name": "reply", + "baseName": "reply", + "type": "string" }, { - "name": "planInfo", - "baseName": "planInfo", - "type": "MasterDetailsResponsePlanInfo" + "name": "tag", + "baseName": "tag", + "type": "string" } ]; static getAttributeTypeMap() { - return MasterDetailsResponse.attributeTypeMap; + return GetSmsEventReportEvents.attributeTypeMap; + } } -} -/** - * Billing details of the master account organization - */ -export class MasterDetailsResponseBillingInfo { + export namespace GetSmsEventReportEvents { + export enum EventEnum { + Bounces = 'bounces', + HardBounces = 'hardBounces', + SoftBounces = 'softBounces', + Delivered = 'delivered', + Sent = 'sent', + Accepted = 'accepted', + Unsubscription = 'unsubscription', + Replies = 'replies', + Blocked = 'blocked' + } + } + export class GetSmtpTemplateOverview { /** - * Billing email id of master account - */ - 'email'?: string; + * ID of the template + */ + 'id': number; /** - * Company name of master account - */ - 'companyName'?: string; - 'name'?: MasterDetailsResponseBillingInfoName; - 'address'?: MasterDetailsResponseBillingInfoAddress; - - static discriminator: string | undefined = undefined; - + * Name of the template + */ + 'name': string; + /** + * Subject of the template + */ + 'subject': string; + /** + * Status of template (true=active, false=inactive) + */ + 'isActive': boolean; + /** + * Status of test sending for the template (true=test email has been sent, false=test email has not been sent) + */ + 'testSent': boolean; + 'sender': GetSmtpTemplateOverviewSender; + /** + * Email defined as the \"Reply to\" for the template + */ + 'replyTo': string; + /** + * Customisation of the \"to\" field for the template + */ + 'toField': string; + /** + * Tag of the template + */ + 'tag': string; + /** + * HTML content of the template + */ + 'htmlContent': string; + /** + * Creation UTC date-time of the template (YYYY-MM-DDTHH:mm:ss.SSSZ) + */ + 'createdAt': string; + /** + * Last modification UTC date-time of the template (YYYY-MM-DDTHH:mm:ss.SSSZ) + */ + 'modifiedAt': string; + /** + * It is true if template is a valid Double opt-in (DOI) template, otherwise it is false. This field will be available only in case of single template detail call. + */ + 'doiTemplate'?: boolean; + + static discriminator: string | undefined = undefined; + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "email", - "baseName": "email", + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "name", + "baseName": "name", "type": "string" }, { - "name": "companyName", - "baseName": "companyName", + "name": "subject", + "baseName": "subject", "type": "string" }, { - "name": "name", - "baseName": "name", - "type": "MasterDetailsResponseBillingInfoName" + "name": "isActive", + "baseName": "isActive", + "type": "boolean" }, { - "name": "address", - "baseName": "address", - "type": "MasterDetailsResponseBillingInfoAddress" - } ]; - - static getAttributeTypeMap() { - return MasterDetailsResponseBillingInfo.attributeTypeMap; - } -} - -/** - * Billing address of master account - */ -export class MasterDetailsResponseBillingInfoAddress { - /** - * Street address - */ - 'streetAddress'?: string; - /** - * Locality - */ - 'locality'?: string; - /** - * Postal code - */ - 'postalCode'?: string; - /** - * State code - */ - 'stateCode'?: string; - /** - * Country code - */ - 'countryCode'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + "name": "testSent", + "baseName": "testSent", + "type": "boolean" + }, { - "name": "streetAddress", - "baseName": "streetAddress", + "name": "sender", + "baseName": "sender", + "type": "GetSmtpTemplateOverviewSender" + }, + { + "name": "replyTo", + "baseName": "replyTo", "type": "string" }, { - "name": "locality", - "baseName": "locality", + "name": "toField", + "baseName": "toField", "type": "string" }, { - "name": "postalCode", - "baseName": "postalCode", + "name": "tag", + "baseName": "tag", "type": "string" }, { - "name": "stateCode", - "baseName": "stateCode", + "name": "htmlContent", + "baseName": "htmlContent", "type": "string" }, { - "name": "countryCode", - "baseName": "countryCode", + "name": "createdAt", + "baseName": "createdAt", "type": "string" + }, + { + "name": "modifiedAt", + "baseName": "modifiedAt", + "type": "string" + }, + { + "name": "doiTemplate", + "baseName": "doiTemplate", + "type": "boolean" } ]; static getAttributeTypeMap() { - return MasterDetailsResponseBillingInfoAddress.attributeTypeMap; + return GetSmtpTemplateOverview.attributeTypeMap; + } } -} -/** - * Billing name of master account holder - */ -export class MasterDetailsResponseBillingInfoName { + export class GetSmtpTemplateOverviewSender { /** - * First name for billing - */ - 'givenName'?: string; + * From email for the template + */ + 'name'?: string; /** - * Last name for billing - */ - 'familyName'?: string; + * From email for the template + */ + 'email'?: string; + /** + * Sender id of the template + */ + 'id'?: string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "givenName", - "baseName": "givenName", + "name": "name", + "baseName": "name", "type": "string" }, { - "name": "familyName", - "baseName": "familyName", + "name": "email", + "baseName": "email", + "type": "string" + }, + { + "name": "id", + "baseName": "id", "type": "string" } ]; static getAttributeTypeMap() { - return MasterDetailsResponseBillingInfoName.attributeTypeMap; + return GetSmtpTemplateOverviewSender.attributeTypeMap; + } } -} -/** - * Plan details - */ -export class MasterDetailsResponsePlanInfo { - /** - * Plan currency - */ - 'currencyCode'?: string; - /** - * Timestamp of next billing date - */ - 'nextBillingAt'?: number; - /** - * Plan amount - */ - 'price'?: number; - /** - * Plan period type - */ - 'planPeriod'?: MasterDetailsResponsePlanInfo.PlanPeriodEnum; - /** - * Number of sub-accounts - */ - 'subAccounts'?: number; + export class GetSmtpTemplates { /** - * List of provided features in the plan - */ - 'features'?: Array; + * Count of transactional email templates + */ + 'count'?: number; + 'templates'?: Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "currencyCode", - "baseName": "currencyCode", - "type": "string" - }, - { - "name": "nextBillingAt", - "baseName": "nextBillingAt", - "type": "number" - }, - { - "name": "price", - "baseName": "price", + "name": "count", + "baseName": "count", "type": "number" }, { - "name": "planPeriod", - "baseName": "planPeriod", - "type": "MasterDetailsResponsePlanInfo.PlanPeriodEnum" - }, - { - "name": "subAccounts", - "baseName": "subAccounts", - "type": "number" - }, + "name": "templates", + "baseName": "templates", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return GetSmtpTemplates.attributeTypeMap; + } + } + + export class GetSsoToken { + /** + * Session token, it will remain valid for 15 days. + */ + 'token': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "features", - "baseName": "features", - "type": "Array" + "name": "token", + "baseName": "token", + "type": "string" } ]; static getAttributeTypeMap() { - return MasterDetailsResponsePlanInfo.attributeTypeMap; + return GetSsoToken.attributeTypeMap; + } } -} -export namespace MasterDetailsResponsePlanInfo { - export enum PlanPeriodEnum { - Month = 'month', - Year = 'year' + export class GetStatsByBrowser extends null { + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + ]; + + static getAttributeTypeMap() { + return super.getAttributeTypeMap().concat(GetStatsByBrowser.attributeTypeMap); } -} -export class MasterDetailsResponsePlanInfoFeatures { - /** - * Name of the feature - */ - 'name'?: string; + } + + export class GetStatsByDevice { /** - * Unit value of the feature - */ - 'unitValue'?: string; + * Statistics of the campaign on the basis of desktop devices + */ + 'desktop'?: { [key: string]: GetDeviceBrowserStats; }; /** - * Quantity provided in the plan - */ - 'quantity'?: number; + * Statistics of the campaign on the basis of mobile devices + */ + 'mobile'?: { [key: string]: GetDeviceBrowserStats; }; /** - * Quantity consumed by master - */ - 'used'?: number; + * Statistics of the campaign on the basis of tablet devices + */ + 'tablet'?: { [key: string]: GetDeviceBrowserStats; }; /** - * Quantity remaining in the plan - */ - 'remaining'?: number; + * Statistics of the campaign on the basis of unknown devices + */ + 'unknown'?: { [key: string]: GetDeviceBrowserStats; }; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "name", - "baseName": "name", - "type": "string" + "name": "desktop", + "baseName": "desktop", + "type": "{ [key: string]: GetDeviceBrowserStats; }" }, { - "name": "unitValue", - "baseName": "unitValue", - "type": "string" + "name": "mobile", + "baseName": "mobile", + "type": "{ [key: string]: GetDeviceBrowserStats; }" }, { - "name": "quantity", - "baseName": "quantity", - "type": "number" - }, - { - "name": "used", - "baseName": "used", - "type": "number" + "name": "tablet", + "baseName": "tablet", + "type": "{ [key: string]: GetDeviceBrowserStats; }" }, { - "name": "remaining", - "baseName": "remaining", - "type": "number" + "name": "unknown", + "baseName": "unknown", + "type": "{ [key: string]: GetDeviceBrowserStats; }" } ]; static getAttributeTypeMap() { - return MasterDetailsResponsePlanInfoFeatures.attributeTypeMap; + return GetStatsByDevice.attributeTypeMap; + } } -} -/** - * Note Details - */ -export class Note { + export class GetStatsByDomain extends null { + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + ]; + + static getAttributeTypeMap() { + return super.getAttributeTypeMap().concat(GetStatsByDomain.attributeTypeMap); + } + } + + export class GetTransacAggregatedSmsReport { /** - * Unique note Id - */ - 'id'?: string; + * Time frame of the report + */ + 'range'?: string; /** - * Text content of a note - */ - 'text': string; + * Number of requests for the timeframe + */ + 'requests'?: number; /** - * Contact ids linked to a note - */ - 'contactIds'?: Array; + * Number of delivered SMS for the timeframe + */ + 'delivered'?: number; /** - * Deal ids linked to a note - */ - 'dealIds'?: Array; + * Number of hardbounces for the timeframe + */ + 'hardBounces'?: number; /** - * Account details of user which created the note - */ - 'authorId'?: any; + * Number of softbounces for the timeframe + */ + 'softBounces'?: number; /** - * Note created date/time - */ - 'createdAt'?: Date; + * Number of blocked contact for the timeframe + */ + 'blocked'?: number; /** - * Note updated date/time - */ - 'updatedAt'?: Date; + * Number of unsubscription for the timeframe + */ + 'unsubscribed'?: number; + /** + * Number of answered SMS for the timeframe + */ + 'replied'?: number; + /** + * Number of accepted for the timeframe + */ + 'accepted'?: number; + /** + * Number of rejected for the timeframe + */ + 'rejected'?: number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "id", - "baseName": "id", + "name": "range", + "baseName": "range", "type": "string" }, { - "name": "text", - "baseName": "text", - "type": "string" + "name": "requests", + "baseName": "requests", + "type": "number" }, { - "name": "contactIds", - "baseName": "contactIds", - "type": "Array" + "name": "delivered", + "baseName": "delivered", + "type": "number" }, { - "name": "dealIds", - "baseName": "dealIds", - "type": "Array" + "name": "hardBounces", + "baseName": "hardBounces", + "type": "number" }, { - "name": "authorId", - "baseName": "authorId", - "type": "any" + "name": "softBounces", + "baseName": "softBounces", + "type": "number" }, { - "name": "createdAt", - "baseName": "createdAt", - "type": "Date" + "name": "blocked", + "baseName": "blocked", + "type": "number" }, { - "name": "updatedAt", - "baseName": "updatedAt", - "type": "Date" - } ]; - - static getAttributeTypeMap() { - return Note.attributeTypeMap; - } -} - -/** - * Note data to be saved - */ -export class NoteData { - /** - * Text content of a note - */ - 'text': string; - /** - * Contact Ids linked to a note - */ - 'contactIds'?: Array; - /** - * Deal Ids linked to a note - */ - 'dealIds'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + "name": "unsubscribed", + "baseName": "unsubscribed", + "type": "number" + }, { - "name": "text", - "baseName": "text", - "type": "string" + "name": "replied", + "baseName": "replied", + "type": "number" }, { - "name": "contactIds", - "baseName": "contactIds", - "type": "Array" + "name": "accepted", + "baseName": "accepted", + "type": "number" }, { - "name": "dealIds", - "baseName": "dealIds", - "type": "Array" + "name": "rejected", + "baseName": "rejected", + "type": "number" } ]; static getAttributeTypeMap() { - return NoteData.attributeTypeMap; + return GetTransacAggregatedSmsReport.attributeTypeMap; + } } -} -/** - * Updated Note ID - */ -export class NoteId { + export class GetTransacBlockedContacts { /** - * Unique note Id - */ - 'id'?: string; + * Count of blocked or unsubscribed contact + */ + 'count'?: number; + 'contacts'?: Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "id", - "baseName": "id", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return NoteId.attributeTypeMap; - } -} - -/** - * List of notes - */ -export class NoteList extends Array { - - static discriminator: string | undefined = undefined; - -} - -export class PostContactInfo { - 'contacts': PostContactInfoContacts; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + "name": "count", + "baseName": "count", + "type": "number" + }, { "name": "contacts", "baseName": "contacts", - "type": "PostContactInfoContacts" + "type": "Array" } ]; static getAttributeTypeMap() { - return PostContactInfo.attributeTypeMap; + return GetTransacBlockedContacts.attributeTypeMap; + } } -} -export class PostContactInfoContacts { - 'success'?: Array; - 'failure'?: Array; + export class GetTransacBlockedContactsContacts { /** - * Displays the count of total number of contacts removed from list when user opts for \"all\" option. - */ - 'total'?: number; + * Email address of the blocked or unsubscribed contact + */ + 'email': string; /** - * Id of the process created to remove contacts from list when user opts for \"all\" option. - */ - 'processId'?: number; + * Sender email address of the blocked or unsubscribed contact + */ + 'senderEmail': string; + 'reason': GetTransacBlockedContactsReason; + /** + * Date when the contact was blocked or unsubscribed on + */ + 'blockedAt': string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "success", - "baseName": "success", - "type": "Array" + "name": "email", + "baseName": "email", + "type": "string" }, { - "name": "failure", - "baseName": "failure", - "type": "Array" + "name": "senderEmail", + "baseName": "senderEmail", + "type": "string" }, { - "name": "total", - "baseName": "total", - "type": "number" + "name": "reason", + "baseName": "reason", + "type": "GetTransacBlockedContactsReason" }, { - "name": "processId", - "baseName": "processId", - "type": "number" + "name": "blockedAt", + "baseName": "blockedAt", + "type": "string" } ]; static getAttributeTypeMap() { - return PostContactInfoContacts.attributeTypeMap; + return GetTransacBlockedContactsContacts.attributeTypeMap; + } } -} -export class PostSendFailed { /** - * Response code - */ - 'code': number; + * Reason for blocking / unsubscribing + */ + export class GetTransacBlockedContactsReason { /** - * Response message - */ - 'message': string; - 'unexistingEmails'?: Array; - 'withoutListEmails'?: Array; - 'blackListedEmails'?: Array; + * Reason code for blocking / unsubscribing (This code is safe for comparison) + */ + 'code'?: GetTransacBlockedContactsReason.CodeEnum; + /** + * Reason for blocking / unsubscribing (This string is not safe for comparison) + */ + 'message'?: string; static discriminator: string | undefined = undefined; @@ -7487,905 +7429,1076 @@ export class PostSendFailed { { "name": "code", "baseName": "code", - "type": "number" + "type": "GetTransacBlockedContactsReason.CodeEnum" }, { "name": "message", "baseName": "message", "type": "string" - }, - { - "name": "unexistingEmails", - "baseName": "unexistingEmails", - "type": "Array" - }, - { - "name": "withoutListEmails", - "baseName": "withoutListEmails", - "type": "Array" - }, - { - "name": "blackListedEmails", - "baseName": "blackListedEmails", - "type": "Array" } ]; static getAttributeTypeMap() { - return PostSendFailed.attributeTypeMap; + return GetTransacBlockedContactsReason.attributeTypeMap; + } } -} -export class PostSendSmsTestFailed { - /** - * Response code - */ - 'code': number; + export namespace GetTransacBlockedContactsReason { + export enum CodeEnum { + UnsubscribedViaMA = 'unsubscribedViaMA', + UnsubscribedViaEmail = 'unsubscribedViaEmail', + AdminBlocked = 'adminBlocked', + UnsubscribedViaApi = 'unsubscribedViaApi', + HardBounce = 'hardBounce', + ContactFlaggedAsSpam = 'contactFlaggedAsSpam' + } + } + export class GetTransacEmailContent { /** - * Response message - */ - 'message': string; - 'unexistingSms'?: Array; - 'withoutListSms'?: Array; + * Email address to which transactional email has been sent + */ + 'email': string; + /** + * Subject of the sent email + */ + 'subject': string; + /** + * Id of the template + */ + 'templateId'?: number; + /** + * Date on which transactional email was sent + */ + 'date': string; + /** + * Series of events which occurred on the transactional email + */ + 'events': Array; + /** + * Actual content of the transactional email that has been sent + */ + 'body': string; + /** + * Count of the attachments that were sent in the email + */ + 'attachmentCount': number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "code", - "baseName": "code", - "type": "number" + "name": "email", + "baseName": "email", + "type": "string" }, { - "name": "message", - "baseName": "message", + "name": "subject", + "baseName": "subject", "type": "string" }, { - "name": "unexistingSms", - "baseName": "unexistingSms", - "type": "Array" + "name": "templateId", + "baseName": "templateId", + "type": "number" }, { - "name": "withoutListSms", - "baseName": "withoutListSms", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return PostSendSmsTestFailed.attributeTypeMap; - } -} - -export class RemainingCreditModel { - 'child': RemainingCreditModelChild; - 'reseller': RemainingCreditModelReseller; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + "name": "date", + "baseName": "date", + "type": "string" + }, { - "name": "child", - "baseName": "child", - "type": "RemainingCreditModelChild" + "name": "events", + "baseName": "events", + "type": "Array" }, { - "name": "reseller", - "baseName": "reseller", - "type": "RemainingCreditModelReseller" + "name": "body", + "baseName": "body", + "type": "string" + }, + { + "name": "attachmentCount", + "baseName": "attachmentCount", + "type": "number" } ]; static getAttributeTypeMap() { - return RemainingCreditModel.attributeTypeMap; + return GetTransacEmailContent.attributeTypeMap; + } } -} -/** - * Credits remaining for child account - */ -export class RemainingCreditModelChild { + export class GetTransacEmailContentEvents { /** - * SMS Credits remaining for child account - */ - 'sms': number; + * Name of the event that occurred on the sent email + */ + 'name': string; /** - * Email Credits remaining for child account - */ - 'email': number; + * Time at which the event occurred + */ + 'time': string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "sms", - "baseName": "sms", - "type": "number" + "name": "name", + "baseName": "name", + "type": "string" }, { - "name": "email", - "baseName": "email", - "type": "number" + "name": "time", + "baseName": "time", + "type": "string" } ]; static getAttributeTypeMap() { - return RemainingCreditModelChild.attributeTypeMap; + return GetTransacEmailContentEvents.attributeTypeMap; + } } -} -export class RemainingCreditModelReseller { + export class GetTransacEmailsList { /** - * SMS Credits remaining for reseller account - */ - 'sms': number; - /** - * Email Credits remaining for reseller account - */ - 'email': number; + * Total number of transactional emails available on your account according to the passed filter + */ + 'count'?: number; + 'transactionalEmails'?: Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "sms", - "baseName": "sms", + "name": "count", + "baseName": "count", "type": "number" }, { - "name": "email", - "baseName": "email", - "type": "number" + "name": "transactionalEmails", + "baseName": "transactionalEmails", + "type": "Array" } ]; static getAttributeTypeMap() { - return RemainingCreditModelReseller.attributeTypeMap; + return GetTransacEmailsList.attributeTypeMap; + } } -} -export class RemoveContactFromList { + export class GetTransacEmailsListTransactionalEmails { /** - * Required if 'all' is false. Emails to remove from a list. You can pass a maximum of 150 emails for removal in one request. - */ - 'emails'?: Array; + * Email address to which transactional email has been sent + */ + 'email': string; /** - * Mandatory if Emails are not passed, ignored otherwise. Emails to add to a list. You can pass a maximum of 150 emails for addition in one request. If you need to add the emails in bulk, please prefer /contacts/import api. - */ - 'ids'?: Array; + * Subject of the sent email + */ + 'subject': string; /** - * Required if none of 'emails' or 'ids' are passed. Remove all existing contacts from a list. A process will be created in this scenario. You can fetch the process details to know about the progress - */ - 'all'?: boolean; + * Id of the template + */ + 'templateId'?: number; + /** + * Message Id of the sent email + */ + 'messageId': string; + /** + * Unique id of the email sent to a particular contact + */ + 'uuid': string; + /** + * Date on which transactional email was sent + */ + 'date': string; + /** + * Email address of the sender from which the email was sent + */ + 'from'?: string; + /** + * Tags used for your email + */ + 'tags'?: Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "emails", - "baseName": "emails", - "type": "Array" + "name": "email", + "baseName": "email", + "type": "string" }, { - "name": "ids", - "baseName": "ids", - "type": "Array" + "name": "subject", + "baseName": "subject", + "type": "string" }, { - "name": "all", - "baseName": "all", - "type": "boolean" + "name": "templateId", + "baseName": "templateId", + "type": "number" + }, + { + "name": "messageId", + "baseName": "messageId", + "type": "string" + }, + { + "name": "uuid", + "baseName": "uuid", + "type": "string" + }, + { + "name": "date", + "baseName": "date", + "type": "string" + }, + { + "name": "from", + "baseName": "from", + "type": "string" + }, + { + "name": "tags", + "baseName": "tags", + "type": "Array" } ]; static getAttributeTypeMap() { - return RemoveContactFromList.attributeTypeMap; + return GetTransacEmailsListTransactionalEmails.attributeTypeMap; + } } -} -export class RemoveCredits { - /** - * Required if email credits are empty. SMS credits to be removed from the child account - */ - 'sms'?: number; - /** - * Required if sms credits are empty. Email credits to be removed from the child account - */ - 'email'?: number; + export class GetTransacSmsReport { + 'reports'?: Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "sms", - "baseName": "sms", - "type": "number" - }, - { - "name": "email", - "baseName": "email", - "type": "number" + "name": "reports", + "baseName": "reports", + "type": "Array" } ]; static getAttributeTypeMap() { - return RemoveCredits.attributeTypeMap; + return GetTransacSmsReport.attributeTypeMap; + } } -} -export class RequestContactExport { + export class GetTransacSmsReportReports { /** - * List of all the attributes that you want to export. These attributes must be present in your contact database. For example, ['fname', 'lname', 'email']. - */ - 'exportAttributes'?: Array; - 'customContactFilter': RequestContactExportCustomContactFilter; + * Date for which statistics are retrieved + */ + 'date'?: string; /** - * Webhook that will be called once the export process is finished. For reference, https://help.sendinblue.com/hc/en-us/articles/360007666479 - */ - 'notifyUrl'?: string; + * Number of requests for the date + */ + 'requests'?: number; + /** + * Number of delivered SMS for the date + */ + 'delivered'?: number; + /** + * Number of hardbounces for the date + */ + 'hardBounces'?: number; + /** + * Number of softbounces for the date + */ + 'softBounces'?: number; + /** + * Number of blocked contact for the date + */ + 'blocked'?: number; + /** + * Number of unsubscription for the date + */ + 'unsubscribed'?: number; + /** + * Number of answered SMS for the date + */ + 'replied'?: number; + /** + * Number of accepted for the date + */ + 'accepted'?: number; + /** + * Number of rejected for the date + */ + 'rejected'?: number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "exportAttributes", - "baseName": "exportAttributes", - "type": "Array" + "name": "date", + "baseName": "date", + "type": "string" }, { - "name": "customContactFilter", - "baseName": "customContactFilter", - "type": "RequestContactExportCustomContactFilter" + "name": "requests", + "baseName": "requests", + "type": "number" }, { - "name": "notifyUrl", - "baseName": "notifyUrl", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return RequestContactExport.attributeTypeMap; - } -} - -/** - * Set the filter for the contacts to be exported. - */ -export class RequestContactExportCustomContactFilter { - /** - * Mandatory if neither actionForEmailCampaigns nor actionForSmsCampaigns is passed. This will export the contacts on the basis of provided action applied on contacts as per the list id. * allContacts - Fetch the list of all contacts for a particular list. * subscribed & unsubscribed - Fetch the list of subscribed / unsubscribed (blacklisted via any means) contacts for a particular list. * unsubscribedPerList - Fetch the list of contacts that are unsubscribed from a particular list only. - */ - 'actionForContacts'?: RequestContactExportCustomContactFilter.ActionForContactsEnum; - /** - * Mandatory if neither actionForContacts nor actionForSmsCampaigns is passed. This will export the contacts on the basis of provided action applied on email campaigns. * openers & nonOpeners - emailCampaignId is mandatory. Fetch the list of readers / non-readers for a particular email campaign. * clickers & nonClickers - emailCampaignId is mandatory. Fetch the list of clickers / non-clickers for a particular email campaign. * unsubscribed - emailCampaignId is mandatory. Fetch the list of all unsubscribed (blacklisted via any means) contacts for a particular email campaign. * hardBounces & softBounces - emailCampaignId is optional. Fetch the list of hard bounces / soft bounces for a particular / all email campaign(s). - */ - 'actionForEmailCampaigns'?: RequestContactExportCustomContactFilter.ActionForEmailCampaignsEnum; - /** - * Mandatory if neither actionForContacts nor actionForEmailCampaigns is passed. This will export the contacts on the basis of provided action applied on sms campaigns. * unsubscribed - Fetch the list of all unsubscribed (blacklisted via any means) contacts for all / particular sms campaigns. * hardBounces & softBounces - Fetch the list of hard bounces / soft bounces for all / particular sms campaigns. - */ - 'actionForSmsCampaigns'?: RequestContactExportCustomContactFilter.ActionForSmsCampaignsEnum; - /** - * Mandatory if actionForContacts is passed, ignored otherwise. Id of the list for which the corresponding action shall be applied in the filter. - */ - 'listId'?: number; - /** - * Considered only if actionForEmailCampaigns is passed, ignored otherwise. Mandatory if action is one of the following - openers, nonOpeners, clickers, nonClickers, unsubscribed. The id of the email campaign for which the corresponding action shall be applied in the filter. - */ - 'emailCampaignId'?: number; - /** - * Considered only if actionForSmsCampaigns is passed, ignored otherwise. The id of sms campaign for which the corresponding action shall be applied in the filter. - */ - 'smsCampaignId'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + "name": "delivered", + "baseName": "delivered", + "type": "number" + }, { - "name": "actionForContacts", - "baseName": "actionForContacts", - "type": "RequestContactExportCustomContactFilter.ActionForContactsEnum" + "name": "hardBounces", + "baseName": "hardBounces", + "type": "number" }, { - "name": "actionForEmailCampaigns", - "baseName": "actionForEmailCampaigns", - "type": "RequestContactExportCustomContactFilter.ActionForEmailCampaignsEnum" + "name": "softBounces", + "baseName": "softBounces", + "type": "number" }, { - "name": "actionForSmsCampaigns", - "baseName": "actionForSmsCampaigns", - "type": "RequestContactExportCustomContactFilter.ActionForSmsCampaignsEnum" + "name": "blocked", + "baseName": "blocked", + "type": "number" }, { - "name": "listId", - "baseName": "listId", + "name": "unsubscribed", + "baseName": "unsubscribed", "type": "number" }, { - "name": "emailCampaignId", - "baseName": "emailCampaignId", + "name": "replied", + "baseName": "replied", "type": "number" }, { - "name": "smsCampaignId", - "baseName": "smsCampaignId", + "name": "accepted", + "baseName": "accepted", + "type": "number" + }, + { + "name": "rejected", + "baseName": "rejected", "type": "number" } ]; static getAttributeTypeMap() { - return RequestContactExportCustomContactFilter.attributeTypeMap; - } -} - -export namespace RequestContactExportCustomContactFilter { - export enum ActionForContactsEnum { - AllContacts = 'allContacts', - Subscribed = 'subscribed', - Unsubscribed = 'unsubscribed', - UnsubscribedPerList = 'unsubscribedPerList' - } - export enum ActionForEmailCampaignsEnum { - Openers = 'openers', - NonOpeners = 'nonOpeners', - Clickers = 'clickers', - NonClickers = 'nonClickers', - Unsubscribed = 'unsubscribed', - HardBounces = 'hardBounces', - SoftBounces = 'softBounces' + return GetTransacSmsReportReports.attributeTypeMap; } - export enum ActionForSmsCampaignsEnum { - HardBounces = 'hardBounces', - SoftBounces = 'softBounces', - Unsubscribed = 'unsubscribed' } -} -export class RequestContactImport { - /** - * Mandatory if fileBody or jsonBody is not defined. URL of the file to be imported (no local file). Possible file formats: .txt, .csv, .json - */ - 'fileUrl'?: string; - /** - * Mandatory if fileUrl and jsonBody is not defined. CSV content to be imported. Use semicolon to separate multiple attributes. Maximum allowed file body size is 10MB . However we recommend a safe limit of around 8 MB to avoid the issues caused due to increase of file body size while parsing. Please use fileUrl instead to import bigger files. - */ - 'fileBody'?: string; - /** - * **Mandatory if fileUrl and fileBody is not defined.** JSON content to be imported. **Maximum allowed json body size is 10MB** . However we recommend a safe limit of around 8 MB to avoid the issues caused due to increase of json body size while parsing. Please use fileUrl instead to import bigger files. - */ - 'jsonBody'?: Array<{ [key: string]: any; }>; + + export class GetWebhook { /** - * Mandatory if newList is not defined. Ids of the lists in which the contacts shall be imported. For example, [2, 4, 7]. - */ - 'listIds'?: Array; + * URL of the webhook + */ + 'url': string; /** - * URL that will be called once the import process is finished. For reference, https://help.sendinblue.com/hc/en-us/articles/360007666479 - */ - 'notifyUrl'?: string; - 'newList'?: RequestContactImportNewList; + * ID of the webhook + */ + 'id': number; /** - * To blacklist all the contacts for email - */ - 'emailBlacklist'?: boolean; + * Description of the webhook + */ + 'description': string; + 'events': Array; /** - * To blacklist all the contacts for sms - */ - 'smsBlacklist'?: boolean; + * Type of webhook (marketing or transac) + */ + 'type': GetWebhook.TypeEnum; /** - * To facilitate the choice to update the existing contacts - */ - 'updateExistingContacts'?: boolean; + * Creation UTC date-time of the webhook (YYYY-MM-DDTHH:mm:ss.SSSZ) + */ + 'createdAt': string; /** - * To facilitate the choice to erase any attribute of the existing contacts with empty value. emptyContactsAttributes = true means the empty fields in your import will erase any attribute that currently contain data in SendinBlue, & emptyContactsAttributes = false means the empty fields will not affect your existing data ( only available if `updateExistingContacts` set to true ) - */ - 'emptyContactsAttributes'?: boolean; + * Last modification UTC date-time of the webhook (YYYY-MM-DDTHH:mm:ss.SSSZ) + */ + 'modifiedAt': string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "fileUrl", - "baseName": "fileUrl", - "type": "string" - }, - { - "name": "fileBody", - "baseName": "fileBody", + "name": "url", + "baseName": "url", "type": "string" }, { - "name": "jsonBody", - "baseName": "jsonBody", - "type": "Array<{ [key: string]: any; }>" - }, - { - "name": "listIds", - "baseName": "listIds", - "type": "Array" + "name": "id", + "baseName": "id", + "type": "number" }, { - "name": "notifyUrl", - "baseName": "notifyUrl", + "name": "description", + "baseName": "description", "type": "string" }, { - "name": "newList", - "baseName": "newList", - "type": "RequestContactImportNewList" + "name": "events", + "baseName": "events", + "type": "Array" }, { - "name": "emailBlacklist", - "baseName": "emailBlacklist", - "type": "boolean" + "name": "type", + "baseName": "type", + "type": "GetWebhook.TypeEnum" }, { - "name": "smsBlacklist", - "baseName": "smsBlacklist", - "type": "boolean" + "name": "createdAt", + "baseName": "createdAt", + "type": "string" }, { - "name": "updateExistingContacts", - "baseName": "updateExistingContacts", - "type": "boolean" - }, + "name": "modifiedAt", + "baseName": "modifiedAt", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return GetWebhook.attributeTypeMap; + } + } + + export namespace GetWebhook { + export enum TypeEnum { + Marketing = 'marketing', + Transac = 'transac' + } + } + export class GetWebhooks { + 'webhooks': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "emptyContactsAttributes", - "baseName": "emptyContactsAttributes", - "type": "boolean" + "name": "webhooks", + "baseName": "webhooks", + "type": "Array" } ]; static getAttributeTypeMap() { - return RequestContactImport.attributeTypeMap; + return GetWebhooks.attributeTypeMap; + } } -} -/** - * To create a new list and import the contacts into it, pass the listName and an optional folderId. - */ -export class RequestContactImportNewList { /** - * List with listName will be created first and users will be imported in it (Mandatory if listIds is empty). - */ - 'listName'?: string; + * Created company id + */ + export class InlineResponse200 { /** - * Id of the folder where this new list shall be created (Mandatory if listName is not empty). - */ - 'folderId'?: number; + * Unique company id + */ + 'id': string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "listName", - "baseName": "listName", + "name": "id", + "baseName": "id", "type": "string" - }, - { - "name": "folderId", - "baseName": "folderId", - "type": "number" } ]; static getAttributeTypeMap() { - return RequestContactImportNewList.attributeTypeMap; + return InlineResponse200.attributeTypeMap; + } } -} -export class RequestSmsRecipientExport { /** - * URL that will be called once the export process is finished. For reference, https://help.sendinblue.com/hc/en-us/articles/360007666479 - */ - 'notifyURL'?: string; + * Created deal id + */ + export class InlineResponse201 { /** - * Filter the recipients based on how they interacted with the campaign - */ - 'recipientsType': RequestSmsRecipientExport.RecipientsTypeEnum; + * Unique deal id + */ + 'id': string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "notifyURL", - "baseName": "notifyURL", + "name": "id", + "baseName": "id", "type": "string" - }, - { - "name": "recipientsType", - "baseName": "recipientsType", - "type": "RequestSmsRecipientExport.RecipientsTypeEnum" } ]; static getAttributeTypeMap() { - return RequestSmsRecipientExport.attributeTypeMap; + return InlineResponse201.attributeTypeMap; } -} - -export namespace RequestSmsRecipientExport { - export enum RecipientsTypeEnum { - All = 'all', - Delivered = 'delivered', - Answered = 'answered', - SoftBounces = 'softBounces', - HardBounces = 'hardBounces', - Unsubscribed = 'unsubscribed' } -} -export class ScheduleSmtpEmail { + /** - * Message ID of the transactional email scheduled - */ - 'messageId'?: string; - 'messageIds'?: Array; + * Task Details + */ + export class InlineResponse2011 { /** - * Batch ID of the batch transactional email scheduled - */ - 'batchId'?: string; + * Unique task id + */ + 'id': string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "messageId", - "baseName": "messageId", + "name": "id", + "baseName": "id", "type": "string" - }, - { - "name": "messageIds", - "baseName": "messageIds", - "type": "Array" - }, + } ]; + + static getAttributeTypeMap() { + return InlineResponse2011.attributeTypeMap; + } + } + + export class ManageIp { + /** + * Dedicated ID + */ + 'ip'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "batchId", - "baseName": "batchId", + "name": "ip", + "baseName": "ip", "type": "string" } ]; static getAttributeTypeMap() { - return ScheduleSmtpEmail.attributeTypeMap; + return ManageIp.attributeTypeMap; + } } -} -export class SendReport { + export class MasterDetailsResponse { /** - * Language of email content for campaign report sending. - */ - 'language'?: SendReport.LanguageEnum; - 'email': SendReportEmail; + * Email id of master account + */ + 'email'?: string; + /** + * Company name of master account organization + */ + 'companyName'?: string; + /** + * Unique identifier of the master account organization + */ + 'id'?: number; + /** + * Currency code of the master account organization + */ + 'currencyCode'?: string; + /** + * Timezone of the master account organization + */ + 'timezone'?: string; + 'billingInfo'?: MasterDetailsResponseBillingInfo; + 'planInfo'?: MasterDetailsResponsePlanInfo; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "language", - "baseName": "language", - "type": "SendReport.LanguageEnum" - }, { "name": "email", "baseName": "email", - "type": "SendReportEmail" + "type": "string" + }, + { + "name": "companyName", + "baseName": "companyName", + "type": "string" + }, + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "currencyCode", + "baseName": "currencyCode", + "type": "string" + }, + { + "name": "timezone", + "baseName": "timezone", + "type": "string" + }, + { + "name": "billingInfo", + "baseName": "billingInfo", + "type": "MasterDetailsResponseBillingInfo" + }, + { + "name": "planInfo", + "baseName": "planInfo", + "type": "MasterDetailsResponsePlanInfo" } ]; static getAttributeTypeMap() { - return SendReport.attributeTypeMap; + return MasterDetailsResponse.attributeTypeMap; } -} - -export namespace SendReport { - export enum LanguageEnum { - Fr = 'fr', - Es = 'es', - Pt = 'pt', - It = 'it', - De = 'de', - En = 'en' } -} -/** - * Custom attributes for the report email. - */ -export class SendReportEmail { + /** - * Email addresses of the recipients - */ - 'to': Array; + * Billing details of the master account organization + */ + export class MasterDetailsResponseBillingInfo { /** - * Custom text message to be presented in the report email. - */ - 'body': string; + * Billing email id of master account + */ + 'email'?: string; + /** + * Company name of master account + */ + 'companyName'?: string; + 'name'?: MasterDetailsResponseBillingInfoName; + 'address'?: MasterDetailsResponseBillingInfoAddress; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "to", - "baseName": "to", - "type": "Array" + "name": "email", + "baseName": "email", + "type": "string" }, { - "name": "body", - "baseName": "body", + "name": "companyName", + "baseName": "companyName", "type": "string" + }, + { + "name": "name", + "baseName": "name", + "type": "MasterDetailsResponseBillingInfoName" + }, + { + "name": "address", + "baseName": "address", + "type": "MasterDetailsResponseBillingInfoAddress" } ]; static getAttributeTypeMap() { - return SendReportEmail.attributeTypeMap; + return MasterDetailsResponseBillingInfo.attributeTypeMap; + } } -} -export class SendSms { - 'reference': string; - 'messageId': number; /** - * Count of SMS's to send multiple text messages - */ - 'smsCount'?: number; + * Billing address of master account + */ + export class MasterDetailsResponseBillingInfoAddress { /** - * SMS credits used per text message - */ - 'usedCredits'?: number; + * Street address + */ + 'streetAddress'?: string; /** - * Remaining SMS credits of the user - */ - 'remainingCredits'?: number; + * Locality + */ + 'locality'?: string; + /** + * Postal code + */ + 'postalCode'?: string; + /** + * State code + */ + 'stateCode'?: string; + /** + * Country code + */ + 'countryCode'?: string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "reference", - "baseName": "reference", + "name": "streetAddress", + "baseName": "streetAddress", "type": "string" }, { - "name": "messageId", - "baseName": "messageId", - "type": "number" + "name": "locality", + "baseName": "locality", + "type": "string" }, { - "name": "smsCount", - "baseName": "smsCount", - "type": "number" + "name": "postalCode", + "baseName": "postalCode", + "type": "string" }, { - "name": "usedCredits", - "baseName": "usedCredits", - "type": "number" + "name": "stateCode", + "baseName": "stateCode", + "type": "string" }, { - "name": "remainingCredits", - "baseName": "remainingCredits", - "type": "number" + "name": "countryCode", + "baseName": "countryCode", + "type": "string" } ]; static getAttributeTypeMap() { - return SendSms.attributeTypeMap; + return MasterDetailsResponseBillingInfoAddress.attributeTypeMap; + } } -} -export class SendSmtpEmail { - 'sender'?: SendSmtpEmailSender; - /** - * Mandatory if messageVersions are not passed, ignored if messageVersions are passed. List of email addresses and names (optional) of the recipients. For example, [{\"name\":\"Jimmy\", \"email\":\"jimmy98@example.com\"}, {\"name\":\"Joe\", \"email\":\"joe@example.com\"}] - */ - 'to'?: Array; /** - * List of email addresses and names (optional) of the recipients in bcc - */ - 'bcc'?: Array; - /** - * List of email addresses and names (optional) of the recipients in cc - */ - 'cc'?: Array; - /** - * HTML body of the message ( Mandatory if 'templateId' is not passed, ignored if 'templateId' is passed ) - */ - 'htmlContent'?: string; + * Billing name of master account holder + */ + export class MasterDetailsResponseBillingInfoName { /** - * Plain Text body of the message ( Ignored if 'templateId' is passed ) - */ - 'textContent'?: string; - /** - * Subject of the message. Mandatory if 'templateId' is not passed - */ - 'subject'?: string; - 'replyTo'?: SendSmtpEmailReplyTo; + * First name for billing + */ + 'givenName'?: string; /** - * Pass the absolute URL (no local file) or the base64 content of the attachment along with the attachment name (Mandatory if attachment content is passed). For example, `[{\"url\":\"https://attachment.domain.com/myAttachmentFromUrl.jpg\", \"name\":\"myAttachmentFromUrl.jpg\"}, {\"content\":\"base64 example content\", \"name\":\"myAttachmentFromBase64.jpg\"}]`. Allowed extensions for attachment file: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub, eps, odt, mp3, m4a, m4v, wma, ogg, flac, wav, aif, aifc, aiff, mp4, mov, avi, mkv, mpeg, mpg, wmv, pkpass and xlsm ( If 'templateId' is passed and is in New Template Language format then both attachment url and content are accepted. If template is in Old template Language format, then 'attachment' is ignored ) - */ - 'attachment'?: Array; + * Last name for billing + */ + 'familyName'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "givenName", + "baseName": "givenName", + "type": "string" + }, + { + "name": "familyName", + "baseName": "familyName", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return MasterDetailsResponseBillingInfoName.attributeTypeMap; + } + } + /** - * Pass the set of custom headers (not the standard headers) that shall be sent along the mail headers in the original email. 'sender.ip' header can be set (only for dedicated ip users) to mention the IP to be used for sending transactional emails. Headers are allowed in `This-Case-Only` (i.e. words separated by hyphen with first letter of each word in capital letter), they will be converted to such case styling if not in this format in the request payload. For example, `{\"sender.ip\":\"1.2.3.4\", \"X-Mailin-custom\":\"some_custom_header\", \"idempotencyKey\":\"abc-123\"}`. - */ - 'headers'?: any; + * Plan details + */ + export class MasterDetailsResponsePlanInfo { /** - * Id of the template. - */ - 'templateId'?: number; + * Plan currency + */ + 'currencyCode'?: string; /** - * Pass the set of attributes to customize the template. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}. It's considered only if template is in New Template Language format. - */ - 'params'?: any; + * Timestamp of next billing date + */ + 'nextBillingAt'?: number; /** - * You can customize and send out multiple versions of a mail. templateId can be customized only if global parameter contains templateId. htmlContent and textContent can be customized only if any of the two, htmlContent or textContent, is present in global parameters. Some global parameters such as **to(mandatory), bcc, cc, replyTo, subject** can also be customized specific to each version. Total number of recipients in one API request must not exceed 2000. However, you can still pass upto 99 recipients maximum in one message version. The size of individual params in all the messageVersions shall not exceed 100 KB limit and that of cumulative params shall not exceed 1000 KB. You can follow this **step-by-step guide** on how to use **messageVersions** to batch send emails - https://developers.sendinblue.com/docs/batch-send-transactional-emails - */ - 'messageVersions'?: Array; + * Plan amount + */ + 'price'?: number; /** - * Tag your emails to find them more easily - */ - 'tags'?: Array; + * Plan period type + */ + 'planPeriod'?: MasterDetailsResponsePlanInfo.PlanPeriodEnum; /** - * UTC date-time on which the email has to schedule (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for scheduling. There can be an expected delay of +5 minutes in scheduled email delivery. **Please note this feature is currently a public beta**. - */ - 'scheduledAt'?: Date; + * Number of sub-accounts + */ + 'subAccounts'?: number; /** - * Valid UUIDv4 batch id to identify the scheduled batches transactional email. If not passed we will create a valid UUIDv4 batch id at our end. - */ - 'batchId'?: string; + * List of provided features in the plan + */ + 'features'?: Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "sender", - "baseName": "sender", - "type": "SendSmtpEmailSender" + "name": "currencyCode", + "baseName": "currencyCode", + "type": "string" }, { - "name": "to", - "baseName": "to", - "type": "Array" + "name": "nextBillingAt", + "baseName": "nextBillingAt", + "type": "number" }, { - "name": "bcc", - "baseName": "bcc", - "type": "Array" + "name": "price", + "baseName": "price", + "type": "number" }, { - "name": "cc", - "baseName": "cc", - "type": "Array" - }, - { - "name": "htmlContent", - "baseName": "htmlContent", - "type": "string" + "name": "planPeriod", + "baseName": "planPeriod", + "type": "MasterDetailsResponsePlanInfo.PlanPeriodEnum" }, { - "name": "textContent", - "baseName": "textContent", - "type": "string" + "name": "subAccounts", + "baseName": "subAccounts", + "type": "number" }, { - "name": "subject", - "baseName": "subject", + "name": "features", + "baseName": "features", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return MasterDetailsResponsePlanInfo.attributeTypeMap; + } + } + + export namespace MasterDetailsResponsePlanInfo { + export enum PlanPeriodEnum { + Month = 'month', + Year = 'year' + } + } + export class MasterDetailsResponsePlanInfoFeatures { + /** + * Name of the feature + */ + 'name'?: string; + /** + * Unit value of the feature + */ + 'unitValue'?: string; + /** + * Quantity provided in the plan + */ + 'quantity'?: number; + /** + * Quantity consumed by master + */ + 'used'?: number; + /** + * Quantity remaining in the plan + */ + 'remaining'?: number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "name", + "baseName": "name", "type": "string" }, { - "name": "replyTo", - "baseName": "replyTo", - "type": "SendSmtpEmailReplyTo" + "name": "unitValue", + "baseName": "unitValue", + "type": "string" }, { - "name": "attachment", - "baseName": "attachment", - "type": "Array" + "name": "quantity", + "baseName": "quantity", + "type": "number" }, { - "name": "headers", - "baseName": "headers", - "type": "any" + "name": "used", + "baseName": "used", + "type": "number" }, { - "name": "templateId", - "baseName": "templateId", + "name": "remaining", + "baseName": "remaining", "type": "number" + } ]; + + static getAttributeTypeMap() { + return MasterDetailsResponsePlanInfoFeatures.attributeTypeMap; + } + } + + /** + * Note Details + */ + export class Note { + /** + * Unique note Id + */ + 'id'?: string; + /** + * Text content of a note + */ + 'text': string; + /** + * Contact ids linked to a note + */ + 'contactIds'?: Array; + /** + * Deal ids linked to a note + */ + 'dealIds'?: Array; + /** + * Account details of user which created the note + */ + 'authorId'?: any; + /** + * Note created date/time + */ + 'createdAt'?: Date; + /** + * Note updated date/time + */ + 'updatedAt'?: Date; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string" }, { - "name": "params", - "baseName": "params", - "type": "any" + "name": "text", + "baseName": "text", + "type": "string" }, { - "name": "messageVersions", - "baseName": "messageVersions", - "type": "Array" + "name": "contactIds", + "baseName": "contactIds", + "type": "Array" }, { - "name": "tags", - "baseName": "tags", + "name": "dealIds", + "baseName": "dealIds", "type": "Array" }, { - "name": "scheduledAt", - "baseName": "scheduledAt", + "name": "authorId", + "baseName": "authorId", + "type": "any" + }, + { + "name": "createdAt", + "baseName": "createdAt", "type": "Date" }, { - "name": "batchId", - "baseName": "batchId", - "type": "string" + "name": "updatedAt", + "baseName": "updatedAt", + "type": "Date" } ]; static getAttributeTypeMap() { - return SendSmtpEmail.attributeTypeMap; + return Note.attributeTypeMap; + } } -} -export class SendSmtpEmailAttachment { /** - * Absolute url of the attachment (no local file). - */ - 'url'?: string; + * Note data to be saved + */ + export class NoteData { /** - * Base64 encoded chunk data of the attachment generated on the fly - */ - 'content'?: string; + * Text content of a note + */ + 'text': string; /** - * Required if content is passed. Name of the attachment - */ - 'name'?: string; + * Contact Ids linked to a note + */ + 'contactIds'?: Array; + /** + * Deal Ids linked to a note + */ + 'dealIds'?: Array; + /** + * Company Ids linked to a note + */ + 'companyIds'?: Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "url", - "baseName": "url", + "name": "text", + "baseName": "text", "type": "string" }, { - "name": "content", - "baseName": "content", - "type": "string" + "name": "contactIds", + "baseName": "contactIds", + "type": "Array" }, { - "name": "name", - "baseName": "name", - "type": "string" + "name": "dealIds", + "baseName": "dealIds", + "type": "Array" + }, + { + "name": "companyIds", + "baseName": "companyIds", + "type": "Array" } ]; static getAttributeTypeMap() { - return SendSmtpEmailAttachment.attributeTypeMap; + return NoteData.attributeTypeMap; + } } -} -export class SendSmtpEmailBcc { /** - * Email address of the recipient in bcc - */ - 'email': string; + * Updated Note ID + */ + export class NoteId { /** - * Name of the recipient in bcc. Maximum allowed characters are 70. - */ - 'name'?: string; + * Unique note Id + */ + 'id'?: string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "email", - "baseName": "email", + "name": "id", + "baseName": "id", "type": "string" - }, + } ]; + + static getAttributeTypeMap() { + return NoteId.attributeTypeMap; + } + } + + /** + * List of notes + */ + export class NoteList extends Array { + + static discriminator: string | undefined = undefined; + + } + + /** + * List of stages + */ + export class Pipeline { + /** + * List of stages + */ + 'stages'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "name", - "baseName": "name", - "type": "string" + "name": "stages", + "baseName": "stages", + "type": "Array" } ]; static getAttributeTypeMap() { - return SendSmtpEmailBcc.attributeTypeMap; + return Pipeline.attributeTypeMap; + } } -} -export class SendSmtpEmailCc { /** - * Email address of the recipient in cc - */ - 'email': string; + * List of stages + */ + export class PipelineStage { /** - * Name of the recipient in cc. Maximum allowed characters are 70. - */ + * Stage id + */ + 'id'?: string; + /** + * Stage name + */ 'name'?: string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "email", - "baseName": "email", + "name": "id", + "baseName": "id", "type": "string" }, { @@ -8395,1102 +8508,1204 @@ export class SendSmtpEmailCc { } ]; static getAttributeTypeMap() { - return SendSmtpEmailCc.attributeTypeMap; + return PipelineStage.attributeTypeMap; + } } -} -export class SendSmtpEmailMessageVersions { - /** - * List of email addresses and names (_optional_) of the recipients. For example, [{\"name\":\"Jimmy\", \"email\":\"jimmy98@example.com\"}, {\"name\":\"Joe\", \"email\":\"joe@example.com\"}] - */ - 'to': Array; - /** - * Pass the set of attributes to customize the template. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}. It's considered only if template is in New Template Language format. - */ - 'params'?: { [key: string]: any; }; - /** - * List of email addresses and names (optional) of the recipients in bcc - */ - 'bcc'?: Array; + export class PostContactInfo { + 'contacts': PostContactInfoContacts; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "contacts", + "baseName": "contacts", + "type": "PostContactInfoContacts" + } ]; + + static getAttributeTypeMap() { + return PostContactInfo.attributeTypeMap; + } + } + + export class PostContactInfoContacts { + 'success'?: Array; + 'failure'?: Array; /** - * List of email addresses and names (optional) of the recipients in cc - */ - 'cc'?: Array; - 'replyTo'?: SendSmtpEmailReplyTo1; + * Displays the count of total number of contacts removed from list when user opts for \"all\" option. + */ + 'total'?: number; /** - * Custom subject specific to message version - */ - 'subject'?: string; + * Id of the process created to remove contacts from list when user opts for \"all\" option. + */ + 'processId'?: number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "to", - "baseName": "to", - "type": "Array" + "name": "success", + "baseName": "success", + "type": "Array" }, { - "name": "params", - "baseName": "params", - "type": "{ [key: string]: any; }" + "name": "failure", + "baseName": "failure", + "type": "Array" }, { - "name": "bcc", - "baseName": "bcc", - "type": "Array" + "name": "total", + "baseName": "total", + "type": "number" }, { - "name": "cc", - "baseName": "cc", - "type": "Array" - }, + "name": "processId", + "baseName": "processId", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return PostContactInfoContacts.attributeTypeMap; + } + } + + export class PostSendFailed { + /** + * Response code + */ + 'code': number; + /** + * Response message + */ + 'message': string; + 'unexistingEmails'?: Array; + 'withoutListEmails'?: Array; + 'blackListedEmails'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "replyTo", - "baseName": "replyTo", - "type": "SendSmtpEmailReplyTo1" + "name": "code", + "baseName": "code", + "type": "number" }, { - "name": "subject", - "baseName": "subject", + "name": "message", + "baseName": "message", "type": "string" + }, + { + "name": "unexistingEmails", + "baseName": "unexistingEmails", + "type": "Array" + }, + { + "name": "withoutListEmails", + "baseName": "withoutListEmails", + "type": "Array" + }, + { + "name": "blackListedEmails", + "baseName": "blackListedEmails", + "type": "Array" } ]; static getAttributeTypeMap() { - return SendSmtpEmailMessageVersions.attributeTypeMap; + return PostSendFailed.attributeTypeMap; + } } -} -/** - * Email (required), along with name (optional), on which transactional mail recipients will be able to reply back. For example, {\"email\":\"ann6533@example.com\", \"name\":\"Ann\"}. - */ -export class SendSmtpEmailReplyTo { + export class PostSendSmsTestFailed { /** - * Email address in reply to - */ - 'email': string; + * Response code + */ + 'code': number; /** - * Name in reply to. Maximum allowed characters are 70. - */ - 'name'?: string; + * Response message + */ + 'message': string; + 'unexistingSms'?: Array; + 'withoutListSms'?: Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "email", - "baseName": "email", - "type": "string" + "name": "code", + "baseName": "code", + "type": "number" }, { - "name": "name", - "baseName": "name", + "name": "message", + "baseName": "message", "type": "string" + }, + { + "name": "unexistingSms", + "baseName": "unexistingSms", + "type": "Array" + }, + { + "name": "withoutListSms", + "baseName": "withoutListSms", + "type": "Array" } ]; static getAttributeTypeMap() { - return SendSmtpEmailReplyTo.attributeTypeMap; + return PostSendSmsTestFailed.attributeTypeMap; + } } -} -/** - * Email (required), along with name (optional), on which transactional mail recipients will be able to reply back. For example, {\"email\":\"ann6533@example.com\", \"name\":\"Ann\"} - */ -export class SendSmtpEmailReplyTo1 { - /** - * Email address in reply to - */ - 'email': string; - /** - * Name in reply to. Maximum allowed characters are 70. - */ - 'name'?: string; + export class RemainingCreditModel { + 'child': RemainingCreditModelChild; + 'reseller': RemainingCreditModelReseller; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "email", - "baseName": "email", - "type": "string" + "name": "child", + "baseName": "child", + "type": "RemainingCreditModelChild" }, { - "name": "name", - "baseName": "name", - "type": "string" + "name": "reseller", + "baseName": "reseller", + "type": "RemainingCreditModelReseller" } ]; static getAttributeTypeMap() { - return SendSmtpEmailReplyTo1.attributeTypeMap; + return RemainingCreditModel.attributeTypeMap; + } } -} -/** - * Mandatory if `templateId` is not passed. Pass `name` (optional) and `email` OR `id` of sender from which emails will be sent. `name` will be ignored if passed along with sender `id`. For example, {\"name\":\"Mary from MyShop\", \"email\":\"no-reply@myshop.com\"} or {\"id\":2} - */ -export class SendSmtpEmailSender { /** - * Name of the sender from which the emails will be sent. Maximum allowed characters are 70. Applicable only when email is passed. - */ - 'name'?: string; + * Credits remaining for child account + */ + export class RemainingCreditModelChild { /** - * Email of the sender from which the emails will be sent. Mandatory if sender id is not passed. - */ - 'email'?: string; + * SMS Credits remaining for child account + */ + 'sms': number; /** - * Id of the sender from which the emails will be sent. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). Mandatory if email is not passed. - */ - 'id'?: number; + * Email Credits remaining for child account + */ + 'email': number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "name", - "baseName": "name", - "type": "string" + "name": "sms", + "baseName": "sms", + "type": "number" }, { "name": "email", "baseName": "email", - "type": "string" - }, - { - "name": "id", - "baseName": "id", "type": "number" } ]; static getAttributeTypeMap() { - return SendSmtpEmailSender.attributeTypeMap; + return RemainingCreditModelChild.attributeTypeMap; + } } -} -export class SendSmtpEmailTo { + export class RemainingCreditModelReseller { /** - * Email address of the recipient - */ - 'email': string; + * SMS Credits remaining for reseller account + */ + 'sms': number; /** - * Name of the recipient. Maximum allowed characters are 70. - */ - 'name'?: string; + * Email Credits remaining for reseller account + */ + 'email': number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "email", - "baseName": "email", - "type": "string" + "name": "sms", + "baseName": "sms", + "type": "number" }, { - "name": "name", - "baseName": "name", - "type": "string" + "name": "email", + "baseName": "email", + "type": "number" } ]; static getAttributeTypeMap() { - return SendSmtpEmailTo.attributeTypeMap; + return RemainingCreditModelReseller.attributeTypeMap; + } } -} -export class SendSmtpEmailTo1 { + export class RemoveContactFromList { /** - * Email address of the recipient - */ - 'email': string; + * Required if 'all' is false. Emails to remove from a list. You can pass a maximum of 150 emails for removal in one request. + */ + 'emails'?: Array; /** - * Name of the recipient. **Maximum allowed characters are 70**. - */ - 'name'?: string; + * Mandatory if Emails are not passed, ignored otherwise. Emails to add to a list. You can pass a maximum of 150 emails for addition in one request. If you need to add the emails in bulk, please prefer /contacts/import api. + */ + 'ids'?: Array; + /** + * Required if none of 'emails' or 'ids' are passed. Remove all existing contacts from a list. A process will be created in this scenario. You can fetch the process details to know about the progress + */ + 'all'?: boolean; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "email", - "baseName": "email", - "type": "string" + "name": "emails", + "baseName": "emails", + "type": "Array" }, { - "name": "name", - "baseName": "name", - "type": "string" + "name": "ids", + "baseName": "ids", + "type": "Array" + }, + { + "name": "all", + "baseName": "all", + "type": "boolean" } ]; static getAttributeTypeMap() { - return SendSmtpEmailTo1.attributeTypeMap; + return RemoveContactFromList.attributeTypeMap; + } } -} -export class SendTestEmail { + export class RemoveCredits { /** - * List of the email addresses of the recipients whom you wish to send the test mail. If left empty, the test mail will be sent to your entire test list. You can not send more than 50 test emails per day. - */ - 'emailTo'?: Array; + * Required if email credits are empty. SMS credits to be removed from the child account + */ + 'sms'?: number; + /** + * Required if sms credits are empty. Email credits to be removed from the child account + */ + 'email'?: number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "emailTo", - "baseName": "emailTo", - "type": "Array" + "name": "sms", + "baseName": "sms", + "type": "number" + }, + { + "name": "email", + "baseName": "email", + "type": "number" } ]; static getAttributeTypeMap() { - return SendTestEmail.attributeTypeMap; + return RemoveCredits.attributeTypeMap; + } } -} -export class SendTestSms { + export class RequestContactExport { /** - * Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted - */ - 'phoneNumber'?: string; + * List of all the attributes that you want to export. These attributes must be present in your contact database. For example, ['fname', 'lname', 'email']. + */ + 'exportAttributes'?: Array; + 'customContactFilter': RequestContactExportCustomContactFilter; + /** + * Webhook that will be called once the export process is finished. For reference, https://help.sendinblue.com/hc/en-us/articles/360007666479 + */ + 'notifyUrl'?: string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "phoneNumber", - "baseName": "phoneNumber", + "name": "exportAttributes", + "baseName": "exportAttributes", + "type": "Array" + }, + { + "name": "customContactFilter", + "baseName": "customContactFilter", + "type": "RequestContactExportCustomContactFilter" + }, + { + "name": "notifyUrl", + "baseName": "notifyUrl", "type": "string" } ]; static getAttributeTypeMap() { - return SendTestSms.attributeTypeMap; + return RequestContactExport.attributeTypeMap; + } } -} -export class SendTransacSms { /** - * Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** - */ - 'sender': string; + * Set the filter for the contacts to be exported. + */ + export class RequestContactExportCustomContactFilter { /** - * Mobile number to send SMS with the country code - */ - 'recipient': string; + * Mandatory if neither actionForEmailCampaigns nor actionForSmsCampaigns is passed. This will export the contacts on the basis of provided action applied on contacts as per the list id. * allContacts - Fetch the list of all contacts for a particular list. * subscribed & unsubscribed - Fetch the list of subscribed / unsubscribed (blacklisted via any means) contacts for a particular list. * unsubscribedPerList - Fetch the list of contacts that are unsubscribed from a particular list only. + */ + 'actionForContacts'?: RequestContactExportCustomContactFilter.ActionForContactsEnum; /** - * Content of the message. If more than 160 characters long, will be sent as multiple text messages - */ - 'content': string; + * Mandatory if neither actionForContacts nor actionForSmsCampaigns is passed. This will export the contacts on the basis of provided action applied on email campaigns. * openers & nonOpeners - emailCampaignId is mandatory. Fetch the list of readers / non-readers for a particular email campaign. * clickers & nonClickers - emailCampaignId is mandatory. Fetch the list of clickers / non-clickers for a particular email campaign. * unsubscribed - emailCampaignId is mandatory. Fetch the list of all unsubscribed (blacklisted via any means) contacts for a particular email campaign. * hardBounces & softBounces - emailCampaignId is optional. Fetch the list of hard bounces / soft bounces for a particular / all email campaign(s). + */ + 'actionForEmailCampaigns'?: RequestContactExportCustomContactFilter.ActionForEmailCampaignsEnum; /** - * Type of the SMS. Marketing SMS messages are those sent typically with marketing content. Transactional SMS messages are sent to individuals and are triggered in response to some action, such as a sign-up, purchase, etc. - */ - 'type'?: SendTransacSms.TypeEnum; + * Mandatory if neither actionForContacts nor actionForEmailCampaigns is passed. This will export the contacts on the basis of provided action applied on sms campaigns. * unsubscribed - Fetch the list of all unsubscribed (blacklisted via any means) contacts for all / particular sms campaigns. * hardBounces & softBounces - Fetch the list of hard bounces / soft bounces for all / particular sms campaigns. + */ + 'actionForSmsCampaigns'?: RequestContactExportCustomContactFilter.ActionForSmsCampaignsEnum; /** - * Tag of the message - */ - 'tag'?: string; + * Mandatory if actionForContacts is passed, ignored otherwise. Id of the list for which the corresponding action shall be applied in the filter. + */ + 'listId'?: number; /** - * Webhook to call for each event triggered by the message (delivered etc.) - */ - 'webUrl'?: string; + * Considered only if actionForEmailCampaigns is passed, ignored otherwise. Mandatory if action is one of the following - openers, nonOpeners, clickers, nonClickers, unsubscribed. The id of the email campaign for which the corresponding action shall be applied in the filter. + */ + 'emailCampaignId'?: number; /** - * Format of the message. It indicates whether the content should be treated as unicode or not. - */ - 'unicodeEnabled'?: boolean; + * Considered only if actionForSmsCampaigns is passed, ignored otherwise. The id of sms campaign for which the corresponding action shall be applied in the filter. + */ + 'smsCampaignId'?: number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "sender", - "baseName": "sender", - "type": "string" - }, - { - "name": "recipient", - "baseName": "recipient", - "type": "string" + "name": "actionForContacts", + "baseName": "actionForContacts", + "type": "RequestContactExportCustomContactFilter.ActionForContactsEnum" }, { - "name": "content", - "baseName": "content", - "type": "string" + "name": "actionForEmailCampaigns", + "baseName": "actionForEmailCampaigns", + "type": "RequestContactExportCustomContactFilter.ActionForEmailCampaignsEnum" }, { - "name": "type", - "baseName": "type", - "type": "SendTransacSms.TypeEnum" + "name": "actionForSmsCampaigns", + "baseName": "actionForSmsCampaigns", + "type": "RequestContactExportCustomContactFilter.ActionForSmsCampaignsEnum" }, { - "name": "tag", - "baseName": "tag", - "type": "string" + "name": "listId", + "baseName": "listId", + "type": "number" }, { - "name": "webUrl", - "baseName": "webUrl", - "type": "string" + "name": "emailCampaignId", + "baseName": "emailCampaignId", + "type": "number" }, { - "name": "unicodeEnabled", - "baseName": "unicodeEnabled", - "type": "boolean" + "name": "smsCampaignId", + "baseName": "smsCampaignId", + "type": "number" } ]; static getAttributeTypeMap() { - return SendTransacSms.attributeTypeMap; + return RequestContactExportCustomContactFilter.attributeTypeMap; + } } -} -export namespace SendTransacSms { - export enum TypeEnum { - Transactional = 'transactional', - Marketing = 'marketing' + export namespace RequestContactExportCustomContactFilter { + export enum ActionForContactsEnum { + AllContacts = 'allContacts', + Subscribed = 'subscribed', + Unsubscribed = 'unsubscribed', + UnsubscribedPerList = 'unsubscribedPerList' } -} -export class SsoTokenRequest { + export enum ActionForEmailCampaignsEnum { + Openers = 'openers', + NonOpeners = 'nonOpeners', + Clickers = 'clickers', + NonClickers = 'nonClickers', + Unsubscribed = 'unsubscribed', + HardBounces = 'hardBounces', + SoftBounces = 'softBounces' + } + export enum ActionForSmsCampaignsEnum { + HardBounces = 'hardBounces', + SoftBounces = 'softBounces', + Unsubscribed = 'unsubscribed' + } + } + export class RequestContactImport { /** - * Id of the sub-account organization - */ - 'id': number; + * Mandatory if fileBody or jsonBody is not defined. URL of the file to be imported (no local file). Possible file formats: .txt, .csv, .json + */ + 'fileUrl'?: string; /** - * User email of sub-account organization - */ - 'email'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "email", - "baseName": "email", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return SsoTokenRequest.attributeTypeMap; - } -} - -export class SubAccountDetailsResponse { + * Mandatory if fileUrl and jsonBody is not defined. CSV content to be imported. Use semicolon to separate multiple attributes. Maximum allowed file body size is 10MB . However we recommend a safe limit of around 8 MB to avoid the issues caused due to increase of file body size while parsing. Please use fileUrl instead to import bigger files. + */ + 'fileBody'?: string; /** - * Name of the sub-account user - */ - 'name'?: string; + * **Mandatory if fileUrl and fileBody is not defined.** JSON content to be imported. **Maximum allowed json body size is 10MB** . However we recommend a safe limit of around 8 MB to avoid the issues caused due to increase of json body size while parsing. Please use fileUrl instead to import bigger files. + */ + 'jsonBody'?: Array<{ [key: string]: any; }>; /** - * Email id of the sub-account organization - */ - 'email'?: string; + * Mandatory if newList is not defined. Ids of the lists in which the contacts shall be imported. For example, [2, 4, 7]. + */ + 'listIds'?: Array; /** - * Sub-account company name - */ - 'companyName'?: string; - 'planInfo'?: SubAccountDetailsResponsePlanInfo; + * URL that will be called once the import process is finished. For reference, https://help.sendinblue.com/hc/en-us/articles/360007666479 + */ + 'notifyUrl'?: string; + 'newList'?: RequestContactImportNewList; + /** + * To blacklist all the contacts for email + */ + 'emailBlacklist'?: boolean; + /** + * To blacklist all the contacts for sms + */ + 'smsBlacklist'?: boolean; + /** + * To facilitate the choice to update the existing contacts + */ + 'updateExistingContacts'?: boolean; + /** + * To facilitate the choice to erase any attribute of the existing contacts with empty value. emptyContactsAttributes = true means the empty fields in your import will erase any attribute that currently contain data in SendinBlue, & emptyContactsAttributes = false means the empty fields will not affect your existing data ( only available if `updateExistingContacts` set to true ) + */ + 'emptyContactsAttributes'?: boolean; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "name", - "baseName": "name", + "name": "fileUrl", + "baseName": "fileUrl", "type": "string" }, { - "name": "email", - "baseName": "email", + "name": "fileBody", + "baseName": "fileBody", "type": "string" }, { - "name": "companyName", - "baseName": "companyName", + "name": "jsonBody", + "baseName": "jsonBody", + "type": "Array<{ [key: string]: any; }>" + }, + { + "name": "listIds", + "baseName": "listIds", + "type": "Array" + }, + { + "name": "notifyUrl", + "baseName": "notifyUrl", "type": "string" }, { - "name": "planInfo", - "baseName": "planInfo", - "type": "SubAccountDetailsResponsePlanInfo" + "name": "newList", + "baseName": "newList", + "type": "RequestContactImportNewList" + }, + { + "name": "emailBlacklist", + "baseName": "emailBlacklist", + "type": "boolean" + }, + { + "name": "smsBlacklist", + "baseName": "smsBlacklist", + "type": "boolean" + }, + { + "name": "updateExistingContacts", + "baseName": "updateExistingContacts", + "type": "boolean" + }, + { + "name": "emptyContactsAttributes", + "baseName": "emptyContactsAttributes", + "type": "boolean" } ]; static getAttributeTypeMap() { - return SubAccountDetailsResponse.attributeTypeMap; + return RequestContactImport.attributeTypeMap; + } } -} -/** - * Sub-account plan details - */ -export class SubAccountDetailsResponsePlanInfo { - 'credits'?: SubAccountDetailsResponsePlanInfoCredits; - 'features'?: SubAccountDetailsResponsePlanInfoFeatures; /** - * type of the plan - */ - 'planType'?: string; + * To create a new list and import the contacts into it, pass the listName and an optional folderId. + */ + export class RequestContactImportNewList { + /** + * List with listName will be created first and users will be imported in it (Mandatory if listIds is empty). + */ + 'listName'?: string; + /** + * Id of the folder where this new list shall be created (Mandatory if listName is not empty). + */ + 'folderId'?: number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "credits", - "baseName": "credits", - "type": "SubAccountDetailsResponsePlanInfoCredits" - }, - { - "name": "features", - "baseName": "features", - "type": "SubAccountDetailsResponsePlanInfoFeatures" + "name": "listName", + "baseName": "listName", + "type": "string" }, { - "name": "planType", - "baseName": "planType", - "type": "string" + "name": "folderId", + "baseName": "folderId", + "type": "number" } ]; static getAttributeTypeMap() { - return SubAccountDetailsResponsePlanInfo.attributeTypeMap; + return RequestContactImportNewList.attributeTypeMap; + } } -} -/** - * Credits quota and remaining credits on the sub-account - */ -export class SubAccountDetailsResponsePlanInfoCredits { + export class RequestSmsRecipientExport { /** - * SMS credits remaining on the sub-account - */ - 'sms'?: number; - 'emails'?: SubAccountDetailsResponsePlanInfoCreditsEmails; + * URL that will be called once the export process is finished. For reference, https://help.sendinblue.com/hc/en-us/articles/360007666479 + */ + 'notifyURL'?: string; + /** + * Filter the recipients based on how they interacted with the campaign + */ + 'recipientsType': RequestSmsRecipientExport.RecipientsTypeEnum; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "sms", - "baseName": "sms", - "type": "number" + "name": "notifyURL", + "baseName": "notifyURL", + "type": "string" }, { - "name": "emails", - "baseName": "emails", - "type": "SubAccountDetailsResponsePlanInfoCreditsEmails" + "name": "recipientsType", + "baseName": "recipientsType", + "type": "RequestSmsRecipientExport.RecipientsTypeEnum" } ]; static getAttributeTypeMap() { - return SubAccountDetailsResponsePlanInfoCredits.attributeTypeMap; + return RequestSmsRecipientExport.attributeTypeMap; + } } -} -/** - * Email credits remaining on the sub-account - */ -export class SubAccountDetailsResponsePlanInfoCreditsEmails { + export namespace RequestSmsRecipientExport { + export enum RecipientsTypeEnum { + All = 'all', + Delivered = 'delivered', + Answered = 'answered', + SoftBounces = 'softBounces', + HardBounces = 'hardBounces', + Unsubscribed = 'unsubscribed' + } + } + export class ScheduleSmtpEmail { /** - * Quantity of email messaging limits provided - */ - 'quantity'?: number; + * Message ID of the transactional email scheduled + */ + 'messageId'?: string; + 'messageIds'?: Array; /** - * Available email messaging limits for use - */ - 'remaining'?: number; + * Batch ID of the batch transactional email scheduled + */ + 'batchId'?: string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "quantity", - "baseName": "quantity", - "type": "number" + "name": "messageId", + "baseName": "messageId", + "type": "string" }, { - "name": "remaining", - "baseName": "remaining", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return SubAccountDetailsResponsePlanInfoCreditsEmails.attributeTypeMap; - } -} - -/** - * Features available on the sub-account - */ -export class SubAccountDetailsResponsePlanInfoFeatures { - 'inbox'?: SubAccountDetailsResponsePlanInfoFeaturesInbox; - 'landingPage'?: SubAccountDetailsResponsePlanInfoFeaturesLandingPage; - 'users'?: SubAccountDetailsResponsePlanInfoFeaturesUsers; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "inbox", - "baseName": "inbox", - "type": "SubAccountDetailsResponsePlanInfoFeaturesInbox" - }, - { - "name": "landingPage", - "baseName": "landingPage", - "type": "SubAccountDetailsResponsePlanInfoFeaturesLandingPage" + "name": "messageIds", + "baseName": "messageIds", + "type": "Array" }, { - "name": "users", - "baseName": "users", - "type": "SubAccountDetailsResponsePlanInfoFeaturesUsers" + "name": "batchId", + "baseName": "batchId", + "type": "string" } ]; static getAttributeTypeMap() { - return SubAccountDetailsResponsePlanInfoFeatures.attributeTypeMap; + return ScheduleSmtpEmail.attributeTypeMap; + } } -} -/** - * Inbox details - */ -export class SubAccountDetailsResponsePlanInfoFeaturesInbox { - /** - * Quantity of inbox provided - */ - 'quantity'?: number; + export class SendReport { /** - * Available inboxes for use - */ - 'remaining'?: number; + * Language of email content for campaign report sending. + */ + 'language'?: SendReport.LanguageEnum; + 'email': SendReportEmail; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "quantity", - "baseName": "quantity", - "type": "number" + "name": "language", + "baseName": "language", + "type": "SendReport.LanguageEnum" }, { - "name": "remaining", - "baseName": "remaining", - "type": "number" + "name": "email", + "baseName": "email", + "type": "SendReportEmail" } ]; static getAttributeTypeMap() { - return SubAccountDetailsResponsePlanInfoFeaturesInbox.attributeTypeMap; + return SendReport.attributeTypeMap; + } } -} -/** - * Landing page details - */ -export class SubAccountDetailsResponsePlanInfoFeaturesLandingPage { + export namespace SendReport { + export enum LanguageEnum { + Fr = 'fr', + Es = 'es', + Pt = 'pt', + It = 'it', + De = 'de', + En = 'en' + } + } /** - * Quantity of landing pages provided - */ - 'quantity'?: number; + * Custom attributes for the report email. + */ + export class SendReportEmail { /** - * Available landing pages for use - */ - 'remaining'?: number; + * Email addresses of the recipients + */ + 'to': Array; + /** + * Custom text message to be presented in the report email. + */ + 'body': string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "quantity", - "baseName": "quantity", - "type": "number" + "name": "to", + "baseName": "to", + "type": "Array" }, { - "name": "remaining", - "baseName": "remaining", - "type": "number" + "name": "body", + "baseName": "body", + "type": "string" } ]; static getAttributeTypeMap() { - return SubAccountDetailsResponsePlanInfoFeaturesLandingPage.attributeTypeMap; + return SendReportEmail.attributeTypeMap; + } } -} -/** - * Multi-account details - */ -export class SubAccountDetailsResponsePlanInfoFeaturesUsers { + export class SendSms { + 'reference': string; + 'messageId': number; /** - * Quantity of multi-account's provided - */ - 'quantity'?: number; + * Count of SMS's to send multiple text messages + */ + 'smsCount'?: number; /** - * Available multi-accounts for use - */ - 'remaining'?: number; + * SMS credits used per text message + */ + 'usedCredits'?: number; + /** + * Remaining SMS credits of the user + */ + 'remainingCredits'?: number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "quantity", - "baseName": "quantity", - "type": "number" + "name": "reference", + "baseName": "reference", + "type": "string" }, { - "name": "remaining", - "baseName": "remaining", + "name": "messageId", + "baseName": "messageId", "type": "number" - } ]; - - static getAttributeTypeMap() { - return SubAccountDetailsResponsePlanInfoFeaturesUsers.attributeTypeMap; - } -} - -/** - * Details of the plan to be changed - */ -export class SubAccountUpdatePlanRequest { - 'credits'?: SubAccountUpdatePlanRequestCredits; - 'features'?: SubAccountUpdatePlanRequestFeatures; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + }, { - "name": "credits", - "baseName": "credits", - "type": "SubAccountUpdatePlanRequestCredits" + "name": "smsCount", + "baseName": "smsCount", + "type": "number" }, { - "name": "features", - "baseName": "features", - "type": "SubAccountUpdatePlanRequestFeatures" - } ]; - - static getAttributeTypeMap() { - return SubAccountUpdatePlanRequest.attributeTypeMap; - } -} - -/** - * Credit details to update - */ -export class SubAccountUpdatePlanRequestCredits { - /** - * Number of email credits - */ - 'email'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + "name": "usedCredits", + "baseName": "usedCredits", + "type": "number" + }, { - "name": "email", - "baseName": "email", + "name": "remainingCredits", + "baseName": "remainingCredits", "type": "number" } ]; static getAttributeTypeMap() { - return SubAccountUpdatePlanRequestCredits.attributeTypeMap; + return SendSms.attributeTypeMap; + } } -} -/** - * Features details to update - */ -export class SubAccountUpdatePlanRequestFeatures { + export class SendSmtpEmail { + 'sender'?: SendSmtpEmailSender; /** - * Number of multi-users - */ - 'users'?: number; + * Mandatory if messageVersions are not passed, ignored if messageVersions are passed. List of email addresses and names (optional) of the recipients. For example, [{\"name\":\"Jimmy\", \"email\":\"jimmy98@example.com\"}, {\"name\":\"Joe\", \"email\":\"joe@example.com\"}] + */ + 'to'?: Array; /** - * Number of landing pages - */ - 'landingPage'?: number; + * List of email addresses and names (optional) of the recipients in bcc + */ + 'bcc'?: Array; /** - * Number of inboxes - */ - 'inbox'?: number; + * List of email addresses and names (optional) of the recipients in cc + */ + 'cc'?: Array; + /** + * HTML body of the message ( Mandatory if 'templateId' is not passed, ignored if 'templateId' is passed ) + */ + 'htmlContent'?: string; + /** + * Plain Text body of the message ( Ignored if 'templateId' is passed ) + */ + 'textContent'?: string; + /** + * Subject of the message. Mandatory if 'templateId' is not passed + */ + 'subject'?: string; + 'replyTo'?: SendSmtpEmailReplyTo; + /** + * Pass the absolute URL (no local file) or the base64 content of the attachment along with the attachment name (Mandatory if attachment content is passed). For example, `[{\"url\":\"https://attachment.domain.com/myAttachmentFromUrl.jpg\", \"name\":\"myAttachmentFromUrl.jpg\"}, {\"content\":\"base64 example content\", \"name\":\"myAttachmentFromBase64.jpg\"}]`. Allowed extensions for attachment file: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub, eps, odt, mp3, m4a, m4v, wma, ogg, flac, wav, aif, aifc, aiff, mp4, mov, avi, mkv, mpeg, mpg, wmv, pkpass and xlsm ( If 'templateId' is passed and is in New Template Language format then both attachment url and content are accepted. If template is in Old template Language format, then 'attachment' is ignored ) + */ + 'attachment'?: Array; + /** + * Pass the set of custom headers (not the standard headers) that shall be sent along the mail headers in the original email. 'sender.ip' header can be set (only for dedicated ip users) to mention the IP to be used for sending transactional emails. Headers are allowed in `This-Case-Only` (i.e. words separated by hyphen with first letter of each word in capital letter), they will be converted to such case styling if not in this format in the request payload. For example, `{\"sender.ip\":\"1.2.3.4\", \"X-Mailin-custom\":\"some_custom_header\", \"idempotencyKey\":\"abc-123\"}`. + */ + 'headers'?: any; + /** + * Id of the template. + */ + 'templateId'?: number; + /** + * Pass the set of attributes to customize the template. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}. It's considered only if template is in New Template Language format. + */ + 'params'?: any; + /** + * You can customize and send out multiple versions of a mail. templateId can be customized only if global parameter contains templateId. htmlContent and textContent can be customized only if any of the two, htmlContent or textContent, is present in global parameters. Some global parameters such as **to(mandatory), bcc, cc, replyTo, subject** can also be customized specific to each version. Total number of recipients in one API request must not exceed 2000. However, you can still pass upto 99 recipients maximum in one message version. The size of individual params in all the messageVersions shall not exceed 100 KB limit and that of cumulative params shall not exceed 1000 KB. You can follow this **step-by-step guide** on how to use **messageVersions** to batch send emails - https://developers.sendinblue.com/docs/batch-send-transactional-emails + */ + 'messageVersions'?: Array; + /** + * Tag your emails to find them more easily + */ + 'tags'?: Array; + /** + * UTC date-time on which the email has to schedule (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for scheduling. There can be an expected delay of +5 minutes in scheduled email delivery. **Please note this feature is currently a public beta**. + */ + 'scheduledAt'?: Date; + /** + * Valid UUIDv4 batch id to identify the scheduled batches transactional email. If not passed we will create a valid UUIDv4 batch id at our end. + */ + 'batchId'?: string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "users", - "baseName": "users", - "type": "number" + "name": "sender", + "baseName": "sender", + "type": "SendSmtpEmailSender" }, { - "name": "landingPage", - "baseName": "landingPage", - "type": "number" + "name": "to", + "baseName": "to", + "type": "Array" }, { - "name": "inbox", - "baseName": "inbox", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return SubAccountUpdatePlanRequestFeatures.attributeTypeMap; - } -} - -export class SubAccountsResponse { - /** - * Total number of subaccounts - */ - 'count'?: number; - 'subAccounts'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + "name": "bcc", + "baseName": "bcc", + "type": "Array" + }, { - "name": "count", - "baseName": "count", - "type": "number" + "name": "cc", + "baseName": "cc", + "type": "Array" }, { - "name": "subAccounts", - "baseName": "subAccounts", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return SubAccountsResponse.attributeTypeMap; - } -} - -export class SubAccountsResponseSubAccounts { - /** - * id of the sub-account - */ - 'id': number; - /** - * Name of the sub-account company - */ - 'companyName': string; - /** - * Whether the sub-account is active or not - */ - 'active': boolean; - /** - * Timestamp when the sub-account was created - */ - 'createdAt': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + "name": "htmlContent", + "baseName": "htmlContent", + "type": "string" + }, { - "name": "id", - "baseName": "id", - "type": "number" + "name": "textContent", + "baseName": "textContent", + "type": "string" }, { - "name": "companyName", - "baseName": "companyName", + "name": "subject", + "baseName": "subject", "type": "string" }, { - "name": "active", - "baseName": "active", - "type": "boolean" + "name": "replyTo", + "baseName": "replyTo", + "type": "SendSmtpEmailReplyTo" }, { - "name": "createdAt", - "baseName": "createdAt", + "name": "attachment", + "baseName": "attachment", + "type": "Array" + }, + { + "name": "headers", + "baseName": "headers", + "type": "any" + }, + { + "name": "templateId", + "baseName": "templateId", "type": "number" + }, + { + "name": "params", + "baseName": "params", + "type": "any" + }, + { + "name": "messageVersions", + "baseName": "messageVersions", + "type": "Array" + }, + { + "name": "tags", + "baseName": "tags", + "type": "Array" + }, + { + "name": "scheduledAt", + "baseName": "scheduledAt", + "type": "Date" + }, + { + "name": "batchId", + "baseName": "batchId", + "type": "string" } ]; static getAttributeTypeMap() { - return SubAccountsResponseSubAccounts.attributeTypeMap; + return SendSmtpEmail.attributeTypeMap; + } } -} -/** - * Task Details - */ -export class Task { - /** - * Unique task id - */ - 'id'?: string; - /** - * Id for type of task e.g Call / Email / Meeting etc. - */ - 'taskTypeId': string; - /** - * Name of task - */ - 'name': string; + export class SendSmtpEmailAttachment { /** - * Contact ids for contacts linked to this task - */ - 'contactsIds'?: Array; + * Absolute url of the attachment (no local file). + */ + 'url'?: string; /** - * Deal ids for deals a task is linked to - */ - 'dealsIds'?: Array; + * Base64 encoded chunk data of the attachment generated on the fly + */ + 'content'?: string; /** - * Companies ids for companies a task is linked to - */ - 'companiesIds'?: Array; + * Required if content is passed. Name of the attachment + */ + 'name'?: string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "id", - "baseName": "id", + "name": "url", + "baseName": "url", "type": "string" }, { - "name": "taskTypeId", - "baseName": "taskTypeId", + "name": "content", + "baseName": "content", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" - }, - { - "name": "contactsIds", - "baseName": "contactsIds", - "type": "Array" - }, + } ]; + + static getAttributeTypeMap() { + return SendSmtpEmailAttachment.attributeTypeMap; + } + } + + export class SendSmtpEmailBcc { + /** + * Email address of the recipient in bcc + */ + 'email': string; + /** + * Name of the recipient in bcc. Maximum allowed characters are 70. + */ + 'name'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "dealsIds", - "baseName": "dealsIds", - "type": "Array" + "name": "email", + "baseName": "email", + "type": "string" }, { - "name": "companiesIds", - "baseName": "companiesIds", - "type": "Array" + "name": "name", + "baseName": "name", + "type": "string" } ]; static getAttributeTypeMap() { - return Task.attributeTypeMap; + return SendSmtpEmailBcc.attributeTypeMap; + } } -} -/** - * List of tasks - */ -export class TaskList { + export class SendSmtpEmailCc { /** - * List of tasks - */ - 'items'?: Array; + * Email address of the recipient in cc + */ + 'email': string; + /** + * Name of the recipient in cc. Maximum allowed characters are 70. + */ + 'name'?: string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "items", - "baseName": "items", - "type": "Array" + "name": "email", + "baseName": "email", + "type": "string" + }, + { + "name": "name", + "baseName": "name", + "type": "string" } ]; static getAttributeTypeMap() { - return TaskList.attributeTypeMap; + return SendSmtpEmailCc.attributeTypeMap; + } } -} -/** - * Task reminder date/time for a task - */ -export class TaskReminder { + export class SendSmtpEmailMessageVersions { /** - * Value of time unit before reminder is to be sent - */ - 'value': number; + * List of email addresses and names (_optional_) of the recipients. For example, [{\"name\":\"Jimmy\", \"email\":\"jimmy98@example.com\"}, {\"name\":\"Joe\", \"email\":\"joe@example.com\"}] + */ + 'to': Array; /** - * Unit of time before reminder is to be sent - */ - 'unit': TaskReminder.UnitEnum; + * Pass the set of attributes to customize the template. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}. It's considered only if template is in New Template Language format. + */ + 'params'?: { [key: string]: any; }; /** - * Type of task reminder e.g email, push - */ - 'types': Array; + * List of email addresses and names (optional) of the recipients in bcc + */ + 'bcc'?: Array; + /** + * List of email addresses and names (optional) of the recipients in cc + */ + 'cc'?: Array; + 'replyTo'?: SendSmtpEmailReplyTo1; + /** + * Custom subject specific to message version + */ + 'subject'?: string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "value", - "baseName": "value", - "type": "number" + "name": "to", + "baseName": "to", + "type": "Array" }, { - "name": "unit", - "baseName": "unit", - "type": "TaskReminder.UnitEnum" + "name": "params", + "baseName": "params", + "type": "{ [key: string]: any; }" }, { - "name": "types", - "baseName": "types", - "type": "Array" + "name": "bcc", + "baseName": "bcc", + "type": "Array" + }, + { + "name": "cc", + "baseName": "cc", + "type": "Array" + }, + { + "name": "replyTo", + "baseName": "replyTo", + "type": "SendSmtpEmailReplyTo1" + }, + { + "name": "subject", + "baseName": "subject", + "type": "string" } ]; static getAttributeTypeMap() { - return TaskReminder.attributeTypeMap; + return SendSmtpEmailMessageVersions.attributeTypeMap; } -} - -export namespace TaskReminder { - export enum UnitEnum { - Minutes = 'minutes', - Hours = 'hours', - Weeks = 'weeks', - Days = 'days' } -} -/** - * Task types details - */ -export class TaskTypes { + /** - * Id of task type - */ - 'id'?: string; + * Email (required), along with name (optional), on which transactional mail recipients will be able to reply back. For example, {\"email\":\"ann6533@example.com\", \"name\":\"Ann\"}. + */ + export class SendSmtpEmailReplyTo { /** - * Title of task type - */ - 'title'?: string; + * Email address in reply to + */ + 'email': string; + /** + * Name in reply to. Maximum allowed characters are 70. + */ + 'name'?: string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "id", - "baseName": "id", + "name": "email", + "baseName": "email", "type": "string" }, { - "name": "title", - "baseName": "title", + "name": "name", + "baseName": "name", "type": "string" } ]; static getAttributeTypeMap() { - return TaskTypes.attributeTypeMap; + return SendSmtpEmailReplyTo.attributeTypeMap; + } } -} -export class UpdateAttribute { /** - * Value of the attribute to update. Use only if the attribute's category is 'calculated' or 'global' - */ - 'value'?: string; + * Email (required), along with name (optional), on which transactional mail recipients will be able to reply back. For example, {\"email\":\"ann6533@example.com\", \"name\":\"Ann\"} + */ + export class SendSmtpEmailReplyTo1 { /** - * List of the values and labels that the attribute can take. Use only if the attribute's category is \"category\". For example, [{\"value\":1, \"label\":\"male\"}, {\"value\":2, \"label\":\"female\"}] - */ - 'enumeration'?: Array; + * Email address in reply to + */ + 'email': string; + /** + * Name in reply to. Maximum allowed characters are 70. + */ + 'name'?: string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "value", - "baseName": "value", + "name": "email", + "baseName": "email", "type": "string" }, { - "name": "enumeration", - "baseName": "enumeration", - "type": "Array" + "name": "name", + "baseName": "name", + "type": "string" } ]; static getAttributeTypeMap() { - return UpdateAttribute.attributeTypeMap; + return SendSmtpEmailReplyTo1.attributeTypeMap; + } } -} -export class UpdateAttributeEnumeration { /** - * Id of the value - */ - 'value': number; + * Mandatory if `templateId` is not passed. Pass `name` (optional) and `email` OR `id` of sender from which emails will be sent. `name` will be ignored if passed along with sender `id`. For example, {\"name\":\"Mary from MyShop\", \"email\":\"no-reply@myshop.com\"} or {\"id\":2} + */ + export class SendSmtpEmailSender { /** - * Label of the value - */ - 'label': string; + * Name of the sender from which the emails will be sent. Maximum allowed characters are 70. Applicable only when email is passed. + */ + 'name'?: string; + /** + * Email of the sender from which the emails will be sent. Mandatory if sender id is not passed. + */ + 'email'?: string; + /** + * Id of the sender from which the emails will be sent. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). Mandatory if email is not passed. + */ + 'id'?: number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "value", - "baseName": "value", - "type": "number" + "name": "name", + "baseName": "name", + "type": "string" }, { - "name": "label", - "baseName": "label", + "name": "email", + "baseName": "email", "type": "string" + }, + { + "name": "id", + "baseName": "id", + "type": "number" } ]; static getAttributeTypeMap() { - return UpdateAttributeEnumeration.attributeTypeMap; + return SendSmtpEmailSender.attributeTypeMap; + } } -} -export class UpdateBatchContacts { + export class SendSmtpEmailTo { /** - * List of contacts to be updated - */ - 'contacts'?: Array; + * Email address of the recipient + */ + 'email': string; + /** + * Name of the recipient. Maximum allowed characters are 70. + */ + 'name'?: string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "contacts", - "baseName": "contacts", - "type": "Array" + "name": "email", + "baseName": "email", + "type": "string" + }, + { + "name": "name", + "baseName": "name", + "type": "string" } ]; static getAttributeTypeMap() { - return UpdateBatchContacts.attributeTypeMap; + return SendSmtpEmailTo.attributeTypeMap; + } } -} -export class UpdateBatchContactsContacts { - /** - * Email address of the user to be updated (For each operation only pass one of the supported contact identifiers. Email, id or sms) - */ - 'email'?: string; - /** - * id of the user to be updated (For each operation only pass one of the supported contact identifiers. Email, id or sms) - */ - 'id'?: number; - /** - * SMS of the user to be updated (For each operation only pass one of the supported contact identifiers. Email, id or sms) - */ - 'sms'?: string; - /** - * Pass the set of attributes to be updated. **These attributes must be present in your account**. To update existing email address of a contact with the new one please pass EMAIL in attribtes. For example, **{ \"EMAIL\":\"newemail@domain.com\", \"FNAME\":\"Ellie\", \"LNAME\":\"Roger\"}**. Keep in mind transactional attributes can be updated the same way as normal attributes. Mobile Number in **SMS** field should be passed with proper country code. For example: **{\"SMS\":\"+91xxxxxxxxxx\"} or {\"SMS\":\"0091xxxxxxxxxx\"}** - */ - 'attributes'?: { [key: string]: any; }; - /** - * Set/unset this field to blacklist/allow the contact for emails (emailBlacklisted = true) - */ - 'emailBlacklisted'?: boolean; - /** - * Set/unset this field to blacklist/allow the contact for SMS (smsBlacklisted = true) - */ - 'smsBlacklisted'?: boolean; + export class SendSmtpEmailTo1 { /** - * Ids of the lists to add the contact to - */ - 'listIds'?: Array; - /** - * Ids of the lists to remove the contact from - */ - 'unlinkListIds'?: Array; + * Email address of the recipient + */ + 'email': string; /** - * transactional email forbidden sender for contact. Use only for email Contact - */ - 'smtpBlacklistSender'?: Array; + * Name of the recipient. **Maximum allowed characters are 70**. + */ + 'name'?: string; static discriminator: string | undefined = undefined; @@ -9501,1114 +9716,2047 @@ export class UpdateBatchContactsContacts { "type": "string" }, { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "sms", - "baseName": "sms", + "name": "name", + "baseName": "name", "type": "string" - }, - { - "name": "attributes", - "baseName": "attributes", - "type": "{ [key: string]: any; }" - }, - { - "name": "emailBlacklisted", - "baseName": "emailBlacklisted", - "type": "boolean" - }, - { - "name": "smsBlacklisted", - "baseName": "smsBlacklisted", - "type": "boolean" - }, - { - "name": "listIds", - "baseName": "listIds", - "type": "Array" - }, - { - "name": "unlinkListIds", - "baseName": "unlinkListIds", - "type": "Array" - }, - { - "name": "smtpBlacklistSender", - "baseName": "smtpBlacklistSender", - "type": "Array" } ]; static getAttributeTypeMap() { - return UpdateBatchContactsContacts.attributeTypeMap; + return SendSmtpEmailTo1.attributeTypeMap; + } } -} -export class UpdateBatchContactsModel { - 'successIds'?: Array; - 'failureIds'?: Array; + export class SendTestEmail { + /** + * List of the email addresses of the recipients whom you wish to send the test mail. If left empty, the test mail will be sent to your entire test list. You can not send more than 50 test emails per day. + */ + 'emailTo'?: Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "successIds", - "baseName": "successIds", - "type": "Array" - }, - { - "name": "failureIds", - "baseName": "failureIds", - "type": "Array" + "name": "emailTo", + "baseName": "emailTo", + "type": "Array" } ]; static getAttributeTypeMap() { - return UpdateBatchContactsModel.attributeTypeMap; + return SendTestEmail.attributeTypeMap; + } } -} -/** - * Status of the campaign - */ -export class UpdateCampaignStatus { + export class SendTestSms { /** - * Note:- replicateTemplate status will be available only for template type campaigns. - */ - 'status'?: UpdateCampaignStatus.StatusEnum; + * Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted + */ + 'phoneNumber'?: string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "status", - "baseName": "status", - "type": "UpdateCampaignStatus.StatusEnum" + "name": "phoneNumber", + "baseName": "phoneNumber", + "type": "string" } ]; static getAttributeTypeMap() { - return UpdateCampaignStatus.attributeTypeMap; + return SendTestSms.attributeTypeMap; } -} - -export namespace UpdateCampaignStatus { - export enum StatusEnum { - Suspended = 'suspended', - Archive = 'archive', - Darchive = 'darchive', - Sent = 'sent', - Queued = 'queued', - Replicate = 'replicate', - ReplicateTemplate = 'replicateTemplate', - Draft = 'draft' } -} -export class UpdateChild { + + export class SendTransacSms { /** - * New Email address to update the child account - */ - 'email'?: string; + * Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** + */ + 'sender': string; /** - * New First name to use to update the child account - */ - 'firstName'?: string; + * Mobile number to send SMS with the country code + */ + 'recipient': string; /** - * New Last name to use to update the child account - */ - 'lastName'?: string; + * Content of the message. If more than 160 characters long, will be sent as multiple text messages + */ + 'content': string; /** - * New Company name to use to update the child account - */ - 'companyName'?: string; + * Type of the SMS. Marketing SMS messages are those sent typically with marketing content. Transactional SMS messages are sent to individuals and are triggered in response to some action, such as a sign-up, purchase, etc. + */ + 'type'?: SendTransacSms.TypeEnum; /** - * New password for the child account to login - */ - 'password'?: string; + * Tag of the message + */ + 'tag'?: string; + /** + * Webhook to call for each event triggered by the message (delivered etc.) + */ + 'webUrl'?: string; + /** + * Format of the message. It indicates whether the content should be treated as unicode or not. + */ + 'unicodeEnabled'?: boolean; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "email", - "baseName": "email", + "name": "sender", + "baseName": "sender", "type": "string" }, { - "name": "firstName", - "baseName": "firstName", + "name": "recipient", + "baseName": "recipient", "type": "string" }, { - "name": "lastName", - "baseName": "lastName", + "name": "content", + "baseName": "content", "type": "string" }, { - "name": "companyName", - "baseName": "companyName", + "name": "type", + "baseName": "type", + "type": "SendTransacSms.TypeEnum" + }, + { + "name": "tag", + "baseName": "tag", "type": "string" }, { - "name": "password", - "baseName": "password", + "name": "webUrl", + "baseName": "webUrl", "type": "string" + }, + { + "name": "unicodeEnabled", + "baseName": "unicodeEnabled", + "type": "boolean" } ]; static getAttributeTypeMap() { - return UpdateChild.attributeTypeMap; + return SendTransacSms.attributeTypeMap; + } } -} -export class UpdateChildAccountStatus { - /** - * Status of Transactional Email Platform activation for your account (true=enabled, false=disabled) - */ - 'transactionalEmail'?: boolean; - /** - * Status of Transactional SMS Platform activation for your account (true=enabled, false=disabled) - */ - 'transactionalSms'?: boolean; + export namespace SendTransacSms { + export enum TypeEnum { + Transactional = 'transactional', + Marketing = 'marketing' + } + } + export class SsoTokenRequest { /** - * Status of Marketing Automation Platform activation for your account (true=enabled, false=disabled) - */ - 'marketingAutomation'?: boolean; + * Id of the sub-account organization + */ + 'id': number; /** - * Status of SMS Campaign Platform activation for your account (true=enabled, false=disabled) - */ - 'smsCampaign'?: boolean; + * User email of sub-account organization + */ + 'email'?: string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "transactionalEmail", - "baseName": "transactionalEmail", - "type": "boolean" + "name": "id", + "baseName": "id", + "type": "number" }, { - "name": "transactionalSms", - "baseName": "transactionalSms", - "type": "boolean" + "name": "email", + "baseName": "email", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return SsoTokenRequest.attributeTypeMap; + } + } + + export class SubAccountDetailsResponse { + /** + * Name of the sub-account user + */ + 'name'?: string; + /** + * Email id of the sub-account organization + */ + 'email'?: string; + /** + * Sub-account company name + */ + 'companyName'?: string; + 'planInfo'?: SubAccountDetailsResponsePlanInfo; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "name", + "baseName": "name", + "type": "string" }, { - "name": "marketingAutomation", - "baseName": "marketingAutomation", - "type": "boolean" + "name": "email", + "baseName": "email", + "type": "string" }, { - "name": "smsCampaign", - "baseName": "smsCampaign", - "type": "boolean" + "name": "companyName", + "baseName": "companyName", + "type": "string" + }, + { + "name": "planInfo", + "baseName": "planInfo", + "type": "SubAccountDetailsResponsePlanInfo" } ]; static getAttributeTypeMap() { - return UpdateChildAccountStatus.attributeTypeMap; + return SubAccountDetailsResponse.attributeTypeMap; + } } -} -export class UpdateChildDomain { /** - * Value for the sender domain that will replace the existing domain - */ - 'domain'?: string; + * Sub-account plan details + */ + export class SubAccountDetailsResponsePlanInfo { + 'credits'?: SubAccountDetailsResponsePlanInfoCredits; + 'features'?: SubAccountDetailsResponsePlanInfoFeatures; + /** + * type of the plan + */ + 'planType'?: string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "domain", - "baseName": "domain", + "name": "credits", + "baseName": "credits", + "type": "SubAccountDetailsResponsePlanInfoCredits" + }, + { + "name": "features", + "baseName": "features", + "type": "SubAccountDetailsResponsePlanInfoFeatures" + }, + { + "name": "planType", + "baseName": "planType", "type": "string" } ]; static getAttributeTypeMap() { - return UpdateChildDomain.attributeTypeMap; + return SubAccountDetailsResponsePlanInfo.attributeTypeMap; + } } -} -export class UpdateContact { - /** - * Pass the set of attributes to be updated. These attributes must be present in your account. To update existing email address of a contact with the new one please pass EMAIL in attributes. For example, `{ \"EMAIL\":\"newemail@domain.com\", \"FNAME\":\"Ellie\", \"LNAME\":\"Roger\"}`. The attribute's parameter should be passed in capital letter while updating a contact. Keep in mind transactional attributes can be updated the same way as normal attributes. Mobile Number in \"SMS\" field should be passed with proper country code. For example {\"SMS\":\"+91xxxxxxxxxx\"} or {\"SMS\":\"0091xxxxxxxxxx\"} - */ - 'attributes'?: any; /** - * Set/unset this field to blacklist/allow the contact for emails (emailBlacklisted = true) - */ - 'emailBlacklisted'?: boolean; + * Credits quota and remaining credits on the sub-account + */ + export class SubAccountDetailsResponsePlanInfoCredits { /** - * Set/unset this field to blacklist/allow the contact for SMS (smsBlacklisted = true) - */ - 'smsBlacklisted'?: boolean; + * SMS credits remaining on the sub-account + */ + 'sms'?: number; + 'emails'?: SubAccountDetailsResponsePlanInfoCreditsEmails; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "sms", + "baseName": "sms", + "type": "number" + }, + { + "name": "emails", + "baseName": "emails", + "type": "SubAccountDetailsResponsePlanInfoCreditsEmails" + } ]; + + static getAttributeTypeMap() { + return SubAccountDetailsResponsePlanInfoCredits.attributeTypeMap; + } + } + /** - * Ids of the lists to add the contact to - */ - 'listIds'?: Array; + * Email credits remaining on the sub-account + */ + export class SubAccountDetailsResponsePlanInfoCreditsEmails { /** - * Ids of the lists to remove the contact from - */ - 'unlinkListIds'?: Array; + * Quantity of email messaging limits provided + */ + 'quantity'?: number; /** - * transactional email forbidden sender for contact. Use only for email Contact - */ - 'smtpBlacklistSender'?: Array; + * Available email messaging limits for use + */ + 'remaining'?: number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "attributes", - "baseName": "attributes", - "type": "any" - }, - { - "name": "emailBlacklisted", - "baseName": "emailBlacklisted", - "type": "boolean" + "name": "quantity", + "baseName": "quantity", + "type": "number" }, { - "name": "smsBlacklisted", - "baseName": "smsBlacklisted", - "type": "boolean" - }, + "name": "remaining", + "baseName": "remaining", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return SubAccountDetailsResponsePlanInfoCreditsEmails.attributeTypeMap; + } + } + + /** + * Features available on the sub-account + */ + export class SubAccountDetailsResponsePlanInfoFeatures { + 'inbox'?: SubAccountDetailsResponsePlanInfoFeaturesInbox; + 'landingPage'?: SubAccountDetailsResponsePlanInfoFeaturesLandingPage; + 'users'?: SubAccountDetailsResponsePlanInfoFeaturesUsers; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "listIds", - "baseName": "listIds", - "type": "Array" + "name": "inbox", + "baseName": "inbox", + "type": "SubAccountDetailsResponsePlanInfoFeaturesInbox" }, { - "name": "unlinkListIds", - "baseName": "unlinkListIds", - "type": "Array" + "name": "landingPage", + "baseName": "landingPage", + "type": "SubAccountDetailsResponsePlanInfoFeaturesLandingPage" }, { - "name": "smtpBlacklistSender", - "baseName": "smtpBlacklistSender", - "type": "Array" + "name": "users", + "baseName": "users", + "type": "SubAccountDetailsResponsePlanInfoFeaturesUsers" } ]; static getAttributeTypeMap() { - return UpdateContact.attributeTypeMap; + return SubAccountDetailsResponsePlanInfoFeatures.attributeTypeMap; + } } -} -export class UpdateEmailCampaign { - /** - * Tag of the campaign - */ - 'tag'?: string; - 'sender'?: UpdateEmailCampaignSender; - /** - * Name of the campaign - */ - 'name'?: string; - /** - * Body of the message (HTML version). If the campaign is designed using Drag & Drop editor via HTML content, then the design page will not have Drag & Drop editor access for that campaign. REQUIRED if htmlUrl is empty - */ - 'htmlContent'?: string; - /** - * Url which contents the body of the email message. REQUIRED if htmlContent is empty - */ - 'htmlUrl'?: string; - /** - * UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. If sendAtBestTime is set to true, your campaign will be sent according to the date passed (ignoring the time part). - */ - 'scheduledAt'?: string; - /** - * Subject of the campaign - */ - 'subject'?: string; - /** - * Email on which campaign recipients will be able to reply to - */ - 'replyTo'?: string; - /** - * To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization - */ - 'toField'?: string; - 'recipients'?: UpdateEmailCampaignRecipients; - /** - * Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps - */ - 'attachmentUrl'?: string; - /** - * Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. You cannot send a campaign of more than 4MB with images embedded in the email. Campaigns with the images embedded in the email must be sent to less than 5000 contacts. - */ - 'inlineImageActivation'?: boolean; - /** - * Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign - */ - 'mirrorActive'?: boolean; - /** - * FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times - */ - 'recurring'?: boolean; - /** - * Footer of the email campaign - */ - 'footer'?: string; - /** - * Header of the email campaign - */ - 'header'?: string; - /** - * Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed - */ - 'utmCampaign'?: string; - /** - * Pass the set of attributes to customize the type 'classic' campaign. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}. The 'params' field will get updated, only if the campaign is in New Template Language, else ignored. The New Template Language is dependent on the values of 'subject', 'htmlContent/htmlUrl', 'sender.name' & 'toField' - */ - 'params'?: any; - /** - * Set this to true if you want to send your campaign at best time. Note:- if true, warmup ip will be disabled. - */ - 'sendAtBestTime'?: boolean; - /** - * Status of A/B Test. abTesting = false means it is disabled, & abTesting = true means it is enabled. 'subjectA', 'subjectB', 'splitRule', 'winnerCriteria' & 'winnerDelay' will be considered if abTesting is set to true. 'subject' if passed is ignored. Can be set to true only if 'sendAtBestTime' is 'false'. You will be able to set up two subject lines for your campaign and send them to a random sample of your total recipients. Half of the test group will receive version A, and the other half will receive version B - */ - 'abTesting'?: boolean; - /** - * Subject A of the campaign. Considered if abTesting = true. subjectA & subjectB should have unique value - */ - 'subjectA'?: string; - /** - * Subject B of the campaign. Considered if abTesting = true. subjectA & subjectB should have unique value - */ - 'subjectB'?: string; /** - * Add the size of your test groups. Considered if abTesting = true. We'll send version A and B to a random sample of recipients, and then the winning version to everyone else - */ - 'splitRule'?: number; - /** - * Choose the metrics that will determinate the winning version. Considered if 'splitRule' >= 1 and < 50. If splitRule = 50, 'winnerCriteria' is ignored if passed or alreday exist in record - */ - 'winnerCriteria'?: UpdateEmailCampaign.WinnerCriteriaEnum; - /** - * Choose the duration of the test in hours. Maximum is 7 days, pass 24*7 = 168 hours. The winning version will be sent at the end of the test. Considered if 'splitRule' >= 1 and < 50. If splitRule = 50, 'winnerDelay' is ignored if passed or alreday exist in record - */ - 'winnerDelay'?: number; + * Inbox details + */ + export class SubAccountDetailsResponsePlanInfoFeaturesInbox { /** - * Available for dedicated ip clients. Set this to true if you wish to warm up your ip. - */ - 'ipWarmupEnable'?: boolean; - /** - * Set an initial quota greater than 1 for warming up your ip. We recommend you set a value of 3000. - */ - 'initialQuota'?: number; + * Quantity of inbox provided + */ + 'quantity'?: number; /** - * Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%. - */ - 'increaseRate'?: number; + * Available inboxes for use + */ + 'remaining'?: number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "tag", - "baseName": "tag", - "type": "string" - }, - { - "name": "sender", - "baseName": "sender", - "type": "UpdateEmailCampaignSender" + "name": "quantity", + "baseName": "quantity", + "type": "number" }, { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "htmlContent", - "baseName": "htmlContent", - "type": "string" - }, - { - "name": "htmlUrl", - "baseName": "htmlUrl", - "type": "string" - }, - { - "name": "scheduledAt", - "baseName": "scheduledAt", - "type": "string" - }, - { - "name": "subject", - "baseName": "subject", - "type": "string" - }, - { - "name": "replyTo", - "baseName": "replyTo", - "type": "string" - }, - { - "name": "toField", - "baseName": "toField", - "type": "string" - }, - { - "name": "recipients", - "baseName": "recipients", - "type": "UpdateEmailCampaignRecipients" - }, - { - "name": "attachmentUrl", - "baseName": "attachmentUrl", - "type": "string" - }, - { - "name": "inlineImageActivation", - "baseName": "inlineImageActivation", - "type": "boolean" - }, - { - "name": "mirrorActive", - "baseName": "mirrorActive", - "type": "boolean" - }, - { - "name": "recurring", - "baseName": "recurring", - "type": "boolean" - }, - { - "name": "footer", - "baseName": "footer", - "type": "string" - }, - { - "name": "header", - "baseName": "header", - "type": "string" - }, - { - "name": "utmCampaign", - "baseName": "utmCampaign", - "type": "string" - }, - { - "name": "params", - "baseName": "params", - "type": "any" - }, - { - "name": "sendAtBestTime", - "baseName": "sendAtBestTime", - "type": "boolean" - }, - { - "name": "abTesting", - "baseName": "abTesting", - "type": "boolean" - }, - { - "name": "subjectA", - "baseName": "subjectA", - "type": "string" - }, - { - "name": "subjectB", - "baseName": "subjectB", - "type": "string" - }, - { - "name": "splitRule", - "baseName": "splitRule", - "type": "number" - }, - { - "name": "winnerCriteria", - "baseName": "winnerCriteria", - "type": "UpdateEmailCampaign.WinnerCriteriaEnum" - }, - { - "name": "winnerDelay", - "baseName": "winnerDelay", - "type": "number" - }, - { - "name": "ipWarmupEnable", - "baseName": "ipWarmupEnable", - "type": "boolean" - }, - { - "name": "initialQuota", - "baseName": "initialQuota", - "type": "number" - }, - { - "name": "increaseRate", - "baseName": "increaseRate", + "name": "remaining", + "baseName": "remaining", "type": "number" } ]; static getAttributeTypeMap() { - return UpdateEmailCampaign.attributeTypeMap; + return SubAccountDetailsResponsePlanInfoFeaturesInbox.attributeTypeMap; } -} - -export namespace UpdateEmailCampaign { - export enum WinnerCriteriaEnum { - Open = 'open', - Click = 'click' } -} -/** - * List ids to include/exclude from campaign - */ -export class UpdateEmailCampaignRecipients { + /** - * List ids which have to be excluded from a campaign - */ - 'exclusionListIds'?: Array; + * Landing page details + */ + export class SubAccountDetailsResponsePlanInfoFeaturesLandingPage { /** - * Lists Ids to send the campaign to. REQUIRED if already not present in campaign and scheduledAt is not empty - */ - 'listIds'?: Array; + * Quantity of landing pages provided + */ + 'quantity'?: number; + /** + * Available landing pages for use + */ + 'remaining'?: number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "exclusionListIds", - "baseName": "exclusionListIds", - "type": "Array" + "name": "quantity", + "baseName": "quantity", + "type": "number" }, { - "name": "listIds", - "baseName": "listIds", - "type": "Array" + "name": "remaining", + "baseName": "remaining", + "type": "number" } ]; static getAttributeTypeMap() { - return UpdateEmailCampaignRecipients.attributeTypeMap; + return SubAccountDetailsResponsePlanInfoFeaturesLandingPage.attributeTypeMap; + } } -} -/** - * Sender details including id or email and name (optional). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example `{\"name\":\"xyz\", \"email\":\"example@abc.com\"}` , `{\"name\":\"xyz\", \"id\":123}` - */ -export class UpdateEmailCampaignSender { /** - * Sender Name from which the campaign emails are sent - */ - 'name'?: string; + * Multi-account details + */ + export class SubAccountDetailsResponsePlanInfoFeaturesUsers { /** - * Sender email from which the campaign emails are sent - */ - 'email'?: string; + * Quantity of multi-account's provided + */ + 'quantity'?: number; /** - * Select the sender for the campaign on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). - */ - 'id'?: number; + * Available multi-accounts for use + */ + 'remaining'?: number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "email", - "baseName": "email", - "type": "string" + "name": "quantity", + "baseName": "quantity", + "type": "number" }, { - "name": "id", - "baseName": "id", + "name": "remaining", + "baseName": "remaining", "type": "number" } ]; static getAttributeTypeMap() { - return UpdateEmailCampaignSender.attributeTypeMap; + return SubAccountDetailsResponsePlanInfoFeaturesUsers.attributeTypeMap; + } } -} -export class UpdateList { /** - * Name of the list. Either of the two parameters (name, folderId) can be updated at a time. - */ - 'name'?: string; - /** - * Id of the folder in which the list is to be moved. Either of the two parameters (name, folderId) can be updated at a time. - */ - 'folderId'?: number; + * Details of the plan to be changed + */ + export class SubAccountUpdatePlanRequest { + 'credits'?: SubAccountUpdatePlanRequestCredits; + 'features'?: SubAccountUpdatePlanRequestFeatures; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "name", - "baseName": "name", - "type": "string" + "name": "credits", + "baseName": "credits", + "type": "SubAccountUpdatePlanRequestCredits" }, { - "name": "folderId", - "baseName": "folderId", - "type": "number" + "name": "features", + "baseName": "features", + "type": "SubAccountUpdatePlanRequestFeatures" } ]; static getAttributeTypeMap() { - return UpdateList.attributeTypeMap; + return SubAccountUpdatePlanRequest.attributeTypeMap; + } } -} -export class UpdateSender { - /** - * From Name to update the sender - */ - 'name'?: string; /** - * From Email to update the sender - */ - 'email'?: string; + * Credit details to update + */ + export class SubAccountUpdatePlanRequestCredits { /** - * Only in case of dedicated IP, IPs to associate to the sender. If passed, will replace all the existing IPs. - */ - 'ips'?: Array; + * Number of email credits + */ + 'email'?: number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, { "name": "email", "baseName": "email", - "type": "string" - }, - { - "name": "ips", - "baseName": "ips", - "type": "Array" + "type": "number" } ]; static getAttributeTypeMap() { - return UpdateSender.attributeTypeMap; + return SubAccountUpdatePlanRequestCredits.attributeTypeMap; + } } -} -export class UpdateSmsCampaign { - /** - * Name of the campaign - */ - 'name'?: string; /** - * Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** - */ - 'sender'?: string; + * Features details to update + */ + export class SubAccountUpdatePlanRequestFeatures { /** - * Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS - */ - 'content'?: string; - 'recipients'?: CreateSmsCampaignRecipients; + * Number of multi-users + */ + 'users'?: number; /** - * UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. - */ - 'scheduledAt'?: string; + * Number of landing pages + */ + 'landingPage'?: number; /** - * Format of the message. It indicates whether the content should be treated as unicode or not. - */ - 'unicodeEnabled'?: boolean; + * Number of inboxes + */ + 'inbox'?: number; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "name", - "baseName": "name", - "type": "string" + "name": "users", + "baseName": "users", + "type": "number" }, { - "name": "sender", - "baseName": "sender", - "type": "string" + "name": "landingPage", + "baseName": "landingPage", + "type": "number" }, { - "name": "content", - "baseName": "content", - "type": "string" + "name": "inbox", + "baseName": "inbox", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return SubAccountUpdatePlanRequestFeatures.attributeTypeMap; + } + } + + export class SubAccountsResponse { + /** + * Total number of subaccounts + */ + 'count'?: number; + 'subAccounts'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "count", + "baseName": "count", + "type": "number" }, { - "name": "recipients", - "baseName": "recipients", - "type": "CreateSmsCampaignRecipients" + "name": "subAccounts", + "baseName": "subAccounts", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return SubAccountsResponse.attributeTypeMap; + } + } + + export class SubAccountsResponseSubAccounts { + /** + * id of the sub-account + */ + 'id': number; + /** + * Name of the sub-account company + */ + 'companyName': string; + /** + * Whether the sub-account is active or not + */ + 'active': boolean; + /** + * Timestamp when the sub-account was created + */ + 'createdAt': number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "number" }, { - "name": "scheduledAt", - "baseName": "scheduledAt", + "name": "companyName", + "baseName": "companyName", "type": "string" }, { - "name": "unicodeEnabled", - "baseName": "unicodeEnabled", + "name": "active", + "baseName": "active", "type": "boolean" + }, + { + "name": "createdAt", + "baseName": "createdAt", + "type": "number" } ]; static getAttributeTypeMap() { - return UpdateSmsCampaign.attributeTypeMap; + return SubAccountsResponseSubAccounts.attributeTypeMap; + } } -} -export class UpdateSmtpTemplate { - /** - * Tag of the template - */ - 'tag'?: string; - 'sender'?: UpdateSmtpTemplateSender; /** - * Name of the template - */ - 'templateName'?: string; - /** - * Required if htmlUrl is empty. If the template is designed using Drag & Drop editor via HTML content, then the design page will not have Drag & Drop editor access for that template. Body of the message (HTML must have more than 10 characters) - */ - 'htmlContent'?: string; + * Task Details + */ + export class Task { /** - * Required if htmlContent is empty. URL to the body of the email (HTML) - */ - 'htmlUrl'?: string; + * Unique task id + */ + 'id'?: string; /** - * Subject of the email - */ - 'subject'?: string; + * Id for type of task e.g Call / Email / Meeting etc. + */ + 'taskTypeId': string; /** - * Email on which campaign recipients will be able to reply to - */ - 'replyTo'?: string; + * Name of task + */ + 'name': string; /** - * To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization - */ - 'toField'?: string; + * Contact ids for contacts linked to this task + */ + 'contactsIds'?: Array; /** - * Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps - */ - 'attachmentUrl'?: string; + * Deal ids for deals a task is linked to + */ + 'dealsIds'?: Array; /** - * Status of the template. isActive = false means template is inactive, isActive = true means template is active - */ - 'isActive'?: boolean; + * Companies ids for companies a task is linked to + */ + 'companiesIds'?: Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "tag", - "baseName": "tag", - "type": "string" - }, - { - "name": "sender", - "baseName": "sender", - "type": "UpdateSmtpTemplateSender" - }, - { - "name": "templateName", - "baseName": "templateName", - "type": "string" - }, - { - "name": "htmlContent", - "baseName": "htmlContent", + "name": "id", + "baseName": "id", "type": "string" }, { - "name": "htmlUrl", - "baseName": "htmlUrl", + "name": "taskTypeId", + "baseName": "taskTypeId", "type": "string" }, { - "name": "subject", - "baseName": "subject", + "name": "name", + "baseName": "name", "type": "string" }, { - "name": "replyTo", - "baseName": "replyTo", - "type": "string" + "name": "contactsIds", + "baseName": "contactsIds", + "type": "Array" }, { - "name": "toField", - "baseName": "toField", - "type": "string" + "name": "dealsIds", + "baseName": "dealsIds", + "type": "Array" }, { - "name": "attachmentUrl", - "baseName": "attachmentUrl", - "type": "string" - }, + "name": "companiesIds", + "baseName": "companiesIds", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return Task.attributeTypeMap; + } + } + + /** + * List of tasks + */ + export class TaskList { + /** + * List of tasks + */ + 'items'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "isActive", - "baseName": "isActive", - "type": "boolean" + "name": "items", + "baseName": "items", + "type": "Array" } ]; static getAttributeTypeMap() { - return UpdateSmtpTemplate.attributeTypeMap; + return TaskList.attributeTypeMap; + } } -} -/** - * Sender details including id or email and name (optional). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example `{\"name\":\"xyz\", \"email\":\"example@abc.com\"}` , `{\"name\":\"xyz\", \"id\":123}` - */ -export class UpdateSmtpTemplateSender { /** - * Name of the sender - */ - 'name'?: string; + * Task reminder date/time for a task + */ + export class TaskReminder { /** - * Email of the sender - */ - 'email'?: string; + * Value of time unit before reminder is to be sent + */ + 'value': number; /** - * Select the sender for the template on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). - */ - 'id'?: number; + * Unit of time before reminder is to be sent + */ + 'unit': TaskReminder.UnitEnum; + /** + * Type of task reminder e.g email, push + */ + 'types': Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "name", - "baseName": "name", - "type": "string" + "name": "value", + "baseName": "value", + "type": "number" }, { - "name": "email", - "baseName": "email", - "type": "string" + "name": "unit", + "baseName": "unit", + "type": "TaskReminder.UnitEnum" }, { - "name": "id", - "baseName": "id", - "type": "number" + "name": "types", + "baseName": "types", + "type": "Array" } ]; static getAttributeTypeMap() { - return UpdateSmtpTemplateSender.attributeTypeMap; + return TaskReminder.attributeTypeMap; + } } -} -export class UpdateWebhook { - /** - * URL of the webhook - */ - 'url'?: string; + export namespace TaskReminder { + export enum UnitEnum { + Minutes = 'minutes', + Hours = 'hours', + Weeks = 'weeks', + Days = 'days' + } + } /** - * Description of the webhook - */ - 'description'?: string; + * Task types details + */ + export class TaskTypes { /** - * - Events triggering the webhook. Possible values for **Transactional** type webhook: #### `sent` OR `request`, `delivered`, `hardBounce`, `softBounce`, `blocked`, `spam`, `invalid`, `deferred`, `click`, `opened`, `uniqueOpened` and `unsubscribed` - Possible values for **Marketing** type webhook: #### `spam`, `opened`, `click`, `hardBounce`, `softBounce`, `unsubscribed`, `listAddition` & `delivered` - Possible values for **Inbound** type webhook: #### `inboundEmailProcessed` - */ - 'events'?: Array; + * Id of task type + */ + 'id'?: string; /** - * Inbound domain of webhook, used in case of event type `inbound` - */ - 'domain'?: string; + * Title of task type + */ + 'title'?: string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "url", - "baseName": "url", - "type": "string" - }, - { - "name": "description", - "baseName": "description", + "name": "id", + "baseName": "id", "type": "string" }, { - "name": "events", - "baseName": "events", - "type": "Array" - }, - { - "name": "domain", - "baseName": "domain", + "name": "title", + "baseName": "title", "type": "string" } ]; static getAttributeTypeMap() { - return UpdateWebhook.attributeTypeMap; + return TaskTypes.attributeTypeMap; + } } -} -export namespace UpdateWebhook { - export enum EventsEnum { - Sent = 'sent', - HardBounce = 'hardBounce', - SoftBounce = 'softBounce', - Blocked = 'blocked', - Spam = 'spam', - Delivered = 'delivered', - Request = 'request', - Click = 'click', - Invalid = 'invalid', - Deferred = 'deferred', - Opened = 'opened', - UniqueOpened = 'uniqueOpened', - Unsubscribed = 'unsubscribed', - ListAddition = 'listAddition', - ContactUpdated = 'contactUpdated', - ContactDeleted = 'contactDeleted', - InboundEmailProcessed = 'inboundEmailProcessed' + export class UpdateAttribute { + /** + * Value of the attribute to update. Use only if the attribute's category is 'calculated' or 'global' + */ + 'value'?: string; + /** + * List of the values and labels that the attribute can take. Use only if the attribute's category is \"category\". For example, [{\"value\":1, \"label\":\"male\"}, {\"value\":2, \"label\":\"female\"}] + */ + 'enumeration'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "value", + "baseName": "value", + "type": "string" + }, + { + "name": "enumeration", + "baseName": "enumeration", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return UpdateAttribute.attributeTypeMap; } -} -export class UploadImageToGallery { + } + + export class UpdateAttributeEnumeration { /** - * The absolute url of the image (no local file). Maximum allowed size for image is 2MB. Allowed extensions for images are - jpeg, jpg, png, bmp, gif. - */ - 'imageUrl': string; + * Id of the value + */ + 'value': number; /** - * Name of the image. - */ - 'name'?: string; + * Label of the value + */ + 'label': string; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "imageUrl", - "baseName": "imageUrl", + "name": "value", + "baseName": "value", + "type": "number" + }, + { + "name": "label", + "baseName": "label", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return UpdateAttributeEnumeration.attributeTypeMap; + } + } + + export class UpdateBatchContacts { + /** + * List of contacts to be updated + */ + 'contacts'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "contacts", + "baseName": "contacts", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return UpdateBatchContacts.attributeTypeMap; + } + } + + export class UpdateBatchContactsContacts { + /** + * Email address of the user to be updated (For each operation only pass one of the supported contact identifiers. Email, id or sms) + */ + 'email'?: string; + /** + * id of the user to be updated (For each operation only pass one of the supported contact identifiers. Email, id or sms) + */ + 'id'?: number; + /** + * SMS of the user to be updated (For each operation only pass one of the supported contact identifiers. Email, id or sms) + */ + 'sms'?: string; + /** + * Pass the set of attributes to be updated. **These attributes must be present in your account**. To update existing email address of a contact with the new one please pass EMAIL in attribtes. For example, **{ \"EMAIL\":\"newemail@domain.com\", \"FNAME\":\"Ellie\", \"LNAME\":\"Roger\"}**. Keep in mind transactional attributes can be updated the same way as normal attributes. Mobile Number in **SMS** field should be passed with proper country code. For example: **{\"SMS\":\"+91xxxxxxxxxx\"} or {\"SMS\":\"0091xxxxxxxxxx\"}** + */ + 'attributes'?: { [key: string]: any; }; + /** + * Set/unset this field to blacklist/allow the contact for emails (emailBlacklisted = true) + */ + 'emailBlacklisted'?: boolean; + /** + * Set/unset this field to blacklist/allow the contact for SMS (smsBlacklisted = true) + */ + 'smsBlacklisted'?: boolean; + /** + * Ids of the lists to add the contact to + */ + 'listIds'?: Array; + /** + * Ids of the lists to remove the contact from + */ + 'unlinkListIds'?: Array; + /** + * transactional email forbidden sender for contact. Use only for email Contact + */ + 'smtpBlacklistSender'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "email", + "baseName": "email", "type": "string" }, { - "name": "name", - "baseName": "name", + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "sms", + "baseName": "sms", "type": "string" + }, + { + "name": "attributes", + "baseName": "attributes", + "type": "{ [key: string]: any; }" + }, + { + "name": "emailBlacklisted", + "baseName": "emailBlacklisted", + "type": "boolean" + }, + { + "name": "smsBlacklisted", + "baseName": "smsBlacklisted", + "type": "boolean" + }, + { + "name": "listIds", + "baseName": "listIds", + "type": "Array" + }, + { + "name": "unlinkListIds", + "baseName": "unlinkListIds", + "type": "Array" + }, + { + "name": "smtpBlacklistSender", + "baseName": "smtpBlacklistSender", + "type": "Array" } ]; static getAttributeTypeMap() { - return UploadImageToGallery.attributeTypeMap; + return UpdateBatchContactsContacts.attributeTypeMap; + } } -} + export class UpdateBatchContactsModel { + 'successIds'?: Array; + 'failureIds'?: Array; -const enumsMap: {[index: string]: any} = { - "AbTestCampaignResult.WinningVersionEnum": AbTestCampaignResult.WinningVersionEnum, - "AbTestCampaignResult.WinningCriteriaEnum": AbTestCampaignResult.WinningCriteriaEnum, - "CreateAttribute.TypeEnum": CreateAttribute.TypeEnum, - "CreateChild.LanguageEnum": CreateChild.LanguageEnum, - "CreateEmailCampaign.WinnerCriteriaEnum": CreateEmailCampaign.WinnerCriteriaEnum, - "CreateSubAccount.LanguageEnum": CreateSubAccount.LanguageEnum, - "CreateWebhook.EventsEnum": CreateWebhook.EventsEnum, - "CreateWebhook.TypeEnum": CreateWebhook.TypeEnum, - "EmailExportRecipients.RecipientsTypeEnum": EmailExportRecipients.RecipientsTypeEnum, - "ErrorModel.CodeEnum": ErrorModel.CodeEnum, - "GetAccountPlan.TypeEnum": GetAccountPlan.TypeEnum, - "GetAccountPlan.CreditsTypeEnum": GetAccountPlan.CreditsTypeEnum, - "GetAttributesAttributes.CategoryEnum": GetAttributesAttributes.CategoryEnum, - "GetAttributesAttributes.TypeEnum": GetAttributesAttributes.TypeEnum, - "GetCampaignOverview.TypeEnum": GetCampaignOverview.TypeEnum, - "GetCampaignOverview.StatusEnum": GetCampaignOverview.StatusEnum, - "GetEmailEventReportEvents.EventEnum": GetEmailEventReportEvents.EventEnum, - "GetInboundEmailEventsByUuidLogs.TypeEnum": GetInboundEmailEventsByUuidLogs.TypeEnum, - "GetProcess.StatusEnum": GetProcess.StatusEnum, - "GetScheduledEmailByBatchIdBatches.StatusEnum": GetScheduledEmailByBatchIdBatches.StatusEnum, - "GetScheduledEmailByMessageId.StatusEnum": GetScheduledEmailByMessageId.StatusEnum, - "GetSmsCampaignOverview.StatusEnum": GetSmsCampaignOverview.StatusEnum, - "GetSmsEventReportEvents.EventEnum": GetSmsEventReportEvents.EventEnum, - "GetTransacBlockedContactsReason.CodeEnum": GetTransacBlockedContactsReason.CodeEnum, - "GetWebhook.TypeEnum": GetWebhook.TypeEnum, - "MasterDetailsResponsePlanInfo.PlanPeriodEnum": MasterDetailsResponsePlanInfo.PlanPeriodEnum, - "RequestContactExportCustomContactFilter.ActionForContactsEnum": RequestContactExportCustomContactFilter.ActionForContactsEnum, - "RequestContactExportCustomContactFilter.ActionForEmailCampaignsEnum": RequestContactExportCustomContactFilter.ActionForEmailCampaignsEnum, - "RequestContactExportCustomContactFilter.ActionForSmsCampaignsEnum": RequestContactExportCustomContactFilter.ActionForSmsCampaignsEnum, - "RequestSmsRecipientExport.RecipientsTypeEnum": RequestSmsRecipientExport.RecipientsTypeEnum, - "SendReport.LanguageEnum": SendReport.LanguageEnum, - "SendTransacSms.TypeEnum": SendTransacSms.TypeEnum, - "TaskReminder.UnitEnum": TaskReminder.UnitEnum, - "UpdateCampaignStatus.StatusEnum": UpdateCampaignStatus.StatusEnum, - "UpdateEmailCampaign.WinnerCriteriaEnum": UpdateEmailCampaign.WinnerCriteriaEnum, - "UpdateWebhook.EventsEnum": UpdateWebhook.EventsEnum, -} + static discriminator: string | undefined = undefined; -const typeMap: {[index: string]: any} = { - "AbTestCampaignResult": AbTestCampaignResult, - "AbTestCampaignResultClickedLinks": AbTestCampaignResultClickedLinks, - "AbTestCampaignResultStatistics": AbTestCampaignResultStatistics, - "AbTestVersionClicks": AbTestVersionClicks, - "AbTestVersionClicksInner": AbTestVersionClicksInner, - "AbTestVersionStats": AbTestVersionStats, - "AddChildDomain": AddChildDomain, - "AddContactToList": AddContactToList, - "AddCredits": AddCredits, - "BlockDomain": BlockDomain, - "Body": Body, - "Body1": Body1, - "CreateAttribute": CreateAttribute, - "CreateAttributeEnumeration": CreateAttributeEnumeration, - "CreateChild": CreateChild, - "CreateContact": CreateContact, - "CreateDoiContact": CreateDoiContact, - "CreateEmailCampaign": CreateEmailCampaign, - "CreateEmailCampaignRecipients": CreateEmailCampaignRecipients, - "CreateEmailCampaignSender": CreateEmailCampaignSender, - "CreateList": CreateList, - "CreateModel": CreateModel, - "CreateReseller": CreateReseller, - "CreateSender": CreateSender, - "CreateSenderIps": CreateSenderIps, - "CreateSenderModel": CreateSenderModel, - "CreateSmsCampaign": CreateSmsCampaign, - "CreateSmsCampaignRecipients": CreateSmsCampaignRecipients, - "CreateSmtpEmail": CreateSmtpEmail, - "CreateSmtpTemplate": CreateSmtpTemplate, - "CreateSmtpTemplateSender": CreateSmtpTemplateSender, - "CreateSubAccount": CreateSubAccount, - "CreateSubAccountResponse": CreateSubAccountResponse, - "CreateUpdateContactModel": CreateUpdateContactModel, - "CreateUpdateFolder": CreateUpdateFolder, - "CreateWebhook": CreateWebhook, - "CreatedProcessId": CreatedProcessId, - "DeleteHardbounces": DeleteHardbounces, - "EmailExportRecipients": EmailExportRecipients, - "ErrorModel": ErrorModel, - "GetAccount": GetAccount, - "GetAccountMarketingAutomation": GetAccountMarketingAutomation, - "GetAccountPlan": GetAccountPlan, - "GetAccountRelay": GetAccountRelay, - "GetAccountRelayData": GetAccountRelayData, - "GetAggregatedReport": GetAggregatedReport, - "GetAttributes": GetAttributes, - "GetAttributesAttributes": GetAttributesAttributes, - "GetAttributesEnumeration": GetAttributesEnumeration, - "GetBlockedDomains": GetBlockedDomains, - "GetCampaignOverview": GetCampaignOverview, - "GetCampaignRecipients": GetCampaignRecipients, - "GetCampaignStats": GetCampaignStats, - "GetChildAccountCreationStatus": GetChildAccountCreationStatus, - "GetChildDomain": GetChildDomain, - "GetChildDomains": GetChildDomains, - "GetChildInfo": GetChildInfo, - "GetChildInfoApiKeys": GetChildInfoApiKeys, - "GetChildInfoApiKeysV2": GetChildInfoApiKeysV2, - "GetChildInfoApiKeysV3": GetChildInfoApiKeysV3, - "GetChildInfoCredits": GetChildInfoCredits, - "GetChildInfoStatistics": GetChildInfoStatistics, - "GetChildrenList": GetChildrenList, - "GetClient": GetClient, - "GetContactCampaignStats": GetContactCampaignStats, - "GetContactCampaignStatsClicked": GetContactCampaignStatsClicked, - "GetContactCampaignStatsOpened": GetContactCampaignStatsOpened, - "GetContactCampaignStatsTransacAttributes": GetContactCampaignStatsTransacAttributes, - "GetContactCampaignStatsUnsubscriptions": GetContactCampaignStatsUnsubscriptions, - "GetContactDetails": GetContactDetails, - "GetContacts": GetContacts, - "GetDeviceBrowserStats": GetDeviceBrowserStats, - "GetEmailCampaign": GetEmailCampaign, - "GetEmailCampaigns": GetEmailCampaigns, - "GetEmailEventReport": GetEmailEventReport, + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "successIds", + "baseName": "successIds", + "type": "Array" + }, + { + "name": "failureIds", + "baseName": "failureIds", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return UpdateBatchContactsModel.attributeTypeMap; + } + } + + /** + * Status of the campaign + */ + export class UpdateCampaignStatus { + /** + * Note:- replicateTemplate status will be available only for template type campaigns. + */ + 'status'?: UpdateCampaignStatus.StatusEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "status", + "baseName": "status", + "type": "UpdateCampaignStatus.StatusEnum" + } ]; + + static getAttributeTypeMap() { + return UpdateCampaignStatus.attributeTypeMap; + } + } + + export namespace UpdateCampaignStatus { + export enum StatusEnum { + Suspended = 'suspended', + Archive = 'archive', + Darchive = 'darchive', + Sent = 'sent', + Queued = 'queued', + Replicate = 'replicate', + ReplicateTemplate = 'replicateTemplate', + Draft = 'draft' + } + } + export class UpdateChild { + /** + * New Email address to update the child account + */ + 'email'?: string; + /** + * New First name to use to update the child account + */ + 'firstName'?: string; + /** + * New Last name to use to update the child account + */ + 'lastName'?: string; + /** + * New Company name to use to update the child account + */ + 'companyName'?: string; + /** + * New password for the child account to login + */ + 'password'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "email", + "baseName": "email", + "type": "string" + }, + { + "name": "firstName", + "baseName": "firstName", + "type": "string" + }, + { + "name": "lastName", + "baseName": "lastName", + "type": "string" + }, + { + "name": "companyName", + "baseName": "companyName", + "type": "string" + }, + { + "name": "password", + "baseName": "password", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return UpdateChild.attributeTypeMap; + } + } + + export class UpdateChildAccountStatus { + /** + * Status of Transactional Email Platform activation for your account (true=enabled, false=disabled) + */ + 'transactionalEmail'?: boolean; + /** + * Status of Transactional SMS Platform activation for your account (true=enabled, false=disabled) + */ + 'transactionalSms'?: boolean; + /** + * Status of Marketing Automation Platform activation for your account (true=enabled, false=disabled) + */ + 'marketingAutomation'?: boolean; + /** + * Status of SMS Campaign Platform activation for your account (true=enabled, false=disabled) + */ + 'smsCampaign'?: boolean; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "transactionalEmail", + "baseName": "transactionalEmail", + "type": "boolean" + }, + { + "name": "transactionalSms", + "baseName": "transactionalSms", + "type": "boolean" + }, + { + "name": "marketingAutomation", + "baseName": "marketingAutomation", + "type": "boolean" + }, + { + "name": "smsCampaign", + "baseName": "smsCampaign", + "type": "boolean" + } ]; + + static getAttributeTypeMap() { + return UpdateChildAccountStatus.attributeTypeMap; + } + } + + export class UpdateChildDomain { + /** + * Value for the sender domain that will replace the existing domain + */ + 'domain'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "domain", + "baseName": "domain", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return UpdateChildDomain.attributeTypeMap; + } + } + + export class UpdateContact { + /** + * Pass the set of attributes to be updated. These attributes must be present in your account. To update existing email address of a contact with the new one please pass EMAIL in attributes. For example, `{ \"EMAIL\":\"newemail@domain.com\", \"FNAME\":\"Ellie\", \"LNAME\":\"Roger\"}`. The attribute's parameter should be passed in capital letter while updating a contact. Keep in mind transactional attributes can be updated the same way as normal attributes. Mobile Number in \"SMS\" field should be passed with proper country code. For example {\"SMS\":\"+91xxxxxxxxxx\"} or {\"SMS\":\"0091xxxxxxxxxx\"} + */ + 'attributes'?: any; + /** + * Set/unset this field to blacklist/allow the contact for emails (emailBlacklisted = true) + */ + 'emailBlacklisted'?: boolean; + /** + * Set/unset this field to blacklist/allow the contact for SMS (smsBlacklisted = true) + */ + 'smsBlacklisted'?: boolean; + /** + * Ids of the lists to add the contact to + */ + 'listIds'?: Array; + /** + * Ids of the lists to remove the contact from + */ + 'unlinkListIds'?: Array; + /** + * transactional email forbidden sender for contact. Use only for email Contact + */ + 'smtpBlacklistSender'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "attributes", + "baseName": "attributes", + "type": "any" + }, + { + "name": "emailBlacklisted", + "baseName": "emailBlacklisted", + "type": "boolean" + }, + { + "name": "smsBlacklisted", + "baseName": "smsBlacklisted", + "type": "boolean" + }, + { + "name": "listIds", + "baseName": "listIds", + "type": "Array" + }, + { + "name": "unlinkListIds", + "baseName": "unlinkListIds", + "type": "Array" + }, + { + "name": "smtpBlacklistSender", + "baseName": "smtpBlacklistSender", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return UpdateContact.attributeTypeMap; + } + } + + export class UpdateEmailCampaign { + /** + * Tag of the campaign + */ + 'tag'?: string; + 'sender'?: UpdateEmailCampaignSender; + /** + * Name of the campaign + */ + 'name'?: string; + /** + * Body of the message (HTML version). If the campaign is designed using Drag & Drop editor via HTML content, then the design page will not have Drag & Drop editor access for that campaign. REQUIRED if htmlUrl is empty + */ + 'htmlContent'?: string; + /** + * Url which contents the body of the email message. REQUIRED if htmlContent is empty + */ + 'htmlUrl'?: string; + /** + * UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. If sendAtBestTime is set to true, your campaign will be sent according to the date passed (ignoring the time part). + */ + 'scheduledAt'?: string; + /** + * Subject of the campaign + */ + 'subject'?: string; + /** + * Email on which campaign recipients will be able to reply to + */ + 'replyTo'?: string; + /** + * To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization + */ + 'toField'?: string; + 'recipients'?: UpdateEmailCampaignRecipients; + /** + * Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps + */ + 'attachmentUrl'?: string; + /** + * Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. You cannot send a campaign of more than 4MB with images embedded in the email. Campaigns with the images embedded in the email must be sent to less than 5000 contacts. + */ + 'inlineImageActivation'?: boolean; + /** + * Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign + */ + 'mirrorActive'?: boolean; + /** + * FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times + */ + 'recurring'?: boolean; + /** + * Footer of the email campaign + */ + 'footer'?: string; + /** + * Header of the email campaign + */ + 'header'?: string; + /** + * Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed + */ + 'utmCampaign'?: string; + /** + * Pass the set of attributes to customize the type 'classic' campaign. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}. The 'params' field will get updated, only if the campaign is in New Template Language, else ignored. The New Template Language is dependent on the values of 'subject', 'htmlContent/htmlUrl', 'sender.name' & 'toField' + */ + 'params'?: any; + /** + * Set this to true if you want to send your campaign at best time. Note:- if true, warmup ip will be disabled. + */ + 'sendAtBestTime'?: boolean; + /** + * Status of A/B Test. abTesting = false means it is disabled, & abTesting = true means it is enabled. 'subjectA', 'subjectB', 'splitRule', 'winnerCriteria' & 'winnerDelay' will be considered if abTesting is set to true. 'subject' if passed is ignored. Can be set to true only if 'sendAtBestTime' is 'false'. You will be able to set up two subject lines for your campaign and send them to a random sample of your total recipients. Half of the test group will receive version A, and the other half will receive version B + */ + 'abTesting'?: boolean; + /** + * Subject A of the campaign. Considered if abTesting = true. subjectA & subjectB should have unique value + */ + 'subjectA'?: string; + /** + * Subject B of the campaign. Considered if abTesting = true. subjectA & subjectB should have unique value + */ + 'subjectB'?: string; + /** + * Add the size of your test groups. Considered if abTesting = true. We'll send version A and B to a random sample of recipients, and then the winning version to everyone else + */ + 'splitRule'?: number; + /** + * Choose the metrics that will determinate the winning version. Considered if 'splitRule' >= 1 and < 50. If splitRule = 50, 'winnerCriteria' is ignored if passed or alreday exist in record + */ + 'winnerCriteria'?: UpdateEmailCampaign.WinnerCriteriaEnum; + /** + * Choose the duration of the test in hours. Maximum is 7 days, pass 24*7 = 168 hours. The winning version will be sent at the end of the test. Considered if 'splitRule' >= 1 and < 50. If splitRule = 50, 'winnerDelay' is ignored if passed or alreday exist in record + */ + 'winnerDelay'?: number; + /** + * Available for dedicated ip clients. Set this to true if you wish to warm up your ip. + */ + 'ipWarmupEnable'?: boolean; + /** + * Set an initial quota greater than 1 for warming up your ip. We recommend you set a value of 3000. + */ + 'initialQuota'?: number; + /** + * Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%. + */ + 'increaseRate'?: number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "tag", + "baseName": "tag", + "type": "string" + }, + { + "name": "sender", + "baseName": "sender", + "type": "UpdateEmailCampaignSender" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "htmlContent", + "baseName": "htmlContent", + "type": "string" + }, + { + "name": "htmlUrl", + "baseName": "htmlUrl", + "type": "string" + }, + { + "name": "scheduledAt", + "baseName": "scheduledAt", + "type": "string" + }, + { + "name": "subject", + "baseName": "subject", + "type": "string" + }, + { + "name": "replyTo", + "baseName": "replyTo", + "type": "string" + }, + { + "name": "toField", + "baseName": "toField", + "type": "string" + }, + { + "name": "recipients", + "baseName": "recipients", + "type": "UpdateEmailCampaignRecipients" + }, + { + "name": "attachmentUrl", + "baseName": "attachmentUrl", + "type": "string" + }, + { + "name": "inlineImageActivation", + "baseName": "inlineImageActivation", + "type": "boolean" + }, + { + "name": "mirrorActive", + "baseName": "mirrorActive", + "type": "boolean" + }, + { + "name": "recurring", + "baseName": "recurring", + "type": "boolean" + }, + { + "name": "footer", + "baseName": "footer", + "type": "string" + }, + { + "name": "header", + "baseName": "header", + "type": "string" + }, + { + "name": "utmCampaign", + "baseName": "utmCampaign", + "type": "string" + }, + { + "name": "params", + "baseName": "params", + "type": "any" + }, + { + "name": "sendAtBestTime", + "baseName": "sendAtBestTime", + "type": "boolean" + }, + { + "name": "abTesting", + "baseName": "abTesting", + "type": "boolean" + }, + { + "name": "subjectA", + "baseName": "subjectA", + "type": "string" + }, + { + "name": "subjectB", + "baseName": "subjectB", + "type": "string" + }, + { + "name": "splitRule", + "baseName": "splitRule", + "type": "number" + }, + { + "name": "winnerCriteria", + "baseName": "winnerCriteria", + "type": "UpdateEmailCampaign.WinnerCriteriaEnum" + }, + { + "name": "winnerDelay", + "baseName": "winnerDelay", + "type": "number" + }, + { + "name": "ipWarmupEnable", + "baseName": "ipWarmupEnable", + "type": "boolean" + }, + { + "name": "initialQuota", + "baseName": "initialQuota", + "type": "number" + }, + { + "name": "increaseRate", + "baseName": "increaseRate", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return UpdateEmailCampaign.attributeTypeMap; + } + } + + export namespace UpdateEmailCampaign { + export enum WinnerCriteriaEnum { + Open = 'open', + Click = 'click' + } + } + /** + * List ids to include/exclude from campaign + */ + export class UpdateEmailCampaignRecipients { + /** + * List ids which have to be excluded from a campaign + */ + 'exclusionListIds'?: Array; + /** + * Lists Ids to send the campaign to. REQUIRED if already not present in campaign and scheduledAt is not empty + */ + 'listIds'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "exclusionListIds", + "baseName": "exclusionListIds", + "type": "Array" + }, + { + "name": "listIds", + "baseName": "listIds", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return UpdateEmailCampaignRecipients.attributeTypeMap; + } + } + + /** + * Sender details including id or email and name (optional). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example `{\"name\":\"xyz\", \"email\":\"example@abc.com\"}` , `{\"name\":\"xyz\", \"id\":123}` + */ + export class UpdateEmailCampaignSender { + /** + * Sender Name from which the campaign emails are sent + */ + 'name'?: string; + /** + * Sender email from which the campaign emails are sent + */ + 'email'?: string; + /** + * Select the sender for the campaign on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). + */ + 'id'?: number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "email", + "baseName": "email", + "type": "string" + }, + { + "name": "id", + "baseName": "id", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return UpdateEmailCampaignSender.attributeTypeMap; + } + } + + export class UpdateList { + /** + * Name of the list. Either of the two parameters (name, folderId) can be updated at a time. + */ + 'name'?: string; + /** + * Id of the folder in which the list is to be moved. Either of the two parameters (name, folderId) can be updated at a time. + */ + 'folderId'?: number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "folderId", + "baseName": "folderId", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return UpdateList.attributeTypeMap; + } + } + + export class UpdateSender { + /** + * From Name to update the sender + */ + 'name'?: string; + /** + * From Email to update the sender + */ + 'email'?: string; + /** + * Only in case of dedicated IP, IPs to associate to the sender. If passed, will replace all the existing IPs. + */ + 'ips'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "email", + "baseName": "email", + "type": "string" + }, + { + "name": "ips", + "baseName": "ips", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return UpdateSender.attributeTypeMap; + } + } + + export class UpdateSmsCampaign { + /** + * Name of the campaign + */ + 'name'?: string; + /** + * Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** + */ + 'sender'?: string; + /** + * Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS + */ + 'content'?: string; + 'recipients'?: CreateSmsCampaignRecipients; + /** + * UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. + */ + 'scheduledAt'?: string; + /** + * Format of the message. It indicates whether the content should be treated as unicode or not. + */ + 'unicodeEnabled'?: boolean; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "sender", + "baseName": "sender", + "type": "string" + }, + { + "name": "content", + "baseName": "content", + "type": "string" + }, + { + "name": "recipients", + "baseName": "recipients", + "type": "CreateSmsCampaignRecipients" + }, + { + "name": "scheduledAt", + "baseName": "scheduledAt", + "type": "string" + }, + { + "name": "unicodeEnabled", + "baseName": "unicodeEnabled", + "type": "boolean" + } ]; + + static getAttributeTypeMap() { + return UpdateSmsCampaign.attributeTypeMap; + } + } + + export class UpdateSmtpTemplate { + /** + * Tag of the template + */ + 'tag'?: string; + 'sender'?: UpdateSmtpTemplateSender; + /** + * Name of the template + */ + 'templateName'?: string; + /** + * Required if htmlUrl is empty. If the template is designed using Drag & Drop editor via HTML content, then the design page will not have Drag & Drop editor access for that template. Body of the message (HTML must have more than 10 characters) + */ + 'htmlContent'?: string; + /** + * Required if htmlContent is empty. URL to the body of the email (HTML) + */ + 'htmlUrl'?: string; + /** + * Subject of the email + */ + 'subject'?: string; + /** + * Email on which campaign recipients will be able to reply to + */ + 'replyTo'?: string; + /** + * To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization + */ + 'toField'?: string; + /** + * Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps + */ + 'attachmentUrl'?: string; + /** + * Status of the template. isActive = false means template is inactive, isActive = true means template is active + */ + 'isActive'?: boolean; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "tag", + "baseName": "tag", + "type": "string" + }, + { + "name": "sender", + "baseName": "sender", + "type": "UpdateSmtpTemplateSender" + }, + { + "name": "templateName", + "baseName": "templateName", + "type": "string" + }, + { + "name": "htmlContent", + "baseName": "htmlContent", + "type": "string" + }, + { + "name": "htmlUrl", + "baseName": "htmlUrl", + "type": "string" + }, + { + "name": "subject", + "baseName": "subject", + "type": "string" + }, + { + "name": "replyTo", + "baseName": "replyTo", + "type": "string" + }, + { + "name": "toField", + "baseName": "toField", + "type": "string" + }, + { + "name": "attachmentUrl", + "baseName": "attachmentUrl", + "type": "string" + }, + { + "name": "isActive", + "baseName": "isActive", + "type": "boolean" + } ]; + + static getAttributeTypeMap() { + return UpdateSmtpTemplate.attributeTypeMap; + } + } + + /** + * Sender details including id or email and name (optional). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example `{\"name\":\"xyz\", \"email\":\"example@abc.com\"}` , `{\"name\":\"xyz\", \"id\":123}` + */ + export class UpdateSmtpTemplateSender { + /** + * Name of the sender + */ + 'name'?: string; + /** + * Email of the sender + */ + 'email'?: string; + /** + * Select the sender for the template on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). + */ + 'id'?: number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "email", + "baseName": "email", + "type": "string" + }, + { + "name": "id", + "baseName": "id", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return UpdateSmtpTemplateSender.attributeTypeMap; + } + } + + export class UpdateWebhook { + /** + * URL of the webhook + */ + 'url'?: string; + /** + * Description of the webhook + */ + 'description'?: string; + /** + * - Events triggering the webhook. Possible values for **Transactional** type webhook: #### `sent` OR `request`, `delivered`, `hardBounce`, `softBounce`, `blocked`, `spam`, `invalid`, `deferred`, `click`, `opened`, `uniqueOpened` and `unsubscribed` - Possible values for **Marketing** type webhook: #### `spam`, `opened`, `click`, `hardBounce`, `softBounce`, `unsubscribed`, `listAddition` & `delivered` - Possible values for **Inbound** type webhook: #### `inboundEmailProcessed` + */ + 'events'?: Array; + /** + * Inbound domain of webhook, used in case of event type `inbound` + */ + 'domain'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "url", + "baseName": "url", + "type": "string" + }, + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "events", + "baseName": "events", + "type": "Array" + }, + { + "name": "domain", + "baseName": "domain", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return UpdateWebhook.attributeTypeMap; + } + } + + export namespace UpdateWebhook { + export enum EventsEnum { + Sent = 'sent', + HardBounce = 'hardBounce', + SoftBounce = 'softBounce', + Blocked = 'blocked', + Spam = 'spam', + Delivered = 'delivered', + Request = 'request', + Click = 'click', + Invalid = 'invalid', + Deferred = 'deferred', + Opened = 'opened', + UniqueOpened = 'uniqueOpened', + Unsubscribed = 'unsubscribed', + ListAddition = 'listAddition', + ContactUpdated = 'contactUpdated', + ContactDeleted = 'contactDeleted', + InboundEmailProcessed = 'inboundEmailProcessed' + } + } + export class UploadImageModel { + /** + * URL of the image uploaded + */ + 'url': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "url", + "baseName": "url", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return UploadImageModel.attributeTypeMap; + } + } + + export class UploadImageToGallery { + /** + * The absolute url of the image (no local file). Maximum allowed size for image is 2MB. Allowed extensions for images are - jpeg, jpg, png, bmp, gif. + */ + 'imageUrl': string; + /** + * Name of the image. + */ + 'name'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "imageUrl", + "baseName": "imageUrl", + "type": "string" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return UploadImageToGallery.attributeTypeMap; + } + } + + + const enumsMap: {[index: string]: any} = { + "AbTestCampaignResult.WinningVersionEnum": AbTestCampaignResult.WinningVersionEnum, + "AbTestCampaignResult.WinningCriteriaEnum": AbTestCampaignResult.WinningCriteriaEnum, + "ConversationsMessage.TypeEnum": ConversationsMessage.TypeEnum, + "CreateAttribute.TypeEnum": CreateAttribute.TypeEnum, + "CreateChild.LanguageEnum": CreateChild.LanguageEnum, + "CreateEmailCampaign.WinnerCriteriaEnum": CreateEmailCampaign.WinnerCriteriaEnum, + "CreateSubAccount.LanguageEnum": CreateSubAccount.LanguageEnum, + "CreateWebhook.EventsEnum": CreateWebhook.EventsEnum, + "CreateWebhook.TypeEnum": CreateWebhook.TypeEnum, + "EmailExportRecipients.RecipientsTypeEnum": EmailExportRecipients.RecipientsTypeEnum, + "ErrorModel.CodeEnum": ErrorModel.CodeEnum, + "GetAccountPlan.TypeEnum": GetAccountPlan.TypeEnum, + "GetAccountPlan.CreditsTypeEnum": GetAccountPlan.CreditsTypeEnum, + "GetAttributesAttributes.CategoryEnum": GetAttributesAttributes.CategoryEnum, + "GetAttributesAttributes.TypeEnum": GetAttributesAttributes.TypeEnum, + "GetCampaignOverview.TypeEnum": GetCampaignOverview.TypeEnum, + "GetCampaignOverview.StatusEnum": GetCampaignOverview.StatusEnum, + "GetEmailEventReportEvents.EventEnum": GetEmailEventReportEvents.EventEnum, + "GetInboundEmailEventsByUuidLogs.TypeEnum": GetInboundEmailEventsByUuidLogs.TypeEnum, + "GetProcess.StatusEnum": GetProcess.StatusEnum, + "GetScheduledEmailByBatchIdBatches.StatusEnum": GetScheduledEmailByBatchIdBatches.StatusEnum, + "GetScheduledEmailByMessageId.StatusEnum": GetScheduledEmailByMessageId.StatusEnum, + "GetSmsCampaignOverview.StatusEnum": GetSmsCampaignOverview.StatusEnum, + "GetSmsEventReportEvents.EventEnum": GetSmsEventReportEvents.EventEnum, + "GetTransacBlockedContactsReason.CodeEnum": GetTransacBlockedContactsReason.CodeEnum, + "GetWebhook.TypeEnum": GetWebhook.TypeEnum, + "MasterDetailsResponsePlanInfo.PlanPeriodEnum": MasterDetailsResponsePlanInfo.PlanPeriodEnum, + "RequestContactExportCustomContactFilter.ActionForContactsEnum": RequestContactExportCustomContactFilter.ActionForContactsEnum, + "RequestContactExportCustomContactFilter.ActionForEmailCampaignsEnum": RequestContactExportCustomContactFilter.ActionForEmailCampaignsEnum, + "RequestContactExportCustomContactFilter.ActionForSmsCampaignsEnum": RequestContactExportCustomContactFilter.ActionForSmsCampaignsEnum, + "RequestSmsRecipientExport.RecipientsTypeEnum": RequestSmsRecipientExport.RecipientsTypeEnum, + "SendReport.LanguageEnum": SendReport.LanguageEnum, + "SendTransacSms.TypeEnum": SendTransacSms.TypeEnum, + "TaskReminder.UnitEnum": TaskReminder.UnitEnum, + "UpdateCampaignStatus.StatusEnum": UpdateCampaignStatus.StatusEnum, + "UpdateEmailCampaign.WinnerCriteriaEnum": UpdateEmailCampaign.WinnerCriteriaEnum, + "UpdateWebhook.EventsEnum": UpdateWebhook.EventsEnum, + } + + const typeMap: {[index: string]: any} = { + "AbTestCampaignResult": AbTestCampaignResult, + "AbTestCampaignResultClickedLinks": AbTestCampaignResultClickedLinks, + "AbTestCampaignResultStatistics": AbTestCampaignResultStatistics, + "AbTestVersionClicks": AbTestVersionClicks, + "AbTestVersionClicksInner": AbTestVersionClicksInner, + "AbTestVersionStats": AbTestVersionStats, + "AddChildDomain": AddChildDomain, + "AddContactToList": AddContactToList, + "AddCredits": AddCredits, + "BlockDomain": BlockDomain, + "Body": Body, + "Body1": Body1, + "Body10": Body10, + "Body11": Body11, + "Body12": Body12, + "Body2": Body2, + "Body3": Body3, + "Body4": Body4, + "Body5": Body5, + "Body6": Body6, + "Body7": Body7, + "Body8": Body8, + "Body9": Body9, + "CompaniesList": CompaniesList, + "Company": Company, + "CompanyAttributes": CompanyAttributes, + "CompanyAttributesInner": CompanyAttributesInner, + "ConversationsMessage": ConversationsMessage, + "ConversationsMessageFile": ConversationsMessageFile, + "ConversationsMessageFileImageInfo": ConversationsMessageFileImageInfo, + "CreateAttribute": CreateAttribute, + "CreateAttributeEnumeration": CreateAttributeEnumeration, + "CreateChild": CreateChild, + "CreateContact": CreateContact, + "CreateDoiContact": CreateDoiContact, + "CreateEmailCampaign": CreateEmailCampaign, + "CreateEmailCampaignRecipients": CreateEmailCampaignRecipients, + "CreateEmailCampaignSender": CreateEmailCampaignSender, + "CreateList": CreateList, + "CreateModel": CreateModel, + "CreateReseller": CreateReseller, + "CreateSender": CreateSender, + "CreateSenderIps": CreateSenderIps, + "CreateSenderModel": CreateSenderModel, + "CreateSmsCampaign": CreateSmsCampaign, + "CreateSmsCampaignRecipients": CreateSmsCampaignRecipients, + "CreateSmtpEmail": CreateSmtpEmail, + "CreateSmtpTemplate": CreateSmtpTemplate, + "CreateSmtpTemplateSender": CreateSmtpTemplateSender, + "CreateSubAccount": CreateSubAccount, + "CreateSubAccountResponse": CreateSubAccountResponse, + "CreateUpdateContactModel": CreateUpdateContactModel, + "CreateUpdateFolder": CreateUpdateFolder, + "CreateWebhook": CreateWebhook, + "CreatedProcessId": CreatedProcessId, + "Deal": Deal, + "DealAttributes": DealAttributes, + "DealAttributesInner": DealAttributesInner, + "DealsList": DealsList, + "DeleteHardbounces": DeleteHardbounces, + "EmailExportRecipients": EmailExportRecipients, + "ErrorModel": ErrorModel, + "FileData": FileData, + "FileDownloadableLink": FileDownloadableLink, + "FileList": FileList, + "GetAccount": GetAccount, + "GetAccountMarketingAutomation": GetAccountMarketingAutomation, + "GetAccountPlan": GetAccountPlan, + "GetAccountRelay": GetAccountRelay, + "GetAccountRelayData": GetAccountRelayData, + "GetAggregatedReport": GetAggregatedReport, + "GetAttributes": GetAttributes, + "GetAttributesAttributes": GetAttributesAttributes, + "GetAttributesEnumeration": GetAttributesEnumeration, + "GetBlockedDomains": GetBlockedDomains, + "GetCampaignOverview": GetCampaignOverview, + "GetCampaignRecipients": GetCampaignRecipients, + "GetCampaignStats": GetCampaignStats, + "GetChildAccountCreationStatus": GetChildAccountCreationStatus, + "GetChildDomain": GetChildDomain, + "GetChildDomains": GetChildDomains, + "GetChildInfo": GetChildInfo, + "GetChildInfoApiKeys": GetChildInfoApiKeys, + "GetChildInfoApiKeysV2": GetChildInfoApiKeysV2, + "GetChildInfoApiKeysV3": GetChildInfoApiKeysV3, + "GetChildInfoCredits": GetChildInfoCredits, + "GetChildInfoStatistics": GetChildInfoStatistics, + "GetChildrenList": GetChildrenList, + "GetClient": GetClient, + "GetContactCampaignStats": GetContactCampaignStats, + "GetContactCampaignStatsClicked": GetContactCampaignStatsClicked, + "GetContactCampaignStatsOpened": GetContactCampaignStatsOpened, + "GetContactCampaignStatsTransacAttributes": GetContactCampaignStatsTransacAttributes, + "GetContactCampaignStatsUnsubscriptions": GetContactCampaignStatsUnsubscriptions, + "GetContactDetails": GetContactDetails, + "GetContacts": GetContacts, + "GetDeviceBrowserStats": GetDeviceBrowserStats, + "GetEmailCampaign": GetEmailCampaign, + "GetEmailCampaigns": GetEmailCampaigns, + "GetEmailEventReport": GetEmailEventReport, "GetEmailEventReportEvents": GetEmailEventReportEvents, "GetExtendedCampaignOverview": GetExtendedCampaignOverview, "GetExtendedCampaignOverviewSender": GetExtendedCampaignOverviewSender, @@ -10679,7 +11827,9 @@ const typeMap: {[index: string]: any} = { "GetTransacSmsReportReports": GetTransacSmsReportReports, "GetWebhook": GetWebhook, "GetWebhooks": GetWebhooks, + "InlineResponse200": InlineResponse200, "InlineResponse201": InlineResponse201, + "InlineResponse2011": InlineResponse2011, "ManageIp": ManageIp, "MasterDetailsResponse": MasterDetailsResponse, "MasterDetailsResponseBillingInfo": MasterDetailsResponseBillingInfo, @@ -10691,6 +11841,8 @@ const typeMap: {[index: string]: any} = { "NoteData": NoteData, "NoteId": NoteId, "NoteList": NoteList, + "Pipeline": Pipeline, + "PipelineStage": PipelineStage, "PostContactInfo": PostContactInfo, "PostContactInfoContacts": PostContactInfoContacts, "PostSendFailed": PostSendFailed, @@ -10759,133 +11911,2540 @@ const typeMap: {[index: string]: any} = { "UpdateSmtpTemplate": UpdateSmtpTemplate, "UpdateSmtpTemplateSender": UpdateSmtpTemplateSender, "UpdateWebhook": UpdateWebhook, + "UploadImageModel": UploadImageModel, "UploadImageToGallery": UploadImageToGallery, -} + } + + export interface Authentication { + /** + * Apply authentication settings to header and query params. + */ + applyToRequest(requestOptions: localVarRequest.Options): void; + } + + export class HttpBasicAuth implements Authentication { + public username = ''; + public password = ''; + + applyToRequest(requestOptions: localVarRequest.Options): void { + requestOptions.auth = { + username: this.username, password: this.password + } + } + } + + export class ApiKeyAuth implements Authentication { + public apiKey = ''; + + constructor(private location: string, private paramName: string) { + } + + applyToRequest(requestOptions: localVarRequest.Options): void { + if (this.location == "query") { + (requestOptions.qs)[this.paramName] = this.apiKey; + } else if (this.location == "header" && requestOptions && requestOptions.headers) { + requestOptions.headers[this.paramName] = this.apiKey; + } + } + } + + export class OAuth implements Authentication { + public accessToken = ''; + + applyToRequest(requestOptions: localVarRequest.Options): void { + if (requestOptions && requestOptions.headers) { + requestOptions.headers["Authorization"] = "Bearer " + this.accessToken; + } + } + } + + export class VoidAuth implements Authentication { + public username = ''; + public password = ''; + + applyToRequest(_: localVarRequest.Options): void { + // Do nothing + } + } + + export enum AccountApiApiKeys { + apiKey, + partnerKey, + } + + export class AccountApi { + protected _basePath = defaultBasePath; + protected defaultHeaders : any = { + 'user-agent': `sendinblue_clientAPI/v${version}/ts-node` + }; + protected _useQuerystring = false; + + protected authentications = { + 'default': new VoidAuth(), + 'apiKey': new ApiKeyAuth('header', 'api-key'), + 'partnerKey': new ApiKeyAuth('header', 'partner-key'), + } + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: AccountApiApiKeys, value: string) { + (this.authentications as any)[AccountApiApiKeys[key]].apiKey = value; + } + /** + * + * @summary Get your account information, plan and credits details + * @param {*} [options] Override http request options. + */ + public getAccount (options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetAccount; }> { + const localVarPath = this.basePath + '/account'; + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; + + (Object).assign(localVarHeaderParams, options.headers); + + const localVarUseFormData = false; + + const localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: GetAccount; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + body = ObjectSerializer.deserialize(body, "GetAccount"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } + } + export enum AttributesApiApiKeys { + apiKey, + partnerKey, + } + + export class AttributesApi { + protected _basePath = defaultBasePath; + protected defaultHeaders : any = { + 'user-agent': `sendinblue_clientAPI/v${version}/ts-node` + }; + protected _useQuerystring = false; + + protected authentications = { + 'default': new VoidAuth(), + 'apiKey': new ApiKeyAuth('header', 'api-key'), + 'partnerKey': new ApiKeyAuth('header', 'partner-key'), + } + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: AttributesApiApiKeys, value: string) { + (this.authentications as any)[AttributesApiApiKeys[key]].apiKey = value; + } + /** + * + * @summary Create contact attribute + * @param attributeCategory Category of the attribute + * @param attributeName Name of the attribute + * @param createAttribute Values to create an attribute + * @param {*} [options] Override http request options. + */ + public createAttribute (attributeCategory: 'normal' | 'transactional' | 'category' | 'calculated' | 'global', attributeName: string, createAttribute: CreateAttribute, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/contacts/attributes/{attributeCategory}/{attributeName}' + .replace('{' + 'attributeCategory' + '}', encodeURIComponent(String(attributeCategory))) + .replace('{' + 'attributeName' + '}', encodeURIComponent(String(attributeName))); + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; + + // verify required parameter 'attributeCategory' is not null or undefined + if (attributeCategory === null || attributeCategory === undefined) { + throw new Error('Required parameter attributeCategory was null or undefined when calling createAttribute.'); + } + + // verify required parameter 'attributeName' is not null or undefined + if (attributeName === null || attributeName === undefined) { + throw new Error('Required parameter attributeName was null or undefined when calling createAttribute.'); + } + + // verify required parameter 'createAttribute' is not null or undefined + if (createAttribute === null || createAttribute === undefined) { + throw new Error('Required parameter createAttribute was null or undefined when calling createAttribute.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + const localVarUseFormData = false; + + const localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(createAttribute, "CreateAttribute") + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } + /** + * + * @summary Delete an attribute + * @param attributeCategory Category of the attribute + * @param attributeName Name of the existing attribute + * @param {*} [options] Override http request options. + */ + public deleteAttribute (attributeCategory: 'normal' | 'transactional' | 'category' | 'calculated' | 'global', attributeName: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/contacts/attributes/{attributeCategory}/{attributeName}' + .replace('{' + 'attributeCategory' + '}', encodeURIComponent(String(attributeCategory))) + .replace('{' + 'attributeName' + '}', encodeURIComponent(String(attributeName))); + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; + + // verify required parameter 'attributeCategory' is not null or undefined + if (attributeCategory === null || attributeCategory === undefined) { + throw new Error('Required parameter attributeCategory was null or undefined when calling deleteAttribute.'); + } + + // verify required parameter 'attributeName' is not null or undefined + if (attributeName === null || attributeName === undefined) { + throw new Error('Required parameter attributeName was null or undefined when calling deleteAttribute.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + const localVarUseFormData = false; + + const localVarRequestOptions: localVarRequest.Options = { + method: 'DELETE', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } + /** + * + * @summary List all attributes + * @param {*} [options] Override http request options. + */ + public getAttributes (options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetAttributes; }> { + const localVarPath = this.basePath + '/contacts/attributes'; + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; + + (Object).assign(localVarHeaderParams, options.headers); + + const localVarUseFormData = false; + + const localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: GetAttributes; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + body = ObjectSerializer.deserialize(body, "GetAttributes"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } + /** + * + * @summary Update contact attribute + * @param attributeCategory Category of the attribute + * @param attributeName Name of the existing attribute + * @param updateAttribute Values to update an attribute + * @param {*} [options] Override http request options. + */ + public updateAttribute (attributeCategory: 'category' | 'calculated' | 'global', attributeName: string, updateAttribute: UpdateAttribute, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/contacts/attributes/{attributeCategory}/{attributeName}' + .replace('{' + 'attributeCategory' + '}', encodeURIComponent(String(attributeCategory))) + .replace('{' + 'attributeName' + '}', encodeURIComponent(String(attributeName))); + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; + + // verify required parameter 'attributeCategory' is not null or undefined + if (attributeCategory === null || attributeCategory === undefined) { + throw new Error('Required parameter attributeCategory was null or undefined when calling updateAttribute.'); + } + + // verify required parameter 'attributeName' is not null or undefined + if (attributeName === null || attributeName === undefined) { + throw new Error('Required parameter attributeName was null or undefined when calling updateAttribute.'); + } + + // verify required parameter 'updateAttribute' is not null or undefined + if (updateAttribute === null || updateAttribute === undefined) { + throw new Error('Required parameter updateAttribute was null or undefined when calling updateAttribute.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + const localVarUseFormData = false; + + const localVarRequestOptions: localVarRequest.Options = { + method: 'PUT', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(updateAttribute, "UpdateAttribute") + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } + } + export enum CompaniesApiApiKeys { + apiKey, + partnerKey, + } + + export class CompaniesApi { + protected _basePath = defaultBasePath; + protected defaultHeaders : any = { + 'user-agent': `sendinblue_clientAPI/v${version}/ts-node` + }; + protected _useQuerystring = false; + + protected authentications = { + 'default': new VoidAuth(), + 'apiKey': new ApiKeyAuth('header', 'api-key'), + 'partnerKey': new ApiKeyAuth('header', 'partner-key'), + } + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: CompaniesApiApiKeys, value: string) { + (this.authentications as any)[CompaniesApiApiKeys[key]].apiKey = value; + } + /** + * + * @summary Get company attributes + * @param {*} [options] Override http request options. + */ + public companiesAttributesGet (options: any = {}) : Promise<{ response: http.IncomingMessage; body: CompanyAttributes; }> { + const localVarPath = this.basePath + '/companies/attributes'; + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; + + (Object).assign(localVarHeaderParams, options.headers); + + const localVarUseFormData = false; + + const localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: CompanyAttributes; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + body = ObjectSerializer.deserialize(body, "CompanyAttributes"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } + /** + * + * @summary Get all companies + * @param filters Filter by attrbutes. If you have filter for owner on your side please send it as {\"attributes.owner\":\"5b1a17d914b73d35a76ca0c7\"} + * @param linkedContactsIds Filter by linked contacts ids + * @param linkedDealsIds Filter by linked deals ids + * @param page Index of the first document of the page + * @param limit Number of documents per page + * @param sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed + * @param sortBy The field used to sort field names. + * @param {*} [options] Override http request options. + */ + public companiesGet (filters?: string, linkedContactsIds?: number, linkedDealsIds?: string, page?: number, limit?: number, sort?: 'asc' | 'desc', sortBy?: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: CompaniesList; }> { + const localVarPath = this.basePath + '/companies'; + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; + + if (filters !== undefined) { + localVarQueryParameters['filters'] = ObjectSerializer.serialize(filters, "string"); + } + + if (linkedContactsIds !== undefined) { + localVarQueryParameters['linkedContactsIds'] = ObjectSerializer.serialize(linkedContactsIds, "number"); + } + + if (linkedDealsIds !== undefined) { + localVarQueryParameters['linkedDealsIds'] = ObjectSerializer.serialize(linkedDealsIds, "string"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (limit !== undefined) { + localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); + } + + if (sortBy !== undefined) { + localVarQueryParameters['sortBy'] = ObjectSerializer.serialize(sortBy, "string"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + const localVarUseFormData = false; + + const localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: CompaniesList; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + body = ObjectSerializer.deserialize(body, "CompaniesList"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } + /** + * + * @summary Delete a company + * @param id + * @param {*} [options] Override http request options. + */ + public companiesIdDelete (id: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/companies/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling companiesIdDelete.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + const localVarUseFormData = false; + + const localVarRequestOptions: localVarRequest.Options = { + method: 'DELETE', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } + /** + * + * @summary Get a company + * @param id + * @param {*} [options] Override http request options. + */ + public companiesIdGet (id: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: Company; }> { + const localVarPath = this.basePath + '/companies/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling companiesIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + const localVarUseFormData = false; + + const localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: Company; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + body = ObjectSerializer.deserialize(body, "Company"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } + /** + * + * @summary Update a company + * @param id + * @param body Updated company details. + * @param {*} [options] Override http request options. + */ + public companiesIdPatch (id: string, body: Body1, options: any = {}) : Promise<{ response: http.IncomingMessage; body: Company; }> { + const localVarPath = this.basePath + '/companies/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling companiesIdPatch.'); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling companiesIdPatch.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + const localVarUseFormData = false; + + const localVarRequestOptions: localVarRequest.Options = { + method: 'PATCH', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(body, "Body1") + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: Company; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + body = ObjectSerializer.deserialize(body, "Company"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } + /** + * + * @summary Link and Unlink company with contacts and deals + * @param id + * @param body Linked / Unlinked contacts and deals ids. + * @param {*} [options] Override http request options. + */ + public companiesLinkUnlinkIdPatch (id: string, body: Body2, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/companies/link-unlink/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling companiesLinkUnlinkIdPatch.'); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling companiesLinkUnlinkIdPatch.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + const localVarUseFormData = false; + + const localVarRequestOptions: localVarRequest.Options = { + method: 'PATCH', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(body, "Body2") + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } + /** + * + * @summary Create a company + * @param body Company create data. + * @param {*} [options] Override http request options. + */ + public companiesPost (body: Body, options: any = {}) : Promise<{ response: http.IncomingMessage; body: InlineResponse200; }> { + const localVarPath = this.basePath + '/companies'; + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling companiesPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + const localVarUseFormData = false; + + const localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(body, "Body") + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: InlineResponse200; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + body = ObjectSerializer.deserialize(body, "InlineResponse200"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } + } + export enum ContactsApiApiKeys { + apiKey, + partnerKey, + } + + export class ContactsApi { + protected _basePath = defaultBasePath; + protected defaultHeaders : any = { + 'user-agent': `sendinblue_clientAPI/v${version}/ts-node` + }; + protected _useQuerystring = false; + + protected authentications = { + 'default': new VoidAuth(), + 'apiKey': new ApiKeyAuth('header', 'api-key'), + 'partnerKey': new ApiKeyAuth('header', 'partner-key'), + } + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: ContactsApiApiKeys, value: string) { + (this.authentications as any)[ContactsApiApiKeys[key]].apiKey = value; + } + /** + * + * @summary Add existing contacts to a list + * @param listId Id of the list + * @param contactEmails Emails addresses OR IDs of the contacts + * @param {*} [options] Override http request options. + */ + public addContactToList (listId: number, contactEmails: AddContactToList, options: any = {}) : Promise<{ response: http.IncomingMessage; body: PostContactInfo; }> { + const localVarPath = this.basePath + '/contacts/lists/{listId}/contacts/add' + .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; + + // verify required parameter 'listId' is not null or undefined + if (listId === null || listId === undefined) { + throw new Error('Required parameter listId was null or undefined when calling addContactToList.'); + } + + // verify required parameter 'contactEmails' is not null or undefined + if (contactEmails === null || contactEmails === undefined) { + throw new Error('Required parameter contactEmails was null or undefined when calling addContactToList.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + const localVarUseFormData = false; + + const localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(contactEmails, "AddContactToList") + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: PostContactInfo; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + body = ObjectSerializer.deserialize(body, "PostContactInfo"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } + /** + * + * @summary Create contact attribute + * @param attributeCategory Category of the attribute + * @param attributeName Name of the attribute + * @param createAttribute Values to create an attribute + * @param {*} [options] Override http request options. + */ + public createAttribute (attributeCategory: 'normal' | 'transactional' | 'category' | 'calculated' | 'global', attributeName: string, createAttribute: CreateAttribute, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/contacts/attributes/{attributeCategory}/{attributeName}' + .replace('{' + 'attributeCategory' + '}', encodeURIComponent(String(attributeCategory))) + .replace('{' + 'attributeName' + '}', encodeURIComponent(String(attributeName))); + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; + + // verify required parameter 'attributeCategory' is not null or undefined + if (attributeCategory === null || attributeCategory === undefined) { + throw new Error('Required parameter attributeCategory was null or undefined when calling createAttribute.'); + } + + // verify required parameter 'attributeName' is not null or undefined + if (attributeName === null || attributeName === undefined) { + throw new Error('Required parameter attributeName was null or undefined when calling createAttribute.'); + } + + // verify required parameter 'createAttribute' is not null or undefined + if (createAttribute === null || createAttribute === undefined) { + throw new Error('Required parameter createAttribute was null or undefined when calling createAttribute.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + const localVarUseFormData = false; + + const localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(createAttribute, "CreateAttribute") + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } + /** + * + * @summary Create a contact + * @param createContact Values to create a contact + * @param {*} [options] Override http request options. + */ + public createContact (createContact: CreateContact, options: any = {}) : Promise<{ response: http.IncomingMessage; body: CreateUpdateContactModel; }> { + const localVarPath = this.basePath + '/contacts'; + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; + + // verify required parameter 'createContact' is not null or undefined + if (createContact === null || createContact === undefined) { + throw new Error('Required parameter createContact was null or undefined when calling createContact.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + const localVarUseFormData = false; + + const localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(createContact, "CreateContact") + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: CreateUpdateContactModel; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + body = ObjectSerializer.deserialize(body, "CreateUpdateContactModel"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } + /** + * + * @summary Create Contact via DOI (Double-Opt-In) Flow + * @param createDoiContact Values to create the Double opt-in (DOI) contact + * @param {*} [options] Override http request options. + */ + public createDoiContact (createDoiContact: CreateDoiContact, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/contacts/doubleOptinConfirmation'; + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; + + // verify required parameter 'createDoiContact' is not null or undefined + if (createDoiContact === null || createDoiContact === undefined) { + throw new Error('Required parameter createDoiContact was null or undefined when calling createDoiContact.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + const localVarUseFormData = false; + + const localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(createDoiContact, "CreateDoiContact") + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } + /** + * + * @summary Create a folder + * @param createFolder Name of the folder + * @param {*} [options] Override http request options. + */ + public createFolder (createFolder: CreateUpdateFolder, options: any = {}) : Promise<{ response: http.IncomingMessage; body: CreateModel; }> { + const localVarPath = this.basePath + '/contacts/folders'; + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; + + // verify required parameter 'createFolder' is not null or undefined + if (createFolder === null || createFolder === undefined) { + throw new Error('Required parameter createFolder was null or undefined when calling createFolder.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + const localVarUseFormData = false; + + const localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(createFolder, "CreateUpdateFolder") + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: CreateModel; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + body = ObjectSerializer.deserialize(body, "CreateModel"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } + /** + * + * @summary Create a list + * @param createList Values to create a list + * @param {*} [options] Override http request options. + */ + public createList (createList: CreateList, options: any = {}) : Promise<{ response: http.IncomingMessage; body: CreateModel; }> { + const localVarPath = this.basePath + '/contacts/lists'; + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; + + // verify required parameter 'createList' is not null or undefined + if (createList === null || createList === undefined) { + throw new Error('Required parameter createList was null or undefined when calling createList.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + const localVarUseFormData = false; + + const localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(createList, "CreateList") + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: CreateModel; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + body = ObjectSerializer.deserialize(body, "CreateModel"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } + /** + * + * @summary Delete an attribute + * @param attributeCategory Category of the attribute + * @param attributeName Name of the existing attribute + * @param {*} [options] Override http request options. + */ + public deleteAttribute (attributeCategory: 'normal' | 'transactional' | 'category' | 'calculated' | 'global', attributeName: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/contacts/attributes/{attributeCategory}/{attributeName}' + .replace('{' + 'attributeCategory' + '}', encodeURIComponent(String(attributeCategory))) + .replace('{' + 'attributeName' + '}', encodeURIComponent(String(attributeName))); + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; + + // verify required parameter 'attributeCategory' is not null or undefined + if (attributeCategory === null || attributeCategory === undefined) { + throw new Error('Required parameter attributeCategory was null or undefined when calling deleteAttribute.'); + } + + // verify required parameter 'attributeName' is not null or undefined + if (attributeName === null || attributeName === undefined) { + throw new Error('Required parameter attributeName was null or undefined when calling deleteAttribute.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + const localVarUseFormData = false; + + const localVarRequestOptions: localVarRequest.Options = { + method: 'DELETE', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } + /** + * + * @summary Delete a contact + * @param identifier Email (urlencoded) OR ID of the contact + * @param {*} [options] Override http request options. + */ + public deleteContact (identifier: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/contacts/{identifier}' + .replace('{' + 'identifier' + '}', encodeURIComponent(String(identifier))); + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; + + // verify required parameter 'identifier' is not null or undefined + if (identifier === null || identifier === undefined) { + throw new Error('Required parameter identifier was null or undefined when calling deleteContact.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + const localVarUseFormData = false; + + const localVarRequestOptions: localVarRequest.Options = { + method: 'DELETE', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } + /** + * + * @summary Delete a folder (and all its lists) + * @param folderId Id of the folder + * @param {*} [options] Override http request options. + */ + public deleteFolder (folderId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/contacts/folders/{folderId}' + .replace('{' + 'folderId' + '}', encodeURIComponent(String(folderId))); + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; + + // verify required parameter 'folderId' is not null or undefined + if (folderId === null || folderId === undefined) { + throw new Error('Required parameter folderId was null or undefined when calling deleteFolder.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + const localVarUseFormData = false; + + const localVarRequestOptions: localVarRequest.Options = { + method: 'DELETE', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } + /** + * + * @summary Delete a list + * @param listId Id of the list + * @param {*} [options] Override http request options. + */ + public deleteList (listId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/contacts/lists/{listId}' + .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; + + // verify required parameter 'listId' is not null or undefined + if (listId === null || listId === undefined) { + throw new Error('Required parameter listId was null or undefined when calling deleteList.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + const localVarUseFormData = false; + + const localVarRequestOptions: localVarRequest.Options = { + method: 'DELETE', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } + /** + * + * @summary List all attributes + * @param {*} [options] Override http request options. + */ + public getAttributes (options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetAttributes; }> { + const localVarPath = this.basePath + '/contacts/attributes'; + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; + + (Object).assign(localVarHeaderParams, options.headers); + + const localVarUseFormData = false; + + const localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: GetAttributes; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + body = ObjectSerializer.deserialize(body, "GetAttributes"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } + /** + * Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats (https://developers.sendinblue.com/reference/contacts-7#getcontactstats) endpoint with the appropriate date ranges. + * @summary Get a contact's details + * @param identifier Email (urlencoded) OR ID of the contact OR its SMS attribute value + * @param startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate + * @param endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. + * @param {*} [options] Override http request options. + */ + public getContactInfo (identifier: string, startDate?: any, endDate?: any, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetExtendedContactDetails; }> { + const localVarPath = this.basePath + '/contacts/{identifier}' + .replace('{' + 'identifier' + '}', encodeURIComponent(String(identifier))); + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; + + // verify required parameter 'identifier' is not null or undefined + if (identifier === null || identifier === undefined) { + throw new Error('Required parameter identifier was null or undefined when calling getContactInfo.'); + } + + if (startDate !== undefined) { + localVarQueryParameters['startDate'] = ObjectSerializer.serialize(startDate, "any"); + } + + if (endDate !== undefined) { + localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "any"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + const localVarUseFormData = false; + + const localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: GetExtendedContactDetails; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + body = ObjectSerializer.deserialize(body, "GetExtendedContactDetails"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } + /** + * + * @summary Get email campaigns' statistics for a contact + * @param identifier Email (urlencoded) OR ID of the contact + * @param startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate + * @param endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days + * @param {*} [options] Override http request options. + */ + public getContactStats (identifier: string, startDate?: string, endDate?: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetContactCampaignStats; }> { + const localVarPath = this.basePath + '/contacts/{identifier}/campaignStats' + .replace('{' + 'identifier' + '}', encodeURIComponent(String(identifier))); + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; + + // verify required parameter 'identifier' is not null or undefined + if (identifier === null || identifier === undefined) { + throw new Error('Required parameter identifier was null or undefined when calling getContactStats.'); + } + + if (startDate !== undefined) { + localVarQueryParameters['startDate'] = ObjectSerializer.serialize(startDate, "string"); + } + + if (endDate !== undefined) { + localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "string"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + const localVarUseFormData = false; + + const localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: GetContactCampaignStats; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + body = ObjectSerializer.deserialize(body, "GetContactCampaignStats"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } + /** + * + * @summary Get all the contacts + * @param limit Number of documents per page + * @param offset Index of the first document of the page + * @param modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + * @param {*} [options] Override http request options. + */ + public getContacts (limit?: number, offset?: number, modifiedSince?: string, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetContacts; }> { + const localVarPath = this.basePath + '/contacts'; + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; + + if (limit !== undefined) { + localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); + } + + if (offset !== undefined) { + localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); + } + + if (modifiedSince !== undefined) { + localVarQueryParameters['modifiedSince'] = ObjectSerializer.serialize(modifiedSince, "string"); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + const localVarUseFormData = false; + + const localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: GetContacts; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + body = ObjectSerializer.deserialize(body, "GetContacts"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } + /** + * + * @summary Get contacts in a list + * @param listId Id of the list + * @param modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. + * @param limit Number of documents per page + * @param offset Index of the first document of the page + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + * @param {*} [options] Override http request options. + */ + public getContactsFromList (listId: number, modifiedSince?: string, limit?: number, offset?: number, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetContacts; }> { + const localVarPath = this.basePath + '/contacts/lists/{listId}/contacts' + .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; + + // verify required parameter 'listId' is not null or undefined + if (listId === null || listId === undefined) { + throw new Error('Required parameter listId was null or undefined when calling getContactsFromList.'); + } + + if (modifiedSince !== undefined) { + localVarQueryParameters['modifiedSince'] = ObjectSerializer.serialize(modifiedSince, "string"); + } + + if (limit !== undefined) { + localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); + } + + if (offset !== undefined) { + localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + const localVarUseFormData = false; + + const localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: GetContacts; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + body = ObjectSerializer.deserialize(body, "GetContacts"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } + /** + * + * @summary Returns a folder's details + * @param folderId id of the folder + * @param {*} [options] Override http request options. + */ + public getFolder (folderId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetFolder; }> { + const localVarPath = this.basePath + '/contacts/folders/{folderId}' + .replace('{' + 'folderId' + '}', encodeURIComponent(String(folderId))); + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; + + // verify required parameter 'folderId' is not null or undefined + if (folderId === null || folderId === undefined) { + throw new Error('Required parameter folderId was null or undefined when calling getFolder.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + const localVarUseFormData = false; + + const localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: GetFolder; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + body = ObjectSerializer.deserialize(body, "GetFolder"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } + /** + * + * @summary Get lists in a folder + * @param folderId Id of the folder + * @param limit Number of documents per page + * @param offset Index of the first document of the page + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + * @param {*} [options] Override http request options. + */ + public getFolderLists (folderId: number, limit?: number, offset?: number, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetFolderLists; }> { + const localVarPath = this.basePath + '/contacts/folders/{folderId}/lists' + .replace('{' + 'folderId' + '}', encodeURIComponent(String(folderId))); + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; + + // verify required parameter 'folderId' is not null or undefined + if (folderId === null || folderId === undefined) { + throw new Error('Required parameter folderId was null or undefined when calling getFolderLists.'); + } + + if (limit !== undefined) { + localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); + } + + if (offset !== undefined) { + localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + const localVarUseFormData = false; + + const localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: GetFolderLists; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + body = ObjectSerializer.deserialize(body, "GetFolderLists"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } + /** + * + * @summary Get all folders + * @param limit Number of documents per page + * @param offset Index of the first document of the page + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + * @param {*} [options] Override http request options. + */ + public getFolders (limit: number, offset: number, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetFolders; }> { + const localVarPath = this.basePath + '/contacts/folders'; + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; + + // verify required parameter 'limit' is not null or undefined + if (limit === null || limit === undefined) { + throw new Error('Required parameter limit was null or undefined when calling getFolders.'); + } + + // verify required parameter 'offset' is not null or undefined + if (offset === null || offset === undefined) { + throw new Error('Required parameter offset was null or undefined when calling getFolders.'); + } + + if (limit !== undefined) { + localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); + } + + if (offset !== undefined) { + localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + const localVarUseFormData = false; + + const localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: GetFolders; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + body = ObjectSerializer.deserialize(body, "GetFolders"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } + /** + * + * @summary Get a list's details + * @param listId Id of the list + * @param {*} [options] Override http request options. + */ + public getList (listId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetExtendedList; }> { + const localVarPath = this.basePath + '/contacts/lists/{listId}' + .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; + + // verify required parameter 'listId' is not null or undefined + if (listId === null || listId === undefined) { + throw new Error('Required parameter listId was null or undefined when calling getList.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + const localVarUseFormData = false; + + const localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: GetExtendedList; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + body = ObjectSerializer.deserialize(body, "GetExtendedList"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + } + /** + * + * @summary Get all the lists + * @param limit Number of documents per page + * @param offset Index of the first document of the page + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + * @param {*} [options] Override http request options. + */ + public getLists (limit?: number, offset?: number, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetLists; }> { + const localVarPath = this.basePath + '/contacts/lists'; + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; -export interface Authentication { - /** - * Apply authentication settings to header and query params. - */ - applyToRequest(requestOptions: localVarRequest.Options): void; -} + if (limit !== undefined) { + localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); + } -export class HttpBasicAuth implements Authentication { - public username = ''; - public password = ''; + if (offset !== undefined) { + localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); + } - applyToRequest(requestOptions: localVarRequest.Options): void { - requestOptions.auth = { - username: this.username, password: this.password + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); } - } -} -export class ApiKeyAuth implements Authentication { - public apiKey = ''; + (Object).assign(localVarHeaderParams, options.headers); - constructor(private location: string, private paramName: string) { - } + const localVarUseFormData = false; - applyToRequest(requestOptions: localVarRequest.Options): void { - if (this.location == "query") { - (requestOptions.qs)[this.paramName] = this.apiKey; - } else if (this.location == "header" && requestOptions && requestOptions.headers) { - requestOptions.headers[this.paramName] = this.apiKey; + const localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } } + return new Promise<{ response: http.IncomingMessage; body: GetLists; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + body = ObjectSerializer.deserialize(body, "GetLists"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); } -} + /** + * It returns the background process ID which on completion calls the notify URL that you have set in the input. + * @summary Import contacts + * @param requestContactImport Values to import contacts in Sendinblue. To know more about the expected format, please have a look at ``https://help.sendinblue.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` + * @param {*} [options] Override http request options. + */ + public importContacts (requestContactImport: RequestContactImport, options: any = {}) : Promise<{ response: http.IncomingMessage; body: CreatedProcessId; }> { + const localVarPath = this.basePath + '/contacts/import'; + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; -export class OAuth implements Authentication { - public accessToken = ''; + // verify required parameter 'requestContactImport' is not null or undefined + if (requestContactImport === null || requestContactImport === undefined) { + throw new Error('Required parameter requestContactImport was null or undefined when calling importContacts.'); + } - applyToRequest(requestOptions: localVarRequest.Options): void { - if (requestOptions && requestOptions.headers) { - requestOptions.headers["Authorization"] = "Bearer " + this.accessToken; + (Object).assign(localVarHeaderParams, options.headers); + + const localVarUseFormData = false; + + const localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(requestContactImport, "RequestContactImport") + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } } + return new Promise<{ response: http.IncomingMessage; body: CreatedProcessId; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + body = ObjectSerializer.deserialize(body, "CreatedProcessId"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); } -} + /** + * + * @summary Delete a contact from a list + * @param listId Id of the list + * @param contactEmails Emails addresses OR IDs of the contacts + * @param {*} [options] Override http request options. + */ + public removeContactFromList (listId: number, contactEmails: RemoveContactFromList, options: any = {}) : Promise<{ response: http.IncomingMessage; body: PostContactInfo; }> { + const localVarPath = this.basePath + '/contacts/lists/{listId}/contacts/remove' + .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; -export class VoidAuth implements Authentication { - public username = ''; - public password = ''; + // verify required parameter 'listId' is not null or undefined + if (listId === null || listId === undefined) { + throw new Error('Required parameter listId was null or undefined when calling removeContactFromList.'); + } - applyToRequest(_: localVarRequest.Options): void { - // Do nothing - } -} + // verify required parameter 'contactEmails' is not null or undefined + if (contactEmails === null || contactEmails === undefined) { + throw new Error('Required parameter contactEmails was null or undefined when calling removeContactFromList.'); + } -export enum AccountApiApiKeys { - apiKey, - partnerKey, -} + (Object).assign(localVarHeaderParams, options.headers); -export class AccountApi { - protected _basePath = defaultBasePath; - protected defaultHeaders : any = { - 'user-agent': `sendinblue_clientAPI/v${version}/ts-node` -}; - protected _useQuerystring = false; + const localVarUseFormData = false; - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } + const localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(contactEmails, "RemoveContactFromList") + }; - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; } } + return new Promise<{ response: http.IncomingMessage; body: PostContactInfo; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + body = ObjectSerializer.deserialize(body, "PostContactInfo"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); } + /** + * It returns the background process ID which on completion calls the notify URL that you have set in the input. File will be available in csv. + * @summary Export contacts + * @param requestContactExport Values to request a contact export + * @param {*} [options] Override http request options. + */ + public requestContactExport (requestContactExport: RequestContactExport, options: any = {}) : Promise<{ response: http.IncomingMessage; body: CreatedProcessId; }> { + const localVarPath = this.basePath + '/contacts/export'; + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } + // verify required parameter 'requestContactExport' is not null or undefined + if (requestContactExport === null || requestContactExport === undefined) { + throw new Error('Required parameter requestContactExport was null or undefined when calling requestContactExport.'); + } - set basePath(basePath: string) { - this._basePath = basePath; - } + (Object).assign(localVarHeaderParams, options.headers); - get basePath() { - return this._basePath; - } + const localVarUseFormData = false; - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } + const localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(requestContactExport, "RequestContactExport") + }; - public setApiKey(key: AccountApiApiKeys, value: string) { - (this.authentications as any)[AccountApiApiKeys[key]].apiKey = value; + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: CreatedProcessId; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + body = ObjectSerializer.deserialize(body, "CreatedProcessId"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); } /** - * - * @summary Get your account information, plan and credits details - * @param {*} [options] Override http request options. - */ - public getAccount (options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetAccount; }> { - const localVarPath = this.basePath + '/account'; + * + * @summary Update contact attribute + * @param attributeCategory Category of the attribute + * @param attributeName Name of the existing attribute + * @param updateAttribute Values to update an attribute + * @param {*} [options] Override http request options. + */ + public updateAttribute (attributeCategory: 'category' | 'calculated' | 'global', attributeName: string, updateAttribute: UpdateAttribute, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/contacts/attributes/{attributeCategory}/{attributeName}' + .replace('{' + 'attributeCategory' + '}', encodeURIComponent(String(attributeCategory))) + .replace('{' + 'attributeName' + '}', encodeURIComponent(String(attributeName))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; + // verify required parameter 'attributeCategory' is not null or undefined + if (attributeCategory === null || attributeCategory === undefined) { + throw new Error('Required parameter attributeCategory was null or undefined when calling updateAttribute.'); + } + + // verify required parameter 'attributeName' is not null or undefined + if (attributeName === null || attributeName === undefined) { + throw new Error('Required parameter attributeName was null or undefined when calling updateAttribute.'); + } + + // verify required parameter 'updateAttribute' is not null or undefined + if (updateAttribute === null || updateAttribute === undefined) { + throw new Error('Required parameter updateAttribute was null or undefined when calling updateAttribute.'); + } + (Object).assign(localVarHeaderParams, options.headers); const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'GET', + method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, + body: ObjectSerializer.serialize(updateAttribute, "UpdateAttribute") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -10901,12 +14460,11 @@ export class AccountApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetAccount; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetAccount"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -10916,86 +14474,21 @@ export class AccountApi { }); }); } -} -export enum AttributesApiApiKeys { - apiKey, - partnerKey, -} - -export class AttributesApi { - protected _basePath = defaultBasePath; - protected defaultHeaders : any = { - 'user-agent': `sendinblue_clientAPI/v${version}/ts-node` -}; - protected _useQuerystring = false; - - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } - - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: AttributesApiApiKeys, value: string) { - (this.authentications as any)[AttributesApiApiKeys[key]].apiKey = value; - } /** - * - * @summary Create contact attribute - * @param attributeCategory Category of the attribute - * @param attributeName Name of the attribute - * @param createAttribute Values to create an attribute - * @param {*} [options] Override http request options. - */ - public createAttribute (attributeCategory: 'normal' | 'transactional' | 'category' | 'calculated' | 'global', attributeName: string, createAttribute: CreateAttribute, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/contacts/attributes/{attributeCategory}/{attributeName}' - .replace('{' + 'attributeCategory' + '}', encodeURIComponent(String(attributeCategory))) - .replace('{' + 'attributeName' + '}', encodeURIComponent(String(attributeName))); + * + * @summary Update multiple contacts + * @param updateBatchContacts Values to update multiple contacts + * @param {*} [options] Override http request options. + */ + public updateBatchContacts (updateBatchContacts: UpdateBatchContacts, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/contacts/batch'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'attributeCategory' is not null or undefined - if (attributeCategory === null || attributeCategory === undefined) { - throw new Error('Required parameter attributeCategory was null or undefined when calling createAttribute.'); - } - - // verify required parameter 'attributeName' is not null or undefined - if (attributeName === null || attributeName === undefined) { - throw new Error('Required parameter attributeName was null or undefined when calling createAttribute.'); - } - - // verify required parameter 'createAttribute' is not null or undefined - if (createAttribute === null || createAttribute === undefined) { - throw new Error('Required parameter createAttribute was null or undefined when calling createAttribute.'); + // verify required parameter 'updateBatchContacts' is not null or undefined + if (updateBatchContacts === null || updateBatchContacts === undefined) { + throw new Error('Required parameter updateBatchContacts was null or undefined when calling updateBatchContacts.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -11009,7 +14502,7 @@ export class AttributesApi { uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(createAttribute, "CreateAttribute") + body: ObjectSerializer.serialize(updateBatchContacts, "UpdateBatchContacts") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -11040,28 +14533,27 @@ export class AttributesApi { }); } /** - * - * @summary Delete an attribute - * @param attributeCategory Category of the attribute - * @param attributeName Name of the existing attribute - * @param {*} [options] Override http request options. - */ - public deleteAttribute (attributeCategory: 'normal' | 'transactional' | 'category' | 'calculated' | 'global', attributeName: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/contacts/attributes/{attributeCategory}/{attributeName}' - .replace('{' + 'attributeCategory' + '}', encodeURIComponent(String(attributeCategory))) - .replace('{' + 'attributeName' + '}', encodeURIComponent(String(attributeName))); + * + * @summary Update a contact + * @param identifier Email (urlencoded) OR ID of the contact + * @param updateContact Values to update a contact + * @param {*} [options] Override http request options. + */ + public updateContact (identifier: string, updateContact: UpdateContact, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/contacts/{identifier}' + .replace('{' + 'identifier' + '}', encodeURIComponent(String(identifier))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'attributeCategory' is not null or undefined - if (attributeCategory === null || attributeCategory === undefined) { - throw new Error('Required parameter attributeCategory was null or undefined when calling deleteAttribute.'); + // verify required parameter 'identifier' is not null or undefined + if (identifier === null || identifier === undefined) { + throw new Error('Required parameter identifier was null or undefined when calling updateContact.'); } - // verify required parameter 'attributeName' is not null or undefined - if (attributeName === null || attributeName === undefined) { - throw new Error('Required parameter attributeName was null or undefined when calling deleteAttribute.'); + // verify required parameter 'updateContact' is not null or undefined + if (updateContact === null || updateContact === undefined) { + throw new Error('Required parameter updateContact was null or undefined when calling updateContact.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -11069,12 +14561,13 @@ export class AttributesApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'DELETE', + method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, + body: ObjectSerializer.serialize(updateContact, "UpdateContact") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -11105,27 +14598,41 @@ export class AttributesApi { }); } /** - * - * @summary List all attributes - * @param {*} [options] Override http request options. - */ - public getAttributes (options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetAttributes; }> { - const localVarPath = this.basePath + '/contacts/attributes'; + * + * @summary Update a folder + * @param folderId Id of the folder + * @param updateFolder Name of the folder + * @param {*} [options] Override http request options. + */ + public updateFolder (folderId: number, updateFolder: CreateUpdateFolder, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/contacts/folders/{folderId}' + .replace('{' + 'folderId' + '}', encodeURIComponent(String(folderId))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; + // verify required parameter 'folderId' is not null or undefined + if (folderId === null || folderId === undefined) { + throw new Error('Required parameter folderId was null or undefined when calling updateFolder.'); + } + + // verify required parameter 'updateFolder' is not null or undefined + if (updateFolder === null || updateFolder === undefined) { + throw new Error('Required parameter updateFolder was null or undefined when calling updateFolder.'); + } + (Object).assign(localVarHeaderParams, options.headers); const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'GET', + method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, + body: ObjectSerializer.serialize(updateFolder, "CreateUpdateFolder") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -11141,12 +14648,11 @@ export class AttributesApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetAttributes; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetAttributes"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -11157,34 +14663,27 @@ export class AttributesApi { }); } /** - * - * @summary Update contact attribute - * @param attributeCategory Category of the attribute - * @param attributeName Name of the existing attribute - * @param updateAttribute Values to update an attribute - * @param {*} [options] Override http request options. - */ - public updateAttribute (attributeCategory: 'category' | 'calculated' | 'global', attributeName: string, updateAttribute: UpdateAttribute, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/contacts/attributes/{attributeCategory}/{attributeName}' - .replace('{' + 'attributeCategory' + '}', encodeURIComponent(String(attributeCategory))) - .replace('{' + 'attributeName' + '}', encodeURIComponent(String(attributeName))); + * + * @summary Update a list + * @param listId Id of the list + * @param updateList Values to update a list + * @param {*} [options] Override http request options. + */ + public updateList (listId: number, updateList: UpdateList, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/contacts/lists/{listId}' + .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'attributeCategory' is not null or undefined - if (attributeCategory === null || attributeCategory === undefined) { - throw new Error('Required parameter attributeCategory was null or undefined when calling updateAttribute.'); - } - - // verify required parameter 'attributeName' is not null or undefined - if (attributeName === null || attributeName === undefined) { - throw new Error('Required parameter attributeName was null or undefined when calling updateAttribute.'); + // verify required parameter 'listId' is not null or undefined + if (listId === null || listId === undefined) { + throw new Error('Required parameter listId was null or undefined when calling updateList.'); } - // verify required parameter 'updateAttribute' is not null or undefined - if (updateAttribute === null || updateAttribute === undefined) { - throw new Error('Required parameter updateAttribute was null or undefined when calling updateAttribute.'); + // verify required parameter 'updateList' is not null or undefined + if (updateList === null || updateList === undefined) { + throw new Error('Required parameter updateList was null or undefined when calling updateList.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -11198,7 +14697,7 @@ export class AttributesApi { uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(updateAttribute, "UpdateAttribute") + body: ObjectSerializer.serialize(updateList, "UpdateList") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -11228,17 +14727,15 @@ export class AttributesApi { }); }); } -} -export enum CRMApiApiKeys { + } + export enum ConversationsApiApiKeys { apiKey, partnerKey, -} + } -export class CRMApi { + export class ConversationsApi { protected _basePath = defaultBasePath; - protected defaultHeaders : any = { - 'user-agent': `sendinblue_clientAPI/v${version}/ts-node` -}; + protected defaultHeaders : any = {}; protected _useQuerystring = false; protected authentications = { @@ -11276,112 +14773,24 @@ export class CRMApi { this.authentications.default = auth; } - public setApiKey(key: CRMApiApiKeys, value: string) { - (this.authentications as any)[CRMApiApiKeys[key]].apiKey = value; - } - /** - * - * @summary Get all notes - * @param entity Filter by note entity type - * @param entityIds Filter by note entity IDs - * @param dateFrom dateFrom to date range filter type (timestamp in milliseconds) - * @param dateTo dateTo to date range filter type (timestamp in milliseconds) - * @param offset Index of the first document of the page - * @param limit Number of documents per page - * @param sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed - * @param {*} [options] Override http request options. - */ - public crmNotesGet (entity?: 'companies' | 'deals' | 'contacts', entityIds?: string, dateFrom?: number, dateTo?: number, offset?: number, limit?: number, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: NoteList; }> { - const localVarPath = this.basePath + '/crm/notes'; - const localVarQueryParameters: any = {}; - const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); - const localVarFormParams: any = {}; - - if (entity !== undefined) { - localVarQueryParameters['entity'] = ObjectSerializer.serialize(entity, "'companies' | 'deals' | 'contacts'"); - } - - if (entityIds !== undefined) { - localVarQueryParameters['entityIds'] = ObjectSerializer.serialize(entityIds, "string"); - } - - if (dateFrom !== undefined) { - localVarQueryParameters['dateFrom'] = ObjectSerializer.serialize(dateFrom, "number"); - } - - if (dateTo !== undefined) { - localVarQueryParameters['dateTo'] = ObjectSerializer.serialize(dateTo, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - const localVarUseFormData = false; - - const localVarRequestOptions: localVarRequest.Options = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - uri: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - this.authentications.apiKey.applyToRequest(localVarRequestOptions); - - this.authentications.partnerKey.applyToRequest(localVarRequestOptions); - - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: NoteList; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - body = ObjectSerializer.deserialize(body, "NoteList"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject({ response: response, body: body }); - } - } - }); - }); - } - /** - * - * @summary Delete a note - * @param id Note ID to delete - * @param {*} [options] Override http request options. - */ - public crmNotesIdDelete (id: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/crm/notes/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + public setApiKey(key: ConversationsApiApiKeys, value: string) { + (this.authentications as any)[ConversationsApiApiKeys[key]].apiKey = value; + } + /** + * We recommend pinging this endpoint every minute for as long as the agent has to be considered online. + * @summary Sets agent’s status to online for 2-3 minutes + * @param body Agent fields. + * @param {*} [options] Override http request options. + */ + public conversationsAgentOnlinePingPost (body: Body12, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/conversations/agentOnlinePing'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling crmNotesIdDelete.'); + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling conversationsAgentOnlinePingPost.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -11389,12 +14798,13 @@ export class CRMApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'DELETE', + method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, + body: ObjectSerializer.serialize(body, "Body12") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -11425,13 +14835,13 @@ export class CRMApi { }); } /** - * - * @summary Get a note - * @param id Note ID to get - * @param {*} [options] Override http request options. - */ - public crmNotesIdGet (id: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: Note; }> { - const localVarPath = this.basePath + '/crm/notes/{id}' + * Only agents’ messages can be deleted. + * @summary Delete a message sent by an agent + * @param id ID of the message + * @param {*} [options] Override http request options. + */ + public conversationsMessagesIdDelete (id: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/conversations/messages/{id}' .replace('{' + 'id' + '}', encodeURIComponent(String(id))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); @@ -11439,7 +14849,7 @@ export class CRMApi { // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling crmNotesIdGet.'); + throw new Error('Required parameter id was null or undefined when calling conversationsMessagesIdDelete.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -11447,7 +14857,7 @@ export class CRMApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'GET', + method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, @@ -11468,12 +14878,11 @@ export class CRMApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: Note; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "Note"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -11484,14 +14893,13 @@ export class CRMApi { }); } /** - * - * @summary Update a note - * @param id Note ID to update - * @param body Note data to update a note - * @param {*} [options] Override http request options. - */ - public crmNotesIdPatch (id: string, body: NoteData, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/crm/notes/{id}' + * + * @summary Get a message + * @param id ID of the message + * @param {*} [options] Override http request options. + */ + public conversationsMessagesIdGet (id: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: ConversationsMessage; }> { + const localVarPath = this.basePath + '/conversations/messages/{id}' .replace('{' + 'id' + '}', encodeURIComponent(String(id))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); @@ -11499,12 +14907,7 @@ export class CRMApi { // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling crmNotesIdPatch.'); - } - - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling crmNotesIdPatch.'); + throw new Error('Required parameter id was null or undefined when calling conversationsMessagesIdGet.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -11512,13 +14915,12 @@ export class CRMApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'PATCH', + method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(body, "NoteData") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -11534,11 +14936,12 @@ export class CRMApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: ConversationsMessage; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { + body = ObjectSerializer.deserialize(body, "ConversationsMessage"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -11549,20 +14952,22 @@ export class CRMApi { }); } /** - * - * @summary Create a note - * @param body Note data to create a note. - * @param {*} [options] Override http request options. - */ - public crmNotesPost (body: NoteData, options: any = {}) : Promise<{ response: http.IncomingMessage; body: NoteId; }> { - const localVarPath = this.basePath + '/crm/notes'; + * Only agents’ messages can be edited. + * @summary Update a message sent by an agent + * @param id ID of the message + * @param body + * @param {*} [options] Override http request options. + */ + public conversationsMessagesIdPut (id: string, body?: Body9, options: any = {}) : Promise<{ response: http.IncomingMessage; body: ConversationsMessage; }> { + const localVarPath = this.basePath + '/conversations/messages/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling crmNotesPost.'); + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling conversationsMessagesIdPut.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -11570,13 +14975,13 @@ export class CRMApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'POST', + method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(body, "NoteData") + body: ObjectSerializer.serialize(body, "Body9") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -11592,12 +14997,12 @@ export class CRMApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: NoteId; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: ConversationsMessage; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "NoteId"); + body = ObjectSerializer.deserialize(body, "ConversationsMessage"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -11608,79 +15013,20 @@ export class CRMApi { }); } /** - * - * @summary Get all tasks - * @param filterType Filter by task type (ID) - * @param filterStatus Filter by task status - * @param filterDate Filter by date - * @param filterAssignTo Filter by assignTo id - * @param filterContacts Filter by contact ids - * @param filterDeals Filter by deals ids - * @param filterCompanies Filter by companies ids - * @param dateFrom dateFrom to date range filter type (timestamp in milliseconds) - * @param dateTo dateTo to date range filter type (timestamp in milliseconds) - * @param offset Index of the first document of the page - * @param limit Number of documents per page - * @param sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed - * @param sortBy The field used to sort field names. - * @param {*} [options] Override http request options. - */ - public crmTasksGet (filterType?: string, filterStatus?: 'done' | 'undone', filterDate?: 'overdue' | 'today' | 'tomorrow' | 'week' | 'range', filterAssignTo?: string, filterContacts?: string, filterDeals?: string, filterCompanies?: string, dateFrom?: number, dateTo?: number, offset?: number, limit?: number, sort?: 'asc' | 'desc', sortBy?: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: TaskList; }> { - const localVarPath = this.basePath + '/crm/tasks'; + * + * @summary Send a message as an agent + * @param body Message fields. + * @param {*} [options] Override http request options. + */ + public conversationsMessagesPost (body: Body8, options: any = {}) : Promise<{ response: http.IncomingMessage; body: ConversationsMessage; }> { + const localVarPath = this.basePath + '/conversations/messages'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - if (filterType !== undefined) { - localVarQueryParameters['filter[type]'] = ObjectSerializer.serialize(filterType, "string"); - } - - if (filterStatus !== undefined) { - localVarQueryParameters['filter[status]'] = ObjectSerializer.serialize(filterStatus, "'done' | 'undone'"); - } - - if (filterDate !== undefined) { - localVarQueryParameters['filter[date]'] = ObjectSerializer.serialize(filterDate, "'overdue' | 'today' | 'tomorrow' | 'week' | 'range'"); - } - - if (filterAssignTo !== undefined) { - localVarQueryParameters['filter[assignTo]'] = ObjectSerializer.serialize(filterAssignTo, "string"); - } - - if (filterContacts !== undefined) { - localVarQueryParameters['filter[contacts]'] = ObjectSerializer.serialize(filterContacts, "string"); - } - - if (filterDeals !== undefined) { - localVarQueryParameters['filter[deals]'] = ObjectSerializer.serialize(filterDeals, "string"); - } - - if (filterCompanies !== undefined) { - localVarQueryParameters['filter[companies]'] = ObjectSerializer.serialize(filterCompanies, "string"); - } - - if (dateFrom !== undefined) { - localVarQueryParameters['dateFrom'] = ObjectSerializer.serialize(dateFrom, "number"); - } - - if (dateTo !== undefined) { - localVarQueryParameters['dateTo'] = ObjectSerializer.serialize(dateTo, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - if (sortBy !== undefined) { - localVarQueryParameters['sortBy'] = ObjectSerializer.serialize(sortBy, "string"); + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling conversationsMessagesPost.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -11688,12 +15034,13 @@ export class CRMApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'GET', + method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, + body: ObjectSerializer.serialize(body, "Body8") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -11709,12 +15056,12 @@ export class CRMApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: TaskList; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: ConversationsMessage; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "TaskList"); + body = ObjectSerializer.deserialize(body, "ConversationsMessage"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -11725,13 +15072,13 @@ export class CRMApi { }); } /** - * - * @summary Delete a task - * @param id - * @param {*} [options] Override http request options. - */ - public crmTasksIdDelete (id: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/crm/tasks/{id}' + * + * @summary Delete an automated message + * @param id ID of the message + * @param {*} [options] Override http request options. + */ + public conversationsPushedMessagesIdDelete (id: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/conversations/pushedMessages/{id}' .replace('{' + 'id' + '}', encodeURIComponent(String(id))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); @@ -11739,7 +15086,7 @@ export class CRMApi { // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling crmTasksIdDelete.'); + throw new Error('Required parameter id was null or undefined when calling conversationsPushedMessagesIdDelete.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -11783,13 +15130,13 @@ export class CRMApi { }); } /** - * - * @summary Get a task - * @param id - * @param {*} [options] Override http request options. - */ - public crmTasksIdGet (id: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: Task; }> { - const localVarPath = this.basePath + '/crm/tasks/{id}' + * + * @summary Get an automated message + * @param id ID of the message sent previously + * @param {*} [options] Override http request options. + */ + public conversationsPushedMessagesIdGet (id: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: ConversationsMessage; }> { + const localVarPath = this.basePath + '/conversations/pushedMessages/{id}' .replace('{' + 'id' + '}', encodeURIComponent(String(id))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); @@ -11797,7 +15144,7 @@ export class CRMApi { // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling crmTasksIdGet.'); + throw new Error('Required parameter id was null or undefined when calling conversationsPushedMessagesIdGet.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -11826,12 +15173,12 @@ export class CRMApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: Task; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: ConversationsMessage; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "Task"); + body = ObjectSerializer.deserialize(body, "ConversationsMessage"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -11842,14 +15189,14 @@ export class CRMApi { }); } /** - * - * @summary Update a task - * @param id - * @param body Updated task details. - * @param {*} [options] Override http request options. - */ - public crmTasksIdPatch (id: string, body: Body1, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/crm/tasks/{id}' + * + * @summary Update an automated message + * @param id ID of the message + * @param body + * @param {*} [options] Override http request options. + */ + public conversationsPushedMessagesIdPut (id: string, body: Body11, options: any = {}) : Promise<{ response: http.IncomingMessage; body: ConversationsMessage; }> { + const localVarPath = this.basePath + '/conversations/pushedMessages/{id}' .replace('{' + 'id' + '}', encodeURIComponent(String(id))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); @@ -11857,12 +15204,12 @@ export class CRMApi { // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling crmTasksIdPatch.'); + throw new Error('Required parameter id was null or undefined when calling conversationsPushedMessagesIdPut.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling crmTasksIdPatch.'); + throw new Error('Required parameter body was null or undefined when calling conversationsPushedMessagesIdPut.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -11870,13 +15217,13 @@ export class CRMApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'PATCH', + method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(body, "Body1") + body: ObjectSerializer.serialize(body, "Body11") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -11892,11 +15239,12 @@ export class CRMApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: ConversationsMessage; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { + body = ObjectSerializer.deserialize(body, "ConversationsMessage"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -11907,20 +15255,20 @@ export class CRMApi { }); } /** - * - * @summary Create a task - * @param body Task name. - * @param {*} [options] Override http request options. - */ - public crmTasksPost (body: Body, options: any = {}) : Promise<{ response: http.IncomingMessage; body: InlineResponse201; }> { - const localVarPath = this.basePath + '/crm/tasks'; + * Example of automated messages: order status, announce new features in your web app, etc. + * @summary Send an automated message to a visitor + * @param body + * @param {*} [options] Override http request options. + */ + public conversationsPushedMessagesPost (body: Body10, options: any = {}) : Promise<{ response: http.IncomingMessage; body: ConversationsMessage; }> { + const localVarPath = this.basePath + '/conversations/pushedMessages'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling crmTasksPost.'); + throw new Error('Required parameter body was null or undefined when calling conversationsPushedMessagesPost.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -11934,7 +15282,7 @@ export class CRMApi { uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(body, "Body") + body: ObjectSerializer.serialize(body, "Body10") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -11950,12 +15298,12 @@ export class CRMApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: InlineResponse201; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: ConversationsMessage; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "InlineResponse201"); + body = ObjectSerializer.deserialize(body, "ConversationsMessage"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -11965,69 +15313,15 @@ export class CRMApi { }); }); } - /** - * - * @summary Get all task types - * @param {*} [options] Override http request options. - */ - public crmTasktypesGet (options: any = {}) : Promise<{ response: http.IncomingMessage; body: TaskTypes; }> { - const localVarPath = this.basePath + '/crm/tasktypes'; - const localVarQueryParameters: any = {}; - const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); - const localVarFormParams: any = {}; - - (Object).assign(localVarHeaderParams, options.headers); - - const localVarUseFormData = false; - - const localVarRequestOptions: localVarRequest.Options = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - uri: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - this.authentications.apiKey.applyToRequest(localVarRequestOptions); - - this.authentications.partnerKey.applyToRequest(localVarRequestOptions); - - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: TaskTypes; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - body = ObjectSerializer.deserialize(body, "TaskTypes"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject({ response: response, body: body }); - } - } - }); - }); } -} -export enum ContactsApiApiKeys { + export enum DealsApiApiKeys { apiKey, partnerKey, -} + } -export class ContactsApi { + export class DealsApi { protected _basePath = defaultBasePath; - protected defaultHeaders : any = { - 'user-agent': `sendinblue_clientAPI/v${version}/ts-node` -}; + protected defaultHeaders : any = {}; protected _useQuerystring = false; protected authentications = { @@ -12065,45 +15359,31 @@ export class ContactsApi { this.authentications.default = auth; } - public setApiKey(key: ContactsApiApiKeys, value: string) { - (this.authentications as any)[ContactsApiApiKeys[key]].apiKey = value; + public setApiKey(key: DealsApiApiKeys, value: string) { + (this.authentications as any)[DealsApiApiKeys[key]].apiKey = value; } /** - * - * @summary Add existing contacts to a list - * @param listId Id of the list - * @param contactEmails Emails addresses OR IDs of the contacts - * @param {*} [options] Override http request options. - */ - public addContactToList (listId: number, contactEmails: AddContactToList, options: any = {}) : Promise<{ response: http.IncomingMessage; body: PostContactInfo; }> { - const localVarPath = this.basePath + '/contacts/lists/{listId}/contacts/add' - .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); + * + * @summary Get deal attributes + * @param {*} [options] Override http request options. + */ + public crmAttributesDealsGet (options: any = {}) : Promise<{ response: http.IncomingMessage; body: DealAttributes; }> { + const localVarPath = this.basePath + '/crm/attributes/deals'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'listId' is not null or undefined - if (listId === null || listId === undefined) { - throw new Error('Required parameter listId was null or undefined when calling addContactToList.'); - } - - // verify required parameter 'contactEmails' is not null or undefined - if (contactEmails === null || contactEmails === undefined) { - throw new Error('Required parameter contactEmails was null or undefined when calling addContactToList.'); - } - (Object).assign(localVarHeaderParams, options.headers); const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'POST', + method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(contactEmails, "AddContactToList") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -12119,12 +15399,12 @@ export class ContactsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: PostContactInfo; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: DealAttributes; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "PostContactInfo"); + body = ObjectSerializer.deserialize(body, "DealAttributes"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -12135,92 +15415,49 @@ export class ContactsApi { }); } /** - * - * @summary Create contact attribute - * @param attributeCategory Category of the attribute - * @param attributeName Name of the attribute - * @param createAttribute Values to create an attribute - * @param {*} [options] Override http request options. - */ - public createAttribute (attributeCategory: 'normal' | 'transactional' | 'category' | 'calculated' | 'global', attributeName: string, createAttribute: CreateAttribute, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/contacts/attributes/{attributeCategory}/{attributeName}' - .replace('{' + 'attributeCategory' + '}', encodeURIComponent(String(attributeCategory))) - .replace('{' + 'attributeName' + '}', encodeURIComponent(String(attributeName))); + * + * @summary Get all deals + * @param filterAttributes Filter by attrbutes. If you have filter for owner on your side please send it as `attributes.owner`.\" + * @param filterLinkedCompaniesIds Filter by linked companies ids + * @param filterLinkedContactsIds Filter by linked companies ids + * @param offset Index of the first document of the page + * @param limit Number of documents per page + * @param sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed + * @param sortBy The field used to sort field names. + * @param {*} [options] Override http request options. + */ + public crmDealsGet (filterAttributes?: string, filterLinkedCompaniesIds?: string, filterLinkedContactsIds?: string, offset?: number, limit?: number, sort?: 'asc' | 'desc', sortBy?: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: DealsList; }> { + const localVarPath = this.basePath + '/crm/deals'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'attributeCategory' is not null or undefined - if (attributeCategory === null || attributeCategory === undefined) { - throw new Error('Required parameter attributeCategory was null or undefined when calling createAttribute.'); - } - - // verify required parameter 'attributeName' is not null or undefined - if (attributeName === null || attributeName === undefined) { - throw new Error('Required parameter attributeName was null or undefined when calling createAttribute.'); - } - - // verify required parameter 'createAttribute' is not null or undefined - if (createAttribute === null || createAttribute === undefined) { - throw new Error('Required parameter createAttribute was null or undefined when calling createAttribute.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - const localVarUseFormData = false; - - const localVarRequestOptions: localVarRequest.Options = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - uri: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(createAttribute, "CreateAttribute") - }; - - this.authentications.apiKey.applyToRequest(localVarRequestOptions); - - this.authentications.partnerKey.applyToRequest(localVarRequestOptions); - - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } + if (filterAttributes !== undefined) { + localVarQueryParameters['filter[attributes]'] = ObjectSerializer.serialize(filterAttributes, "string"); } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject({ response: response, body: body }); - } - } - }); - }); - } - /** - * - * @summary Create a contact - * @param createContact Values to create a contact - * @param {*} [options] Override http request options. - */ - public createContact (createContact: CreateContact, options: any = {}) : Promise<{ response: http.IncomingMessage; body: CreateUpdateContactModel; }> { - const localVarPath = this.basePath + '/contacts'; - const localVarQueryParameters: any = {}; - const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); - const localVarFormParams: any = {}; - // verify required parameter 'createContact' is not null or undefined - if (createContact === null || createContact === undefined) { - throw new Error('Required parameter createContact was null or undefined when calling createContact.'); + if (filterLinkedCompaniesIds !== undefined) { + localVarQueryParameters['filter[linkedCompaniesIds]'] = ObjectSerializer.serialize(filterLinkedCompaniesIds, "string"); + } + + if (filterLinkedContactsIds !== undefined) { + localVarQueryParameters['filter[linkedContactsIds]'] = ObjectSerializer.serialize(filterLinkedContactsIds, "string"); + } + + if (offset !== undefined) { + localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); + } + + if (limit !== undefined) { + localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); + } + + if (sortBy !== undefined) { + localVarQueryParameters['sortBy'] = ObjectSerializer.serialize(sortBy, "string"); } (Object).assign(localVarHeaderParams, options.headers); @@ -12228,13 +15465,12 @@ export class ContactsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'POST', + method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(createContact, "CreateContact") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -12250,12 +15486,12 @@ export class ContactsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: CreateUpdateContactModel; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: DealsList; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "CreateUpdateContactModel"); + body = ObjectSerializer.deserialize(body, "DealsList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -12266,20 +15502,21 @@ export class ContactsApi { }); } /** - * - * @summary Create Contact via DOI (Double-Opt-In) Flow - * @param createDoiContact Values to create the Double opt-in (DOI) contact - * @param {*} [options] Override http request options. - */ - public createDoiContact (createDoiContact: CreateDoiContact, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/contacts/doubleOptinConfirmation'; + * + * @summary Delete a deal + * @param id + * @param {*} [options] Override http request options. + */ + public crmDealsIdDelete (id: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/crm/deals/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'createDoiContact' is not null or undefined - if (createDoiContact === null || createDoiContact === undefined) { - throw new Error('Required parameter createDoiContact was null or undefined when calling createDoiContact.'); + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling crmDealsIdDelete.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -12287,13 +15524,12 @@ export class ContactsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'POST', + method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(createDoiContact, "CreateDoiContact") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -12324,20 +15560,21 @@ export class ContactsApi { }); } /** - * - * @summary Create a folder - * @param createFolder Name of the folder - * @param {*} [options] Override http request options. - */ - public createFolder (createFolder: CreateUpdateFolder, options: any = {}) : Promise<{ response: http.IncomingMessage; body: CreateModel; }> { - const localVarPath = this.basePath + '/contacts/folders'; + * + * @summary Get a deal + * @param id + * @param {*} [options] Override http request options. + */ + public crmDealsIdGet (id: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: Deal; }> { + const localVarPath = this.basePath + '/crm/deals/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'createFolder' is not null or undefined - if (createFolder === null || createFolder === undefined) { - throw new Error('Required parameter createFolder was null or undefined when calling createFolder.'); + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling crmDealsIdGet.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -12345,13 +15582,12 @@ export class ContactsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'POST', + method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(createFolder, "CreateUpdateFolder") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -12367,12 +15603,12 @@ export class ContactsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: CreateModel; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: Deal; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "CreateModel"); + body = ObjectSerializer.deserialize(body, "Deal"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -12383,20 +15619,27 @@ export class ContactsApi { }); } /** - * - * @summary Create a list - * @param createList Values to create a list - * @param {*} [options] Override http request options. - */ - public createList (createList: CreateList, options: any = {}) : Promise<{ response: http.IncomingMessage; body: CreateModel; }> { - const localVarPath = this.basePath + '/contacts/lists'; + * + * @summary Update a deal + * @param id + * @param body Updated deal details. + * @param {*} [options] Override http request options. + */ + public crmDealsIdPatch (id: string, body: Body4, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/crm/deals/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'createList' is not null or undefined - if (createList === null || createList === undefined) { - throw new Error('Required parameter createList was null or undefined when calling createList.'); + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling crmDealsIdPatch.'); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling crmDealsIdPatch.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -12404,13 +15647,13 @@ export class ContactsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'POST', + method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(createList, "CreateList") + body: ObjectSerializer.serialize(body, "Body4") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -12426,12 +15669,11 @@ export class ContactsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: CreateModel; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "CreateModel"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -12442,28 +15684,27 @@ export class ContactsApi { }); } /** - * - * @summary Delete an attribute - * @param attributeCategory Category of the attribute - * @param attributeName Name of the existing attribute - * @param {*} [options] Override http request options. - */ - public deleteAttribute (attributeCategory: 'normal' | 'transactional' | 'category' | 'calculated' | 'global', attributeName: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/contacts/attributes/{attributeCategory}/{attributeName}' - .replace('{' + 'attributeCategory' + '}', encodeURIComponent(String(attributeCategory))) - .replace('{' + 'attributeName' + '}', encodeURIComponent(String(attributeName))); + * + * @summary Link and Unlink a deal with contacts and companies + * @param id + * @param body Linked / Unlinked contacts and companies ids. + * @param {*} [options] Override http request options. + */ + public crmDealsLinkUnlinkIdPatch (id: string, body: Body5, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/crm/deals/link-unlink/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'attributeCategory' is not null or undefined - if (attributeCategory === null || attributeCategory === undefined) { - throw new Error('Required parameter attributeCategory was null or undefined when calling deleteAttribute.'); + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling crmDealsLinkUnlinkIdPatch.'); } - // verify required parameter 'attributeName' is not null or undefined - if (attributeName === null || attributeName === undefined) { - throw new Error('Required parameter attributeName was null or undefined when calling deleteAttribute.'); + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling crmDealsLinkUnlinkIdPatch.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -12471,12 +15712,13 @@ export class ContactsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'DELETE', + method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, + body: ObjectSerializer.serialize(body, "Body5") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -12507,21 +15749,20 @@ export class ContactsApi { }); } /** - * - * @summary Delete a contact - * @param identifier Email (urlencoded) OR ID of the contact - * @param {*} [options] Override http request options. - */ - public deleteContact (identifier: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/contacts/{identifier}' - .replace('{' + 'identifier' + '}', encodeURIComponent(String(identifier))); + * + * @summary Create a deal + * @param body Deal create data. + * @param {*} [options] Override http request options. + */ + public crmDealsPost (body: Body3, options: any = {}) : Promise<{ response: http.IncomingMessage; body: InlineResponse201; }> { + const localVarPath = this.basePath + '/crm/deals'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'identifier' is not null or undefined - if (identifier === null || identifier === undefined) { - throw new Error('Required parameter identifier was null or undefined when calling deleteContact.'); + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling crmDealsPost.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -12529,12 +15770,13 @@ export class ContactsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'DELETE', + method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, + body: ObjectSerializer.serialize(body, "Body3") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -12550,11 +15792,12 @@ export class ContactsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: InlineResponse201; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { + body = ObjectSerializer.deserialize(body, "InlineResponse201"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -12565,29 +15808,22 @@ export class ContactsApi { }); } /** - * - * @summary Delete a folder (and all its lists) - * @param folderId Id of the folder - * @param {*} [options] Override http request options. - */ - public deleteFolder (folderId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/contacts/folders/{folderId}' - .replace('{' + 'folderId' + '}', encodeURIComponent(String(folderId))); + * + * @summary Get pipeline stages + * @param {*} [options] Override http request options. + */ + public crmPipelineDetailsGet (options: any = {}) : Promise<{ response: http.IncomingMessage; body: Pipeline; }> { + const localVarPath = this.basePath + '/crm/pipeline/details'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'folderId' is not null or undefined - if (folderId === null || folderId === undefined) { - throw new Error('Required parameter folderId was null or undefined when calling deleteFolder.'); - } - (Object).assign(localVarHeaderParams, options.headers); const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'DELETE', + method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, @@ -12608,11 +15844,12 @@ export class ContactsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: Pipeline; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { + body = ObjectSerializer.deserialize(body, "Pipeline"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -12622,22 +15859,72 @@ export class ContactsApi { }); }); } + } + export enum EmailCampaignsApiApiKeys { + apiKey, + partnerKey, + } + + export class EmailCampaignsApi { + protected _basePath = defaultBasePath; + protected defaultHeaders : any = { + 'user-agent': `sendinblue_clientAPI/v${version}/ts-node` + }; + protected _useQuerystring = false; + + protected authentications = { + 'default': new VoidAuth(), + 'apiKey': new ApiKeyAuth('header', 'api-key'), + 'partnerKey': new ApiKeyAuth('header', 'partner-key'), + } + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: EmailCampaignsApiApiKeys, value: string) { + (this.authentications as any)[EmailCampaignsApiApiKeys[key]].apiKey = value; + } /** - * - * @summary Delete a list - * @param listId Id of the list - * @param {*} [options] Override http request options. - */ - public deleteList (listId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/contacts/lists/{listId}' - .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); + * + * @summary Create an email campaign + * @param emailCampaigns Values to create a campaign + * @param {*} [options] Override http request options. + */ + public createEmailCampaign (emailCampaigns: CreateEmailCampaign, options: any = {}) : Promise<{ response: http.IncomingMessage; body: CreateModel; }> { + const localVarPath = this.basePath + '/emailCampaigns'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'listId' is not null or undefined - if (listId === null || listId === undefined) { - throw new Error('Required parameter listId was null or undefined when calling deleteList.'); + // verify required parameter 'emailCampaigns' is not null or undefined + if (emailCampaigns === null || emailCampaigns === undefined) { + throw new Error('Required parameter emailCampaigns was null or undefined when calling createEmailCampaign.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -12645,12 +15932,13 @@ export class ContactsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'DELETE', + method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, + body: ObjectSerializer.serialize(emailCampaigns, "CreateEmailCampaign") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -12666,11 +15954,12 @@ export class ContactsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: CreateModel; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { + body = ObjectSerializer.deserialize(body, "CreateModel"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -12681,22 +15970,29 @@ export class ContactsApi { }); } /** - * - * @summary List all attributes - * @param {*} [options] Override http request options. - */ - public getAttributes (options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetAttributes; }> { - const localVarPath = this.basePath + '/contacts/attributes'; + * + * @summary Delete an email campaign + * @param campaignId id of the campaign + * @param {*} [options] Override http request options. + */ + public deleteEmailCampaign (campaignId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/emailCampaigns/{campaignId}' + .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; + // verify required parameter 'campaignId' is not null or undefined + if (campaignId === null || campaignId === undefined) { + throw new Error('Required parameter campaignId was null or undefined when calling deleteEmailCampaign.'); + } + (Object).assign(localVarHeaderParams, options.headers); const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'GET', + method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, @@ -12717,12 +16013,11 @@ export class ContactsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetAttributes; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetAttributes"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -12733,31 +16028,22 @@ export class ContactsApi { }); } /** - * Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats (https://developers.sendinblue.com/reference/contacts-7#getcontactstats) endpoint with the appropriate date ranges. - * @summary Get a contact's details - * @param identifier Email (urlencoded) OR ID of the contact OR its SMS attribute value - * @param startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate - * @param endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. - * @param {*} [options] Override http request options. - */ - public getContactInfo (identifier: string, startDate?: any, endDate?: any, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetExtendedContactDetails; }> { - const localVarPath = this.basePath + '/contacts/{identifier}' - .replace('{' + 'identifier' + '}', encodeURIComponent(String(identifier))); + * + * @summary Export the recipients of an email campaign + * @param campaignId Id of the campaign + * @param recipientExport Values to send for a recipient export request + * @param {*} [options] Override http request options. + */ + public emailExportRecipients (campaignId: number, recipientExport?: EmailExportRecipients, options: any = {}) : Promise<{ response: http.IncomingMessage; body: CreatedProcessId; }> { + const localVarPath = this.basePath + '/emailCampaigns/{campaignId}/exportRecipients' + .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'identifier' is not null or undefined - if (identifier === null || identifier === undefined) { - throw new Error('Required parameter identifier was null or undefined when calling getContactInfo.'); - } - - if (startDate !== undefined) { - localVarQueryParameters['startDate'] = ObjectSerializer.serialize(startDate, "any"); - } - - if (endDate !== undefined) { - localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "any"); + // verify required parameter 'campaignId' is not null or undefined + if (campaignId === null || campaignId === undefined) { + throw new Error('Required parameter campaignId was null or undefined when calling emailExportRecipients.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -12765,12 +16051,13 @@ export class ContactsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'GET', + method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, + body: ObjectSerializer.serialize(recipientExport, "EmailExportRecipients") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -12786,12 +16073,12 @@ export class ContactsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetExtendedContactDetails; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: CreatedProcessId; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetExtendedContactDetails"); + body = ObjectSerializer.deserialize(body, "CreatedProcessId"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -12802,31 +16089,21 @@ export class ContactsApi { }); } /** - * - * @summary Get email campaigns' statistics for a contact - * @param identifier Email (urlencoded) OR ID of the contact - * @param startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate - * @param endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days - * @param {*} [options] Override http request options. - */ - public getContactStats (identifier: string, startDate?: string, endDate?: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetContactCampaignStats; }> { - const localVarPath = this.basePath + '/contacts/{identifier}/campaignStats' - .replace('{' + 'identifier' + '}', encodeURIComponent(String(identifier))); + * Obtain winning version of an A/B test email campaign + * @summary Get an A/B test email campaign results + * @param campaignId Id of the A/B test campaign + * @param {*} [options] Override http request options. + */ + public getAbTestCampaignResult (campaignId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body: AbTestCampaignResult; }> { + const localVarPath = this.basePath + '/emailCampaigns/{campaignId}/abTestCampaignResult' + .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'identifier' is not null or undefined - if (identifier === null || identifier === undefined) { - throw new Error('Required parameter identifier was null or undefined when calling getContactStats.'); - } - - if (startDate !== undefined) { - localVarQueryParameters['startDate'] = ObjectSerializer.serialize(startDate, "string"); - } - - if (endDate !== undefined) { - localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "string"); + // verify required parameter 'campaignId' is not null or undefined + if (campaignId === null || campaignId === undefined) { + throw new Error('Required parameter campaignId was null or undefined when calling getAbTestCampaignResult.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -12855,12 +16132,12 @@ export class ContactsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetContactCampaignStats; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: AbTestCampaignResult; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetContactCampaignStats"); + body = ObjectSerializer.deserialize(body, "AbTestCampaignResult"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -12871,34 +16148,21 @@ export class ContactsApi { }); } /** - * - * @summary Get all the contacts - * @param limit Number of documents per page - * @param offset Index of the first document of the page - * @param modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - * @param {*} [options] Override http request options. - */ - public getContacts (limit?: number, offset?: number, modifiedSince?: string, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetContacts; }> { - const localVarPath = this.basePath + '/contacts'; + * + * @summary Get an email campaign report + * @param campaignId Id of the campaign + * @param {*} [options] Override http request options. + */ + public getEmailCampaign (campaignId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetEmailCampaign; }> { + const localVarPath = this.basePath + '/emailCampaigns/{campaignId}' + .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (modifiedSince !== undefined) { - localVarQueryParameters['modifiedSince'] = ObjectSerializer.serialize(modifiedSince, "string"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); + // verify required parameter 'campaignId' is not null or undefined + if (campaignId === null || campaignId === undefined) { + throw new Error('Required parameter campaignId was null or undefined when calling getEmailCampaign.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -12927,12 +16191,12 @@ export class ContactsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetContacts; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: GetEmailCampaign; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetContacts"); + body = ObjectSerializer.deserialize(body, "GetEmailCampaign"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -12943,29 +16207,37 @@ export class ContactsApi { }); } /** - * - * @summary Get contacts in a list - * @param listId Id of the list - * @param modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. - * @param limit Number of documents per page - * @param offset Index of the first document of the page - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - * @param {*} [options] Override http request options. - */ - public getContactsFromList (listId: number, modifiedSince?: string, limit?: number, offset?: number, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetContacts; }> { - const localVarPath = this.basePath + '/contacts/lists/{listId}/contacts' - .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); + * + * @summary Return all your created email campaigns + * @param type Filter on the type of the campaigns + * @param status Filter on the status of the campaign + * @param startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) + * @param endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) + * @param limit Number of documents per page + * @param offset Index of the first document in the page + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + * @param {*} [options] Override http request options. + */ + public getEmailCampaigns (type?: 'classic' | 'trigger', status?: 'suspended' | 'archive' | 'sent' | 'queued' | 'draft' | 'inProcess', startDate?: string, endDate?: string, limit?: number, offset?: number, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetEmailCampaigns; }> { + const localVarPath = this.basePath + '/emailCampaigns'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'listId' is not null or undefined - if (listId === null || listId === undefined) { - throw new Error('Required parameter listId was null or undefined when calling getContactsFromList.'); + if (type !== undefined) { + localVarQueryParameters['type'] = ObjectSerializer.serialize(type, "'classic' | 'trigger'"); } - if (modifiedSince !== undefined) { - localVarQueryParameters['modifiedSince'] = ObjectSerializer.serialize(modifiedSince, "string"); + if (status !== undefined) { + localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "'suspended' | 'archive' | 'sent' | 'queued' | 'draft' | 'inProcess'"); + } + + if (startDate !== undefined) { + localVarQueryParameters['startDate'] = ObjectSerializer.serialize(startDate, "string"); + } + + if (endDate !== undefined) { + localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "string"); } if (limit !== undefined) { @@ -13006,12 +16278,12 @@ export class ContactsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetContacts; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: GetEmailCampaigns; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetContacts"); + body = ObjectSerializer.deserialize(body, "GetEmailCampaigns"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -13022,21 +16294,21 @@ export class ContactsApi { }); } /** - * - * @summary Returns a folder's details - * @param folderId id of the folder - * @param {*} [options] Override http request options. - */ - public getFolder (folderId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetFolder; }> { - const localVarPath = this.basePath + '/contacts/folders/{folderId}' - .replace('{' + 'folderId' + '}', encodeURIComponent(String(folderId))); + * Get a unique URL to share & import an email template from one Sendinblue account to another. + * @summary Get a shared template url + * @param campaignId Id of the campaign or template + * @param {*} [options] Override http request options. + */ + public getSharedTemplateUrl (campaignId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetSharedTemplateUrl; }> { + const localVarPath = this.basePath + '/emailCampaigns/{campaignId}/sharedUrl' + .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'folderId' is not null or undefined - if (folderId === null || folderId === undefined) { - throw new Error('Required parameter folderId was null or undefined when calling getFolder.'); + // verify required parameter 'campaignId' is not null or undefined + if (campaignId === null || campaignId === undefined) { + throw new Error('Required parameter campaignId was null or undefined when calling getSharedTemplateUrl.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -13065,12 +16337,12 @@ export class ContactsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetFolder; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: GetSharedTemplateUrl; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetFolder"); + body = ObjectSerializer.deserialize(body, "GetSharedTemplateUrl"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -13081,36 +16353,21 @@ export class ContactsApi { }); } /** - * - * @summary Get lists in a folder - * @param folderId Id of the folder - * @param limit Number of documents per page - * @param offset Index of the first document of the page - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - * @param {*} [options] Override http request options. - */ - public getFolderLists (folderId: number, limit?: number, offset?: number, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetFolderLists; }> { - const localVarPath = this.basePath + '/contacts/folders/{folderId}/lists' - .replace('{' + 'folderId' + '}', encodeURIComponent(String(folderId))); + * + * @summary Send an email campaign immediately, based on campaignId + * @param campaignId Id of the campaign + * @param {*} [options] Override http request options. + */ + public sendEmailCampaignNow (campaignId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/emailCampaigns/{campaignId}/sendNow' + .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'folderId' is not null or undefined - if (folderId === null || folderId === undefined) { - throw new Error('Required parameter folderId was null or undefined when calling getFolderLists.'); - } - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); + // verify required parameter 'campaignId' is not null or undefined + if (campaignId === null || campaignId === undefined) { + throw new Error('Required parameter campaignId was null or undefined when calling sendEmailCampaignNow.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -13118,7 +16375,7 @@ export class ContactsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'GET', + method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, @@ -13139,12 +16396,11 @@ export class ContactsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetFolderLists; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetFolderLists"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -13155,39 +16411,27 @@ export class ContactsApi { }); } /** - * - * @summary Get all folders - * @param limit Number of documents per page - * @param offset Index of the first document of the page - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - * @param {*} [options] Override http request options. - */ - public getFolders (limit: number, offset: number, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetFolders; }> { - const localVarPath = this.basePath + '/contacts/folders'; + * A PDF will be sent to the specified email addresses + * @summary Send the report of a campaign + * @param campaignId Id of the campaign + * @param sendReport Values for send a report + * @param {*} [options] Override http request options. + */ + public sendReport (campaignId: number, sendReport: SendReport, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/emailCampaigns/{campaignId}/sendReport' + .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'limit' is not null or undefined - if (limit === null || limit === undefined) { - throw new Error('Required parameter limit was null or undefined when calling getFolders.'); - } - - // verify required parameter 'offset' is not null or undefined - if (offset === null || offset === undefined) { - throw new Error('Required parameter offset was null or undefined when calling getFolders.'); - } - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); + // verify required parameter 'campaignId' is not null or undefined + if (campaignId === null || campaignId === undefined) { + throw new Error('Required parameter campaignId was null or undefined when calling sendReport.'); } - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); + // verify required parameter 'sendReport' is not null or undefined + if (sendReport === null || sendReport === undefined) { + throw new Error('Required parameter sendReport was null or undefined when calling sendReport.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -13195,12 +16439,13 @@ export class ContactsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'GET', + method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, + body: ObjectSerializer.serialize(sendReport, "SendReport") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -13216,12 +16461,11 @@ export class ContactsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetFolders; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetFolders"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -13232,21 +16476,27 @@ export class ContactsApi { }); } /** - * - * @summary Get a list's details - * @param listId Id of the list - * @param {*} [options] Override http request options. - */ - public getList (listId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetExtendedList; }> { - const localVarPath = this.basePath + '/contacts/lists/{listId}' - .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); + * + * @summary Send an email campaign to your test list + * @param campaignId Id of the campaign + * @param emailTo + * @param {*} [options] Override http request options. + */ + public sendTestEmail (campaignId: number, emailTo: SendTestEmail, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/emailCampaigns/{campaignId}/sendTest' + .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'listId' is not null or undefined - if (listId === null || listId === undefined) { - throw new Error('Required parameter listId was null or undefined when calling getList.'); + // verify required parameter 'campaignId' is not null or undefined + if (campaignId === null || campaignId === undefined) { + throw new Error('Required parameter campaignId was null or undefined when calling sendTestEmail.'); + } + + // verify required parameter 'emailTo' is not null or undefined + if (emailTo === null || emailTo === undefined) { + throw new Error('Required parameter emailTo was null or undefined when calling sendTestEmail.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -13254,12 +16504,13 @@ export class ContactsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'GET', + method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, + body: ObjectSerializer.serialize(emailTo, "SendTestEmail") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -13275,12 +16526,11 @@ export class ContactsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetExtendedList; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetExtendedList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -13291,29 +16541,27 @@ export class ContactsApi { }); } /** - * - * @summary Get all the lists - * @param limit Number of documents per page - * @param offset Index of the first document of the page - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - * @param {*} [options] Override http request options. - */ - public getLists (limit?: number, offset?: number, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetLists; }> { - const localVarPath = this.basePath + '/contacts/lists'; + * + * @summary Update an email campaign status + * @param campaignId Id of the campaign + * @param status Status of the campaign + * @param {*} [options] Override http request options. + */ + public updateCampaignStatus (campaignId: number, status: UpdateCampaignStatus, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/emailCampaigns/{campaignId}/status' + .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); + // verify required parameter 'campaignId' is not null or undefined + if (campaignId === null || campaignId === undefined) { + throw new Error('Required parameter campaignId was null or undefined when calling updateCampaignStatus.'); } - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); + // verify required parameter 'status' is not null or undefined + if (status === null || status === undefined) { + throw new Error('Required parameter status was null or undefined when calling updateCampaignStatus.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -13321,12 +16569,13 @@ export class ContactsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'GET', + method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, + body: ObjectSerializer.serialize(status, "UpdateCampaignStatus") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -13342,12 +16591,11 @@ export class ContactsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetLists; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetLists"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -13358,20 +16606,27 @@ export class ContactsApi { }); } /** - * It returns the background process ID which on completion calls the notify URL that you have set in the input. - * @summary Import contacts - * @param requestContactImport Values to import contacts in Sendinblue. To know more about the expected format, please have a look at ``https://help.sendinblue.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` - * @param {*} [options] Override http request options. - */ - public importContacts (requestContactImport: RequestContactImport, options: any = {}) : Promise<{ response: http.IncomingMessage; body: CreatedProcessId; }> { - const localVarPath = this.basePath + '/contacts/import'; + * + * @summary Update an email campaign + * @param campaignId Id of the campaign + * @param emailCampaign Values to update a campaign + * @param {*} [options] Override http request options. + */ + public updateEmailCampaign (campaignId: number, emailCampaign: UpdateEmailCampaign, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/emailCampaigns/{campaignId}' + .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'requestContactImport' is not null or undefined - if (requestContactImport === null || requestContactImport === undefined) { - throw new Error('Required parameter requestContactImport was null or undefined when calling importContacts.'); + // verify required parameter 'campaignId' is not null or undefined + if (campaignId === null || campaignId === undefined) { + throw new Error('Required parameter campaignId was null or undefined when calling updateEmailCampaign.'); + } + + // verify required parameter 'emailCampaign' is not null or undefined + if (emailCampaign === null || emailCampaign === undefined) { + throw new Error('Required parameter emailCampaign was null or undefined when calling updateEmailCampaign.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -13379,13 +16634,13 @@ export class ContactsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'POST', + method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(requestContactImport, "RequestContactImport") + body: ObjectSerializer.serialize(emailCampaign, "UpdateEmailCampaign") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -13401,12 +16656,11 @@ export class ContactsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: CreatedProcessId; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "CreatedProcessId"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -13417,27 +16671,20 @@ export class ContactsApi { }); } /** - * - * @summary Delete a contact from a list - * @param listId Id of the list - * @param contactEmails Emails addresses OR IDs of the contacts - * @param {*} [options] Override http request options. - */ - public removeContactFromList (listId: number, contactEmails: RemoveContactFromList, options: any = {}) : Promise<{ response: http.IncomingMessage; body: PostContactInfo; }> { - const localVarPath = this.basePath + '/contacts/lists/{listId}/contacts/remove' - .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); + * + * @summary Upload an image to your account's image gallery + * @param uploadImage Parameters to upload an image + * @param {*} [options] Override http request options. + */ + public uploadImageToGallery (uploadImage: UploadImageToGallery, options: any = {}) : Promise<{ response: http.IncomingMessage; body: UploadImageModel; }> { + const localVarPath = this.basePath + '/emailCampaigns/images'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'listId' is not null or undefined - if (listId === null || listId === undefined) { - throw new Error('Required parameter listId was null or undefined when calling removeContactFromList.'); - } - - // verify required parameter 'contactEmails' is not null or undefined - if (contactEmails === null || contactEmails === undefined) { - throw new Error('Required parameter contactEmails was null or undefined when calling removeContactFromList.'); + // verify required parameter 'uploadImage' is not null or undefined + if (uploadImage === null || uploadImage === undefined) { + throw new Error('Required parameter uploadImage was null or undefined when calling uploadImageToGallery.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -13451,7 +16698,7 @@ export class ContactsApi { uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(contactEmails, "RemoveContactFromList") + body: ObjectSerializer.serialize(uploadImage, "UploadImageToGallery") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -13467,12 +16714,12 @@ export class ContactsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: PostContactInfo; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: UploadImageModel; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "PostContactInfo"); + body = ObjectSerializer.deserialize(body, "UploadImageModel"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -13482,94 +16729,99 @@ export class ContactsApi { }); }); } - /** - * It returns the background process ID which on completion calls the notify URL that you have set in the input. File will be available in csv. - * @summary Export contacts - * @param requestContactExport Values to request a contact export - * @param {*} [options] Override http request options. - */ - public requestContactExport (requestContactExport: RequestContactExport, options: any = {}) : Promise<{ response: http.IncomingMessage; body: CreatedProcessId; }> { - const localVarPath = this.basePath + '/contacts/export'; - const localVarQueryParameters: any = {}; - const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); - const localVarFormParams: any = {}; + } + export enum FilesApiApiKeys { + apiKey, + partnerKey, + } - // verify required parameter 'requestContactExport' is not null or undefined - if (requestContactExport === null || requestContactExport === undefined) { - throw new Error('Required parameter requestContactExport was null or undefined when calling requestContactExport.'); - } + export class FilesApi { + protected _basePath = defaultBasePath; + protected defaultHeaders : any = {}; + protected _useQuerystring = false; - (Object).assign(localVarHeaderParams, options.headers); + protected authentications = { + 'default': new VoidAuth(), + 'apiKey': new ApiKeyAuth('header', 'api-key'), + 'partnerKey': new ApiKeyAuth('header', 'partner-key'), + } - const localVarUseFormData = false; + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } - const localVarRequestOptions: localVarRequest.Options = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - uri: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(requestContactExport, "RequestContactExport") - }; + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } - this.authentications.apiKey.applyToRequest(localVarRequestOptions); + set basePath(basePath: string) { + this._basePath = basePath; + } - this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + get basePath() { + return this._basePath; + } - this.authentications.default.applyToRequest(localVarRequestOptions); + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: CreatedProcessId; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - body = ObjectSerializer.deserialize(body, "CreatedProcessId"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject({ response: response, body: body }); - } - } - }); - }); + public setApiKey(key: FilesApiApiKeys, value: string) { + (this.authentications as any)[FilesApiApiKeys[key]].apiKey = value; } /** - * - * @summary Update contact attribute - * @param attributeCategory Category of the attribute - * @param attributeName Name of the existing attribute - * @param updateAttribute Values to update an attribute - * @param {*} [options] Override http request options. - */ - public updateAttribute (attributeCategory: 'category' | 'calculated' | 'global', attributeName: string, updateAttribute: UpdateAttribute, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/contacts/attributes/{attributeCategory}/{attributeName}' - .replace('{' + 'attributeCategory' + '}', encodeURIComponent(String(attributeCategory))) - .replace('{' + 'attributeName' + '}', encodeURIComponent(String(attributeName))); + * + * @summary Get all files + * @param entity Filter by file entity type + * @param entityIds Filter by file entity IDs + * @param dateFrom dateFrom to date range filter type (timestamp in milliseconds) + * @param dateTo dateTo to date range filter type (timestamp in milliseconds) + * @param offset Index of the first document of the page + * @param limit Number of documents per page + * @param sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed + * @param {*} [options] Override http request options. + */ + public crmFilesGet (entity?: 'companies' | 'deals' | 'contacts', entityIds?: string, dateFrom?: number, dateTo?: number, offset?: number, limit?: number, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: FileList; }> { + const localVarPath = this.basePath + '/crm/files'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'attributeCategory' is not null or undefined - if (attributeCategory === null || attributeCategory === undefined) { - throw new Error('Required parameter attributeCategory was null or undefined when calling updateAttribute.'); + if (entity !== undefined) { + localVarQueryParameters['entity'] = ObjectSerializer.serialize(entity, "'companies' | 'deals' | 'contacts'"); } - // verify required parameter 'attributeName' is not null or undefined - if (attributeName === null || attributeName === undefined) { - throw new Error('Required parameter attributeName was null or undefined when calling updateAttribute.'); + if (entityIds !== undefined) { + localVarQueryParameters['entityIds'] = ObjectSerializer.serialize(entityIds, "string"); } - // verify required parameter 'updateAttribute' is not null or undefined - if (updateAttribute === null || updateAttribute === undefined) { - throw new Error('Required parameter updateAttribute was null or undefined when calling updateAttribute.'); + if (dateFrom !== undefined) { + localVarQueryParameters['dateFrom'] = ObjectSerializer.serialize(dateFrom, "number"); + } + + if (dateTo !== undefined) { + localVarQueryParameters['dateTo'] = ObjectSerializer.serialize(dateTo, "number"); + } + + if (offset !== undefined) { + localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); + } + + if (limit !== undefined) { + localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); } (Object).assign(localVarHeaderParams, options.headers); @@ -13577,13 +16829,12 @@ export class ContactsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'PUT', + method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(updateAttribute, "UpdateAttribute") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -13599,11 +16850,12 @@ export class ContactsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: FileList; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { + body = ObjectSerializer.deserialize(body, "FileList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -13614,20 +16866,21 @@ export class ContactsApi { }); } /** - * - * @summary Update multiple contacts - * @param updateBatchContacts Values to update multiple contacts - * @param {*} [options] Override http request options. - */ - public updateBatchContacts (updateBatchContacts: UpdateBatchContacts, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/contacts/batch'; + * + * @summary Get file details + * @param id File id to get file data. + * @param {*} [options] Override http request options. + */ + public crmFilesIdDataGet (id: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: FileData; }> { + const localVarPath = this.basePath + '/crm/files/{id}/data' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'updateBatchContacts' is not null or undefined - if (updateBatchContacts === null || updateBatchContacts === undefined) { - throw new Error('Required parameter updateBatchContacts was null or undefined when calling updateBatchContacts.'); + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling crmFilesIdDataGet.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -13635,13 +16888,12 @@ export class ContactsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'POST', + method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(updateBatchContacts, "UpdateBatchContacts") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -13657,11 +16909,12 @@ export class ContactsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: FileData; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { + body = ObjectSerializer.deserialize(body, "FileData"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -13672,27 +16925,21 @@ export class ContactsApi { }); } /** - * - * @summary Update a contact - * @param identifier Email (urlencoded) OR ID of the contact - * @param updateContact Values to update a contact - * @param {*} [options] Override http request options. - */ - public updateContact (identifier: string, updateContact: UpdateContact, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/contacts/{identifier}' - .replace('{' + 'identifier' + '}', encodeURIComponent(String(identifier))); + * + * @summary Delete a file + * @param id File id to delete. + * @param {*} [options] Override http request options. + */ + public crmFilesIdDelete (id: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/crm/files/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'identifier' is not null or undefined - if (identifier === null || identifier === undefined) { - throw new Error('Required parameter identifier was null or undefined when calling updateContact.'); - } - - // verify required parameter 'updateContact' is not null or undefined - if (updateContact === null || updateContact === undefined) { - throw new Error('Required parameter updateContact was null or undefined when calling updateContact.'); + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling crmFilesIdDelete.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -13700,13 +16947,12 @@ export class ContactsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'PUT', + method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(updateContact, "UpdateContact") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -13737,27 +16983,21 @@ export class ContactsApi { }); } /** - * - * @summary Update a folder - * @param folderId Id of the folder - * @param updateFolder Name of the folder - * @param {*} [options] Override http request options. - */ - public updateFolder (folderId: number, updateFolder: CreateUpdateFolder, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/contacts/folders/{folderId}' - .replace('{' + 'folderId' + '}', encodeURIComponent(String(folderId))); + * + * @summary Download a file + * @param id File id to download. + * @param {*} [options] Override http request options. + */ + public crmFilesIdGet (id: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: FileDownloadableLink; }> { + const localVarPath = this.basePath + '/crm/files/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'folderId' is not null or undefined - if (folderId === null || folderId === undefined) { - throw new Error('Required parameter folderId was null or undefined when calling updateFolder.'); - } - - // verify required parameter 'updateFolder' is not null or undefined - if (updateFolder === null || updateFolder === undefined) { - throw new Error('Required parameter updateFolder was null or undefined when calling updateFolder.'); + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling crmFilesIdGet.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -13765,13 +17005,12 @@ export class ContactsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'PUT', + method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(updateFolder, "CreateUpdateFolder") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -13787,11 +17026,12 @@ export class ContactsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: FileDownloadableLink; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { + body = ObjectSerializer.deserialize(body, "FileDownloadableLink"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -13802,41 +17042,53 @@ export class ContactsApi { }); } /** - * - * @summary Update a list - * @param listId Id of the list - * @param updateList Values to update a list - * @param {*} [options] Override http request options. - */ - public updateList (listId: number, updateList: UpdateList, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/contacts/lists/{listId}' - .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); + * + * @summary Upload a file + * @param file File data to create a file. + * @param dealId Deal id linked to a file + * @param contactId Contact id linked to a file + * @param companyId Company id linked to a file + * @param {*} [options] Override http request options. + */ + public crmFilesPost (file: Buffer, dealId?: string, contactId?: number, companyId?: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: FileData; }> { + const localVarPath = this.basePath + '/crm/files'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'listId' is not null or undefined - if (listId === null || listId === undefined) { - throw new Error('Required parameter listId was null or undefined when calling updateList.'); + // verify required parameter 'file' is not null or undefined + if (file === null || file === undefined) { + throw new Error('Required parameter file was null or undefined when calling crmFilesPost.'); } - // verify required parameter 'updateList' is not null or undefined - if (updateList === null || updateList === undefined) { - throw new Error('Required parameter updateList was null or undefined when calling updateList.'); + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + if (file !== undefined) { + localVarFormParams['file'] = file; } + localVarUseFormData = true; - (Object).assign(localVarHeaderParams, options.headers); + if (dealId !== undefined) { + localVarFormParams['dealId'] = ObjectSerializer.serialize(dealId, "string"); + } - const localVarUseFormData = false; + if (contactId !== undefined) { + localVarFormParams['contactId'] = ObjectSerializer.serialize(contactId, "number"); + } + + if (companyId !== undefined) { + localVarFormParams['companyId'] = ObjectSerializer.serialize(companyId, "string"); + } const localVarRequestOptions: localVarRequest.Options = { - method: 'PUT', + method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(updateList, "UpdateList") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -13852,11 +17104,12 @@ export class ContactsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: FileData; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { + body = ObjectSerializer.deserialize(body, "FileData"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -13866,17 +17119,17 @@ export class ContactsApi { }); }); } -} -export enum EmailCampaignsApiApiKeys { + } + export enum FoldersApiApiKeys { apiKey, partnerKey, -} + } -export class EmailCampaignsApi { + export class FoldersApi { protected _basePath = defaultBasePath; protected defaultHeaders : any = { - 'user-agent': `sendinblue_clientAPI/v${version}/ts-node` -}; + 'user-agent': `sendinblue_clientAPI/v${version}/ts-node` + }; protected _useQuerystring = false; protected authentications = { @@ -13914,24 +17167,24 @@ export class EmailCampaignsApi { this.authentications.default = auth; } - public setApiKey(key: EmailCampaignsApiApiKeys, value: string) { - (this.authentications as any)[EmailCampaignsApiApiKeys[key]].apiKey = value; + public setApiKey(key: FoldersApiApiKeys, value: string) { + (this.authentications as any)[FoldersApiApiKeys[key]].apiKey = value; } /** - * - * @summary Create an email campaign - * @param emailCampaigns Values to create a campaign - * @param {*} [options] Override http request options. - */ - public createEmailCampaign (emailCampaigns: CreateEmailCampaign, options: any = {}) : Promise<{ response: http.IncomingMessage; body: CreateModel; }> { - const localVarPath = this.basePath + '/emailCampaigns'; + * + * @summary Create a folder + * @param createFolder Name of the folder + * @param {*} [options] Override http request options. + */ + public createFolder (createFolder: CreateUpdateFolder, options: any = {}) : Promise<{ response: http.IncomingMessage; body: CreateModel; }> { + const localVarPath = this.basePath + '/contacts/folders'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'emailCampaigns' is not null or undefined - if (emailCampaigns === null || emailCampaigns === undefined) { - throw new Error('Required parameter emailCampaigns was null or undefined when calling createEmailCampaign.'); + // verify required parameter 'createFolder' is not null or undefined + if (createFolder === null || createFolder === undefined) { + throw new Error('Required parameter createFolder was null or undefined when calling createFolder.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -13945,7 +17198,7 @@ export class EmailCampaignsApi { uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(emailCampaigns, "CreateEmailCampaign") + body: ObjectSerializer.serialize(createFolder, "CreateUpdateFolder") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -13977,21 +17230,21 @@ export class EmailCampaignsApi { }); } /** - * - * @summary Delete an email campaign - * @param campaignId id of the campaign - * @param {*} [options] Override http request options. - */ - public deleteEmailCampaign (campaignId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/emailCampaigns/{campaignId}' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); + * + * @summary Delete a folder (and all its lists) + * @param folderId Id of the folder + * @param {*} [options] Override http request options. + */ + public deleteFolder (folderId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/contacts/folders/{folderId}' + .replace('{' + 'folderId' + '}', encodeURIComponent(String(folderId))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling deleteEmailCampaign.'); + // verify required parameter 'folderId' is not null or undefined + if (folderId === null || folderId === undefined) { + throw new Error('Required parameter folderId was null or undefined when calling deleteFolder.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -14035,22 +17288,21 @@ export class EmailCampaignsApi { }); } /** - * - * @summary Export the recipients of an email campaign - * @param campaignId Id of the campaign - * @param recipientExport Values to send for a recipient export request - * @param {*} [options] Override http request options. - */ - public emailExportRecipients (campaignId: number, recipientExport?: EmailExportRecipients, options: any = {}) : Promise<{ response: http.IncomingMessage; body: CreatedProcessId; }> { - const localVarPath = this.basePath + '/emailCampaigns/{campaignId}/exportRecipients' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); + * + * @summary Returns a folder's details + * @param folderId id of the folder + * @param {*} [options] Override http request options. + */ + public getFolder (folderId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetFolder; }> { + const localVarPath = this.basePath + '/contacts/folders/{folderId}' + .replace('{' + 'folderId' + '}', encodeURIComponent(String(folderId))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling emailExportRecipients.'); + // verify required parameter 'folderId' is not null or undefined + if (folderId === null || folderId === undefined) { + throw new Error('Required parameter folderId was null or undefined when calling getFolder.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -14058,13 +17310,12 @@ export class EmailCampaignsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'POST', + method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(recipientExport, "EmailExportRecipients") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -14080,12 +17331,12 @@ export class EmailCampaignsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: CreatedProcessId; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: GetFolder; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "CreatedProcessId"); + body = ObjectSerializer.deserialize(body, "GetFolder"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -14096,80 +17347,36 @@ export class EmailCampaignsApi { }); } /** - * Obtain winning version of an A/B test email campaign - * @summary Get an A/B test email campaign results - * @param campaignId Id of the A/B test campaign - * @param {*} [options] Override http request options. - */ - public getAbTestCampaignResult (campaignId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body: AbTestCampaignResult; }> { - const localVarPath = this.basePath + '/emailCampaigns/{campaignId}/abTestCampaignResult' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); + * + * @summary Get lists in a folder + * @param folderId Id of the folder + * @param limit Number of documents per page + * @param offset Index of the first document of the page + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + * @param {*} [options] Override http request options. + */ + public getFolderLists (folderId: number, limit?: number, offset?: number, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetFolderLists; }> { + const localVarPath = this.basePath + '/contacts/folders/{folderId}/lists' + .replace('{' + 'folderId' + '}', encodeURIComponent(String(folderId))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling getAbTestCampaignResult.'); + // verify required parameter 'folderId' is not null or undefined + if (folderId === null || folderId === undefined) { + throw new Error('Required parameter folderId was null or undefined when calling getFolderLists.'); } - (Object).assign(localVarHeaderParams, options.headers); - - const localVarUseFormData = false; - - const localVarRequestOptions: localVarRequest.Options = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - uri: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - this.authentications.apiKey.applyToRequest(localVarRequestOptions); - - this.authentications.partnerKey.applyToRequest(localVarRequestOptions); - - this.authentications.default.applyToRequest(localVarRequestOptions); + if (limit !== undefined) { + localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); + } - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } + if (offset !== undefined) { + localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); } - return new Promise<{ response: http.IncomingMessage; body: AbTestCampaignResult; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - body = ObjectSerializer.deserialize(body, "AbTestCampaignResult"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject({ response: response, body: body }); - } - } - }); - }); - } - /** - * - * @summary Get an email campaign report - * @param campaignId Id of the campaign - * @param {*} [options] Override http request options. - */ - public getEmailCampaign (campaignId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetEmailCampaign; }> { - const localVarPath = this.basePath + '/emailCampaigns/{campaignId}' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); - const localVarQueryParameters: any = {}; - const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); - const localVarFormParams: any = {}; - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling getEmailCampaign.'); + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); } (Object).assign(localVarHeaderParams, options.headers); @@ -14198,12 +17405,12 @@ export class EmailCampaignsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetEmailCampaign; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: GetFolderLists; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetEmailCampaign"); + body = ObjectSerializer.deserialize(body, "GetFolderLists"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -14214,37 +17421,27 @@ export class EmailCampaignsApi { }); } /** - * - * @summary Return all your created email campaigns - * @param type Filter on the type of the campaigns - * @param status Filter on the status of the campaign - * @param startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) - * @param endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) - * @param limit Number of documents per page - * @param offset Index of the first document in the page - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - * @param {*} [options] Override http request options. - */ - public getEmailCampaigns (type?: 'classic' | 'trigger', status?: 'suspended' | 'archive' | 'sent' | 'queued' | 'draft' | 'inProcess', startDate?: string, endDate?: string, limit?: number, offset?: number, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetEmailCampaigns; }> { - const localVarPath = this.basePath + '/emailCampaigns'; + * + * @summary Get all folders + * @param limit Number of documents per page + * @param offset Index of the first document of the page + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + * @param {*} [options] Override http request options. + */ + public getFolders (limit: number, offset: number, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetFolders; }> { + const localVarPath = this.basePath + '/contacts/folders'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - if (type !== undefined) { - localVarQueryParameters['type'] = ObjectSerializer.serialize(type, "'classic' | 'trigger'"); - } - - if (status !== undefined) { - localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "'suspended' | 'archive' | 'sent' | 'queued' | 'draft' | 'inProcess'"); - } - - if (startDate !== undefined) { - localVarQueryParameters['startDate'] = ObjectSerializer.serialize(startDate, "string"); + // verify required parameter 'limit' is not null or undefined + if (limit === null || limit === undefined) { + throw new Error('Required parameter limit was null or undefined when calling getFolders.'); } - if (endDate !== undefined) { - localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "string"); + // verify required parameter 'offset' is not null or undefined + if (offset === null || offset === undefined) { + throw new Error('Required parameter offset was null or undefined when calling getFolders.'); } if (limit !== undefined) { @@ -14285,12 +17482,12 @@ export class EmailCampaignsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetEmailCampaigns; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: GetFolders; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetEmailCampaigns"); + body = ObjectSerializer.deserialize(body, "GetFolders"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -14301,21 +17498,27 @@ export class EmailCampaignsApi { }); } /** - * Get a unique URL to share & import an email template from one Sendinblue account to another. - * @summary Get a shared template url - * @param campaignId Id of the campaign or template - * @param {*} [options] Override http request options. - */ - public getSharedTemplateUrl (campaignId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetSharedTemplateUrl; }> { - const localVarPath = this.basePath + '/emailCampaigns/{campaignId}/sharedUrl' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); + * + * @summary Update a folder + * @param folderId Id of the folder + * @param updateFolder Name of the folder + * @param {*} [options] Override http request options. + */ + public updateFolder (folderId: number, updateFolder: CreateUpdateFolder, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/contacts/folders/{folderId}' + .replace('{' + 'folderId' + '}', encodeURIComponent(String(folderId))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling getSharedTemplateUrl.'); + // verify required parameter 'folderId' is not null or undefined + if (folderId === null || folderId === undefined) { + throw new Error('Required parameter folderId was null or undefined when calling updateFolder.'); + } + + // verify required parameter 'updateFolder' is not null or undefined + if (updateFolder === null || updateFolder === undefined) { + throw new Error('Required parameter updateFolder was null or undefined when calling updateFolder.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -14323,12 +17526,13 @@ export class EmailCampaignsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'GET', + method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, + body: ObjectSerializer.serialize(updateFolder, "CreateUpdateFolder") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -14344,12 +17548,11 @@ export class EmailCampaignsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetSharedTemplateUrl; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetSharedTemplateUrl"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -14359,22 +17562,73 @@ export class EmailCampaignsApi { }); }); } + } + export enum InboundParsingApiApiKeys { + apiKey, + partnerKey, + } + + export class InboundParsingApi { + protected _basePath = defaultBasePath; + protected defaultHeaders : any = { + 'user-agent': `sendinblue_clientAPI/v${version}/ts-node` + }; + protected _useQuerystring = false; + + protected authentications = { + 'default': new VoidAuth(), + 'apiKey': new ApiKeyAuth('header', 'api-key'), + 'partnerKey': new ApiKeyAuth('header', 'partner-key'), + } + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: InboundParsingApiApiKeys, value: string) { + (this.authentications as any)[InboundParsingApiApiKeys[key]].apiKey = value; + } /** - * - * @summary Send an email campaign immediately, based on campaignId - * @param campaignId Id of the campaign - * @param {*} [options] Override http request options. - */ - public sendEmailCampaignNow (campaignId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/emailCampaigns/{campaignId}/sendNow' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); + * This endpoint will retrieve inbound attachment with download token. + * @summary Retrieve inbound attachment with download token. + * @param downloadToken Token to fetch a particular attachment + * @param {*} [options] Override http request options. + */ + public getInboundEmailAttachment (downloadToken: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> { + const localVarPath = this.basePath + '/inbound/attachments/{downloadToken}' + .replace('{' + 'downloadToken' + '}', encodeURIComponent(String(downloadToken))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling sendEmailCampaignNow.'); + // verify required parameter 'downloadToken' is not null or undefined + if (downloadToken === null || downloadToken === undefined) { + throw new Error('Required parameter downloadToken was null or undefined when calling getInboundEmailAttachment.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -14382,12 +17636,12 @@ export class EmailCampaignsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'POST', + method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, - json: true, + encoding: null, }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -14403,11 +17657,12 @@ export class EmailCampaignsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { + body = ObjectSerializer.deserialize(body, "Buffer"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -14418,27 +17673,44 @@ export class EmailCampaignsApi { }); } /** - * A PDF will be sent to the specified email addresses - * @summary Send the report of a campaign - * @param campaignId Id of the campaign - * @param sendReport Values for send a report - * @param {*} [options] Override http request options. - */ - public sendReport (campaignId: number, sendReport: SendReport, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/emailCampaigns/{campaignId}/sendReport' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); + * This endpoint will show the list of all the events for the received emails. + * @summary Get the list of all the events for the received emails. + * @param sender Email address of the sender. + * @param startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. + * @param endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. + * @param limit Number of documents returned per page + * @param offset Index of the first document on the page + * @param sort Sort the results in the ascending/descending order of record creation + * @param {*} [options] Override http request options. + */ + public getInboundEmailEvents (sender?: string, startDate?: string, endDate?: string, limit?: number, offset?: number, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetInboundEmailEvents; }> { + const localVarPath = this.basePath + '/inbound/events'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling sendReport.'); + if (sender !== undefined) { + localVarQueryParameters['sender'] = ObjectSerializer.serialize(sender, "string"); } - // verify required parameter 'sendReport' is not null or undefined - if (sendReport === null || sendReport === undefined) { - throw new Error('Required parameter sendReport was null or undefined when calling sendReport.'); + if (startDate !== undefined) { + localVarQueryParameters['startDate'] = ObjectSerializer.serialize(startDate, "string"); + } + + if (endDate !== undefined) { + localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "string"); + } + + if (limit !== undefined) { + localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); + } + + if (offset !== undefined) { + localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); } (Object).assign(localVarHeaderParams, options.headers); @@ -14446,13 +17718,12 @@ export class EmailCampaignsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'POST', + method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(sendReport, "SendReport") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -14468,11 +17739,12 @@ export class EmailCampaignsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: GetInboundEmailEvents; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { + body = ObjectSerializer.deserialize(body, "GetInboundEmailEvents"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -14483,27 +17755,21 @@ export class EmailCampaignsApi { }); } /** - * - * @summary Send an email campaign to your test list - * @param campaignId Id of the campaign - * @param emailTo - * @param {*} [options] Override http request options. - */ - public sendTestEmail (campaignId: number, emailTo: SendTestEmail, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/emailCampaigns/{campaignId}/sendTest' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); + * This endpoint will show the list of all events history for one particular received email. + * @summary Fetch all events history for one particular received email. + * @param uuid UUID to fetch events specific to recieved email + * @param {*} [options] Override http request options. + */ + public getInboundEmailEventsByUuid (uuid: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetInboundEmailEventsByUuid; }> { + const localVarPath = this.basePath + '/inbound/events/{uuid}' + .replace('{' + 'uuid' + '}', encodeURIComponent(String(uuid))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling sendTestEmail.'); - } - - // verify required parameter 'emailTo' is not null or undefined - if (emailTo === null || emailTo === undefined) { - throw new Error('Required parameter emailTo was null or undefined when calling sendTestEmail.'); + // verify required parameter 'uuid' is not null or undefined + if (uuid === null || uuid === undefined) { + throw new Error('Required parameter uuid was null or undefined when calling getInboundEmailEventsByUuid.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -14511,13 +17777,12 @@ export class EmailCampaignsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'POST', + method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(emailTo, "SendTestEmail") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -14533,11 +17798,12 @@ export class EmailCampaignsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: GetInboundEmailEventsByUuid; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { + body = ObjectSerializer.deserialize(body, "GetInboundEmailEventsByUuid"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -14547,28 +17813,79 @@ export class EmailCampaignsApi { }); }); } + } + export enum ListsApiApiKeys { + apiKey, + partnerKey, + } + + export class ListsApi { + protected _basePath = defaultBasePath; + protected defaultHeaders : any = { + 'user-agent': `sendinblue_clientAPI/v${version}/ts-node` + }; + protected _useQuerystring = false; + + protected authentications = { + 'default': new VoidAuth(), + 'apiKey': new ApiKeyAuth('header', 'api-key'), + 'partnerKey': new ApiKeyAuth('header', 'partner-key'), + } + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: ListsApiApiKeys, value: string) { + (this.authentications as any)[ListsApiApiKeys[key]].apiKey = value; + } /** - * - * @summary Update an email campaign status - * @param campaignId Id of the campaign - * @param status Status of the campaign - * @param {*} [options] Override http request options. - */ - public updateCampaignStatus (campaignId: number, status: UpdateCampaignStatus, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/emailCampaigns/{campaignId}/status' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); + * + * @summary Add existing contacts to a list + * @param listId Id of the list + * @param contactEmails Emails addresses OR IDs of the contacts + * @param {*} [options] Override http request options. + */ + public addContactToList (listId: number, contactEmails: AddContactToList, options: any = {}) : Promise<{ response: http.IncomingMessage; body: PostContactInfo; }> { + const localVarPath = this.basePath + '/contacts/lists/{listId}/contacts/add' + .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling updateCampaignStatus.'); + // verify required parameter 'listId' is not null or undefined + if (listId === null || listId === undefined) { + throw new Error('Required parameter listId was null or undefined when calling addContactToList.'); } - // verify required parameter 'status' is not null or undefined - if (status === null || status === undefined) { - throw new Error('Required parameter status was null or undefined when calling updateCampaignStatus.'); + // verify required parameter 'contactEmails' is not null or undefined + if (contactEmails === null || contactEmails === undefined) { + throw new Error('Required parameter contactEmails was null or undefined when calling addContactToList.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -14576,13 +17893,13 @@ export class EmailCampaignsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'PUT', + method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(status, "UpdateCampaignStatus") + body: ObjectSerializer.serialize(contactEmails, "AddContactToList") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -14598,11 +17915,12 @@ export class EmailCampaignsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: PostContactInfo; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { + body = ObjectSerializer.deserialize(body, "PostContactInfo"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -14613,27 +17931,20 @@ export class EmailCampaignsApi { }); } /** - * - * @summary Update an email campaign - * @param campaignId Id of the campaign - * @param emailCampaign Values to update a campaign - * @param {*} [options] Override http request options. - */ - public updateEmailCampaign (campaignId: number, emailCampaign: UpdateEmailCampaign, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/emailCampaigns/{campaignId}' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); + * + * @summary Create a list + * @param createList Values to create a list + * @param {*} [options] Override http request options. + */ + public createList (createList: CreateList, options: any = {}) : Promise<{ response: http.IncomingMessage; body: CreateModel; }> { + const localVarPath = this.basePath + '/contacts/lists'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling updateEmailCampaign.'); - } - - // verify required parameter 'emailCampaign' is not null or undefined - if (emailCampaign === null || emailCampaign === undefined) { - throw new Error('Required parameter emailCampaign was null or undefined when calling updateEmailCampaign.'); + // verify required parameter 'createList' is not null or undefined + if (createList === null || createList === undefined) { + throw new Error('Required parameter createList was null or undefined when calling createList.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -14641,13 +17952,13 @@ export class EmailCampaignsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'PUT', + method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(emailCampaign, "UpdateEmailCampaign") + body: ObjectSerializer.serialize(createList, "CreateList") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -14663,11 +17974,12 @@ export class EmailCampaignsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: CreateModel; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { + body = ObjectSerializer.deserialize(body, "CreateModel"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -14678,20 +17990,21 @@ export class EmailCampaignsApi { }); } /** - * - * @summary Upload an image to your account's image gallery - * @param uploadImage Parameters to upload an image - * @param {*} [options] Override http request options. - */ - public uploadImageToGallery (uploadImage: UploadImageToGallery, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/emailCampaigns/images'; + * + * @summary Delete a list + * @param listId Id of the list + * @param {*} [options] Override http request options. + */ + public deleteList (listId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/contacts/lists/{listId}' + .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'uploadImage' is not null or undefined - if (uploadImage === null || uploadImage === undefined) { - throw new Error('Required parameter uploadImage was null or undefined when calling uploadImageToGallery.'); + // verify required parameter 'listId' is not null or undefined + if (listId === null || listId === undefined) { + throw new Error('Required parameter listId was null or undefined when calling deleteList.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -14699,13 +18012,12 @@ export class EmailCampaignsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'POST', + method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(uploadImage, "UploadImageToGallery") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -14735,72 +18047,42 @@ export class EmailCampaignsApi { }); }); } -} -export enum FoldersApiApiKeys { - apiKey, - partnerKey, -} - -export class FoldersApi { - protected _basePath = defaultBasePath; - protected defaultHeaders : any = { - 'user-agent': `sendinblue_clientAPI/v${version}/ts-node` -}; - protected _useQuerystring = false; - - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } + /** + * + * @summary Get contacts in a list + * @param listId Id of the list + * @param modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. + * @param limit Number of documents per page + * @param offset Index of the first document of the page + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + * @param {*} [options] Override http request options. + */ + public getContactsFromList (listId: number, modifiedSince?: string, limit?: number, offset?: number, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetContacts; }> { + const localVarPath = this.basePath + '/contacts/lists/{listId}/contacts' + .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } + // verify required parameter 'listId' is not null or undefined + if (listId === null || listId === undefined) { + throw new Error('Required parameter listId was null or undefined when calling getContactsFromList.'); } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - get basePath() { - return this._basePath; - } + if (modifiedSince !== undefined) { + localVarQueryParameters['modifiedSince'] = ObjectSerializer.serialize(modifiedSince, "string"); + } - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } + if (limit !== undefined) { + localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); + } - public setApiKey(key: FoldersApiApiKeys, value: string) { - (this.authentications as any)[FoldersApiApiKeys[key]].apiKey = value; - } - /** - * - * @summary Create a folder - * @param createFolder Name of the folder - * @param {*} [options] Override http request options. - */ - public createFolder (createFolder: CreateUpdateFolder, options: any = {}) : Promise<{ response: http.IncomingMessage; body: CreateModel; }> { - const localVarPath = this.basePath + '/contacts/folders'; - const localVarQueryParameters: any = {}; - const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); - const localVarFormParams: any = {}; + if (offset !== undefined) { + localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); + } - // verify required parameter 'createFolder' is not null or undefined - if (createFolder === null || createFolder === undefined) { - throw new Error('Required parameter createFolder was null or undefined when calling createFolder.'); + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); } (Object).assign(localVarHeaderParams, options.headers); @@ -14808,13 +18090,12 @@ export class FoldersApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'POST', + method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(createFolder, "CreateUpdateFolder") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -14830,12 +18111,12 @@ export class FoldersApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: CreateModel; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: GetContacts; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "CreateModel"); + body = ObjectSerializer.deserialize(body, "GetContacts"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -14846,13 +18127,16 @@ export class FoldersApi { }); } /** - * - * @summary Delete a folder (and all its lists) - * @param folderId Id of the folder - * @param {*} [options] Override http request options. - */ - public deleteFolder (folderId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/contacts/folders/{folderId}' + * + * @summary Get lists in a folder + * @param folderId Id of the folder + * @param limit Number of documents per page + * @param offset Index of the first document of the page + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + * @param {*} [options] Override http request options. + */ + public getFolderLists (folderId: number, limit?: number, offset?: number, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetFolderLists; }> { + const localVarPath = this.basePath + '/contacts/folders/{folderId}/lists' .replace('{' + 'folderId' + '}', encodeURIComponent(String(folderId))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); @@ -14860,7 +18144,19 @@ export class FoldersApi { // verify required parameter 'folderId' is not null or undefined if (folderId === null || folderId === undefined) { - throw new Error('Required parameter folderId was null or undefined when calling deleteFolder.'); + throw new Error('Required parameter folderId was null or undefined when calling getFolderLists.'); + } + + if (limit !== undefined) { + localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); + } + + if (offset !== undefined) { + localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); } (Object).assign(localVarHeaderParams, options.headers); @@ -14868,7 +18164,7 @@ export class FoldersApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'DELETE', + method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, @@ -14889,11 +18185,12 @@ export class FoldersApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: GetFolderLists; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { + body = ObjectSerializer.deserialize(body, "GetFolderLists"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -14904,21 +18201,21 @@ export class FoldersApi { }); } /** - * - * @summary Returns a folder's details - * @param folderId id of the folder - * @param {*} [options] Override http request options. - */ - public getFolder (folderId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetFolder; }> { - const localVarPath = this.basePath + '/contacts/folders/{folderId}' - .replace('{' + 'folderId' + '}', encodeURIComponent(String(folderId))); + * + * @summary Get a list's details + * @param listId Id of the list + * @param {*} [options] Override http request options. + */ + public getList (listId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetExtendedList; }> { + const localVarPath = this.basePath + '/contacts/lists/{listId}' + .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'folderId' is not null or undefined - if (folderId === null || folderId === undefined) { - throw new Error('Required parameter folderId was null or undefined when calling getFolder.'); + // verify required parameter 'listId' is not null or undefined + if (listId === null || listId === undefined) { + throw new Error('Required parameter listId was null or undefined when calling getList.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -14947,12 +18244,12 @@ export class FoldersApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetFolder; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: GetExtendedList; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetFolder"); + body = ObjectSerializer.deserialize(body, "GetExtendedList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -14963,26 +18260,19 @@ export class FoldersApi { }); } /** - * - * @summary Get lists in a folder - * @param folderId Id of the folder - * @param limit Number of documents per page - * @param offset Index of the first document of the page - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - * @param {*} [options] Override http request options. - */ - public getFolderLists (folderId: number, limit?: number, offset?: number, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetFolderLists; }> { - const localVarPath = this.basePath + '/contacts/folders/{folderId}/lists' - .replace('{' + 'folderId' + '}', encodeURIComponent(String(folderId))); + * + * @summary Get all the lists + * @param limit Number of documents per page + * @param offset Index of the first document of the page + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + * @param {*} [options] Override http request options. + */ + public getLists (limit?: number, offset?: number, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetLists; }> { + const localVarPath = this.basePath + '/contacts/lists'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'folderId' is not null or undefined - if (folderId === null || folderId === undefined) { - throw new Error('Required parameter folderId was null or undefined when calling getFolderLists.'); - } - if (limit !== undefined) { localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } @@ -15021,12 +18311,12 @@ export class FoldersApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetFolderLists; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: GetLists; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetFolderLists"); + body = ObjectSerializer.deserialize(body, "GetLists"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -15037,39 +18327,27 @@ export class FoldersApi { }); } /** - * - * @summary Get all folders - * @param limit Number of documents per page - * @param offset Index of the first document of the page - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - * @param {*} [options] Override http request options. - */ - public getFolders (limit: number, offset: number, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetFolders; }> { - const localVarPath = this.basePath + '/contacts/folders'; + * + * @summary Delete a contact from a list + * @param listId Id of the list + * @param contactEmails Emails addresses OR IDs of the contacts + * @param {*} [options] Override http request options. + */ + public removeContactFromList (listId: number, contactEmails: RemoveContactFromList, options: any = {}) : Promise<{ response: http.IncomingMessage; body: PostContactInfo; }> { + const localVarPath = this.basePath + '/contacts/lists/{listId}/contacts/remove' + .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'limit' is not null or undefined - if (limit === null || limit === undefined) { - throw new Error('Required parameter limit was null or undefined when calling getFolders.'); - } - - // verify required parameter 'offset' is not null or undefined - if (offset === null || offset === undefined) { - throw new Error('Required parameter offset was null or undefined when calling getFolders.'); - } - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); + // verify required parameter 'listId' is not null or undefined + if (listId === null || listId === undefined) { + throw new Error('Required parameter listId was null or undefined when calling removeContactFromList.'); } - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); + // verify required parameter 'contactEmails' is not null or undefined + if (contactEmails === null || contactEmails === undefined) { + throw new Error('Required parameter contactEmails was null or undefined when calling removeContactFromList.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -15077,12 +18355,13 @@ export class FoldersApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'GET', + method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, + body: ObjectSerializer.serialize(contactEmails, "RemoveContactFromList") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -15098,12 +18377,12 @@ export class FoldersApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetFolders; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: PostContactInfo; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetFolders"); + body = ObjectSerializer.deserialize(body, "PostContactInfo"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -15114,27 +18393,27 @@ export class FoldersApi { }); } /** - * - * @summary Update a folder - * @param folderId Id of the folder - * @param updateFolder Name of the folder - * @param {*} [options] Override http request options. - */ - public updateFolder (folderId: number, updateFolder: CreateUpdateFolder, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/contacts/folders/{folderId}' - .replace('{' + 'folderId' + '}', encodeURIComponent(String(folderId))); + * + * @summary Update a list + * @param listId Id of the list + * @param updateList Values to update a list + * @param {*} [options] Override http request options. + */ + public updateList (listId: number, updateList: UpdateList, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/contacts/lists/{listId}' + .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'folderId' is not null or undefined - if (folderId === null || folderId === undefined) { - throw new Error('Required parameter folderId was null or undefined when calling updateFolder.'); + // verify required parameter 'listId' is not null or undefined + if (listId === null || listId === undefined) { + throw new Error('Required parameter listId was null or undefined when calling updateList.'); } - // verify required parameter 'updateFolder' is not null or undefined - if (updateFolder === null || updateFolder === undefined) { - throw new Error('Required parameter updateFolder was null or undefined when calling updateFolder.'); + // verify required parameter 'updateList' is not null or undefined + if (updateList === null || updateList === undefined) { + throw new Error('Required parameter updateList was null or undefined when calling updateList.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -15148,7 +18427,7 @@ export class FoldersApi { uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(updateFolder, "CreateUpdateFolder") + body: ObjectSerializer.serialize(updateList, "UpdateList") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -15178,17 +18457,17 @@ export class FoldersApi { }); }); } -} -export enum InboundParsingApiApiKeys { + } + export enum MasterAccountApiApiKeys { apiKey, partnerKey, -} + } -export class InboundParsingApi { + export class MasterAccountApi { protected _basePath = defaultBasePath; protected defaultHeaders : any = { - 'user-agent': `sendinblue_clientAPI/v${version}/ts-node` -}; + 'user-agent': `sendinblue_clientAPI/v${version}/ts-node` + }; protected _useQuerystring = false; protected authentications = { @@ -15226,48 +18505,90 @@ export class InboundParsingApi { this.authentications.default = auth; } - public setApiKey(key: InboundParsingApiApiKeys, value: string) { - (this.authentications as any)[InboundParsingApiApiKeys[key]].apiKey = value; + public setApiKey(key: MasterAccountApiApiKeys, value: string) { + (this.authentications as any)[MasterAccountApiApiKeys[key]].apiKey = value; + } + /** + * This endpoint will provide the details of the master account. + * @summary Get the details of requested master account + * @param {*} [options] Override http request options. + */ + public corporateMasterAccountGet (options: any = {}) : Promise<{ response: http.IncomingMessage; body: MasterDetailsResponse; }> { + const localVarPath = this.basePath + '/corporate/masterAccount'; + const localVarQueryParameters: any = {}; + const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + const localVarFormParams: any = {}; + + (Object).assign(localVarHeaderParams, options.headers); + + const localVarUseFormData = false; + + const localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + this.authentications.apiKey.applyToRequest(localVarRequestOptions); + + this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + + this.authentications.default.applyToRequest(localVarRequestOptions); + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: MasterDetailsResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + body = ObjectSerializer.deserialize(body, "MasterDetailsResponse"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); } /** - * This endpoint will show the list of all the events for the received emails. - * @summary Get the list of all the events for the received emails. - * @param sender Email address of the sender. - * @param startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. - * @param endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. - * @param limit Number of documents returned per page - * @param offset Index of the first document on the page - * @param sort Sort the results in the ascending/descending order of record creation - * @param {*} [options] Override http request options. - */ - public getInboundEmailEvents (sender?: string, startDate?: string, endDate?: string, limit?: number, offset?: number, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetInboundEmailEvents; }> { - const localVarPath = this.basePath + '/inbound/events'; + * This endpoint will provide the list all the sub-accounts of the master account. + * @summary Get the list of all the sub-accounts of the master account. + * @param offset Index of the first sub-account in the page + * @param limit Number of sub-accounts to be displayed on each page + * @param {*} [options] Override http request options. + */ + public corporateSubAccountGet (offset: number, limit: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body: SubAccountsResponse; }> { + const localVarPath = this.basePath + '/corporate/subAccount'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - if (sender !== undefined) { - localVarQueryParameters['sender'] = ObjectSerializer.serialize(sender, "string"); - } - - if (startDate !== undefined) { - localVarQueryParameters['startDate'] = ObjectSerializer.serialize(startDate, "string"); - } - - if (endDate !== undefined) { - localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "string"); + // verify required parameter 'offset' is not null or undefined + if (offset === null || offset === undefined) { + throw new Error('Required parameter offset was null or undefined when calling corporateSubAccountGet.'); } - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); + // verify required parameter 'limit' is not null or undefined + if (limit === null || limit === undefined) { + throw new Error('Required parameter limit was null or undefined when calling corporateSubAccountGet.'); } if (offset !== undefined) { localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); } - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); + if (limit !== undefined) { + localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } (Object).assign(localVarHeaderParams, options.headers); @@ -15296,12 +18617,12 @@ export class InboundParsingApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetInboundEmailEvents; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: SubAccountsResponse; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetInboundEmailEvents"); + body = ObjectSerializer.deserialize(body, "SubAccountsResponse"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -15312,21 +18633,21 @@ export class InboundParsingApi { }); } /** - * This endpoint will show the list of all events history for one particular received email. - * @summary Fetch all events history for one particular received email. - * @param uuid UUID to fetch events specific to recieved email - * @param {*} [options] Override http request options. - */ - public getInboundEmailEventsByUuid (uuid: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetInboundEmailEventsByUuid; }> { - const localVarPath = this.basePath + '/inbound/events/{uuid}' - .replace('{' + 'uuid' + '}', encodeURIComponent(String(uuid))); + * + * @summary Delete a sub-account + * @param id Id of the sub-account organization to be deleted + * @param {*} [options] Override http request options. + */ + public corporateSubAccountIdDelete (id: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/corporate/subAccount/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'uuid' is not null or undefined - if (uuid === null || uuid === undefined) { - throw new Error('Required parameter uuid was null or undefined when calling getInboundEmailEventsByUuid.'); + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling corporateSubAccountIdDelete.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -15334,7 +18655,7 @@ export class InboundParsingApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'GET', + method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, @@ -15355,12 +18676,11 @@ export class InboundParsingApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetInboundEmailEventsByUuid; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetInboundEmailEventsByUuid"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -15370,79 +18690,22 @@ export class InboundParsingApi { }); }); } -} -export enum ListsApiApiKeys { - apiKey, - partnerKey, -} - -export class ListsApi { - protected _basePath = defaultBasePath; - protected defaultHeaders : any = { - 'user-agent': `sendinblue_clientAPI/v${version}/ts-node` -}; - protected _useQuerystring = false; - - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } - - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: ListsApiApiKeys, value: string) { - (this.authentications as any)[ListsApiApiKeys[key]].apiKey = value; - } /** - * - * @summary Add existing contacts to a list - * @param listId Id of the list - * @param contactEmails Emails addresses OR IDs of the contacts - * @param {*} [options] Override http request options. - */ - public addContactToList (listId: number, contactEmails: AddContactToList, options: any = {}) : Promise<{ response: http.IncomingMessage; body: PostContactInfo; }> { - const localVarPath = this.basePath + '/contacts/lists/{listId}/contacts/add' - .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); + * This endpoint will provide the details for the specified sub-account company + * @summary Get sub-account details + * @param id Id of the sub-account organization + * @param {*} [options] Override http request options. + */ + public corporateSubAccountIdGet (id: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body: SubAccountDetailsResponse; }> { + const localVarPath = this.basePath + '/corporate/subAccount/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'listId' is not null or undefined - if (listId === null || listId === undefined) { - throw new Error('Required parameter listId was null or undefined when calling addContactToList.'); - } - - // verify required parameter 'contactEmails' is not null or undefined - if (contactEmails === null || contactEmails === undefined) { - throw new Error('Required parameter contactEmails was null or undefined when calling addContactToList.'); + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling corporateSubAccountIdGet.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -15450,13 +18713,12 @@ export class ListsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'POST', + method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(contactEmails, "AddContactToList") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -15472,12 +18734,12 @@ export class ListsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: PostContactInfo; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: SubAccountDetailsResponse; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "PostContactInfo"); + body = ObjectSerializer.deserialize(body, "SubAccountDetailsResponse"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -15488,20 +18750,27 @@ export class ListsApi { }); } /** - * - * @summary Create a list - * @param createList Values to create a list - * @param {*} [options] Override http request options. - */ - public createList (createList: CreateList, options: any = {}) : Promise<{ response: http.IncomingMessage; body: CreateModel; }> { - const localVarPath = this.basePath + '/contacts/lists'; + * This endpoint will update the sub-account plan + * @summary Update sub-account plan + * @param id Id of the sub-account organization + * @param updatePlanDetails Values to update a sub-account plan + * @param {*} [options] Override http request options. + */ + public corporateSubAccountIdPlanPut (id: number, updatePlanDetails: SubAccountUpdatePlanRequest, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/corporate/subAccount/{id}/plan' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'createList' is not null or undefined - if (createList === null || createList === undefined) { - throw new Error('Required parameter createList was null or undefined when calling createList.'); + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling corporateSubAccountIdPlanPut.'); + } + + // verify required parameter 'updatePlanDetails' is not null or undefined + if (updatePlanDetails === null || updatePlanDetails === undefined) { + throw new Error('Required parameter updatePlanDetails was null or undefined when calling corporateSubAccountIdPlanPut.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -15509,13 +18778,13 @@ export class ListsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'POST', + method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(createList, "CreateList") + body: ObjectSerializer.serialize(updatePlanDetails, "SubAccountUpdatePlanRequest") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -15531,12 +18800,11 @@ export class ListsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: CreateModel; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "CreateModel"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -15547,21 +18815,20 @@ export class ListsApi { }); } /** - * - * @summary Delete a list - * @param listId Id of the list - * @param {*} [options] Override http request options. - */ - public deleteList (listId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/contacts/lists/{listId}' - .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); + * This endpoint will create a new sub-account under a master account + * @summary Create a new sub-account under a master account. + * @param subAccountCreate values to create new sub-account + * @param {*} [options] Override http request options. + */ + public corporateSubAccountPost (subAccountCreate: CreateSubAccount, options: any = {}) : Promise<{ response: http.IncomingMessage; body: CreateSubAccountResponse; }> { + const localVarPath = this.basePath + '/corporate/subAccount'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'listId' is not null or undefined - if (listId === null || listId === undefined) { - throw new Error('Required parameter listId was null or undefined when calling deleteList.'); + // verify required parameter 'subAccountCreate' is not null or undefined + if (subAccountCreate === null || subAccountCreate === undefined) { + throw new Error('Required parameter subAccountCreate was null or undefined when calling corporateSubAccountPost.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -15569,12 +18836,13 @@ export class ListsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'DELETE', + method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, + body: ObjectSerializer.serialize(subAccountCreate, "CreateSubAccount") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -15590,11 +18858,12 @@ export class ListsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: CreateSubAccountResponse; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { + body = ObjectSerializer.deserialize(body, "CreateSubAccountResponse"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -15605,41 +18874,20 @@ export class ListsApi { }); } /** - * - * @summary Get contacts in a list - * @param listId Id of the list - * @param modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. - * @param limit Number of documents per page - * @param offset Index of the first document of the page - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - * @param {*} [options] Override http request options. - */ - public getContactsFromList (listId: number, modifiedSince?: string, limit?: number, offset?: number, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetContacts; }> { - const localVarPath = this.basePath + '/contacts/lists/{listId}/contacts' - .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); + * This endpoint generates an sso token to authenticate and access a sub-account of the master using the account endpoint https://app.sendinblue.com/account/login/sub-account/sso/[token], where [token] will be replaced by the actual token. + * @summary Generate SSO token to access Sendinblue + * @param ssoTokenRequest Values to generate SSO token for sub-account + * @param {*} [options] Override http request options. + */ + public corporateSubAccountSsoTokenPost (ssoTokenRequest: SsoTokenRequest, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetSsoToken; }> { + const localVarPath = this.basePath + '/corporate/subAccount/ssoToken'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'listId' is not null or undefined - if (listId === null || listId === undefined) { - throw new Error('Required parameter listId was null or undefined when calling getContactsFromList.'); - } - - if (modifiedSince !== undefined) { - localVarQueryParameters['modifiedSince'] = ObjectSerializer.serialize(modifiedSince, "string"); - } - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); + // verify required parameter 'ssoTokenRequest' is not null or undefined + if (ssoTokenRequest === null || ssoTokenRequest === undefined) { + throw new Error('Required parameter ssoTokenRequest was null or undefined when calling corporateSubAccountSsoTokenPost.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -15647,12 +18895,13 @@ export class ListsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'GET', + method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, + body: ObjectSerializer.serialize(ssoTokenRequest, "SsoTokenRequest") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -15668,12 +18917,12 @@ export class ListsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetContacts; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: GetSsoToken; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetContacts"); + body = ObjectSerializer.deserialize(body, "GetSsoToken"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -15683,35 +18932,97 @@ export class ListsApi { }); }); } + } + export enum NotesApiApiKeys { + apiKey, + partnerKey, + } + + export class NotesApi { + protected _basePath = defaultBasePath; + protected defaultHeaders : any = {}; + protected _useQuerystring = false; + + protected authentications = { + 'default': new VoidAuth(), + 'apiKey': new ApiKeyAuth('header', 'api-key'), + 'partnerKey': new ApiKeyAuth('header', 'partner-key'), + } + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: NotesApiApiKeys, value: string) { + (this.authentications as any)[NotesApiApiKeys[key]].apiKey = value; + } /** - * - * @summary Get lists in a folder - * @param folderId Id of the folder - * @param limit Number of documents per page - * @param offset Index of the first document of the page - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - * @param {*} [options] Override http request options. - */ - public getFolderLists (folderId: number, limit?: number, offset?: number, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetFolderLists; }> { - const localVarPath = this.basePath + '/contacts/folders/{folderId}/lists' - .replace('{' + 'folderId' + '}', encodeURIComponent(String(folderId))); + * + * @summary Get all notes + * @param entity Filter by note entity type + * @param entityIds Filter by note entity IDs + * @param dateFrom dateFrom to date range filter type (timestamp in milliseconds) + * @param dateTo dateTo to date range filter type (timestamp in milliseconds) + * @param offset Index of the first document of the page + * @param limit Number of documents per page + * @param sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed + * @param {*} [options] Override http request options. + */ + public crmNotesGet (entity?: 'companies' | 'deals' | 'contacts', entityIds?: string, dateFrom?: number, dateTo?: number, offset?: number, limit?: number, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: NoteList; }> { + const localVarPath = this.basePath + '/crm/notes'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'folderId' is not null or undefined - if (folderId === null || folderId === undefined) { - throw new Error('Required parameter folderId was null or undefined when calling getFolderLists.'); + if (entity !== undefined) { + localVarQueryParameters['entity'] = ObjectSerializer.serialize(entity, "'companies' | 'deals' | 'contacts'"); + } + + if (entityIds !== undefined) { + localVarQueryParameters['entityIds'] = ObjectSerializer.serialize(entityIds, "string"); + } + + if (dateFrom !== undefined) { + localVarQueryParameters['dateFrom'] = ObjectSerializer.serialize(dateFrom, "number"); } - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); + if (dateTo !== undefined) { + localVarQueryParameters['dateTo'] = ObjectSerializer.serialize(dateTo, "number"); } if (offset !== undefined) { localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); } + if (limit !== undefined) { + localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); + } + if (sort !== undefined) { localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); } @@ -15742,12 +19053,12 @@ export class ListsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetFolderLists; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: NoteList; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetFolderLists"); + body = ObjectSerializer.deserialize(body, "NoteList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -15758,21 +19069,21 @@ export class ListsApi { }); } /** - * - * @summary Get a list's details - * @param listId Id of the list - * @param {*} [options] Override http request options. - */ - public getList (listId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetExtendedList; }> { - const localVarPath = this.basePath + '/contacts/lists/{listId}' - .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); + * + * @summary Delete a note + * @param id Note ID to delete + * @param {*} [options] Override http request options. + */ + public crmNotesIdDelete (id: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/crm/notes/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'listId' is not null or undefined - if (listId === null || listId === undefined) { - throw new Error('Required parameter listId was null or undefined when calling getList.'); + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling crmNotesIdDelete.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -15780,7 +19091,7 @@ export class ListsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'GET', + method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, @@ -15801,12 +19112,11 @@ export class ListsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetExtendedList; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetExtendedList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -15817,29 +19127,21 @@ export class ListsApi { }); } /** - * - * @summary Get all the lists - * @param limit Number of documents per page - * @param offset Index of the first document of the page - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - * @param {*} [options] Override http request options. - */ - public getLists (limit?: number, offset?: number, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetLists; }> { - const localVarPath = this.basePath + '/contacts/lists'; + * + * @summary Get a note + * @param id Note ID to get + * @param {*} [options] Override http request options. + */ + public crmNotesIdGet (id: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: Note; }> { + const localVarPath = this.basePath + '/crm/notes/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling crmNotesIdGet.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -15868,12 +19170,12 @@ export class ListsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetLists; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: Note; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetLists"); + body = ObjectSerializer.deserialize(body, "Note"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -15884,27 +19186,27 @@ export class ListsApi { }); } /** - * - * @summary Delete a contact from a list - * @param listId Id of the list - * @param contactEmails Emails addresses OR IDs of the contacts - * @param {*} [options] Override http request options. - */ - public removeContactFromList (listId: number, contactEmails: RemoveContactFromList, options: any = {}) : Promise<{ response: http.IncomingMessage; body: PostContactInfo; }> { - const localVarPath = this.basePath + '/contacts/lists/{listId}/contacts/remove' - .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); + * + * @summary Update a note + * @param id Note ID to update + * @param body Note data to update a note + * @param {*} [options] Override http request options. + */ + public crmNotesIdPatch (id: string, body: NoteData, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/crm/notes/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'listId' is not null or undefined - if (listId === null || listId === undefined) { - throw new Error('Required parameter listId was null or undefined when calling removeContactFromList.'); + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling crmNotesIdPatch.'); } - // verify required parameter 'contactEmails' is not null or undefined - if (contactEmails === null || contactEmails === undefined) { - throw new Error('Required parameter contactEmails was null or undefined when calling removeContactFromList.'); + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling crmNotesIdPatch.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -15912,13 +19214,13 @@ export class ListsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'POST', + method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(contactEmails, "RemoveContactFromList") + body: ObjectSerializer.serialize(body, "NoteData") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -15934,12 +19236,11 @@ export class ListsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: PostContactInfo; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "PostContactInfo"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -15950,27 +19251,20 @@ export class ListsApi { }); } /** - * - * @summary Update a list - * @param listId Id of the list - * @param updateList Values to update a list - * @param {*} [options] Override http request options. - */ - public updateList (listId: number, updateList: UpdateList, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/contacts/lists/{listId}' - .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); + * + * @summary Create a note + * @param body Note data to create a note. + * @param {*} [options] Override http request options. + */ + public crmNotesPost (body: NoteData, options: any = {}) : Promise<{ response: http.IncomingMessage; body: NoteId; }> { + const localVarPath = this.basePath + '/crm/notes'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'listId' is not null or undefined - if (listId === null || listId === undefined) { - throw new Error('Required parameter listId was null or undefined when calling updateList.'); - } - - // verify required parameter 'updateList' is not null or undefined - if (updateList === null || updateList === undefined) { - throw new Error('Required parameter updateList was null or undefined when calling updateList.'); + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling crmNotesPost.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -15978,13 +19272,13 @@ export class ListsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'PUT', + method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(updateList, "UpdateList") + body: ObjectSerializer.serialize(body, "NoteData") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -16000,11 +19294,12 @@ export class ListsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: NoteId; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { + body = ObjectSerializer.deserialize(body, "NoteId"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -16014,17 +19309,17 @@ export class ListsApi { }); }); } -} -export enum MasterAccountApiApiKeys { + } + export enum ProcessApiApiKeys { apiKey, partnerKey, -} + } -export class MasterAccountApi { + export class ProcessApi { protected _basePath = defaultBasePath; protected defaultHeaders : any = { - 'user-agent': `sendinblue_clientAPI/v${version}/ts-node` -}; + 'user-agent': `sendinblue_clientAPI/v${version}/ts-node` + }; protected _useQuerystring = false; protected authentications = { @@ -16062,20 +19357,27 @@ export class MasterAccountApi { this.authentications.default = auth; } - public setApiKey(key: MasterAccountApiApiKeys, value: string) { - (this.authentications as any)[MasterAccountApiApiKeys[key]].apiKey = value; + public setApiKey(key: ProcessApiApiKeys, value: string) { + (this.authentications as any)[ProcessApiApiKeys[key]].apiKey = value; } /** - * This endpoint will provide the details of the master account. - * @summary Get the details of requested master account - * @param {*} [options] Override http request options. - */ - public corporateMasterAccountGet (options: any = {}) : Promise<{ response: http.IncomingMessage; body: MasterDetailsResponse; }> { - const localVarPath = this.basePath + '/corporate/masterAccount'; + * + * @summary Return the informations for a process + * @param processId Id of the process + * @param {*} [options] Override http request options. + */ + public getProcess (processId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetProcess; }> { + const localVarPath = this.basePath + '/processes/{processId}' + .replace('{' + 'processId' + '}', encodeURIComponent(String(processId))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; + // verify required parameter 'processId' is not null or undefined + if (processId === null || processId === undefined) { + throw new Error('Required parameter processId was null or undefined when calling getProcess.'); + } + (Object).assign(localVarHeaderParams, options.headers); const localVarUseFormData = false; @@ -16102,12 +19404,12 @@ export class MasterAccountApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: MasterDetailsResponse; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: GetProcess; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "MasterDetailsResponse"); + body = ObjectSerializer.deserialize(body, "GetProcess"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -16118,34 +19420,29 @@ export class MasterAccountApi { }); } /** - * This endpoint will provide the list all the sub-accounts of the master account. - * @summary Get the list of all the sub-accounts of the master account. - * @param offset Index of the first sub-account in the page - * @param limit Number of sub-accounts to be displayed on each page - * @param {*} [options] Override http request options. - */ - public corporateSubAccountGet (offset: number, limit: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body: SubAccountsResponse; }> { - const localVarPath = this.basePath + '/corporate/subAccount'; + * + * @summary Return all the processes for your account + * @param limit Number limitation for the result returned + * @param offset Beginning point in the list to retrieve from. + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + * @param {*} [options] Override http request options. + */ + public getProcesses (limit?: number, offset?: number, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetProcesses; }> { + const localVarPath = this.basePath + '/processes'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'offset' is not null or undefined - if (offset === null || offset === undefined) { - throw new Error('Required parameter offset was null or undefined when calling corporateSubAccountGet.'); - } - - // verify required parameter 'limit' is not null or undefined - if (limit === null || limit === undefined) { - throw new Error('Required parameter limit was null or undefined when calling corporateSubAccountGet.'); + if (limit !== undefined) { + localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } if (offset !== undefined) { localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); } - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); } (Object).assign(localVarHeaderParams, options.headers); @@ -16174,12 +19471,12 @@ export class MasterAccountApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: SubAccountsResponse; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: GetProcesses; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "SubAccountsResponse"); + body = ObjectSerializer.deserialize(body, "GetProcesses"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -16189,80 +19486,79 @@ export class MasterAccountApi { }); }); } - /** - * - * @summary Delete a sub-account - * @param id Id of the sub-account organization to be deleted - * @param {*} [options] Override http request options. - */ - public corporateSubAccountIdDelete (id: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/corporate/subAccount/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - const localVarQueryParameters: any = {}; - const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); - const localVarFormParams: any = {}; + } + export enum ResellerApiApiKeys { + apiKey, + partnerKey, + } - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling corporateSubAccountIdDelete.'); - } + export class ResellerApi { + protected _basePath = defaultBasePath; + protected defaultHeaders : any = { + 'user-agent': `sendinblue_clientAPI/v${version}/ts-node` + }; + protected _useQuerystring = false; - (Object).assign(localVarHeaderParams, options.headers); + protected authentications = { + 'default': new VoidAuth(), + 'apiKey': new ApiKeyAuth('header', 'api-key'), + 'partnerKey': new ApiKeyAuth('header', 'partner-key'), + } - const localVarUseFormData = false; + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } - const localVarRequestOptions: localVarRequest.Options = { - method: 'DELETE', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - uri: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } - this.authentications.apiKey.applyToRequest(localVarRequestOptions); + set basePath(basePath: string) { + this._basePath = basePath; + } - this.authentications.partnerKey.applyToRequest(localVarRequestOptions); + get basePath() { + return this._basePath; + } - this.authentications.default.applyToRequest(localVarRequestOptions); + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject({ response: response, body: body }); - } - } - }); - }); + public setApiKey(key: ResellerApiApiKeys, value: string) { + (this.authentications as any)[ResellerApiApiKeys[key]].apiKey = value; } /** - * This endpoint will provide the details for the specified sub-account company - * @summary Get sub-account details - * @param id Id of the sub-account organization - * @param {*} [options] Override http request options. - */ - public corporateSubAccountIdGet (id: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body: SubAccountDetailsResponse; }> { - const localVarPath = this.basePath + '/corporate/subAccount/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + * + * @summary Add Email and/or SMS credits to a specific child account + * @param childIdentifier Either auth key or id of reseller's child + * @param addCredits Values to post to add credit to a specific child account + * @param {*} [options] Override http request options. + */ + public addCredits (childIdentifier: string, addCredits: AddCredits, options: any = {}) : Promise<{ response: http.IncomingMessage; body: RemainingCreditModel; }> { + const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/credits/add' + .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling corporateSubAccountIdGet.'); + // verify required parameter 'childIdentifier' is not null or undefined + if (childIdentifier === null || childIdentifier === undefined) { + throw new Error('Required parameter childIdentifier was null or undefined when calling addCredits.'); + } + + // verify required parameter 'addCredits' is not null or undefined + if (addCredits === null || addCredits === undefined) { + throw new Error('Required parameter addCredits was null or undefined when calling addCredits.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -16270,12 +19566,13 @@ export class MasterAccountApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'GET', + method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, + body: ObjectSerializer.serialize(addCredits, "AddCredits") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -16291,12 +19588,12 @@ export class MasterAccountApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: SubAccountDetailsResponse; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: RemainingCreditModel; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "SubAccountDetailsResponse"); + body = ObjectSerializer.deserialize(body, "RemainingCreditModel"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -16307,27 +19604,27 @@ export class MasterAccountApi { }); } /** - * This endpoint will update the sub-account plan - * @summary Update sub-account plan - * @param id Id of the sub-account organization - * @param updatePlanDetails Values to update a sub-account plan - * @param {*} [options] Override http request options. - */ - public corporateSubAccountIdPlanPut (id: number, updatePlanDetails: SubAccountUpdatePlanRequest, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/corporate/subAccount/{id}/plan' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + * + * @summary Associate a dedicated IP to the child + * @param childIdentifier Either auth key or id of reseller's child + * @param ip IP to associate + * @param {*} [options] Override http request options. + */ + public associateIpToChild (childIdentifier: string, ip: ManageIp, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/ips/associate' + .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling corporateSubAccountIdPlanPut.'); + // verify required parameter 'childIdentifier' is not null or undefined + if (childIdentifier === null || childIdentifier === undefined) { + throw new Error('Required parameter childIdentifier was null or undefined when calling associateIpToChild.'); } - // verify required parameter 'updatePlanDetails' is not null or undefined - if (updatePlanDetails === null || updatePlanDetails === undefined) { - throw new Error('Required parameter updatePlanDetails was null or undefined when calling corporateSubAccountIdPlanPut.'); + // verify required parameter 'ip' is not null or undefined + if (ip === null || ip === undefined) { + throw new Error('Required parameter ip was null or undefined when calling associateIpToChild.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -16335,13 +19632,13 @@ export class MasterAccountApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'PUT', + method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(updatePlanDetails, "SubAccountUpdatePlanRequest") + body: ObjectSerializer.serialize(ip, "ManageIp") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -16372,20 +19669,27 @@ export class MasterAccountApi { }); } /** - * This endpoint will create a new sub-account under a master account - * @summary Create a new sub-account under a master account. - * @param subAccountCreate values to create new sub-account - * @param {*} [options] Override http request options. - */ - public corporateSubAccountPost (subAccountCreate: CreateSubAccount, options: any = {}) : Promise<{ response: http.IncomingMessage; body: CreateSubAccountResponse; }> { - const localVarPath = this.basePath + '/corporate/subAccount'; + * + * @summary Create a domain for a child account + * @param childIdentifier Either auth key or id of reseller's child + * @param addChildDomain Sender domain to add for a specific child account. This will not be displayed to the parent account. + * @param {*} [options] Override http request options. + */ + public createChildDomain (childIdentifier: string, addChildDomain: AddChildDomain, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/domains' + .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'subAccountCreate' is not null or undefined - if (subAccountCreate === null || subAccountCreate === undefined) { - throw new Error('Required parameter subAccountCreate was null or undefined when calling corporateSubAccountPost.'); + // verify required parameter 'childIdentifier' is not null or undefined + if (childIdentifier === null || childIdentifier === undefined) { + throw new Error('Required parameter childIdentifier was null or undefined when calling createChildDomain.'); + } + + // verify required parameter 'addChildDomain' is not null or undefined + if (addChildDomain === null || addChildDomain === undefined) { + throw new Error('Required parameter addChildDomain was null or undefined when calling createChildDomain.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -16399,7 +19703,7 @@ export class MasterAccountApi { uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(subAccountCreate, "CreateSubAccount") + body: ObjectSerializer.serialize(addChildDomain, "AddChildDomain") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -16415,12 +19719,11 @@ export class MasterAccountApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: CreateSubAccountResponse; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "CreateSubAccountResponse"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -16431,22 +19734,17 @@ export class MasterAccountApi { }); } /** - * This endpoint generates an sso token to authenticate and access a sub-account of the master using the account endpoint https://app.sendinblue.com/account/login/sub-account/sso/[token], where [token] will be replaced by the actual token. - * @summary Generate SSO token to access Sendinblue - * @param ssoTokenRequest Values to generate SSO token for sub-account - * @param {*} [options] Override http request options. - */ - public corporateSubAccountSsoTokenPost (ssoTokenRequest: SsoTokenRequest, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetSsoToken; }> { - const localVarPath = this.basePath + '/corporate/subAccount/ssoToken'; + * + * @summary Creates a reseller child + * @param resellerChild reseller child to add + * @param {*} [options] Override http request options. + */ + public createResellerChild (resellerChild?: CreateChild, options: any = {}) : Promise<{ response: http.IncomingMessage; body: CreateReseller; }> { + const localVarPath = this.basePath + '/reseller/children'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'ssoTokenRequest' is not null or undefined - if (ssoTokenRequest === null || ssoTokenRequest === undefined) { - throw new Error('Required parameter ssoTokenRequest was null or undefined when calling corporateSubAccountSsoTokenPost.'); - } - (Object).assign(localVarHeaderParams, options.headers); const localVarUseFormData = false; @@ -16458,7 +19756,7 @@ export class MasterAccountApi { uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(ssoTokenRequest, "SsoTokenRequest") + body: ObjectSerializer.serialize(resellerChild, "CreateChild") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -16474,12 +19772,12 @@ export class MasterAccountApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetSsoToken; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: CreateReseller; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetSsoToken"); + body = ObjectSerializer.deserialize(body, "CreateReseller"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -16489,73 +19787,29 @@ export class MasterAccountApi { }); }); } -} -export enum ProcessApiApiKeys { - apiKey, - partnerKey, -} - -export class ProcessApi { - protected _basePath = defaultBasePath; - protected defaultHeaders : any = { - 'user-agent': `sendinblue_clientAPI/v${version}/ts-node` -}; - protected _useQuerystring = false; - - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } - - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: ProcessApiApiKeys, value: string) { - (this.authentications as any)[ProcessApiApiKeys[key]].apiKey = value; - } /** - * - * @summary Return the informations for a process - * @param processId Id of the process - * @param {*} [options] Override http request options. - */ - public getProcess (processId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetProcess; }> { - const localVarPath = this.basePath + '/processes/{processId}' - .replace('{' + 'processId' + '}', encodeURIComponent(String(processId))); + * + * @summary Delete the sender domain of the reseller child based on the childIdentifier and domainName passed + * @param childIdentifier Either auth key or id of reseller's child + * @param domainName Pass the existing domain that needs to be deleted + * @param {*} [options] Override http request options. + */ + public deleteChildDomain (childIdentifier: string, domainName: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/domains/{domainName}' + .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))) + .replace('{' + 'domainName' + '}', encodeURIComponent(String(domainName))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'processId' is not null or undefined - if (processId === null || processId === undefined) { - throw new Error('Required parameter processId was null or undefined when calling getProcess.'); + // verify required parameter 'childIdentifier' is not null or undefined + if (childIdentifier === null || childIdentifier === undefined) { + throw new Error('Required parameter childIdentifier was null or undefined when calling deleteChildDomain.'); + } + + // verify required parameter 'domainName' is not null or undefined + if (domainName === null || domainName === undefined) { + throw new Error('Required parameter domainName was null or undefined when calling deleteChildDomain.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -16563,7 +19817,7 @@ export class ProcessApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'GET', + method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, @@ -16584,12 +19838,11 @@ export class ProcessApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetProcess; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetProcess"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -16600,29 +19853,21 @@ export class ProcessApi { }); } /** - * - * @summary Return all the processes for your account - * @param limit Number limitation for the result returned - * @param offset Beginning point in the list to retrieve from. - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - * @param {*} [options] Override http request options. - */ - public getProcesses (limit?: number, offset?: number, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetProcesses; }> { - const localVarPath = this.basePath + '/processes'; + * + * @summary Delete a single reseller child based on the child identifier supplied + * @param childIdentifier Either auth key or child id of reseller's child + * @param {*} [options] Override http request options. + */ + public deleteResellerChild (childIdentifier: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/reseller/children/{childIdentifier}' + .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); + // verify required parameter 'childIdentifier' is not null or undefined + if (childIdentifier === null || childIdentifier === undefined) { + throw new Error('Required parameter childIdentifier was null or undefined when calling deleteResellerChild.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -16630,7 +19875,7 @@ export class ProcessApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'GET', + method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, @@ -16651,12 +19896,11 @@ export class ProcessApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetProcesses; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetProcesses"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -16666,66 +19910,15 @@ export class ProcessApi { }); }); } -} -export enum ResellerApiApiKeys { - apiKey, - partnerKey, -} - -export class ResellerApi { - protected _basePath = defaultBasePath; - protected defaultHeaders : any = { - 'user-agent': `sendinblue_clientAPI/v${version}/ts-node` -}; - protected _useQuerystring = false; - - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } - - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: ResellerApiApiKeys, value: string) { - (this.authentications as any)[ResellerApiApiKeys[key]].apiKey = value; - } /** - * - * @summary Add Email and/or SMS credits to a specific child account - * @param childIdentifier Either auth key or id of reseller's child - * @param addCredits Values to post to add credit to a specific child account - * @param {*} [options] Override http request options. - */ - public addCredits (childIdentifier: string, addCredits: AddCredits, options: any = {}) : Promise<{ response: http.IncomingMessage; body: RemainingCreditModel; }> { - const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/credits/add' + * + * @summary Dissociate a dedicated IP to the child + * @param childIdentifier Either auth key or id of reseller's child + * @param ip IP to dissociate + * @param {*} [options] Override http request options. + */ + public dissociateIpFromChild (childIdentifier: string, ip: ManageIp, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/ips/dissociate' .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); @@ -16733,12 +19926,12 @@ export class ResellerApi { // verify required parameter 'childIdentifier' is not null or undefined if (childIdentifier === null || childIdentifier === undefined) { - throw new Error('Required parameter childIdentifier was null or undefined when calling addCredits.'); + throw new Error('Required parameter childIdentifier was null or undefined when calling dissociateIpFromChild.'); } - // verify required parameter 'addCredits' is not null or undefined - if (addCredits === null || addCredits === undefined) { - throw new Error('Required parameter addCredits was null or undefined when calling addCredits.'); + // verify required parameter 'ip' is not null or undefined + if (ip === null || ip === undefined) { + throw new Error('Required parameter ip was null or undefined when calling dissociateIpFromChild.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -16752,7 +19945,7 @@ export class ResellerApi { uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(addCredits, "AddCredits") + body: ObjectSerializer.serialize(ip, "ManageIp") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -16768,12 +19961,11 @@ export class ResellerApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: RemainingCreditModel; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "RemainingCreditModel"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -16784,14 +19976,13 @@ export class ResellerApi { }); } /** - * - * @summary Associate a dedicated IP to the child - * @param childIdentifier Either auth key or id of reseller's child - * @param ip IP to associate - * @param {*} [options] Override http request options. - */ - public associateIpToChild (childIdentifier: string, ip: ManageIp, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/ips/associate' + * + * @summary Get the status of a reseller's child account creation, whether it is successfully created (exists) or not based on the identifier supplied + * @param childIdentifier Either auth key or id of reseller's child + * @param {*} [options] Override http request options. + */ + public getChildAccountCreationStatus (childIdentifier: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetChildAccountCreationStatus; }> { + const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/accountCreationStatus' .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); @@ -16799,12 +19990,7 @@ export class ResellerApi { // verify required parameter 'childIdentifier' is not null or undefined if (childIdentifier === null || childIdentifier === undefined) { - throw new Error('Required parameter childIdentifier was null or undefined when calling associateIpToChild.'); - } - - // verify required parameter 'ip' is not null or undefined - if (ip === null || ip === undefined) { - throw new Error('Required parameter ip was null or undefined when calling associateIpToChild.'); + throw new Error('Required parameter childIdentifier was null or undefined when calling getChildAccountCreationStatus.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -16812,13 +19998,12 @@ export class ResellerApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'POST', + method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(ip, "ManageIp") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -16834,11 +20019,12 @@ export class ResellerApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: GetChildAccountCreationStatus; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { + body = ObjectSerializer.deserialize(body, "GetChildAccountCreationStatus"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -16849,13 +20035,12 @@ export class ResellerApi { }); } /** - * - * @summary Create a domain for a child account - * @param childIdentifier Either auth key or id of reseller's child - * @param addChildDomain Sender domain to add for a specific child account. This will not be displayed to the parent account. - * @param {*} [options] Override http request options. - */ - public createChildDomain (childIdentifier: string, addChildDomain: AddChildDomain, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + * + * @summary Get all sender domains for a specific child account + * @param childIdentifier Either auth key or id of reseller's child + * @param {*} [options] Override http request options. + */ + public getChildDomains (childIdentifier: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetChildDomains; }> { const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/domains' .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))); const localVarQueryParameters: any = {}; @@ -16864,12 +20049,7 @@ export class ResellerApi { // verify required parameter 'childIdentifier' is not null or undefined if (childIdentifier === null || childIdentifier === undefined) { - throw new Error('Required parameter childIdentifier was null or undefined when calling createChildDomain.'); - } - - // verify required parameter 'addChildDomain' is not null or undefined - if (addChildDomain === null || addChildDomain === undefined) { - throw new Error('Required parameter addChildDomain was null or undefined when calling createChildDomain.'); + throw new Error('Required parameter childIdentifier was null or undefined when calling getChildDomains.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -16877,13 +20057,12 @@ export class ResellerApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'POST', + method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(addChildDomain, "AddChildDomain") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -16899,11 +20078,12 @@ export class ResellerApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: GetChildDomains; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { + body = ObjectSerializer.deserialize(body, "GetChildDomains"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -16914,29 +20094,34 @@ export class ResellerApi { }); } /** - * - * @summary Creates a reseller child - * @param resellerChild reseller child to add - * @param {*} [options] Override http request options. - */ - public createResellerChild (resellerChild?: CreateChild, options: any = {}) : Promise<{ response: http.IncomingMessage; body: CreateReseller; }> { - const localVarPath = this.basePath + '/reseller/children'; + * + * @summary Get a child account's details + * @param childIdentifier Either auth key or id of reseller's child + * @param {*} [options] Override http request options. + */ + public getChildInfo (childIdentifier: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetChildInfo; }> { + const localVarPath = this.basePath + '/reseller/children/{childIdentifier}' + .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; + // verify required parameter 'childIdentifier' is not null or undefined + if (childIdentifier === null || childIdentifier === undefined) { + throw new Error('Required parameter childIdentifier was null or undefined when calling getChildInfo.'); + } + (Object).assign(localVarHeaderParams, options.headers); const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'POST', + method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(resellerChild, "CreateChild") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -16952,12 +20137,12 @@ export class ResellerApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: CreateReseller; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: GetChildInfo; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "CreateReseller"); + body = ObjectSerializer.deserialize(body, "GetChildInfo"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -16968,28 +20153,24 @@ export class ResellerApi { }); } /** - * - * @summary Delete the sender domain of the reseller child based on the childIdentifier and domainName passed - * @param childIdentifier Either auth key or id of reseller's child - * @param domainName Pass the existing domain that needs to be deleted - * @param {*} [options] Override http request options. - */ - public deleteChildDomain (childIdentifier: string, domainName: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/domains/{domainName}' - .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))) - .replace('{' + 'domainName' + '}', encodeURIComponent(String(domainName))); + * + * @summary Get the list of all children accounts + * @param limit Number of documents for child accounts information per page + * @param offset Index of the first document in the page + * @param {*} [options] Override http request options. + */ + public getResellerChilds (limit?: number, offset?: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetChildrenList; }> { + const localVarPath = this.basePath + '/reseller/children'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'childIdentifier' is not null or undefined - if (childIdentifier === null || childIdentifier === undefined) { - throw new Error('Required parameter childIdentifier was null or undefined when calling deleteChildDomain.'); + if (limit !== undefined) { + localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); } - // verify required parameter 'domainName' is not null or undefined - if (domainName === null || domainName === undefined) { - throw new Error('Required parameter domainName was null or undefined when calling deleteChildDomain.'); + if (offset !== undefined) { + localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); } (Object).assign(localVarHeaderParams, options.headers); @@ -16997,7 +20178,7 @@ export class ResellerApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'DELETE', + method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, @@ -17018,11 +20199,12 @@ export class ResellerApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: GetChildrenList; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { + body = ObjectSerializer.deserialize(body, "GetChildrenList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -17033,13 +20215,13 @@ export class ResellerApi { }); } /** - * - * @summary Delete a single reseller child based on the child identifier supplied - * @param childIdentifier Either auth key or child id of reseller's child - * @param {*} [options] Override http request options. - */ - public deleteResellerChild (childIdentifier: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/reseller/children/{childIdentifier}' + * It returns a session [token] which will remain valid for a short period of time. A child account will be able to access a white-labeled section by using the following url pattern => https:/email.mydomain.com/login/sso?token=[token] + * @summary Get session token to access Sendinblue (SSO) + * @param childIdentifier Either auth key or id of reseller's child + * @param {*} [options] Override http request options. + */ + public getSsoToken (childIdentifier: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetSsoToken; }> { + const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/auth' .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); @@ -17047,7 +20229,7 @@ export class ResellerApi { // verify required parameter 'childIdentifier' is not null or undefined if (childIdentifier === null || childIdentifier === undefined) { - throw new Error('Required parameter childIdentifier was null or undefined when calling deleteResellerChild.'); + throw new Error('Required parameter childIdentifier was null or undefined when calling getSsoToken.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -17055,7 +20237,7 @@ export class ResellerApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'DELETE', + method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, @@ -17076,11 +20258,12 @@ export class ResellerApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: GetSsoToken; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { + body = ObjectSerializer.deserialize(body, "GetSsoToken"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -17091,14 +20274,14 @@ export class ResellerApi { }); } /** - * - * @summary Dissociate a dedicated IP to the child - * @param childIdentifier Either auth key or id of reseller's child - * @param ip IP to dissociate - * @param {*} [options] Override http request options. - */ - public dissociateIpFromChild (childIdentifier: string, ip: ManageIp, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/ips/dissociate' + * + * @summary Remove Email and/or SMS credits from a specific child account + * @param childIdentifier Either auth key or id of reseller's child + * @param removeCredits Values to post to remove email or SMS credits from a specific child account + * @param {*} [options] Override http request options. + */ + public removeCredits (childIdentifier: string, removeCredits: RemoveCredits, options: any = {}) : Promise<{ response: http.IncomingMessage; body: RemainingCreditModel; }> { + const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/credits/remove' .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); @@ -17106,12 +20289,12 @@ export class ResellerApi { // verify required parameter 'childIdentifier' is not null or undefined if (childIdentifier === null || childIdentifier === undefined) { - throw new Error('Required parameter childIdentifier was null or undefined when calling dissociateIpFromChild.'); + throw new Error('Required parameter childIdentifier was null or undefined when calling removeCredits.'); } - // verify required parameter 'ip' is not null or undefined - if (ip === null || ip === undefined) { - throw new Error('Required parameter ip was null or undefined when calling dissociateIpFromChild.'); + // verify required parameter 'removeCredits' is not null or undefined + if (removeCredits === null || removeCredits === undefined) { + throw new Error('Required parameter removeCredits was null or undefined when calling removeCredits.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -17125,7 +20308,7 @@ export class ResellerApi { uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(ip, "ManageIp") + body: ObjectSerializer.serialize(removeCredits, "RemoveCredits") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -17141,11 +20324,12 @@ export class ResellerApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: RemainingCreditModel; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { + body = ObjectSerializer.deserialize(body, "RemainingCreditModel"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -17156,13 +20340,14 @@ export class ResellerApi { }); } /** - * - * @summary Get the status of a reseller's child account creation, whether it is successfully created (exists) or not based on the identifier supplied - * @param childIdentifier Either auth key or id of reseller's child - * @param {*} [options] Override http request options. - */ - public getChildAccountCreationStatus (childIdentifier: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetChildAccountCreationStatus; }> { - const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/accountCreationStatus' + * + * @summary Update info of reseller's child account status based on the childIdentifier supplied + * @param childIdentifier Either auth key or id of reseller's child + * @param updateChildAccountStatus values to update in child account status + * @param {*} [options] Override http request options. + */ + public updateChildAccountStatus (childIdentifier: string, updateChildAccountStatus: UpdateChildAccountStatus, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/accountStatus' .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); @@ -17170,7 +20355,12 @@ export class ResellerApi { // verify required parameter 'childIdentifier' is not null or undefined if (childIdentifier === null || childIdentifier === undefined) { - throw new Error('Required parameter childIdentifier was null or undefined when calling getChildAccountCreationStatus.'); + throw new Error('Required parameter childIdentifier was null or undefined when calling updateChildAccountStatus.'); + } + + // verify required parameter 'updateChildAccountStatus' is not null or undefined + if (updateChildAccountStatus === null || updateChildAccountStatus === undefined) { + throw new Error('Required parameter updateChildAccountStatus was null or undefined when calling updateChildAccountStatus.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -17178,12 +20368,13 @@ export class ResellerApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'GET', + method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, + body: ObjectSerializer.serialize(updateChildAccountStatus, "UpdateChildAccountStatus") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -17199,12 +20390,11 @@ export class ResellerApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetChildAccountCreationStatus; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetChildAccountCreationStatus"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -17215,21 +20405,34 @@ export class ResellerApi { }); } /** - * - * @summary Get all sender domains for a specific child account - * @param childIdentifier Either auth key or id of reseller's child - * @param {*} [options] Override http request options. - */ - public getChildDomains (childIdentifier: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetChildDomains; }> { - const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/domains' - .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))); + * + * @summary Update the sender domain of reseller's child based on the childIdentifier and domainName passed + * @param childIdentifier Either auth key or id of reseller's child + * @param domainName Pass the existing domain that needs to be updated + * @param updateChildDomain value to update for sender domain + * @param {*} [options] Override http request options. + */ + public updateChildDomain (childIdentifier: string, domainName: string, updateChildDomain: UpdateChildDomain, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/domains/{domainName}' + .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))) + .replace('{' + 'domainName' + '}', encodeURIComponent(String(domainName))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; // verify required parameter 'childIdentifier' is not null or undefined if (childIdentifier === null || childIdentifier === undefined) { - throw new Error('Required parameter childIdentifier was null or undefined when calling getChildDomains.'); + throw new Error('Required parameter childIdentifier was null or undefined when calling updateChildDomain.'); + } + + // verify required parameter 'domainName' is not null or undefined + if (domainName === null || domainName === undefined) { + throw new Error('Required parameter domainName was null or undefined when calling updateChildDomain.'); + } + + // verify required parameter 'updateChildDomain' is not null or undefined + if (updateChildDomain === null || updateChildDomain === undefined) { + throw new Error('Required parameter updateChildDomain was null or undefined when calling updateChildDomain.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -17237,12 +20440,13 @@ export class ResellerApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'GET', + method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, + body: ObjectSerializer.serialize(updateChildDomain, "UpdateChildDomain") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -17258,12 +20462,11 @@ export class ResellerApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetChildDomains; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetChildDomains"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -17274,12 +20477,13 @@ export class ResellerApi { }); } /** - * - * @summary Get a child account's details - * @param childIdentifier Either auth key or id of reseller's child - * @param {*} [options] Override http request options. - */ - public getChildInfo (childIdentifier: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetChildInfo; }> { + * + * @summary Update info of reseller's child based on the child identifier supplied + * @param childIdentifier Either auth key or id of reseller's child + * @param resellerChild values to update in child profile + * @param {*} [options] Override http request options. + */ + public updateResellerChild (childIdentifier: string, resellerChild: UpdateChild, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { const localVarPath = this.basePath + '/reseller/children/{childIdentifier}' .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))); const localVarQueryParameters: any = {}; @@ -17288,7 +20492,12 @@ export class ResellerApi { // verify required parameter 'childIdentifier' is not null or undefined if (childIdentifier === null || childIdentifier === undefined) { - throw new Error('Required parameter childIdentifier was null or undefined when calling getChildInfo.'); + throw new Error('Required parameter childIdentifier was null or undefined when calling updateResellerChild.'); + } + + // verify required parameter 'resellerChild' is not null or undefined + if (resellerChild === null || resellerChild === undefined) { + throw new Error('Required parameter resellerChild was null or undefined when calling updateResellerChild.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -17296,12 +20505,13 @@ export class ResellerApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'GET', + method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, + body: ObjectSerializer.serialize(resellerChild, "UpdateChild") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -17317,12 +20527,11 @@ export class ResellerApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetChildInfo; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetChildInfo"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -17332,25 +20541,72 @@ export class ResellerApi { }); }); } + } + export enum SMSCampaignsApiApiKeys { + apiKey, + partnerKey, + } + + export class SMSCampaignsApi { + protected _basePath = defaultBasePath; + protected defaultHeaders : any = { + 'user-agent': `sendinblue_clientAPI/v${version}/ts-node` + }; + protected _useQuerystring = false; + + protected authentications = { + 'default': new VoidAuth(), + 'apiKey': new ApiKeyAuth('header', 'api-key'), + 'partnerKey': new ApiKeyAuth('header', 'partner-key'), + } + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: SMSCampaignsApiApiKeys, value: string) { + (this.authentications as any)[SMSCampaignsApiApiKeys[key]].apiKey = value; + } /** - * - * @summary Get the list of all children accounts - * @param limit Number of documents for child accounts information per page - * @param offset Index of the first document in the page - * @param {*} [options] Override http request options. - */ - public getResellerChilds (limit?: number, offset?: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetChildrenList; }> { - const localVarPath = this.basePath + '/reseller/children'; + * + * @summary Creates an SMS campaign + * @param createSmsCampaign Values to create an SMS Campaign + * @param {*} [options] Override http request options. + */ + public createSmsCampaign (createSmsCampaign: CreateSmsCampaign, options: any = {}) : Promise<{ response: http.IncomingMessage; body: CreateModel; }> { + const localVarPath = this.basePath + '/smsCampaigns'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); + // verify required parameter 'createSmsCampaign' is not null or undefined + if (createSmsCampaign === null || createSmsCampaign === undefined) { + throw new Error('Required parameter createSmsCampaign was null or undefined when calling createSmsCampaign.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -17358,12 +20614,13 @@ export class ResellerApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'GET', + method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, + body: ObjectSerializer.serialize(createSmsCampaign, "CreateSmsCampaign") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -17379,12 +20636,12 @@ export class ResellerApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetChildrenList; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: CreateModel; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetChildrenList"); + body = ObjectSerializer.deserialize(body, "CreateModel"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -17395,21 +20652,21 @@ export class ResellerApi { }); } /** - * It returns a session [token] which will remain valid for a short period of time. A child account will be able to access a white-labeled section by using the following url pattern => https:/email.mydomain.com/login/sso?token=[token] - * @summary Get session token to access Sendinblue (SSO) - * @param childIdentifier Either auth key or id of reseller's child - * @param {*} [options] Override http request options. - */ - public getSsoToken (childIdentifier: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetSsoToken; }> { - const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/auth' - .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))); + * + * @summary Delete an SMS campaign + * @param campaignId id of the SMS campaign + * @param {*} [options] Override http request options. + */ + public deleteSmsCampaign (campaignId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/smsCampaigns/{campaignId}' + .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'childIdentifier' is not null or undefined - if (childIdentifier === null || childIdentifier === undefined) { - throw new Error('Required parameter childIdentifier was null or undefined when calling getSsoToken.'); + // verify required parameter 'campaignId' is not null or undefined + if (campaignId === null || campaignId === undefined) { + throw new Error('Required parameter campaignId was null or undefined when calling deleteSmsCampaign.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -17417,7 +20674,7 @@ export class ResellerApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'GET', + method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, @@ -17438,12 +20695,11 @@ export class ResellerApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetSsoToken; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetSsoToken"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -17454,27 +20710,21 @@ export class ResellerApi { }); } /** - * - * @summary Remove Email and/or SMS credits from a specific child account - * @param childIdentifier Either auth key or id of reseller's child - * @param removeCredits Values to post to remove email or SMS credits from a specific child account - * @param {*} [options] Override http request options. - */ - public removeCredits (childIdentifier: string, removeCredits: RemoveCredits, options: any = {}) : Promise<{ response: http.IncomingMessage; body: RemainingCreditModel; }> { - const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/credits/remove' - .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))); + * + * @summary Get an SMS campaign + * @param campaignId id of the SMS campaign + * @param {*} [options] Override http request options. + */ + public getSmsCampaign (campaignId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetSmsCampaign; }> { + const localVarPath = this.basePath + '/smsCampaigns/{campaignId}' + .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'childIdentifier' is not null or undefined - if (childIdentifier === null || childIdentifier === undefined) { - throw new Error('Required parameter childIdentifier was null or undefined when calling removeCredits.'); - } - - // verify required parameter 'removeCredits' is not null or undefined - if (removeCredits === null || removeCredits === undefined) { - throw new Error('Required parameter removeCredits was null or undefined when calling removeCredits.'); + // verify required parameter 'campaignId' is not null or undefined + if (campaignId === null || campaignId === undefined) { + throw new Error('Required parameter campaignId was null or undefined when calling getSmsCampaign.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -17482,13 +20732,12 @@ export class ResellerApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'POST', + method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(removeCredits, "RemoveCredits") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -17504,12 +20753,12 @@ export class ResellerApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: RemainingCreditModel; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: GetSmsCampaign; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "RemainingCreditModel"); + body = ObjectSerializer.deserialize(body, "GetSmsCampaign"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -17520,27 +20769,44 @@ export class ResellerApi { }); } /** - * - * @summary Update info of reseller's child account status based on the childIdentifier supplied - * @param childIdentifier Either auth key or id of reseller's child - * @param updateChildAccountStatus values to update in child account status - * @param {*} [options] Override http request options. - */ - public updateChildAccountStatus (childIdentifier: string, updateChildAccountStatus: UpdateChildAccountStatus, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/accountStatus' - .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))); + * + * @summary Returns the information for all your created SMS campaigns + * @param status Status of campaign. + * @param startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) + * @param endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) + * @param limit Number limitation for the result returned + * @param offset Beginning point in the list to retrieve from. + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + * @param {*} [options] Override http request options. + */ + public getSmsCampaigns (status?: 'suspended' | 'archive' | 'sent' | 'queued' | 'draft' | 'inProcess', startDate?: string, endDate?: string, limit?: number, offset?: number, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetSmsCampaigns; }> { + const localVarPath = this.basePath + '/smsCampaigns'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'childIdentifier' is not null or undefined - if (childIdentifier === null || childIdentifier === undefined) { - throw new Error('Required parameter childIdentifier was null or undefined when calling updateChildAccountStatus.'); + if (status !== undefined) { + localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "'suspended' | 'archive' | 'sent' | 'queued' | 'draft' | 'inProcess'"); } - // verify required parameter 'updateChildAccountStatus' is not null or undefined - if (updateChildAccountStatus === null || updateChildAccountStatus === undefined) { - throw new Error('Required parameter updateChildAccountStatus was null or undefined when calling updateChildAccountStatus.'); + if (startDate !== undefined) { + localVarQueryParameters['startDate'] = ObjectSerializer.serialize(startDate, "string"); + } + + if (endDate !== undefined) { + localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "string"); + } + + if (limit !== undefined) { + localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); + } + + if (offset !== undefined) { + localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); } (Object).assign(localVarHeaderParams, options.headers); @@ -17548,13 +20814,12 @@ export class ResellerApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'PUT', + method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(updateChildAccountStatus, "UpdateChildAccountStatus") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -17570,11 +20835,12 @@ export class ResellerApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: GetSmsCampaigns; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { + body = ObjectSerializer.deserialize(body, "GetSmsCampaigns"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -17585,34 +20851,22 @@ export class ResellerApi { }); } /** - * - * @summary Update the sender domain of reseller's child based on the childIdentifier and domainName passed - * @param childIdentifier Either auth key or id of reseller's child - * @param domainName Pass the existing domain that needs to be updated - * @param updateChildDomain value to update for sender domain - * @param {*} [options] Override http request options. - */ - public updateChildDomain (childIdentifier: string, domainName: string, updateChildDomain: UpdateChildDomain, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/domains/{domainName}' - .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))) - .replace('{' + 'domainName' + '}', encodeURIComponent(String(domainName))); + * It returns the background process ID which on completion calls the notify URL that you have set in the input. + * @summary Export an SMS campaign's recipients + * @param campaignId id of the campaign + * @param recipientExport Values to send for a recipient export request + * @param {*} [options] Override http request options. + */ + public requestSmsRecipientExport (campaignId: number, recipientExport?: RequestSmsRecipientExport, options: any = {}) : Promise<{ response: http.IncomingMessage; body: CreatedProcessId; }> { + const localVarPath = this.basePath + '/smsCampaigns/{campaignId}/exportRecipients' + .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'childIdentifier' is not null or undefined - if (childIdentifier === null || childIdentifier === undefined) { - throw new Error('Required parameter childIdentifier was null or undefined when calling updateChildDomain.'); - } - - // verify required parameter 'domainName' is not null or undefined - if (domainName === null || domainName === undefined) { - throw new Error('Required parameter domainName was null or undefined when calling updateChildDomain.'); - } - - // verify required parameter 'updateChildDomain' is not null or undefined - if (updateChildDomain === null || updateChildDomain === undefined) { - throw new Error('Required parameter updateChildDomain was null or undefined when calling updateChildDomain.'); + // verify required parameter 'campaignId' is not null or undefined + if (campaignId === null || campaignId === undefined) { + throw new Error('Required parameter campaignId was null or undefined when calling requestSmsRecipientExport.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -17620,13 +20874,13 @@ export class ResellerApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'PUT', + method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(updateChildDomain, "UpdateChildDomain") + body: ObjectSerializer.serialize(recipientExport, "RequestSmsRecipientExport") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -17642,11 +20896,12 @@ export class ResellerApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: CreatedProcessId; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { + body = ObjectSerializer.deserialize(body, "CreatedProcessId"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -17657,27 +20912,21 @@ export class ResellerApi { }); } /** - * - * @summary Update info of reseller's child based on the child identifier supplied - * @param childIdentifier Either auth key or id of reseller's child - * @param resellerChild values to update in child profile - * @param {*} [options] Override http request options. - */ - public updateResellerChild (childIdentifier: string, resellerChild: UpdateChild, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/reseller/children/{childIdentifier}' - .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))); + * + * @summary Send your SMS campaign immediately + * @param campaignId id of the campaign + * @param {*} [options] Override http request options. + */ + public sendSmsCampaignNow (campaignId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/smsCampaigns/{campaignId}/sendNow' + .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'childIdentifier' is not null or undefined - if (childIdentifier === null || childIdentifier === undefined) { - throw new Error('Required parameter childIdentifier was null or undefined when calling updateResellerChild.'); - } - - // verify required parameter 'resellerChild' is not null or undefined - if (resellerChild === null || resellerChild === undefined) { - throw new Error('Required parameter resellerChild was null or undefined when calling updateResellerChild.'); + // verify required parameter 'campaignId' is not null or undefined + if (campaignId === null || campaignId === undefined) { + throw new Error('Required parameter campaignId was null or undefined when calling sendSmsCampaignNow.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -17685,13 +20934,12 @@ export class ResellerApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'PUT', + method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(resellerChild, "UpdateChild") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -17721,72 +20969,28 @@ export class ResellerApi { }); }); } -} -export enum SMSCampaignsApiApiKeys { - apiKey, - partnerKey, -} - -export class SMSCampaignsApi { - protected _basePath = defaultBasePath; - protected defaultHeaders : any = { - 'user-agent': `sendinblue_clientAPI/v${version}/ts-node` -}; - protected _useQuerystring = false; - - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } - - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: SMSCampaignsApiApiKeys, value: string) { - (this.authentications as any)[SMSCampaignsApiApiKeys[key]].apiKey = value; - } /** - * - * @summary Creates an SMS campaign - * @param createSmsCampaign Values to create an SMS Campaign - * @param {*} [options] Override http request options. - */ - public createSmsCampaign (createSmsCampaign: CreateSmsCampaign, options: any = {}) : Promise<{ response: http.IncomingMessage; body: CreateModel; }> { - const localVarPath = this.basePath + '/smsCampaigns'; + * Send report of Sent and Archived campaign, to the specified email addresses, with respective data and a pdf attachment in detail. + * @summary Send an SMS campaign's report + * @param campaignId id of the campaign + * @param sendReport Values for send a report + * @param {*} [options] Override http request options. + */ + public sendSmsReport (campaignId: number, sendReport: SendReport, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/smsCampaigns/{campaignId}/sendReport' + .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'createSmsCampaign' is not null or undefined - if (createSmsCampaign === null || createSmsCampaign === undefined) { - throw new Error('Required parameter createSmsCampaign was null or undefined when calling createSmsCampaign.'); + // verify required parameter 'campaignId' is not null or undefined + if (campaignId === null || campaignId === undefined) { + throw new Error('Required parameter campaignId was null or undefined when calling sendSmsReport.'); + } + + // verify required parameter 'sendReport' is not null or undefined + if (sendReport === null || sendReport === undefined) { + throw new Error('Required parameter sendReport was null or undefined when calling sendSmsReport.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -17800,7 +21004,7 @@ export class SMSCampaignsApi { uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(createSmsCampaign, "CreateSmsCampaign") + body: ObjectSerializer.serialize(sendReport, "SendReport") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -17816,12 +21020,11 @@ export class SMSCampaignsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: CreateModel; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "CreateModel"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -17832,13 +21035,14 @@ export class SMSCampaignsApi { }); } /** - * - * @summary Delete an SMS campaign - * @param campaignId id of the SMS campaign - * @param {*} [options] Override http request options. - */ - public deleteSmsCampaign (campaignId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/smsCampaigns/{campaignId}' + * + * @summary Send a test SMS campaign + * @param campaignId Id of the SMS campaign + * @param phoneNumber Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted + * @param {*} [options] Override http request options. + */ + public sendTestSms (campaignId: number, phoneNumber: SendTestSms, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/smsCampaigns/{campaignId}/sendTest' .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); @@ -17846,7 +21050,12 @@ export class SMSCampaignsApi { // verify required parameter 'campaignId' is not null or undefined if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling deleteSmsCampaign.'); + throw new Error('Required parameter campaignId was null or undefined when calling sendTestSms.'); + } + + // verify required parameter 'phoneNumber' is not null or undefined + if (phoneNumber === null || phoneNumber === undefined) { + throw new Error('Required parameter phoneNumber was null or undefined when calling sendTestSms.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -17854,12 +21063,13 @@ export class SMSCampaignsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'DELETE', + method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, + body: ObjectSerializer.serialize(phoneNumber, "SendTestSms") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -17890,12 +21100,13 @@ export class SMSCampaignsApi { }); } /** - * - * @summary Get an SMS campaign - * @param campaignId id of the SMS campaign - * @param {*} [options] Override http request options. - */ - public getSmsCampaign (campaignId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetSmsCampaign; }> { + * + * @summary Update an SMS campaign + * @param campaignId id of the SMS campaign + * @param updateSmsCampaign Values to update an SMS Campaign + * @param {*} [options] Override http request options. + */ + public updateSmsCampaign (campaignId: number, updateSmsCampaign: UpdateSmsCampaign, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { const localVarPath = this.basePath + '/smsCampaigns/{campaignId}' .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); const localVarQueryParameters: any = {}; @@ -17904,7 +21115,12 @@ export class SMSCampaignsApi { // verify required parameter 'campaignId' is not null or undefined if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling getSmsCampaign.'); + throw new Error('Required parameter campaignId was null or undefined when calling updateSmsCampaign.'); + } + + // verify required parameter 'updateSmsCampaign' is not null or undefined + if (updateSmsCampaign === null || updateSmsCampaign === undefined) { + throw new Error('Required parameter updateSmsCampaign was null or undefined when calling updateSmsCampaign.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -17912,12 +21128,13 @@ export class SMSCampaignsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'GET', + method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, + body: ObjectSerializer.serialize(updateSmsCampaign, "UpdateSmsCampaign") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -17933,12 +21150,11 @@ export class SMSCampaignsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetSmsCampaign; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetSmsCampaign"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -17949,44 +21165,27 @@ export class SMSCampaignsApi { }); } /** - * - * @summary Returns the information for all your created SMS campaigns - * @param status Status of campaign. - * @param startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) - * @param endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) - * @param limit Number limitation for the result returned - * @param offset Beginning point in the list to retrieve from. - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - * @param {*} [options] Override http request options. - */ - public getSmsCampaigns (status?: 'suspended' | 'archive' | 'sent' | 'queued' | 'draft' | 'inProcess', startDate?: string, endDate?: string, limit?: number, offset?: number, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetSmsCampaigns; }> { - const localVarPath = this.basePath + '/smsCampaigns'; + * + * @summary Update a campaign's status + * @param campaignId id of the campaign + * @param status Status of the campaign. + * @param {*} [options] Override http request options. + */ + public updateSmsCampaignStatus (campaignId: number, status: UpdateCampaignStatus, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/smsCampaigns/{campaignId}/status' + .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - if (status !== undefined) { - localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "'suspended' | 'archive' | 'sent' | 'queued' | 'draft' | 'inProcess'"); - } - - if (startDate !== undefined) { - localVarQueryParameters['startDate'] = ObjectSerializer.serialize(startDate, "string"); - } - - if (endDate !== undefined) { - localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "string"); - } - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); + // verify required parameter 'campaignId' is not null or undefined + if (campaignId === null || campaignId === undefined) { + throw new Error('Required parameter campaignId was null or undefined when calling updateSmsCampaignStatus.'); } - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); + // verify required parameter 'status' is not null or undefined + if (status === null || status === undefined) { + throw new Error('Required parameter status was null or undefined when calling updateSmsCampaignStatus.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -17994,12 +21193,13 @@ export class SMSCampaignsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'GET', + method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, + body: ObjectSerializer.serialize(status, "UpdateCampaignStatus") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -18015,12 +21215,11 @@ export class SMSCampaignsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetSmsCampaigns; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetSmsCampaigns"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -18030,25 +21229,69 @@ export class SMSCampaignsApi { }); }); } + } + export enum SendersApiApiKeys { + apiKey, + partnerKey, + } + + export class SendersApi { + protected _basePath = defaultBasePath; + protected defaultHeaders : any = { + 'user-agent': `sendinblue_clientAPI/v${version}/ts-node` + }; + protected _useQuerystring = false; + + protected authentications = { + 'default': new VoidAuth(), + 'apiKey': new ApiKeyAuth('header', 'api-key'), + 'partnerKey': new ApiKeyAuth('header', 'partner-key'), + } + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: SendersApiApiKeys, value: string) { + (this.authentications as any)[SendersApiApiKeys[key]].apiKey = value; + } /** - * It returns the background process ID which on completion calls the notify URL that you have set in the input. - * @summary Export an SMS campaign's recipients - * @param campaignId id of the campaign - * @param recipientExport Values to send for a recipient export request - * @param {*} [options] Override http request options. - */ - public requestSmsRecipientExport (campaignId: number, recipientExport?: RequestSmsRecipientExport, options: any = {}) : Promise<{ response: http.IncomingMessage; body: CreatedProcessId; }> { - const localVarPath = this.basePath + '/smsCampaigns/{campaignId}/exportRecipients' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); + * + * @summary Create a new sender + * @param sender sender's name + * @param {*} [options] Override http request options. + */ + public createSender (sender?: CreateSender, options: any = {}) : Promise<{ response: http.IncomingMessage; body: CreateSenderModel; }> { + const localVarPath = this.basePath + '/senders'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling requestSmsRecipientExport.'); - } - (Object).assign(localVarHeaderParams, options.headers); const localVarUseFormData = false; @@ -18060,7 +21303,7 @@ export class SMSCampaignsApi { uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(recipientExport, "RequestSmsRecipientExport") + body: ObjectSerializer.serialize(sender, "CreateSender") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -18076,12 +21319,12 @@ export class SMSCampaignsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: CreatedProcessId; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: CreateSenderModel; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "CreatedProcessId"); + body = ObjectSerializer.deserialize(body, "CreateSenderModel"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -18092,21 +21335,21 @@ export class SMSCampaignsApi { }); } /** - * - * @summary Send your SMS campaign immediately - * @param campaignId id of the campaign - * @param {*} [options] Override http request options. - */ - public sendSmsCampaignNow (campaignId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/smsCampaigns/{campaignId}/sendNow' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); + * + * @summary Delete a sender + * @param senderId Id of the sender + * @param {*} [options] Override http request options. + */ + public deleteSender (senderId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/senders/{senderId}' + .replace('{' + 'senderId' + '}', encodeURIComponent(String(senderId))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling sendSmsCampaignNow.'); + // verify required parameter 'senderId' is not null or undefined + if (senderId === null || senderId === undefined) { + throw new Error('Required parameter senderId was null or undefined when calling deleteSender.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -18114,7 +21357,7 @@ export class SMSCampaignsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'POST', + method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, @@ -18150,41 +21393,27 @@ export class SMSCampaignsApi { }); } /** - * Send report of Sent and Archived campaign, to the specified email addresses, with respective data and a pdf attachment in detail. - * @summary Send an SMS campaign's report - * @param campaignId id of the campaign - * @param sendReport Values for send a report - * @param {*} [options] Override http request options. - */ - public sendSmsReport (campaignId: number, sendReport: SendReport, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/smsCampaigns/{campaignId}/sendReport' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); + * + * @summary Get all the dedicated IPs for your account + * @param {*} [options] Override http request options. + */ + public getIps (options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetIps; }> { + const localVarPath = this.basePath + '/senders/ips'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling sendSmsReport.'); - } - - // verify required parameter 'sendReport' is not null or undefined - if (sendReport === null || sendReport === undefined) { - throw new Error('Required parameter sendReport was null or undefined when calling sendSmsReport.'); - } - (Object).assign(localVarHeaderParams, options.headers); const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'POST', + method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(sendReport, "SendReport") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -18200,11 +21429,12 @@ export class SMSCampaignsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: GetIps; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { + body = ObjectSerializer.deserialize(body, "GetIps"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -18215,27 +21445,21 @@ export class SMSCampaignsApi { }); } /** - * - * @summary Send a test SMS campaign - * @param campaignId Id of the SMS campaign - * @param phoneNumber Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted - * @param {*} [options] Override http request options. - */ - public sendTestSms (campaignId: number, phoneNumber: SendTestSms, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/smsCampaigns/{campaignId}/sendTest' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); + * + * @summary Get all the dedicated IPs for a sender + * @param senderId Id of the sender + * @param {*} [options] Override http request options. + */ + public getIpsFromSender (senderId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetIpsFromSender; }> { + const localVarPath = this.basePath + '/senders/{senderId}/ips' + .replace('{' + 'senderId' + '}', encodeURIComponent(String(senderId))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling sendTestSms.'); - } - - // verify required parameter 'phoneNumber' is not null or undefined - if (phoneNumber === null || phoneNumber === undefined) { - throw new Error('Required parameter phoneNumber was null or undefined when calling sendTestSms.'); + // verify required parameter 'senderId' is not null or undefined + if (senderId === null || senderId === undefined) { + throw new Error('Required parameter senderId was null or undefined when calling getIpsFromSender.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -18243,13 +21467,12 @@ export class SMSCampaignsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'POST', + method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(phoneNumber, "SendTestSms") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -18265,11 +21488,12 @@ export class SMSCampaignsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: GetIpsFromSender; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { + body = ObjectSerializer.deserialize(body, "GetIpsFromSender"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -18280,27 +21504,24 @@ export class SMSCampaignsApi { }); } /** - * - * @summary Update an SMS campaign - * @param campaignId id of the SMS campaign - * @param updateSmsCampaign Values to update an SMS Campaign - * @param {*} [options] Override http request options. - */ - public updateSmsCampaign (campaignId: number, updateSmsCampaign: UpdateSmsCampaign, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/smsCampaigns/{campaignId}' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); + * + * @summary Get the list of all your senders + * @param ip Filter your senders for a specific ip (available for dedicated IP usage only) + * @param domain Filter your senders for a specific domain + * @param {*} [options] Override http request options. + */ + public getSenders (ip?: string, domain?: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetSendersList; }> { + const localVarPath = this.basePath + '/senders'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling updateSmsCampaign.'); + if (ip !== undefined) { + localVarQueryParameters['ip'] = ObjectSerializer.serialize(ip, "string"); } - // verify required parameter 'updateSmsCampaign' is not null or undefined - if (updateSmsCampaign === null || updateSmsCampaign === undefined) { - throw new Error('Required parameter updateSmsCampaign was null or undefined when calling updateSmsCampaign.'); + if (domain !== undefined) { + localVarQueryParameters['domain'] = ObjectSerializer.serialize(domain, "string"); } (Object).assign(localVarHeaderParams, options.headers); @@ -18308,13 +21529,12 @@ export class SMSCampaignsApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'PUT', + method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(updateSmsCampaign, "UpdateSmsCampaign") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -18330,11 +21550,12 @@ export class SMSCampaignsApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: GetSendersList; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { + body = ObjectSerializer.deserialize(body, "GetSendersList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -18345,27 +21566,22 @@ export class SMSCampaignsApi { }); } /** - * - * @summary Update a campaign's status - * @param campaignId id of the campaign - * @param status Status of the campaign. - * @param {*} [options] Override http request options. - */ - public updateSmsCampaignStatus (campaignId: number, status: UpdateCampaignStatus, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/smsCampaigns/{campaignId}/status' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); + * + * @summary Update a sender + * @param senderId Id of the sender + * @param sender sender's name + * @param {*} [options] Override http request options. + */ + public updateSender (senderId: number, sender?: UpdateSender, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/senders/{senderId}' + .replace('{' + 'senderId' + '}', encodeURIComponent(String(senderId))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling updateSmsCampaignStatus.'); - } - - // verify required parameter 'status' is not null or undefined - if (status === null || status === undefined) { - throw new Error('Required parameter status was null or undefined when calling updateSmsCampaignStatus.'); + // verify required parameter 'senderId' is not null or undefined + if (senderId === null || senderId === undefined) { + throw new Error('Required parameter senderId was null or undefined when calling updateSender.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -18379,7 +21595,7 @@ export class SMSCampaignsApi { uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(status, "UpdateCampaignStatus") + body: ObjectSerializer.serialize(sender, "UpdateSender") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -18409,17 +21625,15 @@ export class SMSCampaignsApi { }); }); } -} -export enum SendersApiApiKeys { + } + export enum TasksApiApiKeys { apiKey, partnerKey, -} + } -export class SendersApi { + export class TasksApi { protected _basePath = defaultBasePath; - protected defaultHeaders : any = { - 'user-agent': `sendinblue_clientAPI/v${version}/ts-node` -}; + protected defaultHeaders : any = {}; protected _useQuerystring = false; protected authentications = { @@ -18457,33 +21671,96 @@ export class SendersApi { this.authentications.default = auth; } - public setApiKey(key: SendersApiApiKeys, value: string) { - (this.authentications as any)[SendersApiApiKeys[key]].apiKey = value; - } - /** - * - * @summary Create a new sender - * @param sender sender's name - * @param {*} [options] Override http request options. - */ - public createSender (sender?: CreateSender, options: any = {}) : Promise<{ response: http.IncomingMessage; body: CreateSenderModel; }> { - const localVarPath = this.basePath + '/senders'; + public setApiKey(key: TasksApiApiKeys, value: string) { + (this.authentications as any)[TasksApiApiKeys[key]].apiKey = value; + } + /** + * + * @summary Get all tasks + * @param filterType Filter by task type (ID) + * @param filterStatus Filter by task status + * @param filterDate Filter by date + * @param filterAssignTo Filter by assignTo id + * @param filterContacts Filter by contact ids + * @param filterDeals Filter by deals ids + * @param filterCompanies Filter by companies ids + * @param dateFrom dateFrom to date range filter type (timestamp in milliseconds) + * @param dateTo dateTo to date range filter type (timestamp in milliseconds) + * @param offset Index of the first document of the page + * @param limit Number of documents per page + * @param sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed + * @param sortBy The field used to sort field names. + * @param {*} [options] Override http request options. + */ + public crmTasksGet (filterType?: string, filterStatus?: 'done' | 'undone', filterDate?: 'overdue' | 'today' | 'tomorrow' | 'week' | 'range', filterAssignTo?: string, filterContacts?: string, filterDeals?: string, filterCompanies?: string, dateFrom?: number, dateTo?: number, offset?: number, limit?: number, sort?: 'asc' | 'desc', sortBy?: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: TaskList; }> { + const localVarPath = this.basePath + '/crm/tasks'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; + if (filterType !== undefined) { + localVarQueryParameters['filter[type]'] = ObjectSerializer.serialize(filterType, "string"); + } + + if (filterStatus !== undefined) { + localVarQueryParameters['filter[status]'] = ObjectSerializer.serialize(filterStatus, "'done' | 'undone'"); + } + + if (filterDate !== undefined) { + localVarQueryParameters['filter[date]'] = ObjectSerializer.serialize(filterDate, "'overdue' | 'today' | 'tomorrow' | 'week' | 'range'"); + } + + if (filterAssignTo !== undefined) { + localVarQueryParameters['filter[assignTo]'] = ObjectSerializer.serialize(filterAssignTo, "string"); + } + + if (filterContacts !== undefined) { + localVarQueryParameters['filter[contacts]'] = ObjectSerializer.serialize(filterContacts, "string"); + } + + if (filterDeals !== undefined) { + localVarQueryParameters['filter[deals]'] = ObjectSerializer.serialize(filterDeals, "string"); + } + + if (filterCompanies !== undefined) { + localVarQueryParameters['filter[companies]'] = ObjectSerializer.serialize(filterCompanies, "string"); + } + + if (dateFrom !== undefined) { + localVarQueryParameters['dateFrom'] = ObjectSerializer.serialize(dateFrom, "number"); + } + + if (dateTo !== undefined) { + localVarQueryParameters['dateTo'] = ObjectSerializer.serialize(dateTo, "number"); + } + + if (offset !== undefined) { + localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); + } + + if (limit !== undefined) { + localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); + } + + if (sortBy !== undefined) { + localVarQueryParameters['sortBy'] = ObjectSerializer.serialize(sortBy, "string"); + } + (Object).assign(localVarHeaderParams, options.headers); const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'POST', + method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(sender, "CreateSender") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -18499,12 +21776,12 @@ export class SendersApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: CreateSenderModel; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: TaskList; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "CreateSenderModel"); + body = ObjectSerializer.deserialize(body, "TaskList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -18515,21 +21792,21 @@ export class SendersApi { }); } /** - * - * @summary Delete a sender - * @param senderId Id of the sender - * @param {*} [options] Override http request options. - */ - public deleteSender (senderId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/senders/{senderId}' - .replace('{' + 'senderId' + '}', encodeURIComponent(String(senderId))); + * + * @summary Delete a task + * @param id + * @param {*} [options] Override http request options. + */ + public crmTasksIdDelete (id: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/crm/tasks/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'senderId' is not null or undefined - if (senderId === null || senderId === undefined) { - throw new Error('Required parameter senderId was null or undefined when calling deleteSender.'); + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling crmTasksIdDelete.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -18573,16 +21850,23 @@ export class SendersApi { }); } /** - * - * @summary Get all the dedicated IPs for your account - * @param {*} [options] Override http request options. - */ - public getIps (options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetIps; }> { - const localVarPath = this.basePath + '/senders/ips'; + * + * @summary Get a task + * @param id + * @param {*} [options] Override http request options. + */ + public crmTasksIdGet (id: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: Task; }> { + const localVarPath = this.basePath + '/crm/tasks/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling crmTasksIdGet.'); + } + (Object).assign(localVarHeaderParams, options.headers); const localVarUseFormData = false; @@ -18609,12 +21893,12 @@ export class SendersApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetIps; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: Task; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetIps"); + body = ObjectSerializer.deserialize(body, "Task"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -18625,21 +21909,27 @@ export class SendersApi { }); } /** - * - * @summary Get all the dedicated IPs for a sender - * @param senderId Id of the sender - * @param {*} [options] Override http request options. - */ - public getIpsFromSender (senderId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetIpsFromSender; }> { - const localVarPath = this.basePath + '/senders/{senderId}/ips' - .replace('{' + 'senderId' + '}', encodeURIComponent(String(senderId))); + * + * @summary Update a task + * @param id + * @param body Updated task details. + * @param {*} [options] Override http request options. + */ + public crmTasksIdPatch (id: string, body: Body7, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/crm/tasks/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'senderId' is not null or undefined - if (senderId === null || senderId === undefined) { - throw new Error('Required parameter senderId was null or undefined when calling getIpsFromSender.'); + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling crmTasksIdPatch.'); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling crmTasksIdPatch.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -18647,12 +21937,13 @@ export class SendersApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'GET', + method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, + body: ObjectSerializer.serialize(body, "Body7") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -18668,12 +21959,11 @@ export class SendersApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetIpsFromSender; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetIpsFromSender"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -18684,24 +21974,20 @@ export class SendersApi { }); } /** - * - * @summary Get the list of all your senders - * @param ip Filter your senders for a specific ip (available for dedicated IP usage only) - * @param domain Filter your senders for a specific domain - * @param {*} [options] Override http request options. - */ - public getSenders (ip?: string, domain?: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetSendersList; }> { - const localVarPath = this.basePath + '/senders'; + * + * @summary Create a task + * @param body Task name. + * @param {*} [options] Override http request options. + */ + public crmTasksPost (body: Body6, options: any = {}) : Promise<{ response: http.IncomingMessage; body: InlineResponse2011; }> { + const localVarPath = this.basePath + '/crm/tasks'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - if (ip !== undefined) { - localVarQueryParameters['ip'] = ObjectSerializer.serialize(ip, "string"); - } - - if (domain !== undefined) { - localVarQueryParameters['domain'] = ObjectSerializer.serialize(domain, "string"); + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling crmTasksPost.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -18709,12 +21995,13 @@ export class SendersApi { const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'GET', + method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, + body: ObjectSerializer.serialize(body, "Body6") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -18730,12 +22017,12 @@ export class SendersApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: GetSendersList; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: InlineResponse2011; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "GetSendersList"); + body = ObjectSerializer.deserialize(body, "InlineResponse2011"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -18746,36 +22033,27 @@ export class SendersApi { }); } /** - * - * @summary Update a sender - * @param senderId Id of the sender - * @param sender sender's name - * @param {*} [options] Override http request options. - */ - public updateSender (senderId: number, sender?: UpdateSender, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/senders/{senderId}' - .replace('{' + 'senderId' + '}', encodeURIComponent(String(senderId))); + * + * @summary Get all task types + * @param {*} [options] Override http request options. + */ + public crmTasktypesGet (options: any = {}) : Promise<{ response: http.IncomingMessage; body: TaskTypes; }> { + const localVarPath = this.basePath + '/crm/tasktypes'; const localVarQueryParameters: any = {}; const localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); const localVarFormParams: any = {}; - // verify required parameter 'senderId' is not null or undefined - if (senderId === null || senderId === undefined) { - throw new Error('Required parameter senderId was null or undefined when calling updateSender.'); - } - (Object).assign(localVarHeaderParams, options.headers); const localVarUseFormData = false; const localVarRequestOptions: localVarRequest.Options = { - method: 'PUT', + method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(sender, "UpdateSender") }; this.authentications.apiKey.applyToRequest(localVarRequestOptions); @@ -18791,11 +22069,12 @@ export class SendersApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: TaskTypes; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { + body = ObjectSerializer.deserialize(body, "TaskTypes"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -18805,17 +22084,17 @@ export class SendersApi { }); }); } -} -export enum TransactionalEmailsApiApiKeys { + } + export enum TransactionalEmailsApiApiKeys { apiKey, partnerKey, -} + } -export class TransactionalEmailsApi { + export class TransactionalEmailsApi { protected _basePath = defaultBasePath; protected defaultHeaders : any = { - 'user-agent': `sendinblue_clientAPI/v${version}/ts-node` -}; + 'user-agent': `sendinblue_clientAPI/v${version}/ts-node` + }; protected _useQuerystring = false; protected authentications = { @@ -18857,11 +22136,11 @@ export class TransactionalEmailsApi { (this.authentications as any)[TransactionalEmailsApiApiKeys[key]].apiKey = value; } /** - * Blocks a new domain in order to avoid messages being sent to the same - * @summary Add a new domain to the list of blocked domains - * @param blockDomain - * @param {*} [options] Override http request options. - */ + * Blocks a new domain in order to avoid messages being sent to the same + * @summary Add a new domain to the list of blocked domains + * @param blockDomain + * @param {*} [options] Override http request options. + */ public blockNewDomain (blockDomain: BlockDomain, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { const localVarPath = this.basePath + '/smtp/blockedDomains'; const localVarQueryParameters: any = {}; @@ -18915,11 +22194,11 @@ export class TransactionalEmailsApi { }); } /** - * - * @summary Create an email template - * @param smtpTemplate values to update in transactional email template - * @param {*} [options] Override http request options. - */ + * + * @summary Create an email template + * @param smtpTemplate values to update in transactional email template + * @param {*} [options] Override http request options. + */ public createSmtpTemplate (smtpTemplate: CreateSmtpTemplate, options: any = {}) : Promise<{ response: http.IncomingMessage; body: CreateModel; }> { const localVarPath = this.basePath + '/smtp/templates'; const localVarQueryParameters: any = {}; @@ -18974,11 +22253,11 @@ export class TransactionalEmailsApi { }); } /** - * Unblocks an existing domain from the list of blocked domains - * @summary Unblock an existing domain from the list of blocked domains - * @param domain The name of the domain to be deleted - * @param {*} [options] Override http request options. - */ + * Unblocks an existing domain from the list of blocked domains + * @summary Unblock an existing domain from the list of blocked domains + * @param domain The name of the domain to be deleted + * @param {*} [options] Override http request options. + */ public deleteBlockedDomain (domain: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { const localVarPath = this.basePath + '/smtp/blockedDomains/{domain}' .replace('{' + 'domain' + '}', encodeURIComponent(String(domain))); @@ -19032,11 +22311,11 @@ export class TransactionalEmailsApi { }); } /** - * Delete hardbounces. To use carefully (e.g. in case of temporary ISP failures) - * @summary Delete hardbounces - * @param deleteHardbounces values to delete hardbounces - * @param {*} [options] Override http request options. - */ + * Delete hardbounces. To use carefully (e.g. in case of temporary ISP failures) + * @summary Delete hardbounces + * @param deleteHardbounces values to delete hardbounces + * @param {*} [options] Override http request options. + */ public deleteHardbounces (deleteHardbounces?: DeleteHardbounces, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { const localVarPath = this.basePath + '/smtp/deleteHardbounces'; const localVarQueryParameters: any = {}; @@ -19085,11 +22364,11 @@ export class TransactionalEmailsApi { }); } /** - * Delete scheduled batch of emails by batchId or single scheduled email by messageId - * @summary Delete scheduled emails by batchId or messageId - * @param identifier The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. - * @param {*} [options] Override http request options. - */ + * Delete scheduled batch of emails by batchId or single scheduled email by messageId + * @summary Delete scheduled emails by batchId or messageId + * @param identifier The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. + * @param {*} [options] Override http request options. + */ public deleteScheduledEmailById (identifier: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { const localVarPath = this.basePath + '/smtp/email/{identifier}' .replace('{' + 'identifier' + '}', encodeURIComponent(String(identifier))); @@ -19143,11 +22422,11 @@ export class TransactionalEmailsApi { }); } /** - * - * @summary Delete an inactive email template - * @param templateId id of the template - * @param {*} [options] Override http request options. - */ + * + * @summary Delete an inactive email template + * @param templateId id of the template + * @param {*} [options] Override http request options. + */ public deleteSmtpTemplate (templateId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { const localVarPath = this.basePath + '/smtp/templates/{templateId}' .replace('{' + 'templateId' + '}', encodeURIComponent(String(templateId))); @@ -19201,14 +22480,14 @@ export class TransactionalEmailsApi { }); } /** - * This endpoint will show the aggregated stats for past 90 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days - * @summary Get your transactional email activity aggregated over a period of time - * @param startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate - * @param endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate - * @param days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' - * @param tag Tag of the emails - * @param {*} [options] Override http request options. - */ + * This endpoint will show the aggregated stats for past 90 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days + * @summary Get your transactional email activity aggregated over a period of time + * @param startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate + * @param endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate + * @param days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' + * @param tag Tag of the emails + * @param {*} [options] Override http request options. + */ public getAggregatedSmtpReport (startDate?: string, endDate?: string, days?: number, tag?: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetAggregatedReport; }> { const localVarPath = this.basePath + '/smtp/statistics/aggregatedReport'; const localVarQueryParameters: any = {}; @@ -19273,10 +22552,10 @@ export class TransactionalEmailsApi { }); } /** - * Get the list of blocked domains - * @summary Get the list of blocked domains - * @param {*} [options] Override http request options. - */ + * Get the list of blocked domains + * @summary Get the list of blocked domains + * @param {*} [options] Override http request options. + */ public getBlockedDomains (options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetBlockedDomains; }> { const localVarPath = this.basePath + '/smtp/blockedDomains'; const localVarQueryParameters: any = {}; @@ -19325,21 +22604,21 @@ export class TransactionalEmailsApi { }); } /** - * This endpoint will show the aggregated stats for past 30 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days - * @summary Get all your transactional email activity (unaggregated events) - * @param limit Number limitation for the result returned - * @param offset Beginning point in the list to retrieve from. - * @param startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate - * @param endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate - * @param days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' - * @param email Filter the report for a specific email addresses - * @param event Filter the report for a specific event type - * @param tags Filter the report for tags (serialized and urlencoded array) - * @param messageId Filter on a specific message id - * @param templateId Filter on a specific template id - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - * @param {*} [options] Override http request options. - */ + * This endpoint will show the aggregated stats for past 30 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days + * @summary Get all your transactional email activity (unaggregated events) + * @param limit Number limitation for the result returned + * @param offset Beginning point in the list to retrieve from. + * @param startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate + * @param endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate + * @param days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' + * @param email Filter the report for a specific email addresses + * @param event Filter the report for a specific event type + * @param tags Filter the report for tags (serialized and urlencoded array) + * @param messageId Filter on a specific message id + * @param templateId Filter on a specific template id + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + * @param {*} [options] Override http request options. + */ public getEmailEventReport (limit?: number, offset?: number, startDate?: string, endDate?: string, days?: number, email?: string, event?: 'bounces' | 'hardBounces' | 'softBounces' | 'delivered' | 'spam' | 'requests' | 'opened' | 'clicks' | 'invalid' | 'deferred' | 'blocked' | 'unsubscribed' | 'error' | 'loadedByProxy', tags?: string, messageId?: string, templateId?: number, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetEmailEventReport; }> { const localVarPath = this.basePath + '/smtp/statistics/events'; const localVarQueryParameters: any = {}; @@ -19432,17 +22711,17 @@ export class TransactionalEmailsApi { }); } /** - * Fetch scheduled batch of emails by batchId (Can retrieve data upto 30 days old) - * @summary Fetch scheduled emails by batchId - * @param batchId The batchId of scheduled emails batch (Should be a valid UUIDv4) - * @param startDate Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. - * @param endDate Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - * @param status Filter the records by `status` of the scheduled email batch or message. - * @param limit Number of documents returned per page - * @param offset Index of the first document on the page - * @param {*} [options] Override http request options. - */ + * Fetch scheduled batch of emails by batchId (Can retrieve data upto 30 days old) + * @summary Fetch scheduled emails by batchId + * @param batchId The batchId of scheduled emails batch (Should be a valid UUIDv4) + * @param startDate Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. + * @param endDate Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + * @param status Filter the records by `status` of the scheduled email batch or message. + * @param limit Number of documents returned per page + * @param offset Index of the first document on the page + * @param {*} [options] Override http request options. + */ public getScheduledEmailByBatchId (batchId: string, startDate?: string, endDate?: string, sort?: 'asc' | 'desc', status?: 'processed' | 'inProgress' | 'queued', limit?: number, offset?: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetScheduledEmailByBatchId; }> { const localVarPath = this.basePath + '/smtp/emailStatus/{batchId}' .replace('{' + 'batchId' + '}', encodeURIComponent(String(batchId))); @@ -19521,13 +22800,13 @@ export class TransactionalEmailsApi { }); } /** - * Fetch scheduled email by messageId (Can retrieve data upto 30 days old) - * @summary Fetch scheduled email by messageId - * @param messageId The messageId of scheduled email - * @param startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. - * @param endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. - * @param {*} [options] Override http request options. - */ + * Fetch scheduled email by messageId (Can retrieve data upto 30 days old) + * @summary Fetch scheduled email by messageId + * @param messageId The messageId of scheduled email + * @param startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. + * @param endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. + * @param {*} [options] Override http request options. + */ public getScheduledEmailByMessageId (messageId: string, startDate?: string, endDate?: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetScheduledEmailByMessageId; }> { const localVarPath = this.basePath + '/smtp/emailStatus/{messageId}' .replace('{' + 'messageId' + '}', encodeURIComponent(String(messageId))); @@ -19590,17 +22869,17 @@ export class TransactionalEmailsApi { }); } /** - * - * @summary Get your transactional email activity aggregated per day - * @param limit Number of documents returned per page - * @param offset Index of the first document on the page - * @param startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) - * @param endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) - * @param days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' - * @param tag Tag of the emails - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - * @param {*} [options] Override http request options. - */ + * + * @summary Get your transactional email activity aggregated per day + * @param limit Number of documents returned per page + * @param offset Index of the first document on the page + * @param startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) + * @param endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) + * @param days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' + * @param tag Tag of the emails + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + * @param {*} [options] Override http request options. + */ public getSmtpReport (limit?: number, offset?: number, startDate?: string, endDate?: string, days?: number, tag?: string, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetReports; }> { const localVarPath = this.basePath + '/smtp/statistics/reports'; const localVarQueryParameters: any = {}; @@ -19677,11 +22956,11 @@ export class TransactionalEmailsApi { }); } /** - * - * @summary Returns the template information - * @param templateId id of the template - * @param {*} [options] Override http request options. - */ + * + * @summary Returns the template information + * @param templateId id of the template + * @param {*} [options] Override http request options. + */ public getSmtpTemplate (templateId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetSmtpTemplateOverview; }> { const localVarPath = this.basePath + '/smtp/templates/{templateId}' .replace('{' + 'templateId' + '}', encodeURIComponent(String(templateId))); @@ -19736,14 +23015,14 @@ export class TransactionalEmailsApi { }); } /** - * - * @summary Get the list of email templates - * @param templateStatus Filter on the status of the template. Active = true, inactive = false - * @param limit Number of documents returned per page - * @param offset Index of the first document in the page - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - * @param {*} [options] Override http request options. - */ + * + * @summary Get the list of email templates + * @param templateStatus Filter on the status of the template. Active = true, inactive = false + * @param limit Number of documents returned per page + * @param offset Index of the first document in the page + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + * @param {*} [options] Override http request options. + */ public getSmtpTemplates (templateStatus?: boolean, limit?: number, offset?: number, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetSmtpTemplates; }> { const localVarPath = this.basePath + '/smtp/templates'; const localVarQueryParameters: any = {}; @@ -19808,16 +23087,16 @@ export class TransactionalEmailsApi { }); } /** - * - * @summary Get the list of blocked or unsubscribed transactional contacts - * @param startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts - * @param endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts - * @param limit Number of documents returned per page - * @param offset Index of the first document on the page - * @param senders Comma separated list of emails of the senders from which contacts are blocked or unsubscribed - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - * @param {*} [options] Override http request options. - */ + * + * @summary Get the list of blocked or unsubscribed transactional contacts + * @param startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts + * @param endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts + * @param limit Number of documents returned per page + * @param offset Index of the first document on the page + * @param senders Comma separated list of emails of the senders from which contacts are blocked or unsubscribed + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + * @param {*} [options] Override http request options. + */ public getTransacBlockedContacts (startDate?: string, endDate?: string, limit?: number, offset?: number, senders?: Array, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetTransacBlockedContacts; }> { const localVarPath = this.basePath + '/smtp/blockedContacts'; const localVarQueryParameters: any = {}; @@ -19890,11 +23169,11 @@ export class TransactionalEmailsApi { }); } /** - * - * @summary Get the personalized content of a sent transactional email - * @param uuid Unique id of the transactional email that has been sent to a particular contact - * @param {*} [options] Override http request options. - */ + * + * @summary Get the personalized content of a sent transactional email + * @param uuid Unique id of the transactional email that has been sent to a particular contact + * @param {*} [options] Override http request options. + */ public getTransacEmailContent (uuid: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetTransacEmailContent; }> { const localVarPath = this.basePath + '/smtp/emails/{uuid}' .replace('{' + 'uuid' + '}', encodeURIComponent(String(uuid))); @@ -19949,18 +23228,18 @@ export class TransactionalEmailsApi { }); } /** - * This endpoint will show the list of emails for past 30 days by default. To retrieve emails before that time, please pass startDate and endDate in query filters. - * @summary Get the list of transactional emails on the basis of allowed filters - * @param email Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. - * @param templateId Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email. - * @param messageId Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. - * @param startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. - * @param endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - * @param limit Number of documents returned per page - * @param offset Index of the first document in the page - * @param {*} [options] Override http request options. - */ + * This endpoint will show the list of emails for past 30 days by default. To retrieve emails before that time, please pass startDate and endDate in query filters. + * @summary Get the list of transactional emails on the basis of allowed filters + * @param email Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. + * @param templateId Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email. + * @param messageId Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. + * @param startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. + * @param endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + * @param limit Number of documents returned per page + * @param offset Index of the first document in the page + * @param {*} [options] Override http request options. + */ public getTransacEmailsList (email?: string, templateId?: number, messageId?: string, startDate?: string, endDate?: string, sort?: 'asc' | 'desc', limit?: number, offset?: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetTransacEmailsList; }> { const localVarPath = this.basePath + '/smtp/emails'; const localVarQueryParameters: any = {}; @@ -20041,12 +23320,12 @@ export class TransactionalEmailsApi { }); } /** - * - * @summary Send a template to your test list - * @param templateId Id of the template - * @param sendTestEmail - * @param {*} [options] Override http request options. - */ + * + * @summary Send a template to your test list + * @param templateId Id of the template + * @param sendTestEmail + * @param {*} [options] Override http request options. + */ public sendTestTemplate (templateId: number, sendTestEmail: SendTestEmail, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { const localVarPath = this.basePath + '/smtp/templates/{templateId}/sendTest' .replace('{' + 'templateId' + '}', encodeURIComponent(String(templateId))); @@ -20106,11 +23385,11 @@ export class TransactionalEmailsApi { }); } /** - * - * @summary Send a transactional email - * @param sendSmtpEmail Values to send a transactional email - * @param {*} [options] Override http request options. - */ + * + * @summary Send a transactional email + * @param sendSmtpEmail Values to send a transactional email + * @param {*} [options] Override http request options. + */ public sendTransacEmail (sendSmtpEmail: SendSmtpEmail, options: any = {}) : Promise<{ response: http.IncomingMessage; body: CreateSmtpEmail; }> { const localVarPath = this.basePath + '/smtp/email'; const localVarQueryParameters: any = {}; @@ -20165,11 +23444,11 @@ export class TransactionalEmailsApi { }); } /** - * - * @summary Unblock or resubscribe a transactional contact - * @param email contact email (urlencoded) to unblock. - * @param {*} [options] Override http request options. - */ + * + * @summary Unblock or resubscribe a transactional contact + * @param email contact email (urlencoded) to unblock. + * @param {*} [options] Override http request options. + */ public smtpBlockedContactsEmailDelete (email: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { const localVarPath = this.basePath + '/smtp/blockedContacts/{email}' .replace('{' + 'email' + '}', encodeURIComponent(String(email))); @@ -20223,11 +23502,11 @@ export class TransactionalEmailsApi { }); } /** - * - * @summary Delete an SMTP transactional log - * @param messageId MessageId of the transactional log to delete - * @param {*} [options] Override http request options. - */ + * + * @summary Delete an SMTP transactional log + * @param messageId MessageId of the transactional log to delete + * @param {*} [options] Override http request options. + */ public smtpLogMessageIdDelete (messageId: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { const localVarPath = this.basePath + '/smtp/log/{messageId}' .replace('{' + 'messageId' + '}', encodeURIComponent(String(messageId))); @@ -20281,12 +23560,12 @@ export class TransactionalEmailsApi { }); } /** - * - * @summary Update an email template - * @param templateId id of the template - * @param smtpTemplate values to update in transactional email template - * @param {*} [options] Override http request options. - */ + * + * @summary Update an email template + * @param templateId id of the template + * @param smtpTemplate values to update in transactional email template + * @param {*} [options] Override http request options. + */ public updateSmtpTemplate (templateId: number, smtpTemplate: UpdateSmtpTemplate, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { const localVarPath = this.basePath + '/smtp/templates/{templateId}' .replace('{' + 'templateId' + '}', encodeURIComponent(String(templateId))); @@ -20345,17 +23624,17 @@ export class TransactionalEmailsApi { }); }); } -} -export enum TransactionalSMSApiApiKeys { + } + export enum TransactionalSMSApiApiKeys { apiKey, partnerKey, -} + } -export class TransactionalSMSApi { + export class TransactionalSMSApi { protected _basePath = defaultBasePath; protected defaultHeaders : any = { - 'user-agent': `sendinblue_clientAPI/v${version}/ts-node` -}; + 'user-agent': `sendinblue_clientAPI/v${version}/ts-node` + }; protected _useQuerystring = false; protected authentications = { @@ -20397,19 +23676,19 @@ export class TransactionalSMSApi { (this.authentications as any)[TransactionalSMSApiApiKeys[key]].apiKey = value; } /** - * - * @summary Get all your SMS activity (unaggregated events) - * @param limit Number of documents per page - * @param startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report - * @param endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report - * @param offset Index of the first document of the page - * @param days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' - * @param phoneNumber Filter the report for a specific phone number - * @param event Filter the report for specific events - * @param tags Filter the report for specific tags passed as a serialized urlencoded array - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - * @param {*} [options] Override http request options. - */ + * + * @summary Get all your SMS activity (unaggregated events) + * @param limit Number of documents per page + * @param startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report + * @param endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report + * @param offset Index of the first document of the page + * @param days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' + * @param phoneNumber Filter the report for a specific phone number + * @param event Filter the report for specific events + * @param tags Filter the report for specific tags passed as a serialized urlencoded array + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + * @param {*} [options] Override http request options. + */ public getSmsEvents (limit?: number, startDate?: string, endDate?: string, offset?: number, days?: number, phoneNumber?: string, event?: 'bounces' | 'hardBounces' | 'softBounces' | 'delivered' | 'sent' | 'accepted' | 'unsubscription' | 'replies' | 'blocked', tags?: string, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetSmsEventReport; }> { const localVarPath = this.basePath + '/transactionalSMS/statistics/events'; const localVarQueryParameters: any = {}; @@ -20494,14 +23773,14 @@ export class TransactionalSMSApi { }); } /** - * - * @summary Get your SMS activity aggregated over a period of time - * @param startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report - * @param endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report - * @param days Number of days in the past including today (positive integer). Not compatible with startDate and endDate - * @param tag Filter on a tag - * @param {*} [options] Override http request options. - */ + * + * @summary Get your SMS activity aggregated over a period of time + * @param startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report + * @param endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report + * @param days Number of days in the past including today (positive integer). Not compatible with startDate and endDate + * @param tag Filter on a tag + * @param {*} [options] Override http request options. + */ public getTransacAggregatedSmsReport (startDate?: string, endDate?: string, days?: number, tag?: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetTransacAggregatedSmsReport; }> { const localVarPath = this.basePath + '/transactionalSMS/statistics/aggregatedReport'; const localVarQueryParameters: any = {}; @@ -20566,15 +23845,15 @@ export class TransactionalSMSApi { }); } /** - * - * @summary Get your SMS activity aggregated per day - * @param startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report - * @param endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report - * @param days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' - * @param tag Filter on a tag - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - * @param {*} [options] Override http request options. - */ + * + * @summary Get your SMS activity aggregated per day + * @param startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report + * @param endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report + * @param days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' + * @param tag Filter on a tag + * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + * @param {*} [options] Override http request options. + */ public getTransacSmsReport (startDate?: string, endDate?: string, days?: number, tag?: string, sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetTransacSmsReport; }> { const localVarPath = this.basePath + '/transactionalSMS/statistics/reports'; const localVarQueryParameters: any = {}; @@ -20643,11 +23922,11 @@ export class TransactionalSMSApi { }); } /** - * - * @summary Send SMS message to a mobile number - * @param sendTransacSms Values to send a transactional SMS - * @param {*} [options] Override http request options. - */ + * + * @summary Send SMS message to a mobile number + * @param sendTransacSms Values to send a transactional SMS + * @param {*} [options] Override http request options. + */ public sendTransacSms (sendTransacSms: SendTransacSms, options: any = {}) : Promise<{ response: http.IncomingMessage; body: SendSms; }> { const localVarPath = this.basePath + '/transactionalSMS/sms'; const localVarQueryParameters: any = {}; @@ -20701,17 +23980,17 @@ export class TransactionalSMSApi { }); }); } -} -export enum WebhooksApiApiKeys { + } + export enum WebhooksApiApiKeys { apiKey, partnerKey, -} + } -export class WebhooksApi { + export class WebhooksApi { protected _basePath = defaultBasePath; protected defaultHeaders : any = { - 'user-agent': `sendinblue_clientAPI/v${version}/ts-node` -}; + 'user-agent': `sendinblue_clientAPI/v${version}/ts-node` + }; protected _useQuerystring = false; protected authentications = { @@ -20753,11 +24032,11 @@ export class WebhooksApi { (this.authentications as any)[WebhooksApiApiKeys[key]].apiKey = value; } /** - * - * @summary Create a webhook - * @param createWebhook Values to create a webhook - * @param {*} [options] Override http request options. - */ + * + * @summary Create a webhook + * @param createWebhook Values to create a webhook + * @param {*} [options] Override http request options. + */ public createWebhook (createWebhook: CreateWebhook, options: any = {}) : Promise<{ response: http.IncomingMessage; body: CreateModel; }> { const localVarPath = this.basePath + '/webhooks'; const localVarQueryParameters: any = {}; @@ -20812,11 +24091,11 @@ export class WebhooksApi { }); } /** - * - * @summary Delete a webhook - * @param webhookId Id of the webhook - * @param {*} [options] Override http request options. - */ + * + * @summary Delete a webhook + * @param webhookId Id of the webhook + * @param {*} [options] Override http request options. + */ public deleteWebhook (webhookId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { const localVarPath = this.basePath + '/webhooks/{webhookId}' .replace('{' + 'webhookId' + '}', encodeURIComponent(String(webhookId))); @@ -20870,11 +24149,11 @@ export class WebhooksApi { }); } /** - * - * @summary Get a webhook details - * @param webhookId Id of the webhook - * @param {*} [options] Override http request options. - */ + * + * @summary Get a webhook details + * @param webhookId Id of the webhook + * @param {*} [options] Override http request options. + */ public getWebhook (webhookId: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetWebhook; }> { const localVarPath = this.basePath + '/webhooks/{webhookId}' .replace('{' + 'webhookId' + '}', encodeURIComponent(String(webhookId))); @@ -20929,12 +24208,12 @@ export class WebhooksApi { }); } /** - * - * @summary Get all webhooks - * @param type Filter on webhook type - * @param sort Sort the results in the ascending/descending order of webhook creation - * @param {*} [options] Override http request options. - */ + * + * @summary Get all webhooks + * @param type Filter on webhook type + * @param sort Sort the results in the ascending/descending order of webhook creation + * @param {*} [options] Override http request options. + */ public getWebhooks (type?: 'marketing' | 'transactional' | 'inbound', sort?: 'asc' | 'desc', options: any = {}) : Promise<{ response: http.IncomingMessage; body: GetWebhooks; }> { const localVarPath = this.basePath + '/webhooks'; const localVarQueryParameters: any = {}; @@ -20991,12 +24270,12 @@ export class WebhooksApi { }); } /** - * - * @summary Update a webhook - * @param webhookId Id of the webhook - * @param updateWebhook Values to update a webhook - * @param {*} [options] Override http request options. - */ + * + * @summary Update a webhook + * @param webhookId Id of the webhook + * @param updateWebhook Values to update a webhook + * @param {*} [options] Override http request options. + */ public updateWebhook (webhookId: number, updateWebhook: UpdateWebhook, options: any = {}) : Promise<{ response: http.IncomingMessage; body?: any; }> { const localVarPath = this.basePath + '/webhooks/{webhookId}' .replace('{' + 'webhookId' + '}', encodeURIComponent(String(webhookId)));