import { BaseClient, ClientConfig, Response } from "@commerce-apps/core"; import type { CommonParameters } from "@commerce-apps/core"; import type { OperationOptions } from "retry"; import type { RequestInit } from "node-fetch"; import type { CompositeParameters, CustomRequestBody, QueryParameters, RequireParametersUnlessAllAreOptional } from "../../types"; import type { Campaign, CampaignSearchResult, PromotionCampaignAssignment, PromotionCampaignAssignmentRequest, PromotionCampaignAssignmentResult, PromotionCampaignAssignmentUpdate, SearchRequest } from '../models/index'; /** * [Campaigns](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=campaigns:Summary) * ================================== * * *[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/campaigns/campaigns-oas-v1-public.yaml) # API Overview Campaigns enable experiences based on an optional schedule and qualifying criteria. When an experience is assigned to a campaign, the schedule and qualifiers can only refine the containing campaign. A campaign is defined in the context of a site and is not shared among sites. A campaign can be enabled or disabled. A disabled campaign is inactive and not available to consumers. Enabled promotions contained within a disabled campaign are also inactive. ## Qualifiers Qualifiers are requirements that must be met to enable a campaign's experience. - Schedule: A start and end time and date. This can be open ended at one or both ends. - Coupon: A coupon - Customer Group: Membership in a customer group. - Source Code: A code attached to the site URL that identifies where the customer was redirected from. For more details, see [Qualifiers](https://help.salesforce.com/s/articleView?id=cc.b2c_qualifiers.htm&type=5) on the B2C Commerce documentation. ## Experiences Promotion: A monetary discount or bonus item. Promotions can have additional criteria such as quantity or number of products gating the discount. ## Authentication & Authorization The client requesting the campaign information must have access to the Campaign resource. For resource access, you must use a client ID and client secret from Account Manager to request an access token. The access token is used as a bearer token and added to the Authorization header of your API request. The client must first authenticate against Account Manager to log in. You must include the relevant scope(s) in the client ID used to generate the token. For details, see [Authorization Scopes Catalog.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/auth-z-scope-catalog.html) For detailed setup instructions, see [Authorization for Admin APIs](https://developer.salesforce.com/docs/commerce/commerce-api/guide/authorization-for-admin-apis.html). ## Use Cases ### Flash Sales Use single date promotions when you want to run a campaign for a short period of time. For example, a '20% Off Black Friday' campaign enables a 20% off promotion for registered customers on Black Friday. ### No Date or Time Restrictions You can also configure promotions with no time or date restrictions. This is useful when running coupon-coded promotions, or qualifier-based promotions that require certain criteria to be met. For example, a 'Free Shipping' campaign enables a free shipping promotion when the coupon code "freeship" is added to the cart. ### Redirections Use redirection promotions to trigger a promotion when a customer arrives at the storefront from a specific location. You may want to use this when partnering with other resources or running external advertisements. For example, all users directed from Facebook receive a free hat with purchase. For more information, see [Use Source Codes as Qualifiers](https://help.salesforce.com/s/articleView?id=cc.b2c_using_source_codesas_qualifiers.htm&type=5) in the B2C Commerce documentation. ## Related APIs - [Promotions (Admin)](https://developer.salesforce.com/docs/commerce/commerce-api/references/promotions?meta=Summary) — Manage promotions assigned to campaigns. - [Assignments](https://developer.salesforce.com/docs/commerce/commerce-api/references/assignments?meta=Summary) — Assign promotions and discounts to campaigns. - [Coupons](https://developer.salesforce.com/docs/commerce/commerce-api/references/coupons?meta=Summary) — Manage coupons used as campaign qualifiers.*
* * For instructions on how to retrieve access token for admin APIs: https://developer.salesforce.com/docs/commerce/commerce-api/guide/authorization-for-admin-apis.html

* Example with admin auth * * ```typescript * import { Campaigns, ClientConfig } from "commerce-sdk"; * // or * const { Campaigns, ClientConfig } = require("commerce-sdk"); * * const clientConfig: ClientConfig = { * parameters: { * clientId: "XXXXXX", * organizationId: "XXXX", * shortCode: "XXX", * siteId: "XX" * } * }; * * token = { access_token: 'INSERT_ACCESS_TOKEN_HERE' }; * * clientConfig.headers['authorization'] = `Bearer ${token.access_token}`; * const campaignsClient = new Campaigns(clientConfig); * ``` * * * API Version: 1.4.4
* Last Updated:
*
* */ export declare class Campaigns extends BaseClient { constructor(config: ClientConfig); /** * * * If you would like to get a raw Response object use the other assignPromotionToCampaign function. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.campaignId - The ID of the campaign. * @param options.parameters.promotionId - The ID of the promotion assigned to the campaign. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * * @returns A promise of type PromotionCampaignAssignment. */ assignPromotionToCampaign(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ campaignId: string; promotionId: string; organizationId: string; siteId: string; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: PromotionCampaignAssignmentRequest & CustomRequestBody; }>): Promise; /** * * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.campaignId - The ID of the campaign. * @param options.parameters.promotionId - The ID of the promotion assigned to the campaign. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * @param rawResponse - Set to true to return entire Response object instead of DTO. * * @returns A promise of type Response if rawResponse is true, a promise of type PromotionCampaignAssignment otherwise. */ assignPromotionToCampaign(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ campaignId: string; promotionId: string; organizationId: string; siteId: string; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: PromotionCampaignAssignmentRequest & CustomRequestBody; }>, rawResponse?: T): Promise; /** * ## Supported Query Attributes The query attribute specifies a complex query that you can use to narrow down the search. A subset of these attributes can optionally be used to sort the returned results. | Attribute | Type | Sortable | |-----------|--------|----------| | campaignId | String | yes | | description | String | yes | | enabled | Boolean | yes | | couponId | String | no | | customerGroup | String | no | | sourceCode | String | no | | startDate | Date | no | | endDate | Date | no | | lastModified | Date | no | These fields can only be used in queries as conjunctions (using `AND`). If the field is used in a disjunction (`OR`), an exception is thrown. * * If you would like to get a raw Response object use the other campaignsSearch function. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * * @returns A promise of type CampaignSearchResult. */ campaignsSearch(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; siteId: string; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: SearchRequest & CustomRequestBody; }>): Promise; /** * ## Supported Query Attributes The query attribute specifies a complex query that you can use to narrow down the search. A subset of these attributes can optionally be used to sort the returned results. | Attribute | Type | Sortable | |-----------|--------|----------| | campaignId | String | yes | | description | String | yes | | enabled | Boolean | yes | | couponId | String | no | | customerGroup | String | no | | sourceCode | String | no | | startDate | Date | no | | endDate | Date | no | | lastModified | Date | no | These fields can only be used in queries as conjunctions (using `AND`). If the field is used in a disjunction (`OR`), an exception is thrown. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * @param rawResponse - Set to true to return entire Response object instead of DTO. * * @returns A promise of type Response if rawResponse is true, a promise of type CampaignSearchResult otherwise. */ campaignsSearch(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; siteId: string; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: SearchRequest & CustomRequestBody; }>, rawResponse?: T): Promise; /** * * * If you would like to get a raw Response object use the other createCampaign function. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.campaignId - The ID of the campaign. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * * @returns A promise of type Campaign. */ createCampaign(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ campaignId: string; organizationId: string; siteId: string; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: Campaign & CustomRequestBody; }>): Promise; /** * * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.campaignId - The ID of the campaign. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * @param rawResponse - Set to true to return entire Response object instead of DTO. * * @returns A promise of type Response if rawResponse is true, a promise of type Campaign otherwise. */ createCampaign(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ campaignId: string; organizationId: string; siteId: string; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: Campaign & CustomRequestBody; }>, rawResponse?: T): Promise; /** * * * If you would like to get a raw Response object use the other deleteCampaign function. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.campaignId - The ID of the campaign. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * * @returns A promise of type void. */ deleteCampaign(options?: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ campaignId: string; organizationId: string; siteId: string; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; }>): Promise; /** * * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.campaignId - The ID of the campaign. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param rawResponse - Set to true to return entire Response object instead of DTO. * * @returns A promise of type Response if rawResponse is true, a promise of type void otherwise. */ deleteCampaign(options?: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ campaignId: string; organizationId: string; siteId: string; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; }>, rawResponse?: T): Promise; /** * * * If you would like to get a raw Response object use the other getCampaign function. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.campaignId - The ID of the campaign. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * * @returns A promise of type Campaign. */ getCampaign(options?: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ campaignId: string; organizationId: string; siteId: string; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; }>): Promise; /** * * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.campaignId - The ID of the campaign. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param rawResponse - Set to true to return entire Response object instead of DTO. * * @returns A promise of type Response if rawResponse is true, a promise of type Campaign otherwise. */ getCampaign(options?: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ campaignId: string; organizationId: string; siteId: string; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; }>, rawResponse?: T): Promise; /** * * * If you would like to get a raw Response object use the other getCampaignPromotionAssignment function. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.campaignId - The ID of the campaign. * @param options.parameters.promotionId - The ID of the promotion assigned to the campaign. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * * @returns A promise of type PromotionCampaignAssignment. */ getCampaignPromotionAssignment(options?: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ campaignId: string; promotionId: string; organizationId: string; siteId: string; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; }>): Promise; /** * * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.campaignId - The ID of the campaign. * @param options.parameters.promotionId - The ID of the promotion assigned to the campaign. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param rawResponse - Set to true to return entire Response object instead of DTO. * * @returns A promise of type Response if rawResponse is true, a promise of type PromotionCampaignAssignment otherwise. */ getCampaignPromotionAssignment(options?: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ campaignId: string; promotionId: string; organizationId: string; siteId: string; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; }>, rawResponse?: T): Promise; /** * * * If you would like to get a raw Response object use the other getCampaignPromotionAssignments function. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.campaignId - The ID of the campaign. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * * @returns A promise of type PromotionCampaignAssignmentResult. */ getCampaignPromotionAssignments(options?: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ campaignId: string; organizationId: string; siteId: string; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; }>): Promise; /** * * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.campaignId - The ID of the campaign. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param rawResponse - Set to true to return entire Response object instead of DTO. * * @returns A promise of type Response if rawResponse is true, a promise of type PromotionCampaignAssignmentResult otherwise. */ getCampaignPromotionAssignments(options?: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ campaignId: string; organizationId: string; siteId: string; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; }>, rawResponse?: T): Promise; /** * * * If you would like to get a raw Response object use the other unassignPromotionFromCampaign function. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.campaignId - The ID of the campaign. * @param options.parameters.promotionId - The ID of the promotion assigned to the campaign. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * * @returns A promise of type void. */ unassignPromotionFromCampaign(options?: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ campaignId: string; promotionId: string; organizationId: string; siteId: string; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; }>): Promise; /** * * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.campaignId - The ID of the campaign. * @param options.parameters.promotionId - The ID of the promotion assigned to the campaign. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param rawResponse - Set to true to return entire Response object instead of DTO. * * @returns A promise of type Response if rawResponse is true, a promise of type void otherwise. */ unassignPromotionFromCampaign(options?: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ campaignId: string; promotionId: string; organizationId: string; siteId: string; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; }>, rawResponse?: T): Promise; /** * * * If you would like to get a raw Response object use the other updateCampaign function. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.campaignId - The ID of the campaign. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * * @returns A promise of type Campaign. */ updateCampaign(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ campaignId: string; organizationId: string; siteId: string; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: Campaign & CustomRequestBody; }>): Promise; /** * * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.campaignId - The ID of the campaign. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * @param rawResponse - Set to true to return entire Response object instead of DTO. * * @returns A promise of type Response if rawResponse is true, a promise of type Campaign otherwise. */ updateCampaign(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ campaignId: string; organizationId: string; siteId: string; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: Campaign & CustomRequestBody; }>, rawResponse?: T): Promise; /** * * * If you would like to get a raw Response object use the other updateCampaignPromotionAssignment function. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.campaignId - The ID of the campaign. * @param options.parameters.promotionId - The ID of the promotion assigned to the campaign. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * * @returns A promise of type PromotionCampaignAssignment. */ updateCampaignPromotionAssignment(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ campaignId: string; promotionId: string; organizationId: string; siteId: string; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: PromotionCampaignAssignmentUpdate & CustomRequestBody; }>): Promise; /** * * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.campaignId - The ID of the campaign. * @param options.parameters.promotionId - The ID of the promotion assigned to the campaign. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * @param rawResponse - Set to true to return entire Response object instead of DTO. * * @returns A promise of type Response if rawResponse is true, a promise of type PromotionCampaignAssignment otherwise. */ updateCampaignPromotionAssignment(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ campaignId: string; promotionId: string; organizationId: string; siteId: string; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: PromotionCampaignAssignmentUpdate & CustomRequestBody; }>, rawResponse?: T): Promise; }