clicksend
Version:
This is the official [ClickSend](https://clicksend.com) SDK. Documentation can be found [here](https://developers.clicksend.com/docs/rest/v3/?nodejs#introduction).
2,135 lines (1,983 loc) • 609 kB
text/typescript
/**
* ClickSend v3 API
* This is an official SDK for [ClickSend](https://clicksend.com) Below you will find a current list of the available methods for clicksend. *NOTE: You will need to create a free account to use the API. You can register [here](https://dashboard.clicksend.com/#/signup/step1/)..*
*
* OpenAPI spec version: 3.1
* Contact: support@clicksend.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import localVarRequest = require('request');
import http = require('http');
import Promise = require('bluebird');
let defaultBasePath = 'https://rest.clicksend.com/v3';
// ===============================================
// This file is autogenerated - Please do not edit
// ===============================================
/* tslint:disable:no-unused-variable */
let primitives = [
"string",
"boolean",
"double",
"integer",
"long",
"float",
"number",
"any"
];
class ObjectSerializer {
public static findCorrectType(data: any, expectedType: string) {
if (data == undefined) {
return expectedType;
} else if (primitives.indexOf(expectedType.toLowerCase()) !== -1) {
return expectedType;
} else if (expectedType === "Date") {
return expectedType;
} else {
if (enumsMap[expectedType]) {
return expectedType;
}
if (!typeMap[expectedType]) {
return expectedType; // w/e we don't know the type
}
// Check the discriminator
let discriminatorProperty = typeMap[expectedType].discriminator;
if (discriminatorProperty == null) {
return expectedType; // the type does not have a discriminator. use it.
} else {
if (data[discriminatorProperty]) {
return data[discriminatorProperty]; // use the type given in the discriminator
} else {
return expectedType; // discriminator was not present (or an empty string)
}
}
}
}
public static serialize(data: any, type: string) {
if (data == undefined) {
return data;
} else if (primitives.indexOf(type.toLowerCase()) !== -1) {
return data;
} else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6
let subType: string = type.replace("Array<", ""); // Array<Type> => Type>
subType = subType.substring(0, subType.length - 1); // Type> => Type
let transformedData: any[] = [];
for (let index in data) {
let date = data[index];
transformedData.push(ObjectSerializer.serialize(date, subType));
}
return transformedData;
} else if (type === "Date") {
return data.toString();
} else {
if (enumsMap[type]) {
return data;
}
if (!typeMap[type]) { // in case we dont know the type
return data;
}
// get the map for the correct type.
let attributeTypes = typeMap[type].getAttributeTypeMap();
let instance: {[index: string]: any} = {};
for (let index in attributeTypes) {
let attributeType = attributeTypes[index];
instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type);
}
return instance;
}
}
public static deserialize(data: any, type: string) {
// polymorphism may change the actual type.
type = ObjectSerializer.findCorrectType(data, type);
if (data == undefined) {
return data;
} else if (primitives.indexOf(type.toLowerCase()) !== -1) {
return data;
} else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6
let subType: string = type.replace("Array<", ""); // Array<Type> => Type>
subType = subType.substring(0, subType.length - 1); // Type> => Type
let transformedData: any[] = [];
for (let index in data) {
let date = data[index];
transformedData.push(ObjectSerializer.deserialize(date, subType));
}
return transformedData;
} else if (type === "Date") {
return new Date(data);
} else {
if (enumsMap[type]) {// is Enum
return data;
}
if (!typeMap[type]) { // dont know the type
return data;
}
let instance = new typeMap[type]();
let attributeTypes = typeMap[type].getAttributeTypeMap();
for (let index in attributeTypes) {
let attributeType = attributeTypes[index];
instance[attributeType.name] = ObjectSerializer.deserialize(data[attributeType.baseName], attributeType.type);
}
return instance;
}
}
}
/**
* Complete account details needed for the user.
*/
export class Account {
/**
* Your username
*/
'username': string;
/**
* Your password
*/
'password': string;
/**
* Your phone number in E.164 format.
*/
'userPhone': string;
/**
* Your email
*/
'userEmail': string;
/**
* Your first name
*/
'userFirstName': string;
/**
* Your last name
*/
'userLastName': string;
/**
* Your delivery to value.
*/
'accountName': string;
/**
* Your country
*/
'country': string;
static discriminator: string | undefined = "classType";
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "username",
"baseName": "username",
"type": "string"
},
{
"name": "password",
"baseName": "password",
"type": "string"
},
{
"name": "userPhone",
"baseName": "user_phone",
"type": "string"
},
{
"name": "userEmail",
"baseName": "user_email",
"type": "string"
},
{
"name": "userFirstName",
"baseName": "user_first_name",
"type": "string"
},
{
"name": "userLastName",
"baseName": "user_last_name",
"type": "string"
},
{
"name": "accountName",
"baseName": "account_name",
"type": "string"
},
{
"name": "country",
"baseName": "country",
"type": "string"
} ];
static getAttributeTypeMap() {
return Account.attributeTypeMap;
}
}
export class AccountForgotPasswordVerify {
/**
* ID of subaccount
*/
'subaccountId': number;
/**
* Activation token
*/
'activationToken': string;
/**
* Password
*/
'password': string;
static discriminator: string | undefined = "classType";
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "subaccountId",
"baseName": "subaccount_id",
"type": "number"
},
{
"name": "activationToken",
"baseName": "activation_token",
"type": "string"
},
{
"name": "password",
"baseName": "password",
"type": "string"
} ];
static getAttributeTypeMap() {
return AccountForgotPasswordVerify.attributeTypeMap;
}
}
/**
* Verifies an account by token that should have been sent to the user's phone
*/
export class AccountVerify {
/**
* Country code
*/
'country': string;
/**
* User's phone number
*/
'userPhone': string;
/**
* Type of verification
*/
'type': string;
static discriminator: string | undefined = "classType";
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "country",
"baseName": "country",
"type": "string"
},
{
"name": "userPhone",
"baseName": "user_phone",
"type": "string"
},
{
"name": "type",
"baseName": "type",
"type": "string"
} ];
static getAttributeTypeMap() {
return AccountVerify.attributeTypeMap;
}
}
/**
* Base model for all address-related objects.
*/
export class Address {
/**
* Your address name.
*/
'addressName': string;
/**
* Your address line 1
*/
'addressLine1': string;
/**
* Your city
*/
'addressCity': string;
/**
* Your postal code
*/
'addressPostalCode': string;
/**
* Your country
*/
'addressCountry': string;
/**
* Your address line 2
*/
'addressLine2'?: string;
/**
* Your state
*/
'addressState'?: string;
static discriminator: string | undefined = "classType";
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "addressName",
"baseName": "address_name",
"type": "string"
},
{
"name": "addressLine1",
"baseName": "address_line_1",
"type": "string"
},
{
"name": "addressCity",
"baseName": "address_city",
"type": "string"
},
{
"name": "addressPostalCode",
"baseName": "address_postal_code",
"type": "string"
},
{
"name": "addressCountry",
"baseName": "address_country",
"type": "string"
},
{
"name": "addressLine2",
"baseName": "address_line_2",
"type": "string"
},
{
"name": "addressState",
"baseName": "address_state",
"type": "string"
} ];
static getAttributeTypeMap() {
return Address.attributeTypeMap;
}
}
/**
* Email attachment
*/
export class Attachment {
/**
* The base64-encoded contents of the file.
*/
'content': string;
/**
* The type of file being attached.
*/
'type': string;
/**
* The name of the file being attached.
*/
'filename': string;
/**
* Inline for content that can be displayed within the email, or attachment for any other files.
*/
'disposition': string;
/**
* An ID for the content.
*/
'contentId': string;
static discriminator: string | undefined = "classType";
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "content",
"baseName": "content",
"type": "string"
},
{
"name": "type",
"baseName": "type",
"type": "string"
},
{
"name": "filename",
"baseName": "filename",
"type": "string"
},
{
"name": "disposition",
"baseName": "disposition",
"type": "string"
},
{
"name": "contentId",
"baseName": "content_id",
"type": "string"
} ];
static getAttributeTypeMap() {
return Attachment.attributeTypeMap;
}
}
/**
* Contains all details for the main contact.
*/
export class Contact {
/**
* Your phone number in E.164 format. Must be provided if no fax number or email.
*/
'phoneNumber': string;
/**
*
*/
'custom1': string;
/**
* Your email. Must be provided if no phone number or fax number.
*/
'email'?: string;
/**
* Your fax number. Must be provided if no phone number or email.
*/
'faxNumber'?: string;
/**
* Your first name.
*/
'firstName'?: string;
/**
* Your street address
*/
'addressLine1'?: string;
/**
*
*/
'addressLine2'?: string;
/**
* Your nearest city
*/
'addressCity'?: string;
/**
* Your current state
*/
'addressState'?: string;
/**
* Your current postcode
*/
'addressPostalCode'?: string;
/**
* Your current country
*/
'addressCountry'?: string;
/**
* Your organisation name
*/
'organizationName'?: string;
/**
*
*/
'custom2'?: string;
/**
*
*/
'custom3'?: string;
/**
*
*/
'custom4'?: string;
/**
* Your last name
*/
'lastName'?: string;
static discriminator: string | undefined = "classType";
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "phoneNumber",
"baseName": "phone_number",
"type": "string"
},
{
"name": "custom1",
"baseName": "custom_1",
"type": "string"
},
{
"name": "email",
"baseName": "email",
"type": "string"
},
{
"name": "faxNumber",
"baseName": "fax_number",
"type": "string"
},
{
"name": "firstName",
"baseName": "first_name",
"type": "string"
},
{
"name": "addressLine1",
"baseName": "address_line_1",
"type": "string"
},
{
"name": "addressLine2",
"baseName": "address_line_2",
"type": "string"
},
{
"name": "addressCity",
"baseName": "address_city",
"type": "string"
},
{
"name": "addressState",
"baseName": "address_state",
"type": "string"
},
{
"name": "addressPostalCode",
"baseName": "address_postal_code",
"type": "string"
},
{
"name": "addressCountry",
"baseName": "address_country",
"type": "string"
},
{
"name": "organizationName",
"baseName": "organization_name",
"type": "string"
},
{
"name": "custom2",
"baseName": "custom_2",
"type": "string"
},
{
"name": "custom3",
"baseName": "custom_3",
"type": "string"
},
{
"name": "custom4",
"baseName": "custom_4",
"type": "string"
},
{
"name": "lastName",
"baseName": "last_name",
"type": "string"
} ];
static getAttributeTypeMap() {
return Contact.attributeTypeMap;
}
}
/**
* Your contact list.
*/
export class ContactList {
/**
* Your list name.
*/
'listName': string;
static discriminator: string | undefined = "classType";
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "listName",
"baseName": "list_name",
"type": "string"
} ];
static getAttributeTypeMap() {
return ContactList.attributeTypeMap;
}
}
/**
* Contact list import model
*/
export class ContactListImport {
/**
* URL of file to process
*/
'fileUrl': string;
/**
* Order of fields in file
*/
'fieldOrder': Array<string>;
static discriminator: string | undefined = "classType";
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "fileUrl",
"baseName": "file_url",
"type": "string"
},
{
"name": "fieldOrder",
"baseName": "field_order",
"type": "Array<string>"
} ];
static getAttributeTypeMap() {
return ContactListImport.attributeTypeMap;
}
}
export class CountryListIds {
/**
* Array of country ids
*/
'countryListIds': Array<number>;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "countryListIds",
"baseName": "country_list_ids",
"type": "Array<number>"
} ];
static getAttributeTypeMap() {
return CountryListIds.attributeTypeMap;
}
}
/**
* Credit card model
*/
export class CreditCard {
/**
* Credit card number
*/
'number': string;
/**
* Expiry month of credit card
*/
'expiryMonth': number;
/**
* Expiry year of credit card
*/
'expiryYear': number;
/**
* CVC number of credit card
*/
'cvc': number;
/**
* Name printed on credit card
*/
'name': string;
/**
* Name of bank that credit card belongs to
*/
'bankName': string;
static discriminator: string | undefined = "classType";
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "number",
"baseName": "number",
"type": "string"
},
{
"name": "expiryMonth",
"baseName": "expiry_month",
"type": "number"
},
{
"name": "expiryYear",
"baseName": "expiry_year",
"type": "number"
},
{
"name": "cvc",
"baseName": "cvc",
"type": "number"
},
{
"name": "name",
"baseName": "name",
"type": "string"
},
{
"name": "bankName",
"baseName": "bank_name",
"type": "string"
} ];
static getAttributeTypeMap() {
return CreditCard.attributeTypeMap;
}
}
/**
* All dates before specified timestamp.
*/
export class DateBefore {
/**
* An optional timestamp - mark all as read before this timestamp. If not given, all messages will be marked as read.
*/
'dateBefore'?: number;
static discriminator: string | undefined = "classType";
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "dateBefore",
"baseName": "date_before",
"type": "number"
} ];
static getAttributeTypeMap() {
return DateBefore.attributeTypeMap;
}
}
/**
* Issues with message delivery
*/
export class DeliveryIssue {
/**
* The message id of the message.
*/
'messageId'?: string;
/**
* The type of message, must be one of the following values SMS, MMS, VOICE, EMAIL_MARKETING, EMAIL_TRANSACTIONAL, FAX, POST.
*/
'type': string;
/**
* The description of the message.
*/
'description': string;
/**
* The user's comments.
*/
'clientComments'?: string;
/**
* The user's email address.
*/
'emailAddress': string;
static discriminator: string | undefined = "classType";
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "messageId",
"baseName": "message_id",
"type": "string"
},
{
"name": "type",
"baseName": "type",
"type": "string"
},
{
"name": "description",
"baseName": "description",
"type": "string"
},
{
"name": "clientComments",
"baseName": "client_comments",
"type": "string"
},
{
"name": "emailAddress",
"baseName": "email_address",
"type": "string"
} ];
static getAttributeTypeMap() {
return DeliveryIssue.attributeTypeMap;
}
}
/**
* Model for a Delivery Receipt
*/
export class DeliveryReceiptRule {
/**
* Rule Name.
*/
'ruleName': string;
/**
* Match Type. 0=All reports.
*/
'matchType': number;
/**
* Action to be taken (AUTO_REPLY, EMAIL_USER, EMAIL_FIXED, URL, SMS, POLL, GROUP_SMS, MOVE_CONTACT, CREATE_CONTACT, CREATE_CONTACT_PLUS_EMAIL, CREATE_CONTACT_PLUS_NAME_EMAIL CREATE_CONTACT_PLUS_NAME, SMPP, NONE).
*/
'action': string;
/**
* Action address.
*/
'actionAddress': string;
/**
* Enabled: Disabled=0 or Enabled=1.
*/
'enabled': number;
static discriminator: string | undefined = "classType";
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "ruleName",
"baseName": "rule_name",
"type": "string"
},
{
"name": "matchType",
"baseName": "match_type",
"type": "number"
},
{
"name": "action",
"baseName": "action",
"type": "string"
},
{
"name": "actionAddress",
"baseName": "action_address",
"type": "string"
},
{
"name": "enabled",
"baseName": "enabled",
"type": "number"
} ];
static getAttributeTypeMap() {
return DeliveryReceiptRule.attributeTypeMap;
}
}
/**
* Send Email
*/
export class Email {
/**
* Array of To Recipient items.
*/
'to': Array<EmailRecipient>;
/**
* Array of Cc Recipient items.
*/
'cc'?: Array<EmailRecipient>;
/**
* Array of Bcc Recipient items.
*/
'bcc'?: Array<EmailRecipient>;
'from': EmailFrom;
/**
* Subject of the email.
*/
'subject'?: string;
/**
* Body of the email.
*/
'body': string;
/**
* Array of Attachment items.
*/
'attachments'?: Array<Attachment>;
/**
* Schedule.
*/
'schedule'?: number;
static discriminator: string | undefined = "classType";
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "to",
"baseName": "to",
"type": "Array<EmailRecipient>"
},
{
"name": "cc",
"baseName": "cc",
"type": "Array<EmailRecipient>"
},
{
"name": "bcc",
"baseName": "bcc",
"type": "Array<EmailRecipient>"
},
{
"name": "from",
"baseName": "from",
"type": "EmailFrom"
},
{
"name": "subject",
"baseName": "subject",
"type": "string"
},
{
"name": "body",
"baseName": "body",
"type": "string"
},
{
"name": "attachments",
"baseName": "attachments",
"type": "Array<Attachment>"
},
{
"name": "schedule",
"baseName": "schedule",
"type": "number"
} ];
static getAttributeTypeMap() {
return Email.attributeTypeMap;
}
}
export class EmailAddress {
/**
* Email to be allowed.
*/
'emailAddress': string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "emailAddress",
"baseName": "email_address",
"type": "string"
} ];
static getAttributeTypeMap() {
return EmailAddress.attributeTypeMap;
}
}
/**
* Campaign Model for Email
*/
export class EmailCampaign {
/**
* Your campaign name.
*/
'name': string;
/**
* Your campaign subject.
*/
'subject': string;
/**
* Your campaign message.
*/
'body': string;
/**
* The allowed email address id.
*/
'fromEmailAddressId': number;
/**
* Your name or business name.
*/
'fromName': string;
/**
* Your template id.
*/
'templateId'?: number;
/**
* Your contact list id.
*/
'listId': number;
/**
* Your schedule timestamp.
*/
'schedule'?: number;
static discriminator: string | undefined = "classType";
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "name",
"baseName": "name",
"type": "string"
},
{
"name": "subject",
"baseName": "subject",
"type": "string"
},
{
"name": "body",
"baseName": "body",
"type": "string"
},
{
"name": "fromEmailAddressId",
"baseName": "from_email_address_id",
"type": "number"
},
{
"name": "fromName",
"baseName": "from_name",
"type": "string"
},
{
"name": "templateId",
"baseName": "template_id",
"type": "number"
},
{
"name": "listId",
"baseName": "list_id",
"type": "number"
},
{
"name": "schedule",
"baseName": "schedule",
"type": "number"
} ];
static getAttributeTypeMap() {
return EmailCampaign.attributeTypeMap;
}
}
/**
* From Email object.
*/
export class EmailFrom {
/**
* Email address id of the recipient.
*/
'emailAddressId': string;
/**
* Name of the recipient.
*/
'name'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "emailAddressId",
"baseName": "email_address_id",
"type": "string"
},
{
"name": "name",
"baseName": "name",
"type": "string"
} ];
static getAttributeTypeMap() {
return EmailFrom.attributeTypeMap;
}
}
/**
* Recipient of an email, either To, Cc, or Bcc.
*/
export class EmailRecipient {
/**
* Email of the recipient.
*/
'email': string;
/**
* Name of the recipient.
*/
'name'?: string;
static discriminator: string | undefined = "classType";
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "email",
"baseName": "email",
"type": "string"
},
{
"name": "name",
"baseName": "name",
"type": "string"
} ];
static getAttributeTypeMap() {
return EmailRecipient.attributeTypeMap;
}
}
/**
* Email-to-SMS Allowed Address
*/
export class EmailSMSAddress {
/**
* Your email address
*/
'emailAddress': string;
/**
* Your sender id
*/
'from': string;
/**
* Your subaccount id
*/
'subaccountId'?: string;
static discriminator: string | undefined = "classType";
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "emailAddress",
"baseName": "email_address",
"type": "string"
},
{
"name": "from",
"baseName": "from",
"type": "string"
},
{
"name": "subaccountId",
"baseName": "subaccount_id",
"type": "string"
} ];
static getAttributeTypeMap() {
return EmailSMSAddress.attributeTypeMap;
}
}
/**
* Model for Email Templates
*/
export class EmailTemplateNew {
/**
* The intended name for the new template.
*/
'templateName': string;
/**
* The ID of the master template you want to base on.
*/
'templateIdMaster': number;
static discriminator: string | undefined = "classType";
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "templateName",
"baseName": "template_name",
"type": "string"
},
{
"name": "templateIdMaster",
"baseName": "template_id_master",
"type": "number"
} ];
static getAttributeTypeMap() {
return EmailTemplateNew.attributeTypeMap;
}
}
/**
* Model for Email Templates
*/
export class EmailTemplateUpdate {
/**
* The intended name for the template.
*/
'templateName'?: string;
/**
* Your template body.
*/
'body': string;
static discriminator: string | undefined = "classType";
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "templateName",
"baseName": "template_name",
"type": "string"
},
{
"name": "body",
"baseName": "body",
"type": "string"
} ];
static getAttributeTypeMap() {
return EmailTemplateUpdate.attributeTypeMap;
}
}
/**
* Base model for Fax Messages
*/
export class FaxMessage {
/**
* Your method of sending e.g. 'wordpress', 'php', 'c#'.
*/
'source'?: string;
/**
* Recipient fax number in E.164 format.
*/
'to': string;
/**
* Your list ID if sending to a whole list. Can be used instead of 'to'.
*/
'listId'?: number;
/**
* Your sender id. Must be a valid fax number.
*/
'from'?: string;
/**
* Leave blank for immediate delivery. Your schedule time in unix format https://help.clicksend.com/en/articles/44235-what-is-a-unix-timestamp
*/
'schedule'?: number;
/**
* Your reference. Will be passed back with all replies and delivery reports.
*/
'customString'?: string;
/**
* Recipient country.
*/
'country'?: string;
/**
* An email address where the reply should be emailed to.
*/
'fromEmail'?: string;
static discriminator: string | undefined = "classType";
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "source",
"baseName": "source",
"type": "string"
},
{
"name": "to",
"baseName": "to",
"type": "string"
},
{
"name": "listId",
"baseName": "list_id",
"type": "number"
},
{
"name": "from",
"baseName": "from",
"type": "string"
},
{
"name": "schedule",
"baseName": "schedule",
"type": "number"
},
{
"name": "customString",
"baseName": "custom_string",
"type": "string"
},
{
"name": "country",
"baseName": "country",
"type": "string"
},
{
"name": "fromEmail",
"baseName": "from_email",
"type": "string"
} ];
static getAttributeTypeMap() {
return FaxMessage.attributeTypeMap;
}
}
/**
* Array of FaxMessage items
*/
export class FaxMessageCollection {
/**
* Array of FaxMessage items
*/
'messages': Array<FaxMessage>;
/**
* URL of file to send
*/
'fileUrl': string;
static discriminator: string | undefined = "classType";
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "messages",
"baseName": "messages",
"type": "Array<FaxMessage>"
},
{
"name": "fileUrl",
"baseName": "file_url",
"type": "string"
} ];
static getAttributeTypeMap() {
return FaxMessageCollection.attributeTypeMap;
}
}
/**
* Contains all details for the main contact.
*/
export class Fields {
'fields'?: FieldsFields;
static discriminator: string | undefined = "classType";
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "fields",
"baseName": "fields",
"type": "FieldsFields"
} ];
static getAttributeTypeMap() {
return Fields.attributeTypeMap;
}
}
/**
* From Email object.
*/
export class FieldsFields {
/**
* Your phone number in E.164 format. Must be provided if no fax number or email.
*/
'phoneNumber'?: string;
/**
*
*/
'custom1'?: string;
/**
* Your email. Must be provided if no phone number or fax number.
*/
'email'?: string;
/**
* Your fax number. Must be provided if no phone number or email.
*/
'faxNumber'?: string;
/**
* Your first name.
*/
'firstName'?: string;
/**
* Your street address
*/
'addressLine1'?: string;
/**
*
*/
'addressLine2'?: string;
/**
* Your nearest city
*/
'addressCity'?: string;
/**
* Your current state
*/
'addressState'?: string;
/**
* Your current postcode
*/
'addressPostalCode'?: string;
/**
* Your current country
*/
'addressCountry'?: string;
/**
* Your organisation name
*/
'organizationName'?: string;
/**
*
*/
'custom2'?: string;
/**
*
*/
'custom3'?: string;
/**
*
*/
'custom4'?: string;
/**
* Your last name
*/
'lastName'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "phoneNumber",
"baseName": "phone_number",
"type": "string"
},
{
"name": "custom1",
"baseName": "custom_1",
"type": "string"
},
{
"name": "email",
"baseName": "email",
"type": "string"
},
{
"name": "faxNumber",
"baseName": "fax_number",
"type": "string"
},
{
"name": "firstName",
"baseName": "first_name",
"type": "string"
},
{
"name": "addressLine1",
"baseName": "address_line_1",
"type": "string"
},
{
"name": "addressLine2",
"baseName": "address_line_2",
"type": "string"
},
{
"name": "addressCity",
"baseName": "address_city",
"type": "string"
},
{
"name": "addressState",
"baseName": "address_state",
"type": "string"
},
{
"name": "addressPostalCode",
"baseName": "address_postal_code",
"type": "string"
},
{
"name": "addressCountry",
"baseName": "address_country",
"type": "string"
},
{
"name": "organizationName",
"baseName": "organization_name",
"type": "string"
},
{
"name": "custom2",
"baseName": "custom_2",
"type": "string"
},
{
"name": "custom3",
"baseName": "custom_3",
"type": "string"
},
{
"name": "custom4",
"baseName": "custom_4",
"type": "string"
},
{
"name": "lastName",
"baseName": "last_name",
"type": "string"
} ];
static getAttributeTypeMap() {
return FieldsFields.attributeTypeMap;
}
}
export class ForgotPassword {
/**
* Username belonging to account.
*/
'username': string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "username",
"baseName": "username",
"type": "string"
} ];
static getAttributeTypeMap() {
return ForgotPassword.attributeTypeMap;
}
}
export class ForgotUsername {
/**
* Email belonging to account.
*/
'email'?: string;
/**
* Phone number belonging to account.
*/
'phoneNumber'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "email",
"baseName": "email",
"type": "string"
},
{
"name": "phoneNumber",
"baseName": "phone_number",
"type": "string"
} ];
static getAttributeTypeMap() {
return ForgotUsername.attributeTypeMap;
}
}
/**
* Model for Inbound FAX Rules
*/
export class InboundFaxRule {
/**
* Dedicated Number. Can be '*' to apply to all numbers.
*/
'dedicatedNumber': string;
/**
* Rule Name.
*/
'ruleName': string;
/**
* Action to be taken (AUTO_REPLY, EMAIL_USER, EMAIL_FIXED, URL, SMS, POLL, GROUP_SMS, MOVE_CONTACT, CREATE_CONTACT, CREATE_CONTACT_PLUS_EMAIL, CREATE_CONTACT_PLUS_NAME_EMAIL CREATE_CONTACT_PLUS_NAME, SMPP, NONE).
*/
'action': string;
/**
* Action address.
*/
'actionAddress': string;
/**
* Enabled: Disabled=0 or Enabled=1.
*/
'enabled': number;
static discriminator: string | undefined = "classType";
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "dedicatedNumber",
"baseName": "dedicated_number",
"type": "string"
},
{
"name": "ruleName",
"baseName": "rule_name",
"type": "string"
},
{
"name": "action",
"baseName": "action",
"type": "string"
},
{
"name": "actionAddress",
"baseName": "action_address",
"type": "string"
},
{
"name": "enabled",
"baseName": "enabled",
"type": "number"
} ];
static getAttributeTypeMap() {
return InboundFaxRule.attributeTypeMap;
}
}
/**
* Model for Inbound SMS Rules
*/
export class InboundSMSRule {
/**
* Dedicated Number. Can be '*' to apply to all numbers.
*/
'dedicatedNumber': string;
/**
* Rule Name.
*/
'ruleName': string;
/**
* Message Search Type: 0=Any message, 1=starts with, 2=contains, 3=does not contain.
*/
'messageSearchType': number;
/**
* Message search term.
*/
'messageSearchTerm': string;
/**
* Action to be taken (AUTO_REPLY, EMAIL_USER, EMAIL_FIXED, URL, SMS, POLL, GROUP_SMS, MOVE_CONTACT, CREATE_CONTACT, CREATE_CONTACT_PLUS_EMAIL, CREATE_CONTACT_PLUS_NAME_EMAIL CREATE_CONTACT_PLUS_NAME, SMPP, NONE).
*/
'action': string;
/**
* Action address.
*/
'actionAddress': string;
/**
* Enabled: Disabled=0 or Enabled=1.
*/
'enabled': number;
/**
* post, get, or json. post by default
*/
'webhookType'?: string;
static discriminator: string | undefined = "classType";
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "dedicatedNumber",
"baseName": "dedicated_number",
"type": "string"
},
{
"name": "ruleName",
"baseName": "rule_name",
"type": "string"
},
{
"name": "messageSearchType",
"baseName": "message_search_type",
"type": "number"
},
{
"name": "messageSearchTerm",
"baseName": "message_search_term",
"type": "string"
},
{
"name": "action",
"baseName": "action",
"type": "string"
},
{
"name": "actionAddress",
"baseName": "action_address",
"type": "string"
},
{
"name": "enabled",
"baseName": "enabled",
"type": "number"
},
{
"name": "webhookType",
"baseName": "webhook_type",
"type": "string"
} ];
static getAttributeTypeMap() {
return InboundSMSRule.attributeTypeMap;
}
}
/**
* Campaign Model for MMS
*/
export class MmsCampaign {
/**
* Your list id.
*/
'listId': number;
/**
* Your campaign name.
*/
'name': string;
/**
* Your campaign message.
*/
'body': string;
/**
* Your sender id - more info: https://help.clicksend.com/en/collections/57584-numbers-sender-ids.
*/
'from'?: string;
/**
* Your schedule timestamp.
*/
'schedule'?: number;
/**
* Subject of MMS campaign.
*/
'subject': string;
/**
* URL pointing to media file.
*/
'mediaFile': string;
static discriminator: string | undefined = "classType";
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "listId",
"baseName": "list_id",
"type": "number"
},
{
"name": "name",
"baseName": "name",
"type": "string"
},
{
"name": "body",
"baseName": "body",
"type": "string"
},
{
"name": "from",
"baseName": "from",
"type": "string"
},
{
"name": "schedule",
"baseName": "schedule",
"type": "number"
},
{
"name": "subject",
"baseName": "subject",
"type": "string"
},
{
"name": "mediaFile",
"baseName": "media_file",
"type": "string"
} ];
static getAttributeTypeMap() {
return MmsCampaign.attributeTypeMap;
}
}
/**
* Single MMS message model
*/
export class MmsMessage {
/**
* Recipient phone number in E.164 format
*/
'to'?: string;
/**
* Your message
*/
'body': string;
/**
* Subject line (max 20 characters)
*/
'subject': string;
/**
* Your sender ID
*/
'from'?: string;
/**
* Recipient country
*/
'country'?: string;
/**
* Your method of sending
*/
'source'?: string;
/**
* Your list ID if sending to a whole list (can be used instead of 'to')
*/
'listId'?: number;
/**
* Schedule time in unix format (leave blank for immediate delivery)
*/
'schedule'?: number;
/**
* Custom string for your reference
*/
'customString'?: string;
/**
* Email to send replies to
*/
'fromEmail'?: string;
static discriminator: string | undefined = "classType";
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "to",
"baseName": "to",
"type": "string"
},
{
"name": "body",
"baseName": "body",
"type": "string"
},
{
"name": "subject",
"baseName": "subject",
"type": "string"
},
{
"name": "from",
"baseName": "from",
"type": "string"
},
{
"name": "country",
"baseName": "country",
"type": "string"
},
{
"name": "source",
"baseName": "source",
"type": "string"
},
{
"name": "listId",
"baseName": "list_id",
"type": "number"
},
{
"name": "schedule",
"baseName": "schedule",
"type": "number"
},
{
"name": "customString",
"baseName": "custom_string",
"type": "string"
},
{
"name": "fromEmail",
"baseName": "from_email",
"type": "string"
} ];
static getAttributeTypeMap() {
return MmsMessage.attributeTypeMap;
}
}
/**
* Array of MmsMessage items
*/
export class MmsMessageCollection {
/**
* Media file you want to send
*/
'mediaFile': string;
/**
* Array of MmsMessage models
*/
'messages': Array<MmsMessage>;
static discriminator: string | undefined = "classType";
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "mediaFile",
"baseName": "media_file",
"type": "string"
},
{
"name": "messages",
"baseName": "messages",
"type": "Array<MmsMessage>"
} ];
static getAttributeTypeMap() {
return MmsMessageCollection.attributeTypeMap;
}
}
/**
* PostLetter model
*/
export class PostLetter {
/**
* URL of file to send
*/
'fileUrl': string;
/**
* Whether letter is priority
*/
'priorityPost'?: number;
/**
* Array of PostRecipient models
*/
'recipients': Array<PostRecipient>;
/**
* Whether using our template
*/
'templateUsed'?: number;
/**
* Whether letter is duplex
*/
'duplex'?: number;
/**
* Whether letter is in colour
*/
'colour'?: number;
/**
* Source being sent from
*/
'source'?: string;
static discriminator: string | undefined = "classType";
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "fileUrl",
"baseName": "file_url",
"type": "string"
},
{
"name": "priorityPost",
"baseName": "priority_post",
"type": "number"
},
{
"name": "recipients",
"baseName": "recipients",
"type": "Array<PostRecipient>"
},
{
"name": "templateUsed",
"baseName": "template_used",
"type": "number"
},
{
"name": "duplex",
"baseName": "duplex",
"type": "number"
},
{
"name": "colour",
"baseName": "colour",
"type": "number"
},
{
"name": "source",
"baseName": "source",
"type": "string"
} ];
static getAttributeTypeMap() {
return PostLetter.attributeTypeMap;
}
}
/**
* PostPostcard model
*/
export class PostPostcard {
/**
* Postcard file URLs
*/
'fileUrls': Array<string>;
/**
* Array of recipients
*/
'recipients': Array<PostRecipient>;
static discriminator: string | undefined = "classType";
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "fileUrls",
"baseName": "file_urls",
"type": "Array<string>"
},
{
"name": "recipients",
"baseName": "recipients",
"type": "Array<PostRecipient>"
} ];
static getAttributeTypeMap() {
return PostPostcard.attributeTypeMap;
}
}
/**
* PostRecipient model
*/
export class PostRecipient {
/**
* Name of address
*/
'addressName': string;
/**
* First line of address
*/
'addressLine1': string;
/**
* Second line of address
*/
'addressLine2'?: string;
/**
* City
*/
'addressCity': string;
/**
* State
*/
'addressState': string;
/**
* Postal code
*/
'addressPostalCode': string;
/**
* Country
*/
'addressCountry': string;
/**
* ID of return address to use
*/
'returnAddressId': number;
/**
* When to send letter (0/null=now)
*/
'schedule'?: number;
static discriminator: string | undefined = "classType";
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "addressName",
"baseName": "address_name",
"type": "string"
},
{
"name": "addressLine1",
"baseName": "address_line_1",
"type": "string"
},
{
"name": "addressLine2",
"baseName": "address_line_2",
"type": "string"
},
{
"name": "addressCity",
"baseName": "address_city",
"type": "string"
},
{
"name": "addressState",
"baseName": "address_state",
"type": "string"
},
{
"name": "addressPostalCode",
"baseName": "address_postal_code",
"type": "string"
},
{
"name": "addressCountry",
"baseName": "address_country",
"type": "string"
},
{
"name": "returnAddressId",
"baseName": "return_address_id",
"type": "number"