UNPKG

@datocms/cma-client

Version:
119 lines (118 loc) 4.62 kB
import BaseResource from '../../BaseResource'; import type * as ApiTypes from '../ApiTypes'; import type * as RawApiTypes from '../RawApiTypes'; export default class UploadCollection extends BaseResource { static readonly TYPE: "upload_collection"; /** * Create a new upload collection * * Read more: https://www.datocms.com/docs/content-management-api/resources/upload-collection/create * * @throws {ApiError} * @throws {TimeoutError} */ create(body: ApiTypes.UploadCollectionCreateSchema): Promise<ApiTypes.UploadCollection>; /** * Create a new upload collection * * Read more: https://www.datocms.com/docs/content-management-api/resources/upload-collection/create * * @throws {ApiError} * @throws {TimeoutError} */ rawCreate(body: RawApiTypes.UploadCollectionCreateSchema): Promise<RawApiTypes.UploadCollectionCreateTargetSchema>; /** * Update a upload collection * * Read more: https://www.datocms.com/docs/content-management-api/resources/upload-collection/update * * @throws {ApiError} * @throws {TimeoutError} */ update(uploadCollectionId: string | ApiTypes.UploadCollectionData, body: ApiTypes.UploadCollectionUpdateSchema): Promise<ApiTypes.UploadCollection>; /** * Update a upload collection * * Read more: https://www.datocms.com/docs/content-management-api/resources/upload-collection/update * * @throws {ApiError} * @throws {TimeoutError} */ rawUpdate(uploadCollectionId: string, body: RawApiTypes.UploadCollectionUpdateSchema): Promise<RawApiTypes.UploadCollectionUpdateTargetSchema>; /** * List all upload collections * * Read more: https://www.datocms.com/docs/content-management-api/resources/upload-collection/instances * * @throws {ApiError} * @throws {TimeoutError} */ list(queryParams?: ApiTypes.UploadCollectionInstancesHrefSchema): Promise<ApiTypes.UploadCollectionInstancesTargetSchema>; /** * List all upload collections * * Read more: https://www.datocms.com/docs/content-management-api/resources/upload-collection/instances * * @throws {ApiError} * @throws {TimeoutError} */ rawList(queryParams?: RawApiTypes.UploadCollectionInstancesHrefSchema): Promise<RawApiTypes.UploadCollectionInstancesTargetSchema>; /** * Retrieve a upload collection * * Read more: https://www.datocms.com/docs/content-management-api/resources/upload-collection/self * * @throws {ApiError} * @throws {TimeoutError} */ find(uploadCollectionId: string | ApiTypes.UploadCollectionData): Promise<ApiTypes.UploadCollection>; /** * Retrieve a upload collection * * Read more: https://www.datocms.com/docs/content-management-api/resources/upload-collection/self * * @throws {ApiError} * @throws {TimeoutError} */ rawFind(uploadCollectionId: string): Promise<RawApiTypes.UploadCollectionSelfTargetSchema>; /** * Delete a upload collection * * Read more: https://www.datocms.com/docs/content-management-api/resources/upload-collection/destroy * * @throws {ApiError} * @throws {TimeoutError} */ destroy(uploadCollectionId: string | ApiTypes.UploadCollectionData): Promise<ApiTypes.UploadCollection>; /** * Delete a upload collection * * Read more: https://www.datocms.com/docs/content-management-api/resources/upload-collection/destroy * * @throws {ApiError} * @throws {TimeoutError} */ rawDestroy(uploadCollectionId: string): Promise<RawApiTypes.UploadCollectionDestroyTargetSchema>; /** * Reorders a set of upload collections * * Read more: https://www.datocms.com/docs/content-management-api/resources/upload-collection/reorder * * @throws {ApiError} * @throws {TimeoutError} * * @deprecated This API call is to be considered private and might change without notice */ reorder(body: ApiTypes.UploadCollectionReorderSchema): Promise<ApiTypes.UploadCollectionReorderJobSchema>; /** * Reorders a set of upload collections * * Read more: https://www.datocms.com/docs/content-management-api/resources/upload-collection/reorder * * @throws {ApiError} * @throws {TimeoutError} * * @deprecated This API call is to be considered private and might change without notice */ rawReorder(body: RawApiTypes.UploadCollectionReorderSchema): Promise<RawApiTypes.UploadCollectionReorderJobSchema>; }