Creates an instance of the EnvironmentsApi.
The configuration object for the Permit SDK.
The logger instance for logging.
Clones data (creates a copy) from a source specified environment into a different target environment in the same project. The target environment can be a new environment or an existing environment. For existing environments, the user must specify a conflict strategy - meaning what the system should do in case a copied object conflicts with an existing object (with the same key) in the target environment. The system can overwrite all the conflicting objects, or fail (and cancel the copy) when encountering the first conflict.
The project key.
The environment key.
The parameters for copying the environment.
A promise that resolves to an EnvironmentRead object representing the copied environment.
PermitApiError If the API returns an error HTTP status code.
PermitContextError If the configured ApiContext does not match the required endpoint context.
Creates a new environment.
The project key.
The data for creating the environment.
A promise that resolves to an EnvironmentRead object representing the created environment.
PermitApiError If the API returns an error HTTP status code.
PermitContextError If the configured ApiContext does not match the required endpoint context.
Deletes an environment.
The project key.
The environment key.
A promise that resolves when the environment is successfully deleted.
PermitApiError If the API returns an error HTTP status code.
PermitContextError If the configured ApiContext does not match the required endpoint context.
Ensure that the API Key has the necessary permissions to successfully call the API endpoint. Note that this check is not foolproof, and the API may still throw 401.
The required API Key Access level for the endpoint.
PermitContextError If the currently set API key access level does not match the required access level.
Ensure that the API context matches the required endpoint context.
The required API context level for the endpoint.
PermitContextError If the currently set API context level does not match the required context level.
Gets an environment by project key and environment key.
The project key.
The environment key.
A promise that resolves to an EnvironmentRead object representing the retrieved environment.
PermitApiError If the API returns an error HTTP status code.
PermitContextError If the configured ApiContext does not match the required endpoint context.
Retrieves the API key that grants access for an environment (and only the requested environment). Must be requested with an organization-level api key.
The project key.
The environment key.
A promise that resolves to an APIKeyRead object containing the API key and its metadata.
PermitApiError If the API returns an error HTTP status code.
PermitContextError If the configured ApiContext does not match the required endpoint context.
Gets an environment by project ID and environment ID. Alias for the get method.
The project ID.
The environment ID.
A promise that resolves to an EnvironmentRead object representing the retrieved environment.
PermitApiError If the API returns an error HTTP status code.
PermitContextError If the configured ApiContext does not match the required endpoint context.
Gets an environment by project key and environment key. Alias for the get method.
The project key.
The environment key.
A promise that resolves to an EnvironmentRead object representing the retrieved environment.
PermitApiError If the API returns an error HTTP status code.
PermitContextError If the configured ApiContext does not match the required endpoint context.
Retrieves statistics and metadata for an environment.
The project key.
The environment key.
A promise that resolves to an EnvironmentStats object representing the statistics data.
PermitApiError If the API returns an error HTTP status code.
PermitContextError If the configured ApiContext does not match the required endpoint context.
Retrieves a list of environments.
the filters and pagination options,
A promise that resolves to an array of EnvironmentRead objects representing the listed environments.
PermitApiError If the API returns an error HTTP status code.
PermitContextError If the configured ApiContext does not match the required endpoint context.
Updates an existing environment.
The project key.
The environment key.
The data for updating the environment.
A promise that resolves to an EnvironmentRead object representing the updated environment.
PermitApiError If the API returns an error HTTP status code.
PermitContextError If the configured ApiContext does not match the required endpoint context.
Generated using TypeDoc
The EnvironmentsApi class provides methods for interacting with Permit Environments.