UNPKG

ordercloud-javascript-sdk

Version:

The offical Javascript SDK for the Ordercloud ecommerce API

61 lines (60 loc) 4.05 kB
import { PromotionIntegration } from '../models/PromotionIntegration'; import { PartialDeep } from '../models/PartialDeep'; import { RequiredDeep } from '../models/RequiredDeep'; import { RequestOptions } from '../models/RequestOptions'; declare class PromotionIntegrations { private impersonating; /** * @ignore * not part of public api, don't include in generated docs */ constructor(); /** * Retrieve a promotion integration * Check out the {@link https://ordercloud.io/api-reference/integrations/promotion-integrations/get|api docs} for more info * * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ Get<TPromotionIntegration extends PromotionIntegration>(requestOptions?: RequestOptions): Promise<RequiredDeep<TPromotionIntegration>>; /** * Create or update a promotion integration If an object with the same ID already exists, it will be overwritten. * Check out the {@link https://ordercloud.io/api-reference/integrations/promotion-integrations/save|api docs} for more info * * @param promotionIntegration Required fields: HashKey * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ Save<TPromotionIntegration extends PromotionIntegration>(promotionIntegration: PromotionIntegration, requestOptions?: RequestOptions): Promise<RequiredDeep<TPromotionIntegration>>; /** * Delete a promotion integration * Check out the {@link https://ordercloud.io/api-reference/integrations/promotion-integrations/delete|api docs} for more info * * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ Delete(requestOptions?: RequestOptions): Promise<void>; /** * Partially update a promotion integration * Check out the {@link https://ordercloud.io/api-reference/integrations/promotion-integrations/patch|api docs} for more info * * @param promotionIntegration * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ Patch<TPromotionIntegration extends PromotionIntegration>(promotionIntegration: PartialDeep<PromotionIntegration>, requestOptions?: RequestOptions): Promise<RequiredDeep<TPromotionIntegration>>; /** * @description * enables impersonation by calling the subsequent method with the stored impersonation token * * @example * PromotionIntegrations.As().List() // lists PromotionIntegrations using the impersonated users' token */ As(): this; } declare const _default: PromotionIntegrations; export default _default;