/* tslint:disable */ /* eslint-disable */ /** * Constant Contact API v3 * Swagger build version 3.0.2475 * * The version of the OpenAPI document: 1.0.116 * Contact: webservices@constantcontact.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import type { Configuration } from '../configuration'; import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { AddAccountEmailAddress201Response } from '../models'; // @ts-ignore import { AddAccountEmailAddressRequest } from '../models'; // @ts-ignore import { GetAccountDetails200Response } from '../models'; // @ts-ignore import { GetAccountDetails200ResponsePhysicalAddress } from '../models'; // @ts-ignore import { GetAllAccountEmailAddresses200ResponseInner } from '../models'; // @ts-ignore import { GetUserPrivileges200ResponseInner } from '../models'; // @ts-ignore import { UpdateAccountRequest } from '../models'; /** * AccountServicesApi - axios parameter creator * @export */ export const AccountServicesApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Use this method to add a new email address to a Constant Contact account. If the email address you are adding already exists in the account the API will return a 409 conflict error. When you add a new email address to an account, Constant Contact automatically sends an email to that address with a link to confirm it. After a user clicks that link, the account email status changes from `UNCONFIRMED` to `CONFIRMED`. You can use confirmed account email addresses in the email campaign `from_email` and `reply_to_email` headers. For more use case information, see [Add an Account Email Address](/api_guide/account_post_emails.html) in the API guide. * @summary POST Add an Account Email Address * @param {AddAccountEmailAddressRequest} addAccountEmailAddressRequest A JSON request payload containing the new email address you want to add to the Constant Contact account. * @param {*} [options] Override http request option. * @throws {RequiredError} */ addAccountEmailAddress: async (addAccountEmailAddressRequest: AddAccountEmailAddressRequest, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'addAccountEmailAddressRequest' is not null or undefined assertParamExists('addAccountEmailAddress', 'addAccountEmailAddressRequest', addAccountEmailAddressRequest) const localVarPath = `/account/emails`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication oauth2_access_code required // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2_access_code", ["account_update"], configuration) // authentication oauth2_implicit required // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2_implicit", ["account_update"], configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(addAccountEmailAddressRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Use this method to add the address where the account\'s organization physically resides. The physical address is required to send emails and displays on the footer of every email that is sent from the account. The country (country_code) where the account organization resides determines whether you use the state_code to specify United States (US) and Canada (CA) addresses, or use the state_name to specify all other countries. * @summary POST the Physical Address for the Account * @param {GetAccountDetails200ResponsePhysicalAddress} getAccountDetails200ResponsePhysicalAddress Include all `AccountPhysicalAddress` properties required for the specified `country_code` and then update only those properties that you want to change. Excluding a non-read only field from the request body removes it from the physical address. * @param {*} [options] Override http request option. * @throws {RequiredError} */ addPhysicalAddress: async (getAccountDetails200ResponsePhysicalAddress: GetAccountDetails200ResponsePhysicalAddress, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'getAccountDetails200ResponsePhysicalAddress' is not null or undefined assertParamExists('addPhysicalAddress', 'getAccountDetails200ResponsePhysicalAddress', getAccountDetails200ResponsePhysicalAddress) const localVarPath = `/account/summary/physical_address`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication oauth2_access_code required // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2_access_code", ["account_update"], configuration) // authentication oauth2_implicit required // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2_implicit", ["account_update"], configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(getAccountDetails200ResponsePhysicalAddress, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get account related details for a Constant Contact user account. Use the `extra_fields` query parameter to include the `company_logo` and/or `physical_address` details in the response body. For more details, see [Get Account Summary Details](/api_guide/account_details_get.html). * @summary GET a Summary of Account Details * @param {GetAccountDetailsExtraFieldsEnum} [extraFields] Use the `extra_fields` query parameter to include the `physical_address` and/or `company_logo` details in the response body. Use a comma separated list to include both (physical_address, company logo). * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAccountDetails: async (extraFields?: GetAccountDetailsExtraFieldsEnum, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/account/summary`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication oauth2_access_code required // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2_access_code", ["account_read"], configuration) // authentication oauth2_implicit required // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2_implicit", ["account_read"], configuration) if (extraFields !== undefined) { localVarQueryParameter['extra_fields'] = extraFields; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Use this method to get the address where the account\'s organization physically resides. The physical address is required to send emails and displays on the footer of every email that is sent from the account. * @summary GET the Physical Address for the Account * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAccountPhysicalAddress: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/account/summary/physical_address`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication oauth2_access_code required // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2_access_code", ["account_read"], configuration) // authentication oauth2_implicit required // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2_implicit", ["account_read"], configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Use this method to return a collection of email addresses for the account associated with your access token. When you Create an Email Campaign, you must use an account email address with a `CONFIRMED` status in the email campaign `from_email` and `reply_to_email` headers. Use the query parameters to filter results. You can filter using `confirm_status`, `role_code`, or `email_address`. For example, searching with `confirm_status=CONFIRMED` returns all confirmed email addresses in the account. This method only supports one query parameter at a time. * @summary GET a Collection of Account Email Addresses * @param {GetAllAccountEmailAddressesConfirmStatusEnum} [confirmStatus] Use the `confirm_status` query parameter to search for account emails using the email status. Possible values are `CONFIRMED` or `UNCONFIRMED`. You can also abbreviate the values of this query parameter and use `C` or `U`. * @param {GetAllAccountEmailAddressesRoleCodeEnum} [roleCode] Use the `role_code` query parameter to search for account emails that have a specific role. Each each email address in an account can have multiple roles or no role. Possible values are `CONTACT`, `BILLING`, `REPLY_TO`, `JOURNALING`, or `OTHER`. You can also abbreviate the value of this query parameter and use `C`,`B`,`R`,`J`, or `O`. * @param {string} [emailAddress] Use the `email_address` query parameter to search for a specific account email address. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAllAccountEmailAddresses: async (confirmStatus?: GetAllAccountEmailAddressesConfirmStatusEnum, roleCode?: GetAllAccountEmailAddressesRoleCodeEnum, emailAddress?: string, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/account/emails`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication oauth2_access_code required // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2_access_code", ["account_read"], configuration) // authentication oauth2_implicit required // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2_implicit", ["account_read"], configuration) if (confirmStatus !== undefined) { localVarQueryParameter['confirm_status'] = confirmStatus; } if (roleCode !== undefined) { localVarQueryParameter['role_code'] = roleCode; } if (emailAddress !== undefined) { localVarQueryParameter['email_address'] = emailAddress; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Use this method to return the user privileges associated with your access token as an array of objects. This method returns all user privileges, including privileges the V3 API does not currently use. Constant Contact requires specific user privileges to make requests using the V3 API. For more information, see the [User Privileges and Roles Overview](/api_guide/user_privileges.html). * @summary GET User Privileges * @param {*} [options] Override http request option. * @throws {RequiredError} */ getUserPrivileges: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/account/user/privileges`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication oauth2_access_code required // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2_access_code", [], configuration) // authentication oauth2_implicit required // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2_implicit", [], configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Use this method to update account details for a Constant Contact account, such as the email address or phone number. This PUT method provides a partial update where only valid properties that you include in the request body are updated and excluded properties are not overwritten. For more details, see [Put (update) Account Summary Details](/api_guide/account_details_put.html). * @summary PUT (update) Account Details * @param {UpdateAccountRequest} updateAccountRequest In the request body, specify changes to account details by including and modifying all or select `CustomerPut` properties. Changes to read-only fields (`encoded_account_id`) are ignored. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateAccount: async (updateAccountRequest: UpdateAccountRequest, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'updateAccountRequest' is not null or undefined assertParamExists('updateAccount', 'updateAccountRequest', updateAccountRequest) const localVarPath = `/account/summary`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication oauth2_access_code required // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2_access_code", ["account_update"], configuration) // authentication oauth2_implicit required // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2_implicit", ["account_update"], configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(updateAccountRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Use this method to update the organization\'s physical address for the Constant Contact user account. The physical address is required to send emails and displays on the footer of every email that is sent from the account. To get the current physical address, make a GET call to `/account/summary/physical_address`. The country (country_code) where the account organization resides determines whether you use the state_code to specify United States (US) and Canada (CA) addresses, or use the state_name to specify all other countries. For more details, see [Put (update) the Physical Address for the Account](/api_guide/account_address_put.html). You must have the role of Account Owner assigned to update account level details. * @summary PUT (update) the Physical Address for an Account * @param {GetAccountDetails200ResponsePhysicalAddress} getAccountDetails200ResponsePhysicalAddress Include all `AccountPhysicalAddress` properties required for the specified `country_code` and then update only those properties that you want to change. Excluding a non-read only field from the request body removes it from the physical address. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateAccountPhysicalAddress: async (getAccountDetails200ResponsePhysicalAddress: GetAccountDetails200ResponsePhysicalAddress, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'getAccountDetails200ResponsePhysicalAddress' is not null or undefined assertParamExists('updateAccountPhysicalAddress', 'getAccountDetails200ResponsePhysicalAddress', getAccountDetails200ResponsePhysicalAddress) const localVarPath = `/account/summary/physical_address`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication oauth2_access_code required // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2_access_code", ["account_update"], configuration) // authentication oauth2_implicit required // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2_implicit", ["account_update"], configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(getAccountDetails200ResponsePhysicalAddress, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * AccountServicesApi - functional programming interface * @export */ export const AccountServicesApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = AccountServicesApiAxiosParamCreator(configuration) return { /** * Use this method to add a new email address to a Constant Contact account. If the email address you are adding already exists in the account the API will return a 409 conflict error. When you add a new email address to an account, Constant Contact automatically sends an email to that address with a link to confirm it. After a user clicks that link, the account email status changes from `UNCONFIRMED` to `CONFIRMED`. You can use confirmed account email addresses in the email campaign `from_email` and `reply_to_email` headers. For more use case information, see [Add an Account Email Address](/api_guide/account_post_emails.html) in the API guide. * @summary POST Add an Account Email Address * @param {AddAccountEmailAddressRequest} addAccountEmailAddressRequest A JSON request payload containing the new email address you want to add to the Constant Contact account. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async addAccountEmailAddress(addAccountEmailAddressRequest: AddAccountEmailAddressRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.addAccountEmailAddress(addAccountEmailAddressRequest, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['AccountServicesApi.addAccountEmailAddress']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Use this method to add the address where the account\'s organization physically resides. The physical address is required to send emails and displays on the footer of every email that is sent from the account. The country (country_code) where the account organization resides determines whether you use the state_code to specify United States (US) and Canada (CA) addresses, or use the state_name to specify all other countries. * @summary POST the Physical Address for the Account * @param {GetAccountDetails200ResponsePhysicalAddress} getAccountDetails200ResponsePhysicalAddress Include all `AccountPhysicalAddress` properties required for the specified `country_code` and then update only those properties that you want to change. Excluding a non-read only field from the request body removes it from the physical address. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async addPhysicalAddress(getAccountDetails200ResponsePhysicalAddress: GetAccountDetails200ResponsePhysicalAddress, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.addPhysicalAddress(getAccountDetails200ResponsePhysicalAddress, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['AccountServicesApi.addPhysicalAddress']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Get account related details for a Constant Contact user account. Use the `extra_fields` query parameter to include the `company_logo` and/or `physical_address` details in the response body. For more details, see [Get Account Summary Details](/api_guide/account_details_get.html). * @summary GET a Summary of Account Details * @param {GetAccountDetailsExtraFieldsEnum} [extraFields] Use the `extra_fields` query parameter to include the `physical_address` and/or `company_logo` details in the response body. Use a comma separated list to include both (physical_address, company logo). * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getAccountDetails(extraFields?: GetAccountDetailsExtraFieldsEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getAccountDetails(extraFields, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['AccountServicesApi.getAccountDetails']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Use this method to get the address where the account\'s organization physically resides. The physical address is required to send emails and displays on the footer of every email that is sent from the account. * @summary GET the Physical Address for the Account * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getAccountPhysicalAddress(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getAccountPhysicalAddress(options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['AccountServicesApi.getAccountPhysicalAddress']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Use this method to return a collection of email addresses for the account associated with your access token. When you Create an Email Campaign, you must use an account email address with a `CONFIRMED` status in the email campaign `from_email` and `reply_to_email` headers. Use the query parameters to filter results. You can filter using `confirm_status`, `role_code`, or `email_address`. For example, searching with `confirm_status=CONFIRMED` returns all confirmed email addresses in the account. This method only supports one query parameter at a time. * @summary GET a Collection of Account Email Addresses * @param {GetAllAccountEmailAddressesConfirmStatusEnum} [confirmStatus] Use the `confirm_status` query parameter to search for account emails using the email status. Possible values are `CONFIRMED` or `UNCONFIRMED`. You can also abbreviate the values of this query parameter and use `C` or `U`. * @param {GetAllAccountEmailAddressesRoleCodeEnum} [roleCode] Use the `role_code` query parameter to search for account emails that have a specific role. Each each email address in an account can have multiple roles or no role. Possible values are `CONTACT`, `BILLING`, `REPLY_TO`, `JOURNALING`, or `OTHER`. You can also abbreviate the value of this query parameter and use `C`,`B`,`R`,`J`, or `O`. * @param {string} [emailAddress] Use the `email_address` query parameter to search for a specific account email address. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getAllAccountEmailAddresses(confirmStatus?: GetAllAccountEmailAddressesConfirmStatusEnum, roleCode?: GetAllAccountEmailAddressesRoleCodeEnum, emailAddress?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.getAllAccountEmailAddresses(confirmStatus, roleCode, emailAddress, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['AccountServicesApi.getAllAccountEmailAddresses']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Use this method to return the user privileges associated with your access token as an array of objects. This method returns all user privileges, including privileges the V3 API does not currently use. Constant Contact requires specific user privileges to make requests using the V3 API. For more information, see the [User Privileges and Roles Overview](/api_guide/user_privileges.html). * @summary GET User Privileges * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getUserPrivileges(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.getUserPrivileges(options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['AccountServicesApi.getUserPrivileges']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Use this method to update account details for a Constant Contact account, such as the email address or phone number. This PUT method provides a partial update where only valid properties that you include in the request body are updated and excluded properties are not overwritten. For more details, see [Put (update) Account Summary Details](/api_guide/account_details_put.html). * @summary PUT (update) Account Details * @param {UpdateAccountRequest} updateAccountRequest In the request body, specify changes to account details by including and modifying all or select `CustomerPut` properties. Changes to read-only fields (`encoded_account_id`) are ignored. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateAccount(updateAccountRequest: UpdateAccountRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateAccount(updateAccountRequest, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['AccountServicesApi.updateAccount']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Use this method to update the organization\'s physical address for the Constant Contact user account. The physical address is required to send emails and displays on the footer of every email that is sent from the account. To get the current physical address, make a GET call to `/account/summary/physical_address`. The country (country_code) where the account organization resides determines whether you use the state_code to specify United States (US) and Canada (CA) addresses, or use the state_name to specify all other countries. For more details, see [Put (update) the Physical Address for the Account](/api_guide/account_address_put.html). You must have the role of Account Owner assigned to update account level details. * @summary PUT (update) the Physical Address for an Account * @param {GetAccountDetails200ResponsePhysicalAddress} getAccountDetails200ResponsePhysicalAddress Include all `AccountPhysicalAddress` properties required for the specified `country_code` and then update only those properties that you want to change. Excluding a non-read only field from the request body removes it from the physical address. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateAccountPhysicalAddress(getAccountDetails200ResponsePhysicalAddress: GetAccountDetails200ResponsePhysicalAddress, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateAccountPhysicalAddress(getAccountDetails200ResponsePhysicalAddress, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['AccountServicesApi.updateAccountPhysicalAddress']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, } }; /** * AccountServicesApi - factory interface * @export */ export const AccountServicesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = AccountServicesApiFp(configuration) return { /** * Use this method to add a new email address to a Constant Contact account. If the email address you are adding already exists in the account the API will return a 409 conflict error. When you add a new email address to an account, Constant Contact automatically sends an email to that address with a link to confirm it. After a user clicks that link, the account email status changes from `UNCONFIRMED` to `CONFIRMED`. You can use confirmed account email addresses in the email campaign `from_email` and `reply_to_email` headers. For more use case information, see [Add an Account Email Address](/api_guide/account_post_emails.html) in the API guide. * @summary POST Add an Account Email Address * @param {AddAccountEmailAddressRequest} addAccountEmailAddressRequest A JSON request payload containing the new email address you want to add to the Constant Contact account. * @param {*} [options] Override http request option. * @throws {RequiredError} */ addAccountEmailAddress(addAccountEmailAddressRequest: AddAccountEmailAddressRequest, options?: any): AxiosPromise { return localVarFp.addAccountEmailAddress(addAccountEmailAddressRequest, options).then((request) => request(axios, basePath)); }, /** * Use this method to add the address where the account\'s organization physically resides. The physical address is required to send emails and displays on the footer of every email that is sent from the account. The country (country_code) where the account organization resides determines whether you use the state_code to specify United States (US) and Canada (CA) addresses, or use the state_name to specify all other countries. * @summary POST the Physical Address for the Account * @param {GetAccountDetails200ResponsePhysicalAddress} getAccountDetails200ResponsePhysicalAddress Include all `AccountPhysicalAddress` properties required for the specified `country_code` and then update only those properties that you want to change. Excluding a non-read only field from the request body removes it from the physical address. * @param {*} [options] Override http request option. * @throws {RequiredError} */ addPhysicalAddress(getAccountDetails200ResponsePhysicalAddress: GetAccountDetails200ResponsePhysicalAddress, options?: any): AxiosPromise { return localVarFp.addPhysicalAddress(getAccountDetails200ResponsePhysicalAddress, options).then((request) => request(axios, basePath)); }, /** * Get account related details for a Constant Contact user account. Use the `extra_fields` query parameter to include the `company_logo` and/or `physical_address` details in the response body. For more details, see [Get Account Summary Details](/api_guide/account_details_get.html). * @summary GET a Summary of Account Details * @param {GetAccountDetailsExtraFieldsEnum} [extraFields] Use the `extra_fields` query parameter to include the `physical_address` and/or `company_logo` details in the response body. Use a comma separated list to include both (physical_address, company logo). * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAccountDetails(extraFields?: GetAccountDetailsExtraFieldsEnum, options?: any): AxiosPromise { return localVarFp.getAccountDetails(extraFields, options).then((request) => request(axios, basePath)); }, /** * Use this method to get the address where the account\'s organization physically resides. The physical address is required to send emails and displays on the footer of every email that is sent from the account. * @summary GET the Physical Address for the Account * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAccountPhysicalAddress(options?: any): AxiosPromise { return localVarFp.getAccountPhysicalAddress(options).then((request) => request(axios, basePath)); }, /** * Use this method to return a collection of email addresses for the account associated with your access token. When you Create an Email Campaign, you must use an account email address with a `CONFIRMED` status in the email campaign `from_email` and `reply_to_email` headers. Use the query parameters to filter results. You can filter using `confirm_status`, `role_code`, or `email_address`. For example, searching with `confirm_status=CONFIRMED` returns all confirmed email addresses in the account. This method only supports one query parameter at a time. * @summary GET a Collection of Account Email Addresses * @param {GetAllAccountEmailAddressesConfirmStatusEnum} [confirmStatus] Use the `confirm_status` query parameter to search for account emails using the email status. Possible values are `CONFIRMED` or `UNCONFIRMED`. You can also abbreviate the values of this query parameter and use `C` or `U`. * @param {GetAllAccountEmailAddressesRoleCodeEnum} [roleCode] Use the `role_code` query parameter to search for account emails that have a specific role. Each each email address in an account can have multiple roles or no role. Possible values are `CONTACT`, `BILLING`, `REPLY_TO`, `JOURNALING`, or `OTHER`. You can also abbreviate the value of this query parameter and use `C`,`B`,`R`,`J`, or `O`. * @param {string} [emailAddress] Use the `email_address` query parameter to search for a specific account email address. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAllAccountEmailAddresses(confirmStatus?: GetAllAccountEmailAddressesConfirmStatusEnum, roleCode?: GetAllAccountEmailAddressesRoleCodeEnum, emailAddress?: string, options?: any): AxiosPromise> { return localVarFp.getAllAccountEmailAddresses(confirmStatus, roleCode, emailAddress, options).then((request) => request(axios, basePath)); }, /** * Use this method to return the user privileges associated with your access token as an array of objects. This method returns all user privileges, including privileges the V3 API does not currently use. Constant Contact requires specific user privileges to make requests using the V3 API. For more information, see the [User Privileges and Roles Overview](/api_guide/user_privileges.html). * @summary GET User Privileges * @param {*} [options] Override http request option. * @throws {RequiredError} */ getUserPrivileges(options?: any): AxiosPromise> { return localVarFp.getUserPrivileges(options).then((request) => request(axios, basePath)); }, /** * Use this method to update account details for a Constant Contact account, such as the email address or phone number. This PUT method provides a partial update where only valid properties that you include in the request body are updated and excluded properties are not overwritten. For more details, see [Put (update) Account Summary Details](/api_guide/account_details_put.html). * @summary PUT (update) Account Details * @param {UpdateAccountRequest} updateAccountRequest In the request body, specify changes to account details by including and modifying all or select `CustomerPut` properties. Changes to read-only fields (`encoded_account_id`) are ignored. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateAccount(updateAccountRequest: UpdateAccountRequest, options?: any): AxiosPromise { return localVarFp.updateAccount(updateAccountRequest, options).then((request) => request(axios, basePath)); }, /** * Use this method to update the organization\'s physical address for the Constant Contact user account. The physical address is required to send emails and displays on the footer of every email that is sent from the account. To get the current physical address, make a GET call to `/account/summary/physical_address`. The country (country_code) where the account organization resides determines whether you use the state_code to specify United States (US) and Canada (CA) addresses, or use the state_name to specify all other countries. For more details, see [Put (update) the Physical Address for the Account](/api_guide/account_address_put.html). You must have the role of Account Owner assigned to update account level details. * @summary PUT (update) the Physical Address for an Account * @param {GetAccountDetails200ResponsePhysicalAddress} getAccountDetails200ResponsePhysicalAddress Include all `AccountPhysicalAddress` properties required for the specified `country_code` and then update only those properties that you want to change. Excluding a non-read only field from the request body removes it from the physical address. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateAccountPhysicalAddress(getAccountDetails200ResponsePhysicalAddress: GetAccountDetails200ResponsePhysicalAddress, options?: any): AxiosPromise { return localVarFp.updateAccountPhysicalAddress(getAccountDetails200ResponsePhysicalAddress, options).then((request) => request(axios, basePath)); }, }; }; /** * AccountServicesApi - object-oriented interface * @export * @class AccountServicesApi * @extends {BaseAPI} */ export class AccountServicesApi extends BaseAPI { /** * Use this method to add a new email address to a Constant Contact account. If the email address you are adding already exists in the account the API will return a 409 conflict error. When you add a new email address to an account, Constant Contact automatically sends an email to that address with a link to confirm it. After a user clicks that link, the account email status changes from `UNCONFIRMED` to `CONFIRMED`. You can use confirmed account email addresses in the email campaign `from_email` and `reply_to_email` headers. For more use case information, see [Add an Account Email Address](/api_guide/account_post_emails.html) in the API guide. * @summary POST Add an Account Email Address * @param {AddAccountEmailAddressRequest} addAccountEmailAddressRequest A JSON request payload containing the new email address you want to add to the Constant Contact account. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AccountServicesApi */ public addAccountEmailAddress(addAccountEmailAddressRequest: AddAccountEmailAddressRequest, options?: RawAxiosRequestConfig) { return AccountServicesApiFp(this.configuration).addAccountEmailAddress(addAccountEmailAddressRequest, options).then((request) => request(this.axios, this.basePath)); } /** * Use this method to add the address where the account\'s organization physically resides. The physical address is required to send emails and displays on the footer of every email that is sent from the account. The country (country_code) where the account organization resides determines whether you use the state_code to specify United States (US) and Canada (CA) addresses, or use the state_name to specify all other countries. * @summary POST the Physical Address for the Account * @param {GetAccountDetails200ResponsePhysicalAddress} getAccountDetails200ResponsePhysicalAddress Include all `AccountPhysicalAddress` properties required for the specified `country_code` and then update only those properties that you want to change. Excluding a non-read only field from the request body removes it from the physical address. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AccountServicesApi */ public addPhysicalAddress(getAccountDetails200ResponsePhysicalAddress: GetAccountDetails200ResponsePhysicalAddress, options?: RawAxiosRequestConfig) { return AccountServicesApiFp(this.configuration).addPhysicalAddress(getAccountDetails200ResponsePhysicalAddress, options).then((request) => request(this.axios, this.basePath)); } /** * Get account related details for a Constant Contact user account. Use the `extra_fields` query parameter to include the `company_logo` and/or `physical_address` details in the response body. For more details, see [Get Account Summary Details](/api_guide/account_details_get.html). * @summary GET a Summary of Account Details * @param {GetAccountDetailsExtraFieldsEnum} [extraFields] Use the `extra_fields` query parameter to include the `physical_address` and/or `company_logo` details in the response body. Use a comma separated list to include both (physical_address, company logo). * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AccountServicesApi */ public getAccountDetails(extraFields?: GetAccountDetailsExtraFieldsEnum, options?: RawAxiosRequestConfig) { return AccountServicesApiFp(this.configuration).getAccountDetails(extraFields, options).then((request) => request(this.axios, this.basePath)); } /** * Use this method to get the address where the account\'s organization physically resides. The physical address is required to send emails and displays on the footer of every email that is sent from the account. * @summary GET the Physical Address for the Account * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AccountServicesApi */ public getAccountPhysicalAddress(options?: RawAxiosRequestConfig) { return AccountServicesApiFp(this.configuration).getAccountPhysicalAddress(options).then((request) => request(this.axios, this.basePath)); } /** * Use this method to return a collection of email addresses for the account associated with your access token. When you Create an Email Campaign, you must use an account email address with a `CONFIRMED` status in the email campaign `from_email` and `reply_to_email` headers. Use the query parameters to filter results. You can filter using `confirm_status`, `role_code`, or `email_address`. For example, searching with `confirm_status=CONFIRMED` returns all confirmed email addresses in the account. This method only supports one query parameter at a time. * @summary GET a Collection of Account Email Addresses * @param {GetAllAccountEmailAddressesConfirmStatusEnum} [confirmStatus] Use the `confirm_status` query parameter to search for account emails using the email status. Possible values are `CONFIRMED` or `UNCONFIRMED`. You can also abbreviate the values of this query parameter and use `C` or `U`. * @param {GetAllAccountEmailAddressesRoleCodeEnum} [roleCode] Use the `role_code` query parameter to search for account emails that have a specific role. Each each email address in an account can have multiple roles or no role. Possible values are `CONTACT`, `BILLING`, `REPLY_TO`, `JOURNALING`, or `OTHER`. You can also abbreviate the value of this query parameter and use `C`,`B`,`R`,`J`, or `O`. * @param {string} [emailAddress] Use the `email_address` query parameter to search for a specific account email address. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AccountServicesApi */ public getAllAccountEmailAddresses(confirmStatus?: GetAllAccountEmailAddressesConfirmStatusEnum, roleCode?: GetAllAccountEmailAddressesRoleCodeEnum, emailAddress?: string, options?: RawAxiosRequestConfig) { return AccountServicesApiFp(this.configuration).getAllAccountEmailAddresses(confirmStatus, roleCode, emailAddress, options).then((request) => request(this.axios, this.basePath)); } /** * Use this method to return the user privileges associated with your access token as an array of objects. This method returns all user privileges, including privileges the V3 API does not currently use. Constant Contact requires specific user privileges to make requests using the V3 API. For more information, see the [User Privileges and Roles Overview](/api_guide/user_privileges.html). * @summary GET User Privileges * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AccountServicesApi */ public getUserPrivileges(options?: RawAxiosRequestConfig) { return AccountServicesApiFp(this.configuration).getUserPrivileges(options).then((request) => request(this.axios, this.basePath)); } /** * Use this method to update account details for a Constant Contact account, such as the email address or phone number. This PUT method provides a partial update where only valid properties that you include in the request body are updated and excluded properties are not overwritten. For more details, see [Put (update) Account Summary Details](/api_guide/account_details_put.html). * @summary PUT (update) Account Details * @param {UpdateAccountRequest} updateAccountRequest In the request body, specify changes to account details by including and modifying all or select `CustomerPut` properties. Changes to read-only fields (`encoded_account_id`) are ignored. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AccountServicesApi */ public updateAccount(updateAccountRequest: UpdateAccountRequest, options?: RawAxiosRequestConfig) { return AccountServicesApiFp(this.configuration).updateAccount(updateAccountRequest, options).then((request) => request(this.axios, this.basePath)); } /** * Use this method to update the organization\'s physical address for the Constant Contact user account. The physical address is required to send emails and displays on the footer of every email that is sent from the account. To get the current physical address, make a GET call to `/account/summary/physical_address`. The country (country_code) where the account organization resides determines whether you use the state_code to specify United States (US) and Canada (CA) addresses, or use the state_name to specify all other countries. For more details, see [Put (update) the Physical Address for the Account](/api_guide/account_address_put.html). You must have the role of Account Owner assigned to update account level details. * @summary PUT (update) the Physical Address for an Account * @param {GetAccountDetails200ResponsePhysicalAddress} getAccountDetails200ResponsePhysicalAddress Include all `AccountPhysicalAddress` properties required for the specified `country_code` and then update only those properties that you want to change. Excluding a non-read only field from the request body removes it from the physical address. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AccountServicesApi */ public updateAccountPhysicalAddress(getAccountDetails200ResponsePhysicalAddress: GetAccountDetails200ResponsePhysicalAddress, options?: RawAxiosRequestConfig) { return AccountServicesApiFp(this.configuration).updateAccountPhysicalAddress(getAccountDetails200ResponsePhysicalAddress, options).then((request) => request(this.axios, this.basePath)); } } /** * @export */ export const GetAccountDetailsExtraFieldsEnum = { PhysicalAddress: 'physical_address', CompanyLogo: 'company_logo' } as const; export type GetAccountDetailsExtraFieldsEnum = typeof GetAccountDetailsExtraFieldsEnum[keyof typeof GetAccountDetailsExtraFieldsEnum]; /** * @export */ export const GetAllAccountEmailAddressesConfirmStatusEnum = { Confirmed: 'CONFIRMED', C: 'C', Unconfirmed: 'UNCONFIRMED', U: 'U' } as const; export type GetAllAccountEmailAddressesConfirmStatusEnum = typeof GetAllAccountEmailAddressesConfirmStatusEnum[keyof typeof GetAllAccountEmailAddressesConfirmStatusEnum]; /** * @export */ export const GetAllAccountEmailAddressesRoleCodeEnum = { Contact: 'CONTACT', C: 'C', Billing: 'BILLING', B: 'B', Journaling: 'JOURNALING', J: 'J', ReplyTo: 'REPLY_TO', R: 'R', Other: 'OTHER', O: 'O' } as const; export type GetAllAccountEmailAddressesRoleCodeEnum = typeof GetAllAccountEmailAddressesRoleCodeEnum[keyof typeof GetAllAccountEmailAddressesRoleCodeEnum];