UNPKG

@datocms/cma-client

Version:
115 lines (114 loc) 4.15 kB
import BaseResource from '../../BaseResource'; import type * as ApiTypes from '../ApiTypes'; import type * as RawApiTypes from '../RawApiTypes'; export default class Environment extends BaseResource { static readonly TYPE: "environment"; /** * Fork an existing environment * * Read more: https://www.datocms.com/docs/content-management-api/resources/environment/fork * * @throws {ApiError} * @throws {TimeoutError} */ fork(environmentId: string | ApiTypes.EnvironmentData, body: ApiTypes.EnvironmentForkSchema, queryParams?: ApiTypes.EnvironmentForkHrefSchema): Promise<ApiTypes.Environment>; /** * Fork an existing environment * * Read more: https://www.datocms.com/docs/content-management-api/resources/environment/fork * * @throws {ApiError} * @throws {TimeoutError} */ rawFork(environmentId: string, body: RawApiTypes.EnvironmentForkSchema, queryParams?: RawApiTypes.EnvironmentForkHrefSchema): Promise<RawApiTypes.EnvironmentForkJobSchema>; /** * Promote an environment to primary * * Read more: https://www.datocms.com/docs/content-management-api/resources/environment/promote * * @throws {ApiError} * @throws {TimeoutError} */ promote(environmentId: string | ApiTypes.EnvironmentData): Promise<ApiTypes.Environment>; /** * Promote an environment to primary * * Read more: https://www.datocms.com/docs/content-management-api/resources/environment/promote * * @throws {ApiError} * @throws {TimeoutError} */ rawPromote(environmentId: string): Promise<RawApiTypes.EnvironmentPromoteTargetSchema>; /** * Rename an environment * * Read more: https://www.datocms.com/docs/content-management-api/resources/environment/rename * * @throws {ApiError} * @throws {TimeoutError} */ rename(environmentId: string | ApiTypes.EnvironmentData, body: ApiTypes.EnvironmentRenameSchema): Promise<ApiTypes.Environment>; /** * Rename an environment * * Read more: https://www.datocms.com/docs/content-management-api/resources/environment/rename * * @throws {ApiError} * @throws {TimeoutError} */ rawRename(environmentId: string, body: RawApiTypes.EnvironmentRenameSchema): Promise<RawApiTypes.EnvironmentRenameTargetSchema>; /** * List all environments * * Read more: https://www.datocms.com/docs/content-management-api/resources/environment/instances * * @throws {ApiError} * @throws {TimeoutError} */ list(): Promise<ApiTypes.EnvironmentInstancesTargetSchema>; /** * List all environments * * Read more: https://www.datocms.com/docs/content-management-api/resources/environment/instances * * @throws {ApiError} * @throws {TimeoutError} */ rawList(): Promise<RawApiTypes.EnvironmentInstancesTargetSchema>; /** * Retrieve a environment * * Read more: https://www.datocms.com/docs/content-management-api/resources/environment/self * * @throws {ApiError} * @throws {TimeoutError} */ find(environmentId: string | ApiTypes.EnvironmentData): Promise<ApiTypes.Environment>; /** * Retrieve a environment * * Read more: https://www.datocms.com/docs/content-management-api/resources/environment/self * * @throws {ApiError} * @throws {TimeoutError} */ rawFind(environmentId: string): Promise<RawApiTypes.EnvironmentSelfTargetSchema>; /** * Delete a environment * * Read more: https://www.datocms.com/docs/content-management-api/resources/environment/destroy * * @throws {ApiError} * @throws {TimeoutError} */ destroy(environmentId: string | ApiTypes.EnvironmentData): Promise<ApiTypes.Environment>; /** * Delete a environment * * Read more: https://www.datocms.com/docs/content-management-api/resources/environment/destroy * * @throws {ApiError} * @throws {TimeoutError} */ rawDestroy(environmentId: string): Promise<RawApiTypes.EnvironmentDestroyJobSchema>; }