import { ListPage } from '../models/ListPage'; import { Searchable } from '../models/Searchable'; import { Sortable } from '../models/Sortable'; import { Filters } from '../models/Filters'; import { Category } from '../models/Category'; import { CategoryAssignment } from '../models/CategoryAssignment'; import { PartyType } from '../models/PartyType'; import { CategoryProductAssignment } from '../models/CategoryProductAssignment'; import { PartialDeep } from '../models/PartialDeep'; import { RequiredDeep } from '../models/RequiredDeep'; import { RequestOptions } from '../models/RequestOptions'; declare class Categories { private impersonating; /** * @ignore * not part of public api, don't include in generated docs */ constructor(); /** * Get a list of categories. * Check out the {@link https://ordercloud.io/api-reference/product-catalogs/categories/list|api docs} for more info * * @param catalogID ID of the catalog. * @param listOptions.depth Depth of the category. * @param listOptions.search Word or phrase to search for. * @param listOptions.searchOn Comma-delimited list of fields to search on. * @param listOptions.sortBy Comma-delimited list of fields to sort by. * @param listOptions.page Page of results to return. Default: 1. When paginating through many items (> page 30), we recommend the "Last ID" method, as outlined in the Advanced Querying documentation. * @param listOptions.pageSize Number of results to return per page. Default: 20, max: 100. * @param listOptions.filters An object or dictionary representing key/value pairs to apply as filters. Valid keys are top-level properties of the returned model or 'xp.???' * @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. */ List(catalogID: string, listOptions?: { depth?: string; search?: string; searchOn?: Searchable<'Categories.List'>; sortBy?: Sortable<'Categories.List'>; page?: number; pageSize?: number; filters?: Filters; }, requestOptions?: RequestOptions): Promise>>; /** * Create a new category. If ID is provided and an object with that ID already exists, a 409 (conflict) error is returned. * Check out the {@link https://ordercloud.io/api-reference/product-catalogs/categories/create|api docs} for more info * * @param catalogID ID of the catalog. * @param category Required fields: Name * @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. */ Create(catalogID: string, category: Category, requestOptions?: RequestOptions): Promise>; /** * Get a single category. * Check out the {@link https://ordercloud.io/api-reference/product-catalogs/categories/get|api docs} for more info * * @param catalogID ID of the catalog. * @param categoryID ID of the category. * @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(catalogID: string, categoryID: string, requestOptions?: RequestOptions): Promise>; /** * Create or update a category. If an object with the same ID already exists, it will be overwritten. * Check out the {@link https://ordercloud.io/api-reference/product-catalogs/categories/save|api docs} for more info * * @param catalogID ID of the catalog. * @param categoryID ID of the category. * @param category Required fields: Name * @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(catalogID: string, categoryID: string, category: Category, requestOptions?: RequestOptions): Promise>; /** * Delete a category. Deleting a parent category will also delete all of that category's children. * Check out the {@link https://ordercloud.io/api-reference/product-catalogs/categories/delete|api docs} for more info * * @param catalogID ID of the catalog. * @param categoryID ID of the category. * @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(catalogID: string, categoryID: string, requestOptions?: RequestOptions): Promise; /** * Partially update a category. * Check out the {@link https://ordercloud.io/api-reference/product-catalogs/categories/patch|api docs} for more info * * @param catalogID ID of the catalog. * @param categoryID ID of the category. * @param category * @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(catalogID: string, categoryID: string, category: PartialDeep, requestOptions?: RequestOptions): Promise>; /** * Delete a category assignment. * Check out the {@link https://ordercloud.io/api-reference/product-catalogs/categories/delete-assignment|api docs} for more info * * @param catalogID ID of the catalog. * @param categoryID ID of the category. * @param listOptions.buyerID ID of the buyer. * @param listOptions.userID ID of the user. * @param listOptions.userGroupID ID of the user group. * @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. */ DeleteAssignment(catalogID: string, categoryID: string, listOptions?: { buyerID?: string; userID?: string; userGroupID?: string; }, requestOptions?: RequestOptions): Promise; /** * Delete a category product assignment. * Check out the {@link https://ordercloud.io/api-reference/product-catalogs/categories/delete-product-assignment|api docs} for more info * * @param catalogID ID of the catalog. * @param categoryID ID of the category. * @param productID ID of the product. * @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. */ DeleteProductAssignment(catalogID: string, categoryID: string, productID: string, requestOptions?: RequestOptions): Promise; /** * Get a list of category assignments. * Check out the {@link https://ordercloud.io/api-reference/product-catalogs/categories/list-assignments|api docs} for more info * * @param catalogID ID of the catalog. * @param listOptions.categoryID ID of the category. * @param listOptions.buyerID ID of the buyer. * @param listOptions.userID ID of the user. * @param listOptions.userGroupID ID of the user group. * @param listOptions.level Level of the category assignment. Possible values: User, Group, Company. * @param listOptions.page Page of results to return. Default: 1. When paginating through many items (> page 30), we recommend the "Last ID" method, as outlined in the Advanced Querying documentation. * @param listOptions.pageSize Number of results to return per page. Default: 20, max: 100. * @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. */ ListAssignments(catalogID: string, listOptions?: { categoryID?: string; buyerID?: string; userID?: string; userGroupID?: string; level?: PartyType; page?: number; pageSize?: number; }, requestOptions?: RequestOptions): Promise>>; /** * Create or update a category assignment. * Check out the {@link https://ordercloud.io/api-reference/product-catalogs/categories/save-assignment|api docs} for more info * * @param catalogID ID of the catalog. * @param categoryAssignment Required fields: CategoryID, BuyerID * @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. */ SaveAssignment(catalogID: string, categoryAssignment: CategoryAssignment, requestOptions?: RequestOptions): Promise; /** * Get a list of category product assignments. * Check out the {@link https://ordercloud.io/api-reference/product-catalogs/categories/list-product-assignments|api docs} for more info * * @param catalogID ID of the catalog. * @param listOptions.categoryID ID of the category. * @param listOptions.productID ID of the product. * @param listOptions.page Page of results to return. Default: 1. When paginating through many items (> page 30), we recommend the "Last ID" method, as outlined in the Advanced Querying documentation. * @param listOptions.pageSize Number of results to return per page. Default: 20, max: 100. * @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. */ ListProductAssignments(catalogID: string, listOptions?: { categoryID?: string; productID?: string; page?: number; pageSize?: number; }, requestOptions?: RequestOptions): Promise>>; /** * Create or update a category product assignment. * Check out the {@link https://ordercloud.io/api-reference/product-catalogs/categories/save-product-assignment|api docs} for more info * * @param catalogID ID of the catalog. * @param categoryProductAssignment Required fields: CategoryID, 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. */ SaveProductAssignment(catalogID: string, categoryProductAssignment: CategoryProductAssignment, requestOptions?: RequestOptions): Promise; /** * @description * enables impersonation by calling the subsequent method with the stored impersonation token * * @example * Categories.As().List() // lists Categories using the impersonated users' token */ As(): this; } declare const _default: Categories; export default _default;