@datocms/cma-client
Version:
JS client for DatoCMS REST Content Management API
232 lines (231 loc) • 9.05 kB
TypeScript
import * as Utils from '@datocms/rest-client-utils';
import BaseResource from '../../BaseResource';
import type * as SchemaTypes from '../SchemaTypes';
import type * as SimpleSchemaTypes from '../SimpleSchemaTypes';
export default class Upload extends BaseResource {
static readonly TYPE: "upload";
/**
* Create a new upload
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload/create
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
create(body: SimpleSchemaTypes.UploadCreateSchema): Promise<SimpleSchemaTypes.Upload>;
/**
* Create a new upload
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload/create
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
rawCreate(body: SchemaTypes.UploadCreateSchema): Promise<SchemaTypes.UploadCreateJobSchema>;
/**
* List all uploads
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload/instances
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
list(queryParams?: SimpleSchemaTypes.UploadInstancesHrefSchema): Promise<SimpleSchemaTypes.UploadInstancesTargetSchema>;
/**
* List all uploads
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload/instances
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
rawList(queryParams?: SchemaTypes.UploadInstancesHrefSchema): Promise<SchemaTypes.UploadInstancesTargetSchema>;
/**
* Async iterator to auto-paginate over elements returned by list()
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload/instances
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
listPagedIterator(queryParams?: Utils.OmitFromKnownKeys<SimpleSchemaTypes.UploadInstancesHrefSchema, 'page'>, iteratorOptions?: Utils.IteratorOptions): AsyncGenerator<SimpleSchemaTypes.Upload, void, unknown>;
/**
* Async iterator to auto-paginate over elements returned by rawList()
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload/instances
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
rawListPagedIterator(queryParams?: Utils.OmitFromKnownKeys<SchemaTypes.UploadInstancesHrefSchema, 'page'>, iteratorOptions?: Utils.IteratorOptions): AsyncGenerator<SchemaTypes.Upload, void, unknown>;
/**
* Retrieve an upload
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload/self
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
find(uploadId: string | SimpleSchemaTypes.UploadData): Promise<SimpleSchemaTypes.Upload>;
/**
* Retrieve an upload
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload/self
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
rawFind(uploadId: string): Promise<SchemaTypes.UploadSelfTargetSchema>;
/**
* Delete an upload
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload/destroy
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
destroy(uploadId: string | SimpleSchemaTypes.UploadData): Promise<SimpleSchemaTypes.Upload>;
/**
* Delete an upload
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload/destroy
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
rawDestroy(uploadId: string): Promise<SchemaTypes.UploadDestroyTargetSchema>;
/**
* Update an upload
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload/update
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
update(uploadId: string | SimpleSchemaTypes.UploadData, body: SimpleSchemaTypes.UploadUpdateSchema): Promise<SimpleSchemaTypes.Upload>;
/**
* Update an upload
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload/update
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
rawUpdate(uploadId: string, body: SchemaTypes.UploadUpdateSchema): Promise<SchemaTypes.UploadUpdateJobSchema>;
/**
* Batch add tags to uploads
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload/batch_add_tags
*
* @throws {ApiError}
* @throws {TimeoutError}
*
* @deprecated This API call is to be considered private and might change without notice
*/
batchAddTags(body: SimpleSchemaTypes.UploadBatchAddTagsSchema, queryParams?: SimpleSchemaTypes.UploadBatchAddTagsHrefSchema): Promise<SimpleSchemaTypes.UploadBatchAddTagsJobSchema>;
/**
* Batch add tags to uploads
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload/batch_add_tags
*
* @throws {ApiError}
* @throws {TimeoutError}
*
* @deprecated This API call is to be considered private and might change without notice
*/
rawBatchAddTags(body: SchemaTypes.UploadBatchAddTagsSchema, queryParams?: SchemaTypes.UploadBatchAddTagsHrefSchema): Promise<SchemaTypes.UploadBatchAddTagsJobSchema>;
/**
* Delete multiple uploads
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload/batch_destroy
*
* @throws {ApiError}
* @throws {TimeoutError}
*
* @deprecated This API call is to be considered private and might change without notice
*/
batchDestroy(queryParams?: SimpleSchemaTypes.UploadBatchDestroyHrefSchema): Promise<SimpleSchemaTypes.UploadBatchDestroyJobSchema>;
/**
* Delete multiple uploads
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload/batch_destroy
*
* @throws {ApiError}
* @throws {TimeoutError}
*
* @deprecated This API call is to be considered private and might change without notice
*/
rawBatchDestroy(queryParams?: SchemaTypes.UploadBatchDestroyHrefSchema): Promise<SchemaTypes.UploadBatchDestroyJobSchema>;
/**
* Referenced records
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload/references
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
references(uploadId: string | SimpleSchemaTypes.UploadData, queryParams?: SimpleSchemaTypes.UploadReferencesHrefSchema): Promise<SimpleSchemaTypes.UploadReferencesTargetSchema>;
/**
* Referenced records
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload/references
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
rawReferences(uploadId: string, queryParams?: SchemaTypes.UploadReferencesHrefSchema): Promise<SchemaTypes.UploadReferencesTargetSchema>;
/**
* Add tags to assets in bulk
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload/bulk_tag
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
bulkTag(body: SimpleSchemaTypes.UploadBulkTagSchema): Promise<SimpleSchemaTypes.UploadBulkTagJobSchema>;
/**
* Add tags to assets in bulk
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload/bulk_tag
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
rawBulkTag(body: SchemaTypes.UploadBulkTagSchema): Promise<SchemaTypes.UploadBulkTagJobSchema>;
/**
* Put assets into a collection in bulk
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload/bulk_set_upload_collection
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
bulkSetUploadCollection(body: SimpleSchemaTypes.UploadBulkSetUploadCollectionSchema): Promise<SimpleSchemaTypes.UploadBulkSetUploadCollectionJobSchema>;
/**
* Put assets into a collection in bulk
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload/bulk_set_upload_collection
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
rawBulkSetUploadCollection(body: SchemaTypes.UploadBulkSetUploadCollectionSchema): Promise<SchemaTypes.UploadBulkSetUploadCollectionJobSchema>;
/**
* Destroy uploads
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload/bulk_destroy
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
bulkDestroy(body: SimpleSchemaTypes.UploadBulkDestroySchema): Promise<SimpleSchemaTypes.UploadBulkDestroyJobSchema>;
/**
* Destroy uploads
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/upload/bulk_destroy
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
rawBulkDestroy(body: SchemaTypes.UploadBulkDestroySchema): Promise<SchemaTypes.UploadBulkDestroyJobSchema>;
}