/* 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 { CreateCSVImportActivity201Response } from '../models'; // @ts-ignore import { CreateDeleteActivity201Response } from '../models'; // @ts-ignore import { CreateDeleteActivityRequest } from '../models'; // @ts-ignore import { CreateExportActivity201Response } from '../models'; // @ts-ignore import { CreateExportActivityRequest } from '../models'; // @ts-ignore import { CreateImportJSONActivityRequest } from '../models'; // @ts-ignore import { CreateListAddActivityRequest } from '../models'; // @ts-ignore import { CreateListDeleteActivity201Response } from '../models'; // @ts-ignore import { CreateListDeleteActivityRequest } from '../models'; // @ts-ignore import { CreateListRemoveActivity201Response } from '../models'; // @ts-ignore import { CreateListRemoveActivityRequest } from '../models'; // @ts-ignore import { CreateTagDeleteActivityRequest } from '../models'; // @ts-ignore import { CreateTagRemoveActivity201Response } from '../models'; // @ts-ignore import { CreateTagRemoveActivityRequest } from '../models'; // @ts-ignore import { GetActivityById200Response } from '../models'; // @ts-ignore import { GetAllActivities200Response } from '../models'; // @ts-ignore import { PostCustomFieldDelete201Response } from '../models'; // @ts-ignore import { PostCustomFieldDeleteRequest } from '../models'; /** * BulkActivitiesApi - axios parameter creator * @export */ export const BulkActivitiesApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * This multipart method creates an asynchronous background job that adds or updates contacts by importing a CSV file containing contact information. Do not use a Content-Type header value with this method. Importing a new contact automatically sets the contact\'s `permission_to_send` property as `implicit` and the `opt_in_source` property as `Account`. Importing an existing contact only updates the contact properties you include in the request. The CSV file has a maximum of 40,000 lines including the header row (39,999 contacts) and a maximum file size of 4 megabytes (MB). Lines above the 40,000 line maximum are not processed. If the request body exceeds 4 MB, only the contacts contained in the first 4 MB are imported and the remaining data is dropped. * @summary Import Contacts using a CSV File * @param {File} file The CSV file you are importing. The column headings that you can use in the file are: `first_name`, `last_name`, `email`, `phone`, `job_title`, `anniversary`, `birthday_day`, `birthday_month`, `company_name`, `street`, `street2`, `city`, `state`, `zip`, and `country`. The only required column heading is `email`. You can also use custom fields as column headings. Enter the custom field name prefixed with `cf:` as the column heading. For example, use `cf:first_name` as the header name if you have a custom field named \\\"first_name\\\". The custom field must already exist in the Constant Contact account you are using. Depending on the custom field data type, you can enter dates or strings as the value of the custom field. Each contact can contain up to 25 different custom fields. * @param {Array} listIds Specify which contact lists you are adding all imported contacts to as an array of up to 50 contact `list_id` values. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createCSVImportActivity: async (file: File, listIds: Array, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'file' is not null or undefined assertParamExists('createCSVImportActivity', 'file', file) // verify required parameter 'listIds' is not null or undefined assertParamExists('createCSVImportActivity', 'listIds', listIds) const localVarPath = `/activities/contacts_file_import`; // 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; const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)(); // authentication oauth2_access_code required // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2_access_code", ["contact_data"], configuration) // authentication oauth2_implicit required // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2_implicit", ["contact_data"], configuration) if (file !== undefined) { localVarFormParams.append('file', file as any); } if (listIds) { localVarFormParams.append('list_ids', listIds.join(COLLECTION_FORMATS.csv)); } localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = localVarFormParams; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Use this endpoint to bulk delete contacts in an account. Contacts to delete are specified by contact_id (up to 500), or by list_id (up to 50 lists); all contacts that are members of the list_ids are deleted. Deleted contacts won’t receive email from you, and they don’t count as active contacts. Unlike unsubscribed contacts, deleted contacts can be added back to an account. [Learn how to revive deleted contacts](/api_guide/contacts_delete.html#revive). * @summary Delete Contacts in Bulk * @param {CreateDeleteActivityRequest} createDeleteActivityRequest The request body contains an array of contact_ids <em>or</em> list_ids. All contact_ids provided are deleted, or all members of each specified list_id are deleted. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createDeleteActivity: async (createDeleteActivityRequest: CreateDeleteActivityRequest, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'createDeleteActivityRequest' is not null or undefined assertParamExists('createDeleteActivity', 'createDeleteActivityRequest', createDeleteActivityRequest) const localVarPath = `/activities/contact_delete`; // 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", ["contact_data"], configuration) // authentication oauth2_implicit required // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2_implicit", ["contact_data"], 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(createDeleteActivityRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Use this method to create an activity that exports contacts and contact details to a CSV file. By default, all contacts are exported. To filter contacts to export, specify the source to use, `contact_id`, `list_id`, or `segment_id` (all mutually exclusive). By default, all contact related fields are exported. Use the fields array to only export specific contact fields. You must export `email_address` to successfully export `email_optin_source`, `email_optin_date`, `email_optout_source`, `email_optout_date`, or `email_optout_reason`. After Constant Contact finishes processing the activity, use the `results` link in the response body to retrieve the CSV file. * @summary Export Contacts to a File * @param {CreateExportActivityRequest} createExportActivityRequest A JSON payload that specifies the contacts (rows in the CSV file) and contact properties (columns in the CSV file) you want to export. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createExportActivity: async (createExportActivityRequest: CreateExportActivityRequest, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'createExportActivityRequest' is not null or undefined assertParamExists('createExportActivity', 'createExportActivityRequest', createExportActivityRequest) const localVarPath = `/activities/contact_exports`; // 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", ["contact_data"], configuration) // authentication oauth2_implicit required // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2_implicit", ["contact_data"], 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(createExportActivityRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Use this method to create an asynchronous background job that adds new contacts or updates existing contacts by importing a JSON payload. This method requires a request body that contains the contact data you are importing and the contact lists to which you want to add the imported contacts. Importing a new contact automatically sets the contact\'s `permission_to_send` property as `implicit` and the `opt_in_source` property as `Account`. Importing an existing contact only updates the contact properties you include in the request. For each contact, you can import up to three addresses and three phone numbers. International phone numbers are currently not supported. To import custom fields, prefix the custom field name with `cf:` and add it as a contact property. For example, use the property name `cf:first_name` if you have a custom field named first_name. The custom field must already exist in the Constant Contact account you are using. Each contact can contain up to 25 custom fields. The request body payload has a maximum size of 4 megabytes (MB). If the request body exceeds 4 MB, this method only imports the first 4 MB and drops the remaining data. Use the activity URL to check the status of the import activity request. * @summary Import Contacts using a JSON Payload * @param {CreateImportJSONActivityRequest} createImportJSONActivityRequest The JSON request payload that contains the contact data and contact lists for the import. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createImportJSONActivity: async (createImportJSONActivityRequest: CreateImportJSONActivityRequest, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'createImportJSONActivityRequest' is not null or undefined assertParamExists('createImportJSONActivity', 'createImportJSONActivityRequest', createImportJSONActivityRequest) const localVarPath = `/activities/contacts_json_import`; // 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", ["contact_data"], configuration) // authentication oauth2_implicit required // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2_implicit", ["contact_data"], 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(createImportJSONActivityRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Use this method to create an activity that adds contacts to one or more lists. Each contact can be a member of up to 50 lists. Use the properties in the `source` object to specify the contacts you want to add to lists. Use the `list_ids` array to specify which lists you want to add your source contacts to. * @summary Add Contacts to Lists * @param {CreateListAddActivityRequest} createListAddActivityRequest The JSON payload used to create the \'add contacts to lists\' activity * @param {*} [options] Override http request option. * @throws {RequiredError} */ createListAddActivity: async (createListAddActivityRequest: CreateListAddActivityRequest, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'createListAddActivityRequest' is not null or undefined assertParamExists('createListAddActivity', 'createListAddActivityRequest', createListAddActivityRequest) const localVarPath = `/activities/add_list_memberships`; // 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", ["contact_data"], configuration) // authentication oauth2_implicit required // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2_implicit", ["contact_data"], 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(createListAddActivityRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Use this endpoint to delete up to 100 contact lists in an account. * @summary Delete Contact Lists * @param {CreateListDeleteActivityRequest} createListDeleteActivityRequest An array of `list_id`\'s to delete. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createListDeleteActivity: async (createListDeleteActivityRequest: CreateListDeleteActivityRequest, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'createListDeleteActivityRequest' is not null or undefined assertParamExists('createListDeleteActivity', 'createListDeleteActivityRequest', createListDeleteActivityRequest) const localVarPath = `/activities/list_delete`; // 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", ["contact_data"], configuration) // authentication oauth2_implicit required // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2_implicit", ["contact_data"], 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(createListDeleteActivityRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Use this method to create an activity that removes contacts from one or more contact lists. Use the properties in the `source` object to remove specific contacts from your lists. Use the `list_ids` array to specify the target lists from which contacts are removed. Optionally, if the source is `all_active_contacts` (billable) or `list_ids`, use the `exclude` object to exclude specific contacts from being removed from the destination lists. * @summary Remove Contacts from Lists * @param {CreateListRemoveActivityRequest} createListRemoveActivityRequest The JSON payload used to create the Remove Contacts from Lists\' activity * @param {*} [options] Override http request option. * @throws {RequiredError} */ createListRemoveActivity: async (createListRemoveActivityRequest: CreateListRemoveActivityRequest, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'createListRemoveActivityRequest' is not null or undefined assertParamExists('createListRemoveActivity', 'createListRemoveActivityRequest', createListRemoveActivityRequest) const localVarPath = `/activities/remove_list_memberships`; // 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", ["contact_data"], configuration) // authentication oauth2_implicit required // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2_implicit", ["contact_data"], 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(createListRemoveActivityRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Use this method to create an asynchronous activity that adds one or more tags to all contacts meeting your contact filtering criteria. Use the `source` type to identify contacts from which the specified tags (`tag_id`) are added. Source criteria are mutually exclusive. If the source is `all_active_contacts` or `list_ids`, you can optionally choose to `exclude` contacts by `contact_id`. Use the activity link in the results to check the status of your request. For more use case information, see \"[Add Tags to Contacts](/api_guide/add_tagging_activity.html) * @summary Add Tags to Contacts * @param {CreateTagRemoveActivityRequest} createTagRemoveActivityRequest The JSON payload used to create an asynchronous activity that adds tags to contacts that meet your specified contact filtering criteria. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createTagAddContactActivity: async (createTagRemoveActivityRequest: CreateTagRemoveActivityRequest, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'createTagRemoveActivityRequest' is not null or undefined assertParamExists('createTagAddContactActivity', 'createTagRemoveActivityRequest', createTagRemoveActivityRequest) const localVarPath = `/activities/contacts_taggings_add`; // 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", ["contact_data"], configuration) // authentication oauth2_implicit required // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2_implicit", ["contact_data"], 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(createTagRemoveActivityRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Use this method to create an asynchronous activity that deletes up to 500 tags. Deleted tags are automatically removed from tagged contacts. Use the `tag_ids` array of string values in the request body to specify which tags to delete. * @summary Delete Tags * @param {CreateTagDeleteActivityRequest} createTagDeleteActivityRequest An array of string values (`tag_id`s) to delete. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createTagDeleteActivity: async (createTagDeleteActivityRequest: CreateTagDeleteActivityRequest, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'createTagDeleteActivityRequest' is not null or undefined assertParamExists('createTagDeleteActivity', 'createTagDeleteActivityRequest', createTagDeleteActivityRequest) const localVarPath = `/activities/contacts_tags_delete`; // 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", ["contact_data"], configuration) // authentication oauth2_implicit required // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2_implicit", ["contact_data"], 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(createTagDeleteActivityRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Use this method to create an asynchronous activity that removes one or more tags from all contacts meeting your contact filtering criteria. Filtering criteria must include the `source` type used to identify contacts from which the specified tags (`tag_id`) are removed. Source types are mutually exclusive. If the specified source is either `all_active_contacts` or `list_ids`, you can optionally choose to `exclude` specified contacts by `contact_id`. Use the activity link in the results to check the status of your request.\" For more use case information, see \"[Remove Tags from Contacts](/api_guide/remove_tagging_activity.html) * @summary Remove Tags from Contacts * @param {CreateTagRemoveActivityRequest} createTagRemoveActivityRequest The JSON payload used to create an asynchronous activity that removes tags from contacts meeting your specified contact filtering criteria. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createTagRemoveActivity: async (createTagRemoveActivityRequest: CreateTagRemoveActivityRequest, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'createTagRemoveActivityRequest' is not null or undefined assertParamExists('createTagRemoveActivity', 'createTagRemoveActivityRequest', createTagRemoveActivityRequest) const localVarPath = `/activities/contacts_taggings_remove`; // 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", ["contact_data"], configuration) // authentication oauth2_implicit required // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2_implicit", ["contact_data"], 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(createTagRemoveActivityRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This endpoint returns an activity status report. * @summary GET an Activity Status * @param {string} activityId The unique ID of the activity to GET * @param {*} [options] Override http request option. * @throws {RequiredError} */ getActivityById: async (activityId: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'activityId' is not null or undefined assertParamExists('getActivityById', 'activityId', activityId) const localVarPath = `/activities/{activity_id}` .replace(`{${"activity_id"}}`, encodeURIComponent(String(activityId))); // 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", ["contact_data"], configuration) // authentication oauth2_implicit required // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2_implicit", ["contact_data"], configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This endpoint returns a collection of activities. Use the state query parameter to include only activities with a specific status (processing, completed, cancelled, failed, or time_out). Use the limit query parameter to define the number of activities returned per page. Learn [more](/api_guide/activity_status.html). * @summary GET Activity Status Collection * @param {number} [limit] Specifies the number of results displayed per page of output, from 1 - 500, default = 50. * @param {GetAllActivitiesStateEnum} [state] Use this parameter to filter the response to include only activities in one of the following states: cancelled, completed, failed, processing, or timed_out. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAllActivities: async (limit?: number, state?: GetAllActivitiesStateEnum, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/activities`; // 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", ["contact_data"], configuration) // authentication oauth2_implicit required // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2_implicit", ["contact_data"], configuration) if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (state !== undefined) { localVarQueryParameter['state'] = state; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Use this endpoint to retrieve (GET) a CSV file containing exported contacts by providing the `activity_id` of a completed CSV export activity. * @summary Retrieve Exported Contacts File * @param {string} fileExportId The unique ID of the exported file provided in the results: section of the export contacts activity response. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getCSVExportFile: async (fileExportId: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'fileExportId' is not null or undefined assertParamExists('getCSVExportFile', 'fileExportId', fileExportId) const localVarPath = `/contact_exports/{file_export_id}` .replace(`{${"file_export_id"}}`, encodeURIComponent(String(fileExportId))); // 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", ["contact_data"], configuration) // authentication oauth2_implicit required // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2_implicit", ["contact_data"], 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 endpoint to delete up to 100 custom fields for an account. * @summary Delete Custom Fields * @param {PostCustomFieldDeleteRequest} postCustomFieldDeleteRequest An array of `custom_field_id`\'s to delete. * @param {*} [options] Override http request option. * @throws {RequiredError} */ postCustomFieldDelete: async (postCustomFieldDeleteRequest: PostCustomFieldDeleteRequest, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'postCustomFieldDeleteRequest' is not null or undefined assertParamExists('postCustomFieldDelete', 'postCustomFieldDeleteRequest', postCustomFieldDeleteRequest) const localVarPath = `/activities/custom_fields_delete`; // 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", ["contact_data"], configuration) // authentication oauth2_implicit required // oauth required await setOAuthToObject(localVarHeaderParameter, "oauth2_implicit", ["contact_data"], 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(postCustomFieldDeleteRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * BulkActivitiesApi - functional programming interface * @export */ export const BulkActivitiesApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = BulkActivitiesApiAxiosParamCreator(configuration) return { /** * This multipart method creates an asynchronous background job that adds or updates contacts by importing a CSV file containing contact information. Do not use a Content-Type header value with this method. Importing a new contact automatically sets the contact\'s `permission_to_send` property as `implicit` and the `opt_in_source` property as `Account`. Importing an existing contact only updates the contact properties you include in the request. The CSV file has a maximum of 40,000 lines including the header row (39,999 contacts) and a maximum file size of 4 megabytes (MB). Lines above the 40,000 line maximum are not processed. If the request body exceeds 4 MB, only the contacts contained in the first 4 MB are imported and the remaining data is dropped. * @summary Import Contacts using a CSV File * @param {File} file The CSV file you are importing. The column headings that you can use in the file are: `first_name`, `last_name`, `email`, `phone`, `job_title`, `anniversary`, `birthday_day`, `birthday_month`, `company_name`, `street`, `street2`, `city`, `state`, `zip`, and `country`. The only required column heading is `email`. You can also use custom fields as column headings. Enter the custom field name prefixed with `cf:` as the column heading. For example, use `cf:first_name` as the header name if you have a custom field named \\\"first_name\\\". The custom field must already exist in the Constant Contact account you are using. Depending on the custom field data type, you can enter dates or strings as the value of the custom field. Each contact can contain up to 25 different custom fields. * @param {Array} listIds Specify which contact lists you are adding all imported contacts to as an array of up to 50 contact `list_id` values. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createCSVImportActivity(file: File, listIds: Array, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createCSVImportActivity(file, listIds, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['BulkActivitiesApi.createCSVImportActivity']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Use this endpoint to bulk delete contacts in an account. Contacts to delete are specified by contact_id (up to 500), or by list_id (up to 50 lists); all contacts that are members of the list_ids are deleted. Deleted contacts won’t receive email from you, and they don’t count as active contacts. Unlike unsubscribed contacts, deleted contacts can be added back to an account. [Learn how to revive deleted contacts](/api_guide/contacts_delete.html#revive). * @summary Delete Contacts in Bulk * @param {CreateDeleteActivityRequest} createDeleteActivityRequest The request body contains an array of contact_ids <em>or</em> list_ids. All contact_ids provided are deleted, or all members of each specified list_id are deleted. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createDeleteActivity(createDeleteActivityRequest: CreateDeleteActivityRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createDeleteActivity(createDeleteActivityRequest, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['BulkActivitiesApi.createDeleteActivity']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Use this method to create an activity that exports contacts and contact details to a CSV file. By default, all contacts are exported. To filter contacts to export, specify the source to use, `contact_id`, `list_id`, or `segment_id` (all mutually exclusive). By default, all contact related fields are exported. Use the fields array to only export specific contact fields. You must export `email_address` to successfully export `email_optin_source`, `email_optin_date`, `email_optout_source`, `email_optout_date`, or `email_optout_reason`. After Constant Contact finishes processing the activity, use the `results` link in the response body to retrieve the CSV file. * @summary Export Contacts to a File * @param {CreateExportActivityRequest} createExportActivityRequest A JSON payload that specifies the contacts (rows in the CSV file) and contact properties (columns in the CSV file) you want to export. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createExportActivity(createExportActivityRequest: CreateExportActivityRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createExportActivity(createExportActivityRequest, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['BulkActivitiesApi.createExportActivity']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Use this method to create an asynchronous background job that adds new contacts or updates existing contacts by importing a JSON payload. This method requires a request body that contains the contact data you are importing and the contact lists to which you want to add the imported contacts. Importing a new contact automatically sets the contact\'s `permission_to_send` property as `implicit` and the `opt_in_source` property as `Account`. Importing an existing contact only updates the contact properties you include in the request. For each contact, you can import up to three addresses and three phone numbers. International phone numbers are currently not supported. To import custom fields, prefix the custom field name with `cf:` and add it as a contact property. For example, use the property name `cf:first_name` if you have a custom field named first_name. The custom field must already exist in the Constant Contact account you are using. Each contact can contain up to 25 custom fields. The request body payload has a maximum size of 4 megabytes (MB). If the request body exceeds 4 MB, this method only imports the first 4 MB and drops the remaining data. Use the activity URL to check the status of the import activity request. * @summary Import Contacts using a JSON Payload * @param {CreateImportJSONActivityRequest} createImportJSONActivityRequest The JSON request payload that contains the contact data and contact lists for the import. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createImportJSONActivity(createImportJSONActivityRequest: CreateImportJSONActivityRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createImportJSONActivity(createImportJSONActivityRequest, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['BulkActivitiesApi.createImportJSONActivity']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Use this method to create an activity that adds contacts to one or more lists. Each contact can be a member of up to 50 lists. Use the properties in the `source` object to specify the contacts you want to add to lists. Use the `list_ids` array to specify which lists you want to add your source contacts to. * @summary Add Contacts to Lists * @param {CreateListAddActivityRequest} createListAddActivityRequest The JSON payload used to create the \'add contacts to lists\' activity * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createListAddActivity(createListAddActivityRequest: CreateListAddActivityRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createListAddActivity(createListAddActivityRequest, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['BulkActivitiesApi.createListAddActivity']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Use this endpoint to delete up to 100 contact lists in an account. * @summary Delete Contact Lists * @param {CreateListDeleteActivityRequest} createListDeleteActivityRequest An array of `list_id`\'s to delete. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createListDeleteActivity(createListDeleteActivityRequest: CreateListDeleteActivityRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createListDeleteActivity(createListDeleteActivityRequest, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['BulkActivitiesApi.createListDeleteActivity']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Use this method to create an activity that removes contacts from one or more contact lists. Use the properties in the `source` object to remove specific contacts from your lists. Use the `list_ids` array to specify the target lists from which contacts are removed. Optionally, if the source is `all_active_contacts` (billable) or `list_ids`, use the `exclude` object to exclude specific contacts from being removed from the destination lists. * @summary Remove Contacts from Lists * @param {CreateListRemoveActivityRequest} createListRemoveActivityRequest The JSON payload used to create the Remove Contacts from Lists\' activity * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createListRemoveActivity(createListRemoveActivityRequest: CreateListRemoveActivityRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createListRemoveActivity(createListRemoveActivityRequest, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['BulkActivitiesApi.createListRemoveActivity']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Use this method to create an asynchronous activity that adds one or more tags to all contacts meeting your contact filtering criteria. Use the `source` type to identify contacts from which the specified tags (`tag_id`) are added. Source criteria are mutually exclusive. If the source is `all_active_contacts` or `list_ids`, you can optionally choose to `exclude` contacts by `contact_id`. Use the activity link in the results to check the status of your request. For more use case information, see \"[Add Tags to Contacts](/api_guide/add_tagging_activity.html) * @summary Add Tags to Contacts * @param {CreateTagRemoveActivityRequest} createTagRemoveActivityRequest The JSON payload used to create an asynchronous activity that adds tags to contacts that meet your specified contact filtering criteria. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createTagAddContactActivity(createTagRemoveActivityRequest: CreateTagRemoveActivityRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createTagAddContactActivity(createTagRemoveActivityRequest, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['BulkActivitiesApi.createTagAddContactActivity']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Use this method to create an asynchronous activity that deletes up to 500 tags. Deleted tags are automatically removed from tagged contacts. Use the `tag_ids` array of string values in the request body to specify which tags to delete. * @summary Delete Tags * @param {CreateTagDeleteActivityRequest} createTagDeleteActivityRequest An array of string values (`tag_id`s) to delete. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createTagDeleteActivity(createTagDeleteActivityRequest: CreateTagDeleteActivityRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createTagDeleteActivity(createTagDeleteActivityRequest, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['BulkActivitiesApi.createTagDeleteActivity']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Use this method to create an asynchronous activity that removes one or more tags from all contacts meeting your contact filtering criteria. Filtering criteria must include the `source` type used to identify contacts from which the specified tags (`tag_id`) are removed. Source types are mutually exclusive. If the specified source is either `all_active_contacts` or `list_ids`, you can optionally choose to `exclude` specified contacts by `contact_id`. Use the activity link in the results to check the status of your request.\" For more use case information, see \"[Remove Tags from Contacts](/api_guide/remove_tagging_activity.html) * @summary Remove Tags from Contacts * @param {CreateTagRemoveActivityRequest} createTagRemoveActivityRequest The JSON payload used to create an asynchronous activity that removes tags from contacts meeting your specified contact filtering criteria. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createTagRemoveActivity(createTagRemoveActivityRequest: CreateTagRemoveActivityRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createTagRemoveActivity(createTagRemoveActivityRequest, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['BulkActivitiesApi.createTagRemoveActivity']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * This endpoint returns an activity status report. * @summary GET an Activity Status * @param {string} activityId The unique ID of the activity to GET * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getActivityById(activityId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getActivityById(activityId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['BulkActivitiesApi.getActivityById']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * This endpoint returns a collection of activities. Use the state query parameter to include only activities with a specific status (processing, completed, cancelled, failed, or time_out). Use the limit query parameter to define the number of activities returned per page. Learn [more](/api_guide/activity_status.html). * @summary GET Activity Status Collection * @param {number} [limit] Specifies the number of results displayed per page of output, from 1 - 500, default = 50. * @param {GetAllActivitiesStateEnum} [state] Use this parameter to filter the response to include only activities in one of the following states: cancelled, completed, failed, processing, or timed_out. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getAllActivities(limit?: number, state?: GetAllActivitiesStateEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getAllActivities(limit, state, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['BulkActivitiesApi.getAllActivities']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Use this endpoint to retrieve (GET) a CSV file containing exported contacts by providing the `activity_id` of a completed CSV export activity. * @summary Retrieve Exported Contacts File * @param {string} fileExportId The unique ID of the exported file provided in the results: section of the export contacts activity response. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getCSVExportFile(fileExportId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getCSVExportFile(fileExportId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['BulkActivitiesApi.getCSVExportFile']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Use this endpoint to delete up to 100 custom fields for an account. * @summary Delete Custom Fields * @param {PostCustomFieldDeleteRequest} postCustomFieldDeleteRequest An array of `custom_field_id`\'s to delete. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async postCustomFieldDelete(postCustomFieldDeleteRequest: PostCustomFieldDeleteRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.postCustomFieldDelete(postCustomFieldDeleteRequest, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['BulkActivitiesApi.postCustomFieldDelete']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, } }; /** * BulkActivitiesApi - factory interface * @export */ export const BulkActivitiesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = BulkActivitiesApiFp(configuration) return { /** * This multipart method creates an asynchronous background job that adds or updates contacts by importing a CSV file containing contact information. Do not use a Content-Type header value with this method. Importing a new contact automatically sets the contact\'s `permission_to_send` property as `implicit` and the `opt_in_source` property as `Account`. Importing an existing contact only updates the contact properties you include in the request. The CSV file has a maximum of 40,000 lines including the header row (39,999 contacts) and a maximum file size of 4 megabytes (MB). Lines above the 40,000 line maximum are not processed. If the request body exceeds 4 MB, only the contacts contained in the first 4 MB are imported and the remaining data is dropped. * @summary Import Contacts using a CSV File * @param {File} file The CSV file you are importing. The column headings that you can use in the file are: `first_name`, `last_name`, `email`, `phone`, `job_title`, `anniversary`, `birthday_day`, `birthday_month`, `company_name`, `street`, `street2`, `city`, `state`, `zip`, and `country`. The only required column heading is `email`. You can also use custom fields as column headings. Enter the custom field name prefixed with `cf:` as the column heading. For example, use `cf:first_name` as the header name if you have a custom field named \\\"first_name\\\". The custom field must already exist in the Constant Contact account you are using. Depending on the custom field data type, you can enter dates or strings as the value of the custom field. Each contact can contain up to 25 different custom fields. * @param {Array} listIds Specify which contact lists you are adding all imported contacts to as an array of up to 50 contact `list_id` values. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createCSVImportActivity(file: File, listIds: Array, options?: any): AxiosPromise { return localVarFp.createCSVImportActivity(file, listIds, options).then((request) => request(axios, basePath)); }, /** * Use this endpoint to bulk delete contacts in an account. Contacts to delete are specified by contact_id (up to 500), or by list_id (up to 50 lists); all contacts that are members of the list_ids are deleted. Deleted contacts won’t receive email from you, and they don’t count as active contacts. Unlike unsubscribed contacts, deleted contacts can be added back to an account. [Learn how to revive deleted contacts](/api_guide/contacts_delete.html#revive). * @summary Delete Contacts in Bulk * @param {CreateDeleteActivityRequest} createDeleteActivityRequest The request body contains an array of contact_ids <em>or</em> list_ids. All contact_ids provided are deleted, or all members of each specified list_id are deleted. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createDeleteActivity(createDeleteActivityRequest: CreateDeleteActivityRequest, options?: any): AxiosPromise { return localVarFp.createDeleteActivity(createDeleteActivityRequest, options).then((request) => request(axios, basePath)); }, /** * Use this method to create an activity that exports contacts and contact details to a CSV file. By default, all contacts are exported. To filter contacts to export, specify the source to use, `contact_id`, `list_id`, or `segment_id` (all mutually exclusive). By default, all contact related fields are exported. Use the fields array to only export specific contact fields. You must export `email_address` to successfully export `email_optin_source`, `email_optin_date`, `email_optout_source`, `email_optout_date`, or `email_optout_reason`. After Constant Contact finishes processing the activity, use the `results` link in the response body to retrieve the CSV file. * @summary Export Contacts to a File * @param {CreateExportActivityRequest} createExportActivityRequest A JSON payload that specifies the contacts (rows in the CSV file) and contact properties (columns in the CSV file) you want to export. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createExportActivity(createExportActivityRequest: CreateExportActivityRequest, options?: any): AxiosPromise { return localVarFp.createExportActivity(createExportActivityRequest, options).then((request) => request(axios, basePath)); }, /** * Use this method to create an asynchronous background job that adds new contacts or updates existing contacts by importing a JSON payload. This method requires a request body that contains the contact data you are importing and the contact lists to which you want to add the imported contacts. Importing a new contact automatically sets the contact\'s `permission_to_send` property as `implicit` and the `opt_in_source` property as `Account`. Importing an existing contact only updates the contact properties you include in the request. For each contact, you can import up to three addresses and three phone numbers. International phone numbers are currently not supported. To import custom fields, prefix the custom field name with `cf:` and add it as a contact property. For example, use the property name `cf:first_name` if you have a custom field named first_name. The custom field must already exist in the Constant Contact account you are using. Each contact can contain up to 25 custom fields. The request body payload has a maximum size of 4 megabytes (MB). If the request body exceeds 4 MB, this method only imports the first 4 MB and drops the remaining data. Use the activity URL to check the status of the import activity request. * @summary Import Contacts using a JSON Payload * @param {CreateImportJSONActivityRequest} createImportJSONActivityRequest The JSON request payload that contains the contact data and contact lists for the import. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createImportJSONActivity(createImportJSONActivityRequest: CreateImportJSONActivityRequest, options?: any): AxiosPromise { return localVarFp.createImportJSONActivity(createImportJSONActivityRequest, options).then((request) => request(axios, basePath)); }, /** * Use this method to create an activity that adds contacts to one or more lists. Each contact can be a member of up to 50 lists. Use the properties in the `source` object to specify the contacts you want to add to lists. Use the `list_ids` array to specify which lists you want to add your source contacts to. * @summary Add Contacts to Lists * @param {CreateListAddActivityRequest} createListAddActivityRequest The JSON payload used to create the \'add contacts to lists\' activity * @param {*} [options] Override http request option. * @throws {RequiredError} */ createListAddActivity(createListAddActivityRequest: CreateListAddActivityRequest, options?: any): AxiosPromise { return localVarFp.createListAddActivity(createListAddActivityRequest, options).then((request) => request(axios, basePath)); }, /** * Use this endpoint to delete up to 100 contact lists in an account. * @summary Delete Contact Lists * @param {CreateListDeleteActivityRequest} createListDeleteActivityRequest An array of `list_id`\'s to delete. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createListDeleteActivity(createListDeleteActivityRequest: CreateListDeleteActivityRequest, options?: any): AxiosPromise { return localVarFp.createListDeleteActivity(createListDeleteActivityRequest, options).then((request) => request(axios, basePath)); }, /** * Use this method to create an activity that removes contacts from one or more contact lists. Use the properties in the `source` object to remove specific contacts from your lists. Use the `list_ids` array to specify the target lists from which contacts are removed. Optionally, if the source is `all_active_contacts` (billable) or `list_ids`, use the `exclude` object to exclude specific contacts from being removed from the destination lists. * @summary Remove Contacts from Lists * @param {CreateListRemoveActivityRequest} createListRemoveActivityRequest The JSON payload used to create the Remove Contacts from Lists\' activity * @param {*} [options] Override http request option. * @throws {RequiredError} */ createListRemoveActivity(createListRemoveActivityRequest: CreateListRemoveActivityRequest, options?: any): AxiosPromise { return localVarFp.createListRemoveActivity(createListRemoveActivityRequest, options).then((request) => request(axios, basePath)); }, /** * Use this method to create an asynchronous activity that adds one or more tags to all contacts meeting your contact filtering criteria. Use the `source` type to identify contacts from which the specified tags (`tag_id`) are added. Source criteria are mutually exclusive. If the source is `all_active_contacts` or `list_ids`, you can optionally choose to `exclude` contacts by `contact_id`. Use the activity link in the results to check the status of your request. For more use case information, see \"[Add Tags to Contacts](/api_guide/add_tagging_activity.html) * @summary Add Tags to Contacts * @param {CreateTagRemoveActivityRequest} createTagRemoveActivityRequest The JSON payload used to create an asynchronous activity that adds tags to contacts that meet your specified contact filtering criteria. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createTagAddContactActivity(createTagRemoveActivityRequest: CreateTagRemoveActivityRequest, options?: any): AxiosPromise { return localVarFp.createTagAddContactActivity(createTagRemoveActivityRequest, options).then((request) => request(axios, basePath)); }, /** * Use this method to create an asynchronous activity that deletes up to 500 tags. Deleted tags are automatically removed from tagged contacts. Use the `tag_ids` array of string values in the request body to specify which tags to delete. * @summary Delete Tags * @param {CreateTagDeleteActivityRequest} createTagDeleteActivityRequest An array of string values (`tag_id`s) to delete. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createTagDeleteActivity(createTagDeleteActivityRequest: CreateTagDeleteActivityRequest, options?: any): AxiosPromise { return localVarFp.createTagDeleteActivity(createTagDeleteActivityRequest, options).then((request) => request(axios, basePath)); }, /** * Use this method to create an asynchronous activity that removes one or more tags from all contacts meeting your contact filtering criteria. Filtering criteria must include the `source` type used to identify contacts from which the specified tags (`tag_id`) are removed. Source types are mutually exclusive. If the specified source is either `all_active_contacts` or `list_ids`, you can optionally choose to `exclude` specified contacts by `contact_id`. Use the activity link in the results to check the status of your request.\" For more use case information, see \"[Remove Tags from Contacts](/api_guide/remove_tagging_activity.html) * @summary Remove Tags from Contacts * @param {CreateTagRemoveActivityRequest} createTagRemoveActivityRequest The JSON payload used to create an asynchronous activity that removes tags from contacts meeting your specified contact filtering criteria. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createTagRemoveActivity(createTagRemoveActivityRequest: CreateTagRemoveActivityRequest, options?: any): AxiosPromise { return localVarFp.createTagRemoveActivity(createTagRemoveActivityRequest, options).then((request) => request(axios, basePath)); }, /** * This endpoint returns an activity status report. * @summary GET an Activity Status * @param {string} activityId The unique ID of the activity to GET * @param {*} [options] Override http request option. * @throws {RequiredError} */ getActivityById(activityId: string, options?: any): AxiosPromise { return localVarFp.getActivityById(activityId, options).then((request) => request(axios, basePath)); }, /** * This endpoint returns a collection of activities. Use the state query parameter to include only activities with a specific status (processing, completed, cancelled, failed, or time_out). Use the limit query parameter to define the number of activities returned per page. Learn [more](/api_guide/activity_status.html). * @summary GET Activity Status Collection * @param {number} [limit] Specifies the number of results displayed per page of output, from 1 - 500, default = 50. * @param {GetAllActivitiesStateEnum} [state] Use this parameter to filter the response to include only activities in one of the following states: cancelled, completed, failed, processing, or timed_out. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAllActivities(limit?: number, state?: GetAllActivitiesStateEnum, options?: any): AxiosPromise { return localVarFp.getAllActivities(limit, state, options).then((request) => request(axios, basePath)); }, /** * Use this endpoint to retrieve (GET) a CSV file containing exported contacts by providing the `activity_id` of a completed CSV export activity. * @summary Retrieve Exported Contacts File * @param {string} fileExportId The unique ID of the exported file provided in the results: section of the export contacts activity response. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getCSVExportFile(fileExportId: string, options?: any): AxiosPromise { return localVarFp.getCSVExportFile(fileExportId, options).then((request) => request(axios, basePath)); }, /** * Use this endpoint to delete up to 100 custom fields for an account. * @summary Delete Custom Fields * @param {PostCustomFieldDeleteRequest} postCustomFieldDeleteRequest An array of `custom_field_id`\'s to delete. * @param {*} [options] Override http request option. * @throws {RequiredError} */ postCustomFieldDelete(postCustomFieldDeleteRequest: PostCustomFieldDeleteRequest, options?: any): AxiosPromise { return localVarFp.postCustomFieldDelete(postCustomFieldDeleteRequest, options).then((request) => request(axios, basePath)); }, }; }; /** * BulkActivitiesApi - object-oriented interface * @export * @class BulkActivitiesApi * @extends {BaseAPI} */ export class BulkActivitiesApi extends BaseAPI { /** * This multipart method creates an asynchronous background job that adds or updates contacts by importing a CSV file containing contact information. Do not use a Content-Type header value with this method. Importing a new contact automatically sets the contact\'s `permission_to_send` property as `implicit` and the `opt_in_source` property as `Account`. Importing an existing contact only updates the contact properties you include in the request. The CSV file has a maximum of 40,000 lines including the header row (39,999 contacts) and a maximum file size of 4 megabytes (MB). Lines above the 40,000 line maximum are not processed. If the request body exceeds 4 MB, only the contacts contained in the first 4 MB are imported and the remaining data is dropped. * @summary Import Contacts using a CSV File * @param {File} file The CSV file you are importing. The column headings that you can use in the file are: `first_name`, `last_name`, `email`, `phone`, `job_title`, `anniversary`, `birthday_day`, `birthday_month`, `company_name`, `street`, `street2`, `city`, `state`, `zip`, and `country`. The only required column heading is `email`. You can also use custom fields as column headings. Enter the custom field name prefixed with `cf:` as the column heading. For example, use `cf:first_name` as the header name if you have a custom field named \\\"first_name\\\". The custom field must already exist in the Constant Contact account you are using. Depending on the custom field data type, you can enter dates or strings as the value of the custom field. Each contact can contain up to 25 different custom fields. * @param {Array} listIds Specify which contact lists you are adding all imported contacts to as an array of up to 50 contact `list_id` values. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BulkActivitiesApi */ public createCSVImportActivity(file: File, listIds: Array, options?: RawAxiosRequestConfig) { return BulkActivitiesApiFp(this.configuration).createCSVImportActivity(file, listIds, options).then((request) => request(this.axios, this.basePath)); } /** * Use this endpoint to bulk delete contacts in an account. Contacts to delete are specified by contact_id (up to 500), or by list_id (up to 50 lists); all contacts that are members of the list_ids are deleted. Deleted contacts won’t receive email from you, and they don’t count as active contacts. Unlike unsubscribed contacts, deleted contacts can be added back to an account. [Learn how to revive deleted contacts](/api_guide/contacts_delete.html#revive). * @summary Delete Contacts in Bulk * @param {CreateDeleteActivityRequest} createDeleteActivityRequest The request body contains an array of contact_ids <em>or</em> list_ids. All contact_ids provided are deleted, or all members of each specified list_id are deleted. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BulkActivitiesApi */ public createDeleteActivity(createDeleteActivityRequest: CreateDeleteActivityRequest, options?: RawAxiosRequestConfig) { return BulkActivitiesApiFp(this.configuration).createDeleteActivity(createDeleteActivityRequest, options).then((request) => request(this.axios, this.basePath)); } /** * Use this method to create an activity that exports contacts and contact details to a CSV file. By default, all contacts are exported. To filter contacts to export, specify the source to use, `contact_id`, `list_id`, or `segment_id` (all mutually exclusive). By default, all contact related fields are exported. Use the fields array to only export specific contact fields. You must export `email_address` to successfully export `email_optin_source`, `email_optin_date`, `email_optout_source`, `email_optout_date`, or `email_optout_reason`. After Constant Contact finishes processing the activity, use the `results` link in the response body to retrieve the CSV file. * @summary Export Contacts to a File * @param {CreateExportActivityRequest} createExportActivityRequest A JSON payload that specifies the contacts (rows in the CSV file) and contact properties (columns in the CSV file) you want to export. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BulkActivitiesApi */ public createExportActivity(createExportActivityRequest: CreateExportActivityRequest, options?: RawAxiosRequestConfig) { return BulkActivitiesApiFp(this.configuration).createExportActivity(createExportActivityRequest, options).then((request) => request(this.axios, this.basePath)); } /** * Use this method to create an asynchronous background job that adds new contacts or updates existing contacts by importing a JSON payload. This method requires a request body that contains the contact data you are importing and the contact lists to which you want to add the imported contacts. Importing a new contact automatically sets the contact\'s `permission_to_send` property as `implicit` and the `opt_in_source` property as `Account`. Importing an existing contact only updates the contact properties you include in the request. For each contact, you can import up to three addresses and three phone numbers. International phone numbers are currently not supported. To import custom fields, prefix the custom field name with `cf:` and add it as a contact property. For example, use the property name `cf:first_name` if you have a custom field named first_name. The custom field must already exist in the Constant Contact account you are using. Each contact can contain up to 25 custom fields. The request body payload has a maximum size of 4 megabytes (MB). If the request body exceeds 4 MB, this method only imports the first 4 MB and drops the remaining data. Use the activity URL to check the status of the import activity request. * @summary Import Contacts using a JSON Payload * @param {CreateImportJSONActivityRequest} createImportJSONActivityRequest The JSON request payload that contains the contact data and contact lists for the import. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BulkActivitiesApi */ public createImportJSONActivity(createImportJSONActivityRequest: CreateImportJSONActivityRequest, options?: RawAxiosRequestConfig) { return BulkActivitiesApiFp(this.configuration).createImportJSONActivity(createImportJSONActivityRequest, options).then((request) => request(this.axios, this.basePath)); } /** * Use this method to create an activity that adds contacts to one or more lists. Each contact can be a member of up to 50 lists. Use the properties in the `source` object to specify the contacts you want to add to lists. Use the `list_ids` array to specify which lists you want to add your source contacts to. * @summary Add Contacts to Lists * @param {CreateListAddActivityRequest} createListAddActivityRequest The JSON payload used to create the \'add contacts to lists\' activity * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BulkActivitiesApi */ public createListAddActivity(createListAddActivityRequest: CreateListAddActivityRequest, options?: RawAxiosRequestConfig) { return BulkActivitiesApiFp(this.configuration).createListAddActivity(createListAddActivityRequest, options).then((request) => request(this.axios, this.basePath)); } /** * Use this endpoint to delete up to 100 contact lists in an account. * @summary Delete Contact Lists * @param {CreateListDeleteActivityRequest} createListDeleteActivityRequest An array of `list_id`\'s to delete. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BulkActivitiesApi */ public createListDeleteActivity(createListDeleteActivityRequest: CreateListDeleteActivityRequest, options?: RawAxiosRequestConfig) { return BulkActivitiesApiFp(this.configuration).createListDeleteActivity(createListDeleteActivityRequest, options).then((request) => request(this.axios, this.basePath)); } /** * Use this method to create an activity that removes contacts from one or more contact lists. Use the properties in the `source` object to remove specific contacts from your lists. Use the `list_ids` array to specify the target lists from which contacts are removed. Optionally, if the source is `all_active_contacts` (billable) or `list_ids`, use the `exclude` object to exclude specific contacts from being removed from the destination lists. * @summary Remove Contacts from Lists * @param {CreateListRemoveActivityRequest} createListRemoveActivityRequest The JSON payload used to create the Remove Contacts from Lists\' activity * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BulkActivitiesApi */ public createListRemoveActivity(createListRemoveActivityRequest: CreateListRemoveActivityRequest, options?: RawAxiosRequestConfig) { return BulkActivitiesApiFp(this.configuration).createListRemoveActivity(createListRemoveActivityRequest, options).then((request) => request(this.axios, this.basePath)); } /** * Use this method to create an asynchronous activity that adds one or more tags to all contacts meeting your contact filtering criteria. Use the `source` type to identify contacts from which the specified tags (`tag_id`) are added. Source criteria are mutually exclusive. If the source is `all_active_contacts` or `list_ids`, you can optionally choose to `exclude` contacts by `contact_id`. Use the activity link in the results to check the status of your request. For more use case information, see \"[Add Tags to Contacts](/api_guide/add_tagging_activity.html) * @summary Add Tags to Contacts * @param {CreateTagRemoveActivityRequest} createTagRemoveActivityRequest The JSON payload used to create an asynchronous activity that adds tags to contacts that meet your specified contact filtering criteria. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BulkActivitiesApi */ public createTagAddContactActivity(createTagRemoveActivityRequest: CreateTagRemoveActivityRequest, options?: RawAxiosRequestConfig) { return BulkActivitiesApiFp(this.configuration).createTagAddContactActivity(createTagRemoveActivityRequest, options).then((request) => request(this.axios, this.basePath)); } /** * Use this method to create an asynchronous activity that deletes up to 500 tags. Deleted tags are automatically removed from tagged contacts. Use the `tag_ids` array of string values in the request body to specify which tags to delete. * @summary Delete Tags * @param {CreateTagDeleteActivityRequest} createTagDeleteActivityRequest An array of string values (`tag_id`s) to delete. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BulkActivitiesApi */ public createTagDeleteActivity(createTagDeleteActivityRequest: CreateTagDeleteActivityRequest, options?: RawAxiosRequestConfig) { return BulkActivitiesApiFp(this.configuration).createTagDeleteActivity(createTagDeleteActivityRequest, options).then((request) => request(this.axios, this.basePath)); } /** * Use this method to create an asynchronous activity that removes one or more tags from all contacts meeting your contact filtering criteria. Filtering criteria must include the `source` type used to identify contacts from which the specified tags (`tag_id`) are removed. Source types are mutually exclusive. If the specified source is either `all_active_contacts` or `list_ids`, you can optionally choose to `exclude` specified contacts by `contact_id`. Use the activity link in the results to check the status of your request.\" For more use case information, see \"[Remove Tags from Contacts](/api_guide/remove_tagging_activity.html) * @summary Remove Tags from Contacts * @param {CreateTagRemoveActivityRequest} createTagRemoveActivityRequest The JSON payload used to create an asynchronous activity that removes tags from contacts meeting your specified contact filtering criteria. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BulkActivitiesApi */ public createTagRemoveActivity(createTagRemoveActivityRequest: CreateTagRemoveActivityRequest, options?: RawAxiosRequestConfig) { return BulkActivitiesApiFp(this.configuration).createTagRemoveActivity(createTagRemoveActivityRequest, options).then((request) => request(this.axios, this.basePath)); } /** * This endpoint returns an activity status report. * @summary GET an Activity Status * @param {string} activityId The unique ID of the activity to GET * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BulkActivitiesApi */ public getActivityById(activityId: string, options?: RawAxiosRequestConfig) { return BulkActivitiesApiFp(this.configuration).getActivityById(activityId, options).then((request) => request(this.axios, this.basePath)); } /** * This endpoint returns a collection of activities. Use the state query parameter to include only activities with a specific status (processing, completed, cancelled, failed, or time_out). Use the limit query parameter to define the number of activities returned per page. Learn [more](/api_guide/activity_status.html). * @summary GET Activity Status Collection * @param {number} [limit] Specifies the number of results displayed per page of output, from 1 - 500, default = 50. * @param {GetAllActivitiesStateEnum} [state] Use this parameter to filter the response to include only activities in one of the following states: cancelled, completed, failed, processing, or timed_out. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BulkActivitiesApi */ public getAllActivities(limit?: number, state?: GetAllActivitiesStateEnum, options?: RawAxiosRequestConfig) { return BulkActivitiesApiFp(this.configuration).getAllActivities(limit, state, options).then((request) => request(this.axios, this.basePath)); } /** * Use this endpoint to retrieve (GET) a CSV file containing exported contacts by providing the `activity_id` of a completed CSV export activity. * @summary Retrieve Exported Contacts File * @param {string} fileExportId The unique ID of the exported file provided in the results: section of the export contacts activity response. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BulkActivitiesApi */ public getCSVExportFile(fileExportId: string, options?: RawAxiosRequestConfig) { return BulkActivitiesApiFp(this.configuration).getCSVExportFile(fileExportId, options).then((request) => request(this.axios, this.basePath)); } /** * Use this endpoint to delete up to 100 custom fields for an account. * @summary Delete Custom Fields * @param {PostCustomFieldDeleteRequest} postCustomFieldDeleteRequest An array of `custom_field_id`\'s to delete. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BulkActivitiesApi */ public postCustomFieldDelete(postCustomFieldDeleteRequest: PostCustomFieldDeleteRequest, options?: RawAxiosRequestConfig) { return BulkActivitiesApiFp(this.configuration).postCustomFieldDelete(postCustomFieldDeleteRequest, options).then((request) => request(this.axios, this.basePath)); } } /** * @export */ export const GetAllActivitiesStateEnum = { Processing: 'processing', Completed: 'completed', Cancelled: 'cancelled', Failed: 'failed', TimedOut: 'timed_out' } as const; export type GetAllActivitiesStateEnum = typeof GetAllActivitiesStateEnum[keyof typeof GetAllActivitiesStateEnum];