1 | import type { RawAxiosRequestHeaders } from 'axios';
|
2 | import type { CollectionProp, GetSpaceEnvAliasParams, GetSpaceParams, PaginationQueryParams } from '../../common-types';
|
3 | import type { CreateEnvironmentAliasProps, EnvironmentAliasProps } from '../../entities/environment-alias';
|
4 | import type { OptionalDefaults } from '../wrappers/wrap';
|
5 | export type EnvironmentAliasPlainClientAPI = {
|
6 | /**
|
7 | * Fetch an environment alias
|
8 | * @param params a space and environment alias id
|
9 | * @returns the environment alias\
|
10 | * @throws if the environment alias does not exist
|
11 | * @example
|
12 | * ```javascript
|
13 | * const environmentAlias = await client.environmentAlias.get({
|
14 | * spaceId: '<space_id>',
|
15 | * environmentAliasId: '<environment_alias_id>'
|
16 | * })
|
17 | * ```
|
18 | */
|
19 | get(params: OptionalDefaults<GetSpaceEnvAliasParams>): Promise<EnvironmentAliasProps>;
|
20 | /**
|
21 | * Fetch all environment aliases in a space
|
22 | * @param params a space Id and optional pagination parameters
|
23 | * @returns a collection of environment aliases
|
24 | * @throws if the space does not exist
|
25 | * @example
|
26 | * ```javascript
|
27 | * const environmentAliases = await client.environmentAlias.getMany({
|
28 | * spaceId: '<space_id>'
|
29 | * })
|
30 | * ```
|
31 | */
|
32 | getMany(params: OptionalDefaults<GetSpaceParams & PaginationQueryParams>): Promise<CollectionProp<EnvironmentAliasProps>>;
|
33 | /**
|
34 | * Create an environment alias
|
35 | * @param params a space ID to create the environment alias in
|
36 | * @param rawData the environment alias metadata
|
37 | * @param headers optional custom headers
|
38 | * @returns the created environment alias
|
39 | * @throws if the space does not exist, or `rawData` is invalid
|
40 | * @example
|
41 | * ```javascript
|
42 | * const environmentAlias = await client.environmentAlias.createWithId(
|
43 | * {
|
44 | * spaceId: '<space_id>',
|
45 | * environmentAliasId: '<environment_alias_id>',
|
46 | * },
|
47 | * {
|
48 | * environment: {
|
49 | * sys: {
|
50 | * type: 'Link',
|
51 | * linkType: 'Environment',
|
52 | * id: '<environment_id>',
|
53 | * },
|
54 | * },
|
55 | * }
|
56 | * );
|
57 | * ```
|
58 | */
|
59 | createWithId(params: OptionalDefaults<GetSpaceEnvAliasParams>, rawData: CreateEnvironmentAliasProps, headers?: RawAxiosRequestHeaders): Promise<EnvironmentAliasProps>;
|
60 | /**
|
61 | * Update an environment alias
|
62 | * @param params a space and environment alias id
|
63 | * @param rawData the updated environment alias metadata
|
64 | * @param headers optional custom headers
|
65 | * @returns the updated environment alias
|
66 | * @throws if the environment alias does not exist, or `rawData` is invalid
|
67 | * @example
|
68 | * ```javascript
|
69 | * const environmentAlias = await client.environmentAlias.update(
|
70 | * {
|
71 | * spaceId: '<space_id>',
|
72 | * environmentAliasId: '<environment_alias_id>',
|
73 | * },
|
74 | * {
|
75 | * environment: {
|
76 | * sys: {
|
77 | * type: 'Link',
|
78 | * linkType: 'Environment',
|
79 | * id: '<environment_id>',
|
80 | * },
|
81 | * }
|
82 | * );
|
83 | */
|
84 | update(params: OptionalDefaults<GetSpaceEnvAliasParams>, rawData: EnvironmentAliasProps, headers?: RawAxiosRequestHeaders): Promise<EnvironmentAliasProps>;
|
85 | /**
|
86 | * Delete an environment alias
|
87 | * @param params a space and environment alias id
|
88 | * @returns an empty object
|
89 | * @throws if the environment alias does not exist
|
90 | * @example
|
91 | * ```javascript
|
92 | * await client.environmentAlias.delete({
|
93 | * spaceId: '<space_id>',
|
94 | * environmentAliasId: '<environment_alias_id>',
|
95 | * })
|
96 | * ```
|
97 | */
|
98 | delete(params: OptionalDefaults<GetSpaceEnvAliasParams>): Promise<any>;
|
99 | };
|