@datocms/cma-client
Version:
JS client for DatoCMS REST Content Management API
119 lines (118 loc) • 4.75 kB
TypeScript
import BaseResource from '../../BaseResource';
import type * as SchemaTypes from '../SchemaTypes';
import type * as SimpleSchemaTypes from '../SimpleSchemaTypes';
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: SimpleSchemaTypes.UploadCollectionCreateSchema): Promise<SimpleSchemaTypes.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: SchemaTypes.UploadCollectionCreateSchema): Promise<SchemaTypes.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 | SimpleSchemaTypes.UploadCollectionData, body: SimpleSchemaTypes.UploadCollectionUpdateSchema): Promise<SimpleSchemaTypes.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: SchemaTypes.UploadCollectionUpdateSchema): Promise<SchemaTypes.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?: SimpleSchemaTypes.UploadCollectionInstancesHrefSchema): Promise<SimpleSchemaTypes.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?: SchemaTypes.UploadCollectionInstancesHrefSchema): Promise<SchemaTypes.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 | SimpleSchemaTypes.UploadCollectionData): Promise<SimpleSchemaTypes.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<SchemaTypes.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 | SimpleSchemaTypes.UploadCollectionData): Promise<SimpleSchemaTypes.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<SchemaTypes.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: SimpleSchemaTypes.UploadCollectionReorderSchema): Promise<SimpleSchemaTypes.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: SchemaTypes.UploadCollectionReorderSchema): Promise<SchemaTypes.UploadCollectionReorderJobSchema>;
}