UNPKG

ordercloud-javascript-sdk

Version:

The offical Javascript SDK for the Ordercloud ecommerce API

72 lines (71 loc) 4.82 kB
import { ProductSyncConfig } from '../models/ProductSyncConfig'; import { SyncProduct } from '../models/SyncProduct'; import { PartialDeep } from '../models/PartialDeep'; import { RequiredDeep } from '../models/RequiredDeep'; import { RequestOptions } from '../models/RequestOptions'; declare class ProductSynchronization { private impersonating; /** * @ignore * not part of public api, don't include in generated docs */ constructor(); /** * Retrieve a product sync * Check out the {@link https://ordercloud.io/api-reference/integrations/product-synchronization/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<TProductSyncConfig extends ProductSyncConfig>(requestOptions?: RequestOptions): Promise<RequiredDeep<TProductSyncConfig>>; /** * Create or update a product sync If an object with the same ID already exists, it will be overwritten. * Check out the {@link https://ordercloud.io/api-reference/integrations/product-synchronization/save|api docs} for more info * * @param productSyncConfig Required fields: SyncProductChanged, SyncProductDeleted, DeliveryConfigID * @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<TProductSyncConfig extends ProductSyncConfig>(productSyncConfig: ProductSyncConfig, requestOptions?: RequestOptions): Promise<RequiredDeep<TProductSyncConfig>>; /** * Delete a product sync * Check out the {@link https://ordercloud.io/api-reference/integrations/product-synchronization/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 product sync * Check out the {@link https://ordercloud.io/api-reference/integrations/product-synchronization/patch|api docs} for more info * * @param productSyncConfig * @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<TProductSyncConfig extends ProductSyncConfig>(productSyncConfig: PartialDeep<ProductSyncConfig>, requestOptions?: RequestOptions): Promise<RequiredDeep<TProductSyncConfig>>; /** * Sync a product * Check out the {@link https://ordercloud.io/api-reference/integrations/product-synchronization/sync|api docs} for more info * * @param syncProduct Required fields: ProductID * @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. */ Sync(syncProduct: SyncProduct, requestOptions?: RequestOptions): Promise<void>; /** * @description * enables impersonation by calling the subsequent method with the stored impersonation token * * @example * ProductSynchronization.As().List() // lists ProductSynchronization using the impersonated users' token */ As(): this; } declare const _default: ProductSynchronization; export default _default;