@datocms/cma-client
Version:
JS client for DatoCMS REST Content Management API
144 lines (143 loc) • 5.36 kB
TypeScript
import BaseResource from '../../BaseResource';
import type * as ApiTypes from '../ApiTypes';
import type * as RawApiTypes from '../RawApiTypes';
export default class ItemType extends BaseResource {
static readonly TYPE: "item_type";
/**
* Create a new model/block model
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/create
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
create(body: ApiTypes.ItemTypeCreateSchema, queryParams?: ApiTypes.ItemTypeCreateHrefSchema): Promise<ApiTypes.ItemType>;
/**
* Create a new model/block model
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/create
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
rawCreate(body: RawApiTypes.ItemTypeCreateSchema, queryParams?: RawApiTypes.ItemTypeCreateHrefSchema): Promise<RawApiTypes.ItemTypeCreateTargetSchema>;
/**
* Update a model/block model
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/update
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
update(itemTypeId: string | ApiTypes.ItemTypeData, body: ApiTypes.ItemTypeUpdateSchema): Promise<ApiTypes.ItemType>;
/**
* Update a model/block model
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/update
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
rawUpdate(itemTypeId: string, body: RawApiTypes.ItemTypeUpdateSchema): Promise<RawApiTypes.ItemTypeUpdateJobSchema>;
/**
* List all models/block models
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/instances
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
list(): Promise<ApiTypes.ItemTypeInstancesTargetSchema>;
/**
* List all models/block models
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/instances
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
rawList(): Promise<RawApiTypes.ItemTypeInstancesTargetSchema>;
/**
* Retrieve a model/block model
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/self
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
find(itemTypeId: string | ApiTypes.ItemTypeData): Promise<ApiTypes.ItemType>;
/**
* Retrieve a model/block model
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/self
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
rawFind(itemTypeId: string): Promise<RawApiTypes.ItemTypeSelfTargetSchema>;
/**
* Duplicate model/block model
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/duplicate
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
duplicate(itemTypeId: string | ApiTypes.ItemTypeData): Promise<ApiTypes.ItemType>;
/**
* Duplicate model/block model
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/duplicate
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
rawDuplicate(itemTypeId: string): Promise<RawApiTypes.ItemTypeDuplicateTargetSchema>;
/**
* Delete a model/block model
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/destroy
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
destroy(itemTypeId: string | ApiTypes.ItemTypeData, queryParams?: ApiTypes.ItemTypeDestroyHrefSchema): Promise<ApiTypes.ItemType>;
/**
* Delete a model/block model
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/destroy
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
rawDestroy(itemTypeId: string, queryParams?: RawApiTypes.ItemTypeDestroyHrefSchema): Promise<RawApiTypes.ItemTypeDestroyJobSchema>;
/**
* List models referencing another model/block
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/referencing
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
referencing(itemTypeId: string | ApiTypes.ItemTypeData): Promise<ApiTypes.ItemTypeReferencingTargetSchema>;
/**
* List models referencing another model/block
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/referencing
*
* @throws {ApiError}
* @throws {TimeoutError}
*/
rawReferencing(itemTypeId: string): Promise<RawApiTypes.ItemTypeReferencingTargetSchema>;
/**
* Reorders a set of fields and fieldsets within the model
*
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/reorder_fields_and_fieldsets
*
* @throws {ApiError}
* @throws {TimeoutError}
*
* @deprecated This API call is to be considered private and might change without notice
*/
rawReorderFieldsAndFieldsets(itemTypeId: string, body: RawApiTypes.ItemTypeReorderFieldsAndFieldsetsSchema): Promise<RawApiTypes.ItemTypeReorderFieldsAndFieldsetsJobSchema>;
}