import type { RawAxiosRequestHeaders } from 'axios'; import type { CollectionProp, GetSpaceEnvironmentParams, GetSpaceParams, PaginationQueryParams } from '../../common-types'; import type { CreateEnvironmentProps, EnvironmentProps } from '../../entities/environment'; import type { OptionalDefaults } from '../wrappers/wrap'; export type EnvironmentPlainClientAPI = { /** * Fetch an environment * @param params a space and environment id * @returns the environment * @throws if the environment does not exist * @example * ```javascript * const environment = await client.environment.get({ * spaceId: '', * environmentId: '' * }) * ``` */ get(params: OptionalDefaults): Promise; /** * Fetch all environments in a space * @param params a space Id and optional pagination parameters * @returns a collection of environments * @throws if the space does not exist * @example * ```javascript * const environments = await client.environment.getMany({ * spaceId: '' * }) * ``` */ getMany(params: OptionalDefaults): Promise>; /** * Create an environment * @param params a space ID to create the environment in * @param rawData the environment metadata * @param headers optional custom headers * @returns the created environment * @throws if the space does not exist, or `rawData` is invalid * @example * ```javascript * const environment = await client.environment.create( * { * spaceId: '' * }, * { * name: 'new-env' * } * ) * ``` */ create(params: OptionalDefaults, rawData: Partial>, headers?: RawAxiosRequestHeaders): Promise; /** * Create an environment with a specific ID * @param params a space ID to create the environment in * @param rawData the environment metadata * @param headers optional custom headers * @returns the created environment * @throws if the space does not exist, or `rawData` is invalid * @example * ```javascript * const environment = await client.environment.createWithId( * { * spaceId: '', * environmentId: '' * }, * { * name: 'new-env' * } * ) * ``` */ createWithId(params: OptionalDefaults, rawData: CreateEnvironmentProps, headers?: RawAxiosRequestHeaders): Promise; /** * Update an environment * @param params a space and environment id * @param rawData the environment metadata * @param headers optional custom headers * @returns the updated environment * @throws if the environment does not exist, or `rawData` is invalid * @example * ```javascript * let environment = await client.environment.get({ * spaceId: '', * environmentId: '' * }) * * environment = await client.environment.update( * { * spaceId: '', * environmentId: '' * }, * { * name: 'updated-env' * } * ) * ``` */ update(params: OptionalDefaults, rawData: EnvironmentProps, headers?: RawAxiosRequestHeaders): Promise; /** * Delete an environment * @param params a space and environment id * @returns an empty object * @throws if the environment does not exist * @example * ```javascript * await client.environment.delete({ * spaceId: '', * environmentId: '' * }) * ``` */ delete(params: OptionalDefaults): Promise; };