Class EnvironmentsApi


  • public class EnvironmentsApi
    extends java.lang.Object
    • Constructor Detail

      • EnvironmentsApi

        public EnvironmentsApi()
      • EnvironmentsApi

        public EnvironmentsApi​(ApiClient apiClient)
    • Method Detail

      • getApiClient

        public ApiClient getApiClient()
      • setApiClient

        public void setApiClient​(ApiClient apiClient)
      • getHostIndex

        public int getHostIndex()
      • setHostIndex

        public void setHostIndex​(int hostIndex)
      • getCustomBaseUrl

        public java.lang.String getCustomBaseUrl()
      • setCustomBaseUrl

        public void setCustomBaseUrl​(java.lang.String customBaseUrl)
      • deleteEnvironmentCall

        public okhttp3.Call deleteEnvironmentCall​(java.lang.String projectKey,
                                                  java.lang.String environmentKey,
                                                  ApiCallback _callback)
                                           throws ApiException
        Build call for deleteEnvironment
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        _callback - Callback for upload/download progress
        Returns:
        Call to execute
        Throws:
        ApiException - If fail to serialize the request body object
      • deleteEnvironment

        public void deleteEnvironment​(java.lang.String projectKey,
                                      java.lang.String environmentKey)
                               throws ApiException
        Delete environment Delete a environment by key.
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • deleteEnvironmentWithHttpInfo

        public ApiResponse<java.lang.Void> deleteEnvironmentWithHttpInfo​(java.lang.String projectKey,
                                                                         java.lang.String environmentKey)
                                                                  throws ApiException
        Delete environment Delete a environment by key.
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        Returns:
        ApiResponse<Void>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • deleteEnvironmentAsync

        public okhttp3.Call deleteEnvironmentAsync​(java.lang.String projectKey,
                                                   java.lang.String environmentKey,
                                                   ApiCallback<java.lang.Void> _callback)
                                            throws ApiException
        Delete environment (asynchronously) Delete a environment by key.
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        _callback - The callback to be executed when the API call finishes
        Returns:
        The request call
        Throws:
        ApiException - If fail to process the API call, e.g. serializing the request body object
      • getEnvironmentCall

        public okhttp3.Call getEnvironmentCall​(java.lang.String projectKey,
                                               java.lang.String environmentKey,
                                               ApiCallback _callback)
                                        throws ApiException
        Build call for getEnvironment
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        _callback - Callback for upload/download progress
        Returns:
        Call to execute
        Throws:
        ApiException - If fail to serialize the request body object
      • getEnvironment

        public Environment getEnvironment​(java.lang.String projectKey,
                                          java.lang.String environmentKey)
                                   throws ApiException
        Get environment > ### Approval settings > > The `approvalSettings` key is only returned when the Flag Approvals feature is enabled. Get an environment given a project and key.
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        Returns:
        Environment
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • getEnvironmentWithHttpInfo

        public ApiResponse<Environment> getEnvironmentWithHttpInfo​(java.lang.String projectKey,
                                                                   java.lang.String environmentKey)
                                                            throws ApiException
        Get environment > ### Approval settings > > The `approvalSettings` key is only returned when the Flag Approvals feature is enabled. Get an environment given a project and key.
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        Returns:
        ApiResponse<Environment>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • getEnvironmentAsync

        public okhttp3.Call getEnvironmentAsync​(java.lang.String projectKey,
                                                java.lang.String environmentKey,
                                                ApiCallback<Environment> _callback)
                                         throws ApiException
        Get environment (asynchronously) > ### Approval settings > > The `approvalSettings` key is only returned when the Flag Approvals feature is enabled. Get an environment given a project and key.
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        _callback - The callback to be executed when the API call finishes
        Returns:
        The request call
        Throws:
        ApiException - If fail to process the API call, e.g. serializing the request body object
      • getEnvironmentsByProjectCall

        public okhttp3.Call getEnvironmentsByProjectCall​(java.lang.String projectKey,
                                                         java.lang.Long limit,
                                                         java.lang.Long offset,
                                                         java.lang.String filter,
                                                         java.lang.String sort,
                                                         ApiCallback _callback)
                                                  throws ApiException
        Build call for getEnvironmentsByProject
        Parameters:
        projectKey - The project key (required)
        limit - The number of environments to return in the response. Defaults to 20. (optional)
        offset - Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`. (optional)
        filter - A comma-separated list of filters. Each filter is of the form `field:value`. (optional)
        sort - A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order. (optional)
        _callback - Callback for upload/download progress
        Returns:
        Call to execute
        Throws:
        ApiException - If fail to serialize the request body object
      • getEnvironmentsByProject

        public Environments getEnvironmentsByProject​(java.lang.String projectKey,
                                                     java.lang.Long limit,
                                                     java.lang.Long offset,
                                                     java.lang.String filter,
                                                     java.lang.String sort)
                                              throws ApiException
        List environments Return a list of environments for the specified project. By default, this returns the first 20 environments. Page through this list with the `limit` parameter and by following the `first`, `prev`, `next`, and `last` links in the `_links` field that returns. If those links do not appear, the pages they refer to don't exist. For example, the `first` and `prev` links will be missing from the response on the first page, because there is no previous page and you cannot return to the first page when you are already on the first page. ### Filtering environments LaunchDarkly supports two fields for filters: - `query` is a string that matches against the environments' names and keys. It is not case sensitive. - `tags` is a `+` separate list of environment tags. It filters the list of environments that have all of the tags in the list. For example, the filter `query:abc,tags:tag-1+tag-2` matches environments with the string `abc` in their name or key and also are tagged with `tag-1` and `tag-2`. The filter is not case-sensitive. ### Sorting environments LaunchDarkly supports two fields for sorting: - `name` sorts by environment name. - `createdOn` sorts by the creation date of the environment. For example, `sort=name` sorts the response by environment name in ascending order.
        Parameters:
        projectKey - The project key (required)
        limit - The number of environments to return in the response. Defaults to 20. (optional)
        offset - Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`. (optional)
        filter - A comma-separated list of filters. Each filter is of the form `field:value`. (optional)
        sort - A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order. (optional)
        Returns:
        Environments
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • getEnvironmentsByProjectWithHttpInfo

        public ApiResponse<Environments> getEnvironmentsByProjectWithHttpInfo​(java.lang.String projectKey,
                                                                              java.lang.Long limit,
                                                                              java.lang.Long offset,
                                                                              java.lang.String filter,
                                                                              java.lang.String sort)
                                                                       throws ApiException
        List environments Return a list of environments for the specified project. By default, this returns the first 20 environments. Page through this list with the `limit` parameter and by following the `first`, `prev`, `next`, and `last` links in the `_links` field that returns. If those links do not appear, the pages they refer to don't exist. For example, the `first` and `prev` links will be missing from the response on the first page, because there is no previous page and you cannot return to the first page when you are already on the first page. ### Filtering environments LaunchDarkly supports two fields for filters: - `query` is a string that matches against the environments' names and keys. It is not case sensitive. - `tags` is a `+` separate list of environment tags. It filters the list of environments that have all of the tags in the list. For example, the filter `query:abc,tags:tag-1+tag-2` matches environments with the string `abc` in their name or key and also are tagged with `tag-1` and `tag-2`. The filter is not case-sensitive. ### Sorting environments LaunchDarkly supports two fields for sorting: - `name` sorts by environment name. - `createdOn` sorts by the creation date of the environment. For example, `sort=name` sorts the response by environment name in ascending order.
        Parameters:
        projectKey - The project key (required)
        limit - The number of environments to return in the response. Defaults to 20. (optional)
        offset - Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`. (optional)
        filter - A comma-separated list of filters. Each filter is of the form `field:value`. (optional)
        sort - A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order. (optional)
        Returns:
        ApiResponse<Environments>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • getEnvironmentsByProjectAsync

        public okhttp3.Call getEnvironmentsByProjectAsync​(java.lang.String projectKey,
                                                          java.lang.Long limit,
                                                          java.lang.Long offset,
                                                          java.lang.String filter,
                                                          java.lang.String sort,
                                                          ApiCallback<Environments> _callback)
                                                   throws ApiException
        List environments (asynchronously) Return a list of environments for the specified project. By default, this returns the first 20 environments. Page through this list with the `limit` parameter and by following the `first`, `prev`, `next`, and `last` links in the `_links` field that returns. If those links do not appear, the pages they refer to don't exist. For example, the `first` and `prev` links will be missing from the response on the first page, because there is no previous page and you cannot return to the first page when you are already on the first page. ### Filtering environments LaunchDarkly supports two fields for filters: - `query` is a string that matches against the environments' names and keys. It is not case sensitive. - `tags` is a `+` separate list of environment tags. It filters the list of environments that have all of the tags in the list. For example, the filter `query:abc,tags:tag-1+tag-2` matches environments with the string `abc` in their name or key and also are tagged with `tag-1` and `tag-2`. The filter is not case-sensitive. ### Sorting environments LaunchDarkly supports two fields for sorting: - `name` sorts by environment name. - `createdOn` sorts by the creation date of the environment. For example, `sort=name` sorts the response by environment name in ascending order.
        Parameters:
        projectKey - The project key (required)
        limit - The number of environments to return in the response. Defaults to 20. (optional)
        offset - Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`. (optional)
        filter - A comma-separated list of filters. Each filter is of the form `field:value`. (optional)
        sort - A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order. (optional)
        _callback - The callback to be executed when the API call finishes
        Returns:
        The request call
        Throws:
        ApiException - If fail to process the API call, e.g. serializing the request body object
      • patchEnvironmentCall

        public okhttp3.Call patchEnvironmentCall​(java.lang.String projectKey,
                                                 java.lang.String environmentKey,
                                                 java.util.List<PatchOperation> patchOperation,
                                                 ApiCallback _callback)
                                          throws ApiException
        Build call for patchEnvironment
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        patchOperation - (required)
        _callback - Callback for upload/download progress
        Returns:
        Call to execute
        Throws:
        ApiException - If fail to serialize the request body object
      • patchEnvironment

        public Environment patchEnvironment​(java.lang.String projectKey,
                                            java.lang.String environmentKey,
                                            java.util.List<PatchOperation> patchOperation)
                                     throws ApiException
        Update environment Update an environment. Requires a [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes to the environment. To update fields in the environment object that are arrays, set the `path` to the name of the field and then append `/<array index>`. Using `/0` appends to the beginning of the array. ### Approval settings This request only returns the `approvalSettings` key if the [Flag Approvals](https://docs.launchdarkly.com/home/feature-workflows/approvals) feature is enabled. Only the `canReviewOwnRequest`, `canApplyDeclinedChanges`, `minNumApprovals`, `required` and `requiredApprovalTagsfields` are editable. If you try to patch the environment by setting both `required` and `requiredApprovalTags`, the request fails and an error appears. You can specify either required approvals for all flags in an environment or those with specific tags, but not both.
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        patchOperation - (required)
        Returns:
        Environment
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • patchEnvironmentWithHttpInfo

        public ApiResponse<Environment> patchEnvironmentWithHttpInfo​(java.lang.String projectKey,
                                                                     java.lang.String environmentKey,
                                                                     java.util.List<PatchOperation> patchOperation)
                                                              throws ApiException
        Update environment Update an environment. Requires a [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes to the environment. To update fields in the environment object that are arrays, set the `path` to the name of the field and then append `/<array index>`. Using `/0` appends to the beginning of the array. ### Approval settings This request only returns the `approvalSettings` key if the [Flag Approvals](https://docs.launchdarkly.com/home/feature-workflows/approvals) feature is enabled. Only the `canReviewOwnRequest`, `canApplyDeclinedChanges`, `minNumApprovals`, `required` and `requiredApprovalTagsfields` are editable. If you try to patch the environment by setting both `required` and `requiredApprovalTags`, the request fails and an error appears. You can specify either required approvals for all flags in an environment or those with specific tags, but not both.
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        patchOperation - (required)
        Returns:
        ApiResponse<Environment>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • patchEnvironmentAsync

        public okhttp3.Call patchEnvironmentAsync​(java.lang.String projectKey,
                                                  java.lang.String environmentKey,
                                                  java.util.List<PatchOperation> patchOperation,
                                                  ApiCallback<Environment> _callback)
                                           throws ApiException
        Update environment (asynchronously) Update an environment. Requires a [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes to the environment. To update fields in the environment object that are arrays, set the `path` to the name of the field and then append `/<array index>`. Using `/0` appends to the beginning of the array. ### Approval settings This request only returns the `approvalSettings` key if the [Flag Approvals](https://docs.launchdarkly.com/home/feature-workflows/approvals) feature is enabled. Only the `canReviewOwnRequest`, `canApplyDeclinedChanges`, `minNumApprovals`, `required` and `requiredApprovalTagsfields` are editable. If you try to patch the environment by setting both `required` and `requiredApprovalTags`, the request fails and an error appears. You can specify either required approvals for all flags in an environment or those with specific tags, but not both.
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        patchOperation - (required)
        _callback - The callback to be executed when the API call finishes
        Returns:
        The request call
        Throws:
        ApiException - If fail to process the API call, e.g. serializing the request body object
      • postEnvironmentCall

        public okhttp3.Call postEnvironmentCall​(java.lang.String projectKey,
                                                EnvironmentPost environmentPost,
                                                ApiCallback _callback)
                                         throws ApiException
        Build call for postEnvironment
        Parameters:
        projectKey - The project key (required)
        environmentPost - (required)
        _callback - Callback for upload/download progress
        Returns:
        Call to execute
        Throws:
        ApiException - If fail to serialize the request body object
      • postEnvironment

        public Environment postEnvironment​(java.lang.String projectKey,
                                           EnvironmentPost environmentPost)
                                    throws ApiException
        Create environment > ### Approval settings > > The `approvalSettings` key is only returned when the Flag Approvals feature is enabled. > > You cannot update approval settings when creating new environments. Update approval settings with the PATCH Environment API. Create a new environment in a specified project with a given name, key, swatch color, and default TTL.
        Parameters:
        projectKey - The project key (required)
        environmentPost - (required)
        Returns:
        Environment
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • postEnvironmentWithHttpInfo

        public ApiResponse<Environment> postEnvironmentWithHttpInfo​(java.lang.String projectKey,
                                                                    EnvironmentPost environmentPost)
                                                             throws ApiException
        Create environment > ### Approval settings > > The `approvalSettings` key is only returned when the Flag Approvals feature is enabled. > > You cannot update approval settings when creating new environments. Update approval settings with the PATCH Environment API. Create a new environment in a specified project with a given name, key, swatch color, and default TTL.
        Parameters:
        projectKey - The project key (required)
        environmentPost - (required)
        Returns:
        ApiResponse<Environment>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • postEnvironmentAsync

        public okhttp3.Call postEnvironmentAsync​(java.lang.String projectKey,
                                                 EnvironmentPost environmentPost,
                                                 ApiCallback<Environment> _callback)
                                          throws ApiException
        Create environment (asynchronously) > ### Approval settings > > The `approvalSettings` key is only returned when the Flag Approvals feature is enabled. > > You cannot update approval settings when creating new environments. Update approval settings with the PATCH Environment API. Create a new environment in a specified project with a given name, key, swatch color, and default TTL.
        Parameters:
        projectKey - The project key (required)
        environmentPost - (required)
        _callback - The callback to be executed when the API call finishes
        Returns:
        The request call
        Throws:
        ApiException - If fail to process the API call, e.g. serializing the request body object
      • resetEnvironmentMobileKeyCall

        public okhttp3.Call resetEnvironmentMobileKeyCall​(java.lang.String projectKey,
                                                          java.lang.String environmentKey,
                                                          ApiCallback _callback)
                                                   throws ApiException
        Build call for resetEnvironmentMobileKey
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        _callback - Callback for upload/download progress
        Returns:
        Call to execute
        Throws:
        ApiException - If fail to serialize the request body object
      • resetEnvironmentMobileKey

        public Environment resetEnvironmentMobileKey​(java.lang.String projectKey,
                                                     java.lang.String environmentKey)
                                              throws ApiException
        Reset environment mobile SDK key Reset an environment's mobile key. The optional expiry for the old key is deprecated for this endpoint, so the old key will always expire immediately.
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        Returns:
        Environment
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • resetEnvironmentMobileKeyWithHttpInfo

        public ApiResponse<Environment> resetEnvironmentMobileKeyWithHttpInfo​(java.lang.String projectKey,
                                                                              java.lang.String environmentKey)
                                                                       throws ApiException
        Reset environment mobile SDK key Reset an environment's mobile key. The optional expiry for the old key is deprecated for this endpoint, so the old key will always expire immediately.
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        Returns:
        ApiResponse<Environment>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • resetEnvironmentMobileKeyAsync

        public okhttp3.Call resetEnvironmentMobileKeyAsync​(java.lang.String projectKey,
                                                           java.lang.String environmentKey,
                                                           ApiCallback<Environment> _callback)
                                                    throws ApiException
        Reset environment mobile SDK key (asynchronously) Reset an environment's mobile key. The optional expiry for the old key is deprecated for this endpoint, so the old key will always expire immediately.
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        _callback - The callback to be executed when the API call finishes
        Returns:
        The request call
        Throws:
        ApiException - If fail to process the API call, e.g. serializing the request body object
      • resetEnvironmentSDKKeyCall

        public okhttp3.Call resetEnvironmentSDKKeyCall​(java.lang.String projectKey,
                                                       java.lang.String environmentKey,
                                                       java.lang.Long expiry,
                                                       ApiCallback _callback)
                                                throws ApiException
        Build call for resetEnvironmentSDKKey
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        expiry - The time at which you want the old SDK key to expire, in UNIX milliseconds. By default, the key expires immediately. (optional)
        _callback - Callback for upload/download progress
        Returns:
        Call to execute
        Throws:
        ApiException - If fail to serialize the request body object
      • resetEnvironmentSDKKey

        public Environment resetEnvironmentSDKKey​(java.lang.String projectKey,
                                                  java.lang.String environmentKey,
                                                  java.lang.Long expiry)
                                           throws ApiException
        Reset environment SDK key Reset an environment's SDK key with an optional expiry time for the old key.
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        expiry - The time at which you want the old SDK key to expire, in UNIX milliseconds. By default, the key expires immediately. (optional)
        Returns:
        Environment
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • resetEnvironmentSDKKeyWithHttpInfo

        public ApiResponse<Environment> resetEnvironmentSDKKeyWithHttpInfo​(java.lang.String projectKey,
                                                                           java.lang.String environmentKey,
                                                                           java.lang.Long expiry)
                                                                    throws ApiException
        Reset environment SDK key Reset an environment's SDK key with an optional expiry time for the old key.
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        expiry - The time at which you want the old SDK key to expire, in UNIX milliseconds. By default, the key expires immediately. (optional)
        Returns:
        ApiResponse<Environment>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • resetEnvironmentSDKKeyAsync

        public okhttp3.Call resetEnvironmentSDKKeyAsync​(java.lang.String projectKey,
                                                        java.lang.String environmentKey,
                                                        java.lang.Long expiry,
                                                        ApiCallback<Environment> _callback)
                                                 throws ApiException
        Reset environment SDK key (asynchronously) Reset an environment's SDK key with an optional expiry time for the old key.
        Parameters:
        projectKey - The project key (required)
        environmentKey - The environment key (required)
        expiry - The time at which you want the old SDK key to expire, in UNIX milliseconds. By default, the key expires immediately. (optional)
        _callback - The callback to be executed when the API call finishes
        Returns:
        The request call
        Throws:
        ApiException - If fail to process the API call, e.g. serializing the request body object