Class FeatureFlagsApi


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

      • FeatureFlagsApi

        public FeatureFlagsApi()
      • FeatureFlagsApi

        public FeatureFlagsApi​(ApiClient apiClient)
    • Method Detail

      • getApiClient

        public ApiClient getApiClient()
      • setApiClient

        public void setApiClient​(ApiClient apiClient)
      • copyFeatureFlagCall

        public okhttp3.Call copyFeatureFlagCall​(java.lang.String projKey,
                                                java.lang.String featureFlagKey,
                                                FlagCopyConfigPost flagCopyConfigPost,
                                                ApiCallback _callback)
                                         throws ApiException
        Build call for copyFeatureFlag
        Parameters:
        projKey - The project key. (required)
        featureFlagKey - The feature flag's key. The key identifies the flag in your code. (required)
        flagCopyConfigPost - (required)
        _callback - Callback for upload/download progress
        Returns:
        Call to execute
        Throws:
        ApiException - If fail to serialize the request body object
      • copyFeatureFlag

        public FeatureFlag copyFeatureFlag​(java.lang.String projKey,
                                           java.lang.String featureFlagKey,
                                           FlagCopyConfigPost flagCopyConfigPost)
                                    throws ApiException
        Copy feature flag The includedActions and excludedActions define the parts of the flag configuration that are copied or not copied. By default, the entire flag configuration is copied. You can have either `includedActions` or `excludedActions` but not both. Valid `includedActions` and `excludedActions` include: - `updateOn` - `updatePrerequisites` - `updateTargets` - `updateRules` - `updateFallthrough` - `updateOffVariation` The `source` and `target` must be JSON objects if using curl, specifying the environment key and (optional) current flag configuration version in that environment. For example: ```json { \"key\": \"production\", \"currentVersion\": 3 } ``` If target is specified as above, the API will test to ensure that the current flag version in the `production` environment is `3`, and reject attempts to copy settings to `production` otherwise. You can use this to enforce optimistic locking on copy attempts.
        Parameters:
        projKey - The project key. (required)
        featureFlagKey - The feature flag's key. The key identifies the flag in your code. (required)
        flagCopyConfigPost - (required)
        Returns:
        FeatureFlag
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • copyFeatureFlagWithHttpInfo

        public ApiResponse<FeatureFlag> copyFeatureFlagWithHttpInfo​(java.lang.String projKey,
                                                                    java.lang.String featureFlagKey,
                                                                    FlagCopyConfigPost flagCopyConfigPost)
                                                             throws ApiException
        Copy feature flag The includedActions and excludedActions define the parts of the flag configuration that are copied or not copied. By default, the entire flag configuration is copied. You can have either `includedActions` or `excludedActions` but not both. Valid `includedActions` and `excludedActions` include: - `updateOn` - `updatePrerequisites` - `updateTargets` - `updateRules` - `updateFallthrough` - `updateOffVariation` The `source` and `target` must be JSON objects if using curl, specifying the environment key and (optional) current flag configuration version in that environment. For example: ```json { \"key\": \"production\", \"currentVersion\": 3 } ``` If target is specified as above, the API will test to ensure that the current flag version in the `production` environment is `3`, and reject attempts to copy settings to `production` otherwise. You can use this to enforce optimistic locking on copy attempts.
        Parameters:
        projKey - The project key. (required)
        featureFlagKey - The feature flag's key. The key identifies the flag in your code. (required)
        flagCopyConfigPost - (required)
        Returns:
        ApiResponse<FeatureFlag>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • copyFeatureFlagAsync

        public okhttp3.Call copyFeatureFlagAsync​(java.lang.String projKey,
                                                 java.lang.String featureFlagKey,
                                                 FlagCopyConfigPost flagCopyConfigPost,
                                                 ApiCallback<FeatureFlag> _callback)
                                          throws ApiException
        Copy feature flag (asynchronously) The includedActions and excludedActions define the parts of the flag configuration that are copied or not copied. By default, the entire flag configuration is copied. You can have either `includedActions` or `excludedActions` but not both. Valid `includedActions` and `excludedActions` include: - `updateOn` - `updatePrerequisites` - `updateTargets` - `updateRules` - `updateFallthrough` - `updateOffVariation` The `source` and `target` must be JSON objects if using curl, specifying the environment key and (optional) current flag configuration version in that environment. For example: ```json { \"key\": \"production\", \"currentVersion\": 3 } ``` If target is specified as above, the API will test to ensure that the current flag version in the `production` environment is `3`, and reject attempts to copy settings to `production` otherwise. You can use this to enforce optimistic locking on copy attempts.
        Parameters:
        projKey - The project key. (required)
        featureFlagKey - The feature flag's key. The key identifies the flag in your code. (required)
        flagCopyConfigPost - (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
      • deleteFeatureFlagCall

        public okhttp3.Call deleteFeatureFlagCall​(java.lang.String projKey,
                                                  java.lang.String key,
                                                  ApiCallback _callback)
                                           throws ApiException
        Build call for deleteFeatureFlag
        Parameters:
        projKey - The project key. (required)
        key - The feature flag's key. The key identifies the flag in your code. (required)
        _callback - Callback for upload/download progress
        Returns:
        Call to execute
        Throws:
        ApiException - If fail to serialize the request body object
      • deleteFeatureFlag

        public void deleteFeatureFlag​(java.lang.String projKey,
                                      java.lang.String key)
                               throws ApiException
        Delete feature flag Delete a feature flag in all environments. Use with caution: only delete feature flags your application no longer uses.
        Parameters:
        projKey - The project key. (required)
        key - The feature flag's key. The key identifies the flag in your code. (required)
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • deleteFeatureFlagWithHttpInfo

        public ApiResponse<java.lang.Void> deleteFeatureFlagWithHttpInfo​(java.lang.String projKey,
                                                                         java.lang.String key)
                                                                  throws ApiException
        Delete feature flag Delete a feature flag in all environments. Use with caution: only delete feature flags your application no longer uses.
        Parameters:
        projKey - The project key. (required)
        key - The feature flag's key. The key identifies the flag in your code. (required)
        Returns:
        ApiResponse<Void>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • deleteFeatureFlagAsync

        public okhttp3.Call deleteFeatureFlagAsync​(java.lang.String projKey,
                                                   java.lang.String key,
                                                   ApiCallback<java.lang.Void> _callback)
                                            throws ApiException
        Delete feature flag (asynchronously) Delete a feature flag in all environments. Use with caution: only delete feature flags your application no longer uses.
        Parameters:
        projKey - The project key. (required)
        key - The feature flag's key. The key identifies the flag in your code. (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
      • getExpiringUserTargetsCall

        public okhttp3.Call getExpiringUserTargetsCall​(java.lang.String projKey,
                                                       java.lang.String envKey,
                                                       java.lang.String flagKey,
                                                       ApiCallback _callback)
                                                throws ApiException
        Build call for getExpiringUserTargets
        Parameters:
        projKey - The project key. (required)
        envKey - The environment key. (required)
        flagKey - The feature flag key. (required)
        _callback - Callback for upload/download progress
        Returns:
        Call to execute
        Throws:
        ApiException - If fail to serialize the request body object
      • getExpiringUserTargets

        public ExpiringUserTargetGetResponse getExpiringUserTargets​(java.lang.String projKey,
                                                                    java.lang.String envKey,
                                                                    java.lang.String flagKey)
                                                             throws ApiException
        Get expiring user targets for feature flag Get a list of user targets on a feature flag that are scheduled for removal.
        Parameters:
        projKey - The project key. (required)
        envKey - The environment key. (required)
        flagKey - The feature flag key. (required)
        Returns:
        ExpiringUserTargetGetResponse
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • getExpiringUserTargetsWithHttpInfo

        public ApiResponse<ExpiringUserTargetGetResponse> getExpiringUserTargetsWithHttpInfo​(java.lang.String projKey,
                                                                                             java.lang.String envKey,
                                                                                             java.lang.String flagKey)
                                                                                      throws ApiException
        Get expiring user targets for feature flag Get a list of user targets on a feature flag that are scheduled for removal.
        Parameters:
        projKey - The project key. (required)
        envKey - The environment key. (required)
        flagKey - The feature flag key. (required)
        Returns:
        ApiResponse<ExpiringUserTargetGetResponse>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • getExpiringUserTargetsAsync

        public okhttp3.Call getExpiringUserTargetsAsync​(java.lang.String projKey,
                                                        java.lang.String envKey,
                                                        java.lang.String flagKey,
                                                        ApiCallback<ExpiringUserTargetGetResponse> _callback)
                                                 throws ApiException
        Get expiring user targets for feature flag (asynchronously) Get a list of user targets on a feature flag that are scheduled for removal.
        Parameters:
        projKey - The project key. (required)
        envKey - The environment key. (required)
        flagKey - The feature flag 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
      • getFeatureFlagCall

        public okhttp3.Call getFeatureFlagCall​(java.lang.String projKey,
                                               java.lang.String key,
                                               java.lang.String env,
                                               ApiCallback _callback)
                                        throws ApiException
        Build call for getFeatureFlag
        Parameters:
        projKey - The project key (required)
        key - The feature flag key (required)
        env - Filter configurations by environment (optional)
        _callback - Callback for upload/download progress
        Returns:
        Call to execute
        Throws:
        ApiException - If fail to serialize the request body object
      • getFeatureFlag

        public FeatureFlag getFeatureFlag​(java.lang.String projKey,
                                          java.lang.String key,
                                          java.lang.String env)
                                   throws ApiException
        Get feature flag Get a single feature flag by key. By default, this returns the configurations for all environments. You can filter environments with the `env` query parameter. For example, setting `env=production` restricts the returned configurations to just the `production` environment.
        Parameters:
        projKey - The project key (required)
        key - The feature flag key (required)
        env - Filter configurations by environment (optional)
        Returns:
        FeatureFlag
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • getFeatureFlagWithHttpInfo

        public ApiResponse<FeatureFlag> getFeatureFlagWithHttpInfo​(java.lang.String projKey,
                                                                   java.lang.String key,
                                                                   java.lang.String env)
                                                            throws ApiException
        Get feature flag Get a single feature flag by key. By default, this returns the configurations for all environments. You can filter environments with the `env` query parameter. For example, setting `env=production` restricts the returned configurations to just the `production` environment.
        Parameters:
        projKey - The project key (required)
        key - The feature flag key (required)
        env - Filter configurations by environment (optional)
        Returns:
        ApiResponse<FeatureFlag>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • getFeatureFlagAsync

        public okhttp3.Call getFeatureFlagAsync​(java.lang.String projKey,
                                                java.lang.String key,
                                                java.lang.String env,
                                                ApiCallback<FeatureFlag> _callback)
                                         throws ApiException
        Get feature flag (asynchronously) Get a single feature flag by key. By default, this returns the configurations for all environments. You can filter environments with the `env` query parameter. For example, setting `env=production` restricts the returned configurations to just the `production` environment.
        Parameters:
        projKey - The project key (required)
        key - The feature flag key (required)
        env - Filter configurations by environment (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
      • getFeatureFlagStatusCall

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

        public FlagStatusRep getFeatureFlagStatus​(java.lang.String projKey,
                                                  java.lang.String envKey,
                                                  java.lang.String key)
                                           throws ApiException
        Get feature flag status Get the status for a particular feature flag.
        Parameters:
        projKey - The project key (required)
        envKey - The environment key (required)
        key - The feature flag key (required)
        Returns:
        FlagStatusRep
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • getFeatureFlagStatusWithHttpInfo

        public ApiResponse<FlagStatusRep> getFeatureFlagStatusWithHttpInfo​(java.lang.String projKey,
                                                                           java.lang.String envKey,
                                                                           java.lang.String key)
                                                                    throws ApiException
        Get feature flag status Get the status for a particular feature flag.
        Parameters:
        projKey - The project key (required)
        envKey - The environment key (required)
        key - The feature flag key (required)
        Returns:
        ApiResponse<FlagStatusRep>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • getFeatureFlagStatusAsync

        public okhttp3.Call getFeatureFlagStatusAsync​(java.lang.String projKey,
                                                      java.lang.String envKey,
                                                      java.lang.String key,
                                                      ApiCallback<FlagStatusRep> _callback)
                                               throws ApiException
        Get feature flag status (asynchronously) Get the status for a particular feature flag.
        Parameters:
        projKey - The project key (required)
        envKey - The environment key (required)
        key - The feature flag 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
      • getFeatureFlagStatusAcrossEnvironmentsCall

        public okhttp3.Call getFeatureFlagStatusAcrossEnvironmentsCall​(java.lang.String projKey,
                                                                       java.lang.String key,
                                                                       java.lang.String env,
                                                                       ApiCallback _callback)
                                                                throws ApiException
        Build call for getFeatureFlagStatusAcrossEnvironments
        Parameters:
        projKey - The project key (required)
        key - The feature flag key (required)
        env - Optional environment filter (optional)
        _callback - Callback for upload/download progress
        Returns:
        Call to execute
        Throws:
        ApiException - If fail to serialize the request body object
      • getFeatureFlagStatusAcrossEnvironments

        public FeatureFlagStatusAcrossEnvironments getFeatureFlagStatusAcrossEnvironments​(java.lang.String projKey,
                                                                                          java.lang.String key,
                                                                                          java.lang.String env)
                                                                                   throws ApiException
        Get flag status across environments Get the status for a particular feature flag across environments.
        Parameters:
        projKey - The project key (required)
        key - The feature flag key (required)
        env - Optional environment filter (optional)
        Returns:
        FeatureFlagStatusAcrossEnvironments
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • getFeatureFlagStatusAcrossEnvironmentsWithHttpInfo

        public ApiResponse<FeatureFlagStatusAcrossEnvironments> getFeatureFlagStatusAcrossEnvironmentsWithHttpInfo​(java.lang.String projKey,
                                                                                                                   java.lang.String key,
                                                                                                                   java.lang.String env)
                                                                                                            throws ApiException
        Get flag status across environments Get the status for a particular feature flag across environments.
        Parameters:
        projKey - The project key (required)
        key - The feature flag key (required)
        env - Optional environment filter (optional)
        Returns:
        ApiResponse<FeatureFlagStatusAcrossEnvironments>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • getFeatureFlagStatusAcrossEnvironmentsAsync

        public okhttp3.Call getFeatureFlagStatusAcrossEnvironmentsAsync​(java.lang.String projKey,
                                                                        java.lang.String key,
                                                                        java.lang.String env,
                                                                        ApiCallback<FeatureFlagStatusAcrossEnvironments> _callback)
                                                                 throws ApiException
        Get flag status across environments (asynchronously) Get the status for a particular feature flag across environments.
        Parameters:
        projKey - The project key (required)
        key - The feature flag key (required)
        env - Optional environment filter (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
      • getFeatureFlagStatusesCall

        public okhttp3.Call getFeatureFlagStatusesCall​(java.lang.String projKey,
                                                       java.lang.String envKey,
                                                       ApiCallback _callback)
                                                throws ApiException
        Build call for getFeatureFlagStatuses
        Parameters:
        projKey - The project key (required)
        envKey - Filter configurations by environment (required)
        _callback - Callback for upload/download progress
        Returns:
        Call to execute
        Throws:
        ApiException - If fail to serialize the request body object
      • getFeatureFlagStatuses

        public FeatureFlagStatuses getFeatureFlagStatuses​(java.lang.String projKey,
                                                          java.lang.String envKey)
                                                   throws ApiException
        List feature flag statuses Get a list of statuses for all feature flags. The status includes the last time the feature flag was requested, as well as a state, which is one of the following: - `new`: the feature flag was created within the last seven days, and has not been requested yet - `active`: the feature flag was requested by your servers or clients within the last seven days - `inactive`: the feature flag was created more than seven days ago, and hasn't been requested by your servers or clients within the past seven days - `launched`: one variation of the feature flag has been rolled out to all your users for at least 7 days
        Parameters:
        projKey - The project key (required)
        envKey - Filter configurations by environment (required)
        Returns:
        FeatureFlagStatuses
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • getFeatureFlagStatusesWithHttpInfo

        public ApiResponse<FeatureFlagStatuses> getFeatureFlagStatusesWithHttpInfo​(java.lang.String projKey,
                                                                                   java.lang.String envKey)
                                                                            throws ApiException
        List feature flag statuses Get a list of statuses for all feature flags. The status includes the last time the feature flag was requested, as well as a state, which is one of the following: - `new`: the feature flag was created within the last seven days, and has not been requested yet - `active`: the feature flag was requested by your servers or clients within the last seven days - `inactive`: the feature flag was created more than seven days ago, and hasn't been requested by your servers or clients within the past seven days - `launched`: one variation of the feature flag has been rolled out to all your users for at least 7 days
        Parameters:
        projKey - The project key (required)
        envKey - Filter configurations by environment (required)
        Returns:
        ApiResponse<FeatureFlagStatuses>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • getFeatureFlagStatusesAsync

        public okhttp3.Call getFeatureFlagStatusesAsync​(java.lang.String projKey,
                                                        java.lang.String envKey,
                                                        ApiCallback<FeatureFlagStatuses> _callback)
                                                 throws ApiException
        List feature flag statuses (asynchronously) Get a list of statuses for all feature flags. The status includes the last time the feature flag was requested, as well as a state, which is one of the following: - `new`: the feature flag was created within the last seven days, and has not been requested yet - `active`: the feature flag was requested by your servers or clients within the last seven days - `inactive`: the feature flag was created more than seven days ago, and hasn't been requested by your servers or clients within the past seven days - `launched`: one variation of the feature flag has been rolled out to all your users for at least 7 days
        Parameters:
        projKey - The project key (required)
        envKey - Filter configurations by environment (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
      • getFeatureFlagsCall

        public okhttp3.Call getFeatureFlagsCall​(java.lang.String projKey,
                                                java.lang.String env,
                                                java.lang.String tag,
                                                java.lang.Long limit,
                                                java.lang.Long offset,
                                                java.lang.String query,
                                                java.lang.Boolean archived,
                                                java.lang.Boolean summary,
                                                java.lang.String filter,
                                                java.lang.String sort,
                                                ApiCallback _callback)
                                         throws ApiException
        Build call for getFeatureFlags
        Parameters:
        projKey - The project key (required)
        env - Filter configurations by environment (optional)
        tag - Filter feature flags by tag (optional)
        limit - The number of feature flags to return. Defaults to -1, which returns all flags (optional)
        offset - Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next limit items (optional)
        query - A string that matches against the flags' keys and names. It is not case sensitive (optional)
        archived - A boolean to filter the list to archived flags. When this is absent, only unarchived flags will be returned (optional)
        summary - By default in API version >= 1, flags will _not_ include their list of prerequisites, targets or rules. Set summary=0 to include these fields for each flag returned (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
      • getFeatureFlags

        public FeatureFlags getFeatureFlags​(java.lang.String projKey,
                                            java.lang.String env,
                                            java.lang.String tag,
                                            java.lang.Long limit,
                                            java.lang.Long offset,
                                            java.lang.String query,
                                            java.lang.Boolean archived,
                                            java.lang.Boolean summary,
                                            java.lang.String filter,
                                            java.lang.String sort)
                                     throws ApiException
        List feature flags Get a list of all features in the given project. By default, each feature includes configurations for each environment. You can filter environments with the env query parameter. For example, setting `env=production` restricts the returned configurations to just your production environment. You can also filter feature flags by tag with the tag query parameter. We support the following fields for filters: - `query` is a string that matches against the flags' keys and names. It is not case sensitive. - `archived` is a boolean to filter the list to archived flags. When this is absent, only unarchived flags are returned. - `type` is a string allowing filtering to `temporary` or `permanent` flags. - `status` is a string allowing filtering to `new`, `inactive`, `active`, or `launched` flags in the specified environment. This filter also requires a `filterEnv` field to be set to a valid environment. For example: `filter=status:active,filterEnv:production`. - `tags` is a + separated list of tags. It filters the list to members who have all of the tags in the list. - `hasExperiment` is a boolean with values of true or false and returns any flags that have an attached metric. - `hasDataExport` is a boolean with values of true or false and returns any flags that are currently exporting data in the specified environment. This includes flags that are exporting data via Experimentation. This filter also requires a `filterEnv` field to be set to a valid environment key. e.g. `filter=hasExperiment:true,filterEnv:production` - `evaluated` is an object that contains a key of `after` and a value in Unix time in milliseconds. This returns all flags that have been evaluated since the time you specify in the environment provided. This filter also requires a `filterEnv` field to be set to a valid environment. For example: `filter=evaluated:{\"after\": 1590768455282},filterEnv:production`. - `filterEnv` is a string with the key of a valid environment. The filterEnv field is used for filters that are environment specific. If there are multiple environment specific filters you should only declare this parameter once. For example: `filter=evaluated:{\"after\": 1590768455282},filterEnv:production,status:active`. An example filter is `query:abc,tags:foo+bar`. This matches flags with the string `abc` in their key or name, ignoring case, which also have the tags `foo` and `bar`. By default, this returns all flags. You can page through the list with the `limit` parameter and by following the `first`, `prev`, `next`, and `last` links in the returned `_links` field. These links will not be present if 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.
        Parameters:
        projKey - The project key (required)
        env - Filter configurations by environment (optional)
        tag - Filter feature flags by tag (optional)
        limit - The number of feature flags to return. Defaults to -1, which returns all flags (optional)
        offset - Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next limit items (optional)
        query - A string that matches against the flags' keys and names. It is not case sensitive (optional)
        archived - A boolean to filter the list to archived flags. When this is absent, only unarchived flags will be returned (optional)
        summary - By default in API version >= 1, flags will _not_ include their list of prerequisites, targets or rules. Set summary=0 to include these fields for each flag returned (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:
        FeatureFlags
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • getFeatureFlagsWithHttpInfo

        public ApiResponse<FeatureFlags> getFeatureFlagsWithHttpInfo​(java.lang.String projKey,
                                                                     java.lang.String env,
                                                                     java.lang.String tag,
                                                                     java.lang.Long limit,
                                                                     java.lang.Long offset,
                                                                     java.lang.String query,
                                                                     java.lang.Boolean archived,
                                                                     java.lang.Boolean summary,
                                                                     java.lang.String filter,
                                                                     java.lang.String sort)
                                                              throws ApiException
        List feature flags Get a list of all features in the given project. By default, each feature includes configurations for each environment. You can filter environments with the env query parameter. For example, setting `env=production` restricts the returned configurations to just your production environment. You can also filter feature flags by tag with the tag query parameter. We support the following fields for filters: - `query` is a string that matches against the flags' keys and names. It is not case sensitive. - `archived` is a boolean to filter the list to archived flags. When this is absent, only unarchived flags are returned. - `type` is a string allowing filtering to `temporary` or `permanent` flags. - `status` is a string allowing filtering to `new`, `inactive`, `active`, or `launched` flags in the specified environment. This filter also requires a `filterEnv` field to be set to a valid environment. For example: `filter=status:active,filterEnv:production`. - `tags` is a + separated list of tags. It filters the list to members who have all of the tags in the list. - `hasExperiment` is a boolean with values of true or false and returns any flags that have an attached metric. - `hasDataExport` is a boolean with values of true or false and returns any flags that are currently exporting data in the specified environment. This includes flags that are exporting data via Experimentation. This filter also requires a `filterEnv` field to be set to a valid environment key. e.g. `filter=hasExperiment:true,filterEnv:production` - `evaluated` is an object that contains a key of `after` and a value in Unix time in milliseconds. This returns all flags that have been evaluated since the time you specify in the environment provided. This filter also requires a `filterEnv` field to be set to a valid environment. For example: `filter=evaluated:{\"after\": 1590768455282},filterEnv:production`. - `filterEnv` is a string with the key of a valid environment. The filterEnv field is used for filters that are environment specific. If there are multiple environment specific filters you should only declare this parameter once. For example: `filter=evaluated:{\"after\": 1590768455282},filterEnv:production,status:active`. An example filter is `query:abc,tags:foo+bar`. This matches flags with the string `abc` in their key or name, ignoring case, which also have the tags `foo` and `bar`. By default, this returns all flags. You can page through the list with the `limit` parameter and by following the `first`, `prev`, `next`, and `last` links in the returned `_links` field. These links will not be present if 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.
        Parameters:
        projKey - The project key (required)
        env - Filter configurations by environment (optional)
        tag - Filter feature flags by tag (optional)
        limit - The number of feature flags to return. Defaults to -1, which returns all flags (optional)
        offset - Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next limit items (optional)
        query - A string that matches against the flags' keys and names. It is not case sensitive (optional)
        archived - A boolean to filter the list to archived flags. When this is absent, only unarchived flags will be returned (optional)
        summary - By default in API version >= 1, flags will _not_ include their list of prerequisites, targets or rules. Set summary=0 to include these fields for each flag returned (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<FeatureFlags>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • getFeatureFlagsAsync

        public okhttp3.Call getFeatureFlagsAsync​(java.lang.String projKey,
                                                 java.lang.String env,
                                                 java.lang.String tag,
                                                 java.lang.Long limit,
                                                 java.lang.Long offset,
                                                 java.lang.String query,
                                                 java.lang.Boolean archived,
                                                 java.lang.Boolean summary,
                                                 java.lang.String filter,
                                                 java.lang.String sort,
                                                 ApiCallback<FeatureFlags> _callback)
                                          throws ApiException
        List feature flags (asynchronously) Get a list of all features in the given project. By default, each feature includes configurations for each environment. You can filter environments with the env query parameter. For example, setting `env=production` restricts the returned configurations to just your production environment. You can also filter feature flags by tag with the tag query parameter. We support the following fields for filters: - `query` is a string that matches against the flags' keys and names. It is not case sensitive. - `archived` is a boolean to filter the list to archived flags. When this is absent, only unarchived flags are returned. - `type` is a string allowing filtering to `temporary` or `permanent` flags. - `status` is a string allowing filtering to `new`, `inactive`, `active`, or `launched` flags in the specified environment. This filter also requires a `filterEnv` field to be set to a valid environment. For example: `filter=status:active,filterEnv:production`. - `tags` is a + separated list of tags. It filters the list to members who have all of the tags in the list. - `hasExperiment` is a boolean with values of true or false and returns any flags that have an attached metric. - `hasDataExport` is a boolean with values of true or false and returns any flags that are currently exporting data in the specified environment. This includes flags that are exporting data via Experimentation. This filter also requires a `filterEnv` field to be set to a valid environment key. e.g. `filter=hasExperiment:true,filterEnv:production` - `evaluated` is an object that contains a key of `after` and a value in Unix time in milliseconds. This returns all flags that have been evaluated since the time you specify in the environment provided. This filter also requires a `filterEnv` field to be set to a valid environment. For example: `filter=evaluated:{\"after\": 1590768455282},filterEnv:production`. - `filterEnv` is a string with the key of a valid environment. The filterEnv field is used for filters that are environment specific. If there are multiple environment specific filters you should only declare this parameter once. For example: `filter=evaluated:{\"after\": 1590768455282},filterEnv:production,status:active`. An example filter is `query:abc,tags:foo+bar`. This matches flags with the string `abc` in their key or name, ignoring case, which also have the tags `foo` and `bar`. By default, this returns all flags. You can page through the list with the `limit` parameter and by following the `first`, `prev`, `next`, and `last` links in the returned `_links` field. These links will not be present if 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.
        Parameters:
        projKey - The project key (required)
        env - Filter configurations by environment (optional)
        tag - Filter feature flags by tag (optional)
        limit - The number of feature flags to return. Defaults to -1, which returns all flags (optional)
        offset - Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next limit items (optional)
        query - A string that matches against the flags' keys and names. It is not case sensitive (optional)
        archived - A boolean to filter the list to archived flags. When this is absent, only unarchived flags will be returned (optional)
        summary - By default in API version >= 1, flags will _not_ include their list of prerequisites, targets or rules. Set summary=0 to include these fields for each flag returned (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
      • patchExpiringUserTargetsCall

        public okhttp3.Call patchExpiringUserTargetsCall​(java.lang.String projKey,
                                                         java.lang.String envKey,
                                                         java.lang.String flagKey,
                                                         PatchWithComment patchWithComment,
                                                         ApiCallback _callback)
                                                  throws ApiException
        Build call for patchExpiringUserTargets
        Parameters:
        projKey - The project key. (required)
        envKey - The environment key. (required)
        flagKey - The feature flag key. (required)
        patchWithComment - (required)
        _callback - Callback for upload/download progress
        Returns:
        Call to execute
        Throws:
        ApiException - If fail to serialize the request body object
      • patchExpiringUserTargets

        public ExpiringUserTargetPatchResponse patchExpiringUserTargets​(java.lang.String projKey,
                                                                        java.lang.String envKey,
                                                                        java.lang.String flagKey,
                                                                        PatchWithComment patchWithComment)
                                                                 throws ApiException
        Update expiring user targets on feature flag Update the list of user targets on a feature flag that are scheduled for removal.
        Parameters:
        projKey - The project key. (required)
        envKey - The environment key. (required)
        flagKey - The feature flag key. (required)
        patchWithComment - (required)
        Returns:
        ExpiringUserTargetPatchResponse
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • patchExpiringUserTargetsWithHttpInfo

        public ApiResponse<ExpiringUserTargetPatchResponse> patchExpiringUserTargetsWithHttpInfo​(java.lang.String projKey,
                                                                                                 java.lang.String envKey,
                                                                                                 java.lang.String flagKey,
                                                                                                 PatchWithComment patchWithComment)
                                                                                          throws ApiException
        Update expiring user targets on feature flag Update the list of user targets on a feature flag that are scheduled for removal.
        Parameters:
        projKey - The project key. (required)
        envKey - The environment key. (required)
        flagKey - The feature flag key. (required)
        patchWithComment - (required)
        Returns:
        ApiResponse<ExpiringUserTargetPatchResponse>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • patchExpiringUserTargetsAsync

        public okhttp3.Call patchExpiringUserTargetsAsync​(java.lang.String projKey,
                                                          java.lang.String envKey,
                                                          java.lang.String flagKey,
                                                          PatchWithComment patchWithComment,
                                                          ApiCallback<ExpiringUserTargetPatchResponse> _callback)
                                                   throws ApiException
        Update expiring user targets on feature flag (asynchronously) Update the list of user targets on a feature flag that are scheduled for removal.
        Parameters:
        projKey - The project key. (required)
        envKey - The environment key. (required)
        flagKey - The feature flag key. (required)
        patchWithComment - (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
      • patchFeatureFlagCall

        public okhttp3.Call patchFeatureFlagCall​(java.lang.String projKey,
                                                 java.lang.String key,
                                                 PatchWithComment patchWithComment,
                                                 ApiCallback _callback)
                                          throws ApiException
        Build call for patchFeatureFlag
        Parameters:
        projKey - The project key. (required)
        key - The feature flag's key. The key identifies the flag in your code. (required)
        patchWithComment - (required)
        _callback - Callback for upload/download progress
        Returns:
        Call to execute
        Throws:
        ApiException - If fail to serialize the request body object
      • patchFeatureFlag

        public FeatureFlag patchFeatureFlag​(java.lang.String projKey,
                                            java.lang.String key,
                                            PatchWithComment patchWithComment)
                                     throws ApiException
        Update feature flag Perform a partial update to a feature flag. ## Using JSON Patches on a feature flag When using the update feature flag endpoint to add individual users to a specific variation, there are two different patch documents, depending on whether users are already being individually targeted for the variation. If a flag variation already has users individually targeted, the path for the JSON Patch operation is: ```json { \"op\": \"add\", \"path\": \"/environments/devint/targets/0/values/-\", \"value\": \"TestClient10\" } ``` If a flag variation does not already have users individually targeted, the path for the JSON Patch operation is: ```json [ { \"op\": \"add\", \"path\": \"/environments/devint/targets/-\", \"value\": { \"variation\": 0, \"values\": [\"TestClient10\"] } } ] ``` ## Using semantic patches on a feature flag To use a [semantic patch](/#section/Updates/Updates-via-semantic-patches) on a feature flag resource, you must include a header in the request. If you call a semantic patch resource without this header, you receive a `400` response as your semantic patch will be interpreted as a JSON patch. Use this header: ``` Content-Type: application/json; domain-model=launchdarkly.semanticpatch ``` The body of a semantic patch request takes the following three properties: 1. comment `string`: (Optional) A description of the update. 1. environmentKey `string`: (Required) The key of the LaunchDarkly environment. 1. instructions `array`: (Required) The action or list of actions to be performed by the update. Each update action in the list must be an object/hash table with a `kind` property, although depending on the action, other properties may be necessary. Read below for more information on the specific supported semantic patch instructions. If any instruction in the patch encounters an error, the error will be returned and the flag will not be changed. In general, instructions will silently do nothing if the flag is already in the state requested by the patch instruction. For example, `removeUserTargets` does nothing when the targets have already been removed). They will generally error if a parameter refers to something that does not exist, like a variation ID that doesn't correspond to a variation on the flag or a rule ID that doesn't belong to a rule on the flag. Other specific error conditions are noted in the instruction descriptions. ### Instructions #### `turnFlagOn` Sets the flag's targeting state to on. #### `turnFlagOff` Sets the flag's targeting state to off. #### `addUserTargets` Adds the user keys in `values` to the individual user targets for the variation specified by `variationId`. Returns an error if this causes the same user key to be targeted in multiple variations. ##### Parameters - `values`: list of user keys - `variationId`: ID of a variation on the flag #### `removeUserTargets` Removes the user keys in `values` to the individual user targets for the variation specified by `variationId`. Does nothing if the user keys are not targeted. ##### Parameters - `values`: list of user keys - `variationId`: ID of a variation on the flag #### `replaceUserTargets` Completely replaces the existing set of user targeting. All variations must be provided. Example: ```json { \"kind\": \"replaceUserTargets\", \"targets\": [ { \"variationId\": \"variation-1\", \"values\": [\"blah\", \"foo\", \"bar\"] }, { \"variationId\": \"variation-2\", \"values\": [\"abc\", \"def\"] } ] } ``` ##### Parameters - `targets`: a list of user targeting #### `clearUserTargets` Removes all individual user targets from the variation specified by `variationId` ##### Parameters - `variationId`: ID of a variation on the flag #### `addPrerequisite` Adds the flag indicated by `key` with variation `variationId` as a prerequisite to the flag. ##### Parameters - `key`: flag key of another flag - `variationId`: ID of a variation of the flag with key `key` #### `removePrerequisite` Removes the prerequisite indicated by `key`. Does nothing if this prerequisite does not exist. ##### Parameters - `key`: flag key of an existing prerequisite #### `updatePrerequisite` Changes the prerequisite with flag key `key` to the variation indicated by `variationId`. Returns an error if this prerequisite does not exist. ##### Parameters - `key`: flag key of an existing prerequisite - `variationId`: ID of a variation of the flag with key `key` #### `replacePrerequisites` Completely replaces the existing set of prerequisites for a given flag. Example: ```json { \"kind\": \"replacePrerequisites\", \"prerequisites\": [ { \"key\": \"flag-key\", \"variationId\": \"variation-1\" }, { \"key\": \"another-flag\", \"variationId\": \"variation-2\" } ] } ``` ##### Parameters - `prerequisites`: a list of prerequisites #### `addRule` Adds a new rule to the flag with the given `clauses` which serves the variation indicated by `variationId` or the percent rollout indicated by `rolloutWeights` and `rolloutBucketBy`. If `beforeRuleId` is set, the rule will be added in the list of rules before the indicated rule. Otherwise, the rule will be added to the end of the list. ##### Parameters - `clauses`: Array of clauses (see `addClauses`) - `beforeRuleId`: Optional ID of a rule in the flag - `variationId`: ID of a variation of the flag - `rolloutWeights`: Map of variationId to weight in thousandths of a percent (0-100000) - `rolloutBucketBy`: Optional user attribute #### `removeRule` Removes the targeting rule specified by `ruleId`. Does nothing if the rule does not exist. ##### Parameters - `ruleId`: ID of a rule in the flag #### `replaceRules` Completely replaces the existing rules for a given flag. Example: ```json { \"kind\": \"replaceRules\", \"rules\": [ { \"variationId\": \"variation-1\", \"description\": \"myRule\", \"clauses\": [ { \"attribute\": \"segmentMatch\", \"op\": \"segmentMatch\", \"values\": [\"test\"] } ], \"trackEvents\": true } ] } ``` ##### Parameters - `rules`: a list of rules #### `addClauses` Adds the given clauses to the rule indicated by `ruleId`. ##### Parameters - `ruleId`: ID of a rule in the flag - `clauses`: Array of clause objects, with `attribute` (string), `op` (string), and `values` (array of strings, numbers, or dates) properties. #### `removeClauses` Removes the clauses specified by `clauseIds` from the rule indicated by `ruleId`. #### Parameters - `ruleId`: ID of a rule in the flag - `clauseIds`: Array of IDs of clauses in the rule #### `updateClause` Replaces the clause indicated by `ruleId` and `clauseId` with `clause`. ##### Parameters - `ruleId`: ID of a rule in the flag - `clauseId`: ID of a clause in that rule - `clause`: Clause object #### `addValuesToClause` Adds `values` to the values of the clause indicated by `ruleId` and `clauseId`. ##### Parameters - `ruleId`: ID of a rule in the flag - `clauseId`: ID of a clause in that rule - `values`: Array of strings #### `removeValuesFromClause` Removes `values` from the values of the clause indicated by `ruleId` and `clauseId`. ##### Parameters `ruleId`: ID of a rule in the flag `clauseId`: ID of a clause in that rule `values`: Array of strings #### `reorderRules` Rearranges the rules to match the order given in `ruleIds`. Will return an error if `ruleIds` does not match the current set of rules on the flag. ##### Parameters - `ruleIds`: Array of IDs of all rules in the flag #### `updateRuleVariationOrRollout` Updates what the rule indicated by `ruleId` serves if its clauses evaluate to true. Can either be a fixed variation indicated by `variationId` or a percent rollout indicated by `rolloutWeights` and `rolloutBucketBy`. ##### Parameters - `ruleId`: ID of a rule in the flag - `variationId`: ID of a variation of the flag or - `rolloutWeights`: Map of variationId to weight in thousandths of a percent (0-100000) - `rolloutBucketBy`: Optional user attribute #### `updateFallthroughVariationOrRollout` Updates the flag's fallthrough, which is served if none of the targeting rules match. Can either be a fixed variation indicated by `variationId` or a percent rollout indicated by `rolloutWeights` and `rolloutBucketBy`. ##### Parameters `variationId`: ID of a variation of the flag or `rolloutWeights`: Map of variationId to weight in thousandths of a percent (0-100000) `rolloutBucketBy`: Optional user attribute #### `updateOffVariation` Updates the variation served when the flag's targeting is off to the variation indicated by `variationId`. ##### Parameters `variationId`: ID of a variation of the flag ### Example ```json { \"environmentKey\": \"production\", \"instructions\": [ { \"kind\": \"turnFlagOn\" }, { \"kind\": \"turnFlagOff\" }, { \"kind\": \"addUserTargets\", \"variationId\": \"8bfb304e-d516-47e5-8727-e7f798e8992d\", \"values\": [\"userId\", \"userId2\"] }, { \"kind\": \"removeUserTargets\", \"variationId\": \"8bfb304e-d516-47e5-8727-e7f798e8992d\", \"values\": [\"userId3\", \"userId4\"] }, { \"kind\": \"updateFallthroughVariationOrRollout\", \"rolloutWeights\": { \"variationId\": 50000, \"variationId2\": 50000 }, \"rolloutBucketBy\": null }, { \"kind\": \"addRule\", \"clauses\": [ { \"attribute\": \"segmentMatch\", \"negate\": false, \"values\": [\"test-segment\"] } ], \"variationId\": null, \"rolloutWeights\": { \"variationId\": 50000, \"variationId2\": 50000 }, \"rolloutBucketBy\": \"key\" }, { \"kind\": \"removeRule\", \"ruleId\": \"99f12464-a429-40fc-86cc-b27612188955\" }, { \"kind\": \"reorderRules\", \"ruleIds\": [\"2f72974e-de68-4243-8dd3-739582147a1f\", \"8bfb304e-d516-47e5-8727-e7f798e8992d\"] }, { \"kind\": \"addClauses\", \"ruleId\": \"1134\", \"clauses\": [ { \"attribute\": \"email\", \"op\": \"in\", \"negate\": false, \"values\": [\"[email protected]\"] } ] }, { \"kind\": \"removeClauses\", \"ruleId\": \"1242529\", \"clauseIds\": [\"8bfb304e-d516-47e5-8727-e7f798e8992d\"] }, { \"kind\": \"updateClause\", \"ruleId\": \"2f72974e-de68-4243-8dd3-739582147a1f\", \"clauseId\": \"309845\", \"clause\": { \"attribute\": \"segmentMatch\", \"negate\": false, \"values\": [\"test-segment\"] } }, { \"kind\": \"updateRuleVariationOrRollout\", \"ruleId\": \"2342\", \"rolloutWeights\": null, \"rolloutBucketBy\": null }, { \"kind\": \"updateOffVariation\", \"variationId\": \"3242453\" }, { \"kind\": \"addPrerequisite\", \"variationId\": \"234235\", \"key\": \"flagKey2\" }, { \"kind\": \"updatePrerequisite\", \"variationId\": \"234235\", \"key\": \"flagKey2\" }, { \"kind\": \"removePrerequisite\", \"key\": \"flagKey\" } ] } ``` ## Using JSON patches on a feature flag If you do not include the header described above, you can use [JSON patch](/#section/Updates/Updates-via-JSON-Patch).
        Parameters:
        projKey - The project key. (required)
        key - The feature flag's key. The key identifies the flag in your code. (required)
        patchWithComment - (required)
        Returns:
        FeatureFlag
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • patchFeatureFlagWithHttpInfo

        public ApiResponse<FeatureFlag> patchFeatureFlagWithHttpInfo​(java.lang.String projKey,
                                                                     java.lang.String key,
                                                                     PatchWithComment patchWithComment)
                                                              throws ApiException
        Update feature flag Perform a partial update to a feature flag. ## Using JSON Patches on a feature flag When using the update feature flag endpoint to add individual users to a specific variation, there are two different patch documents, depending on whether users are already being individually targeted for the variation. If a flag variation already has users individually targeted, the path for the JSON Patch operation is: ```json { \"op\": \"add\", \"path\": \"/environments/devint/targets/0/values/-\", \"value\": \"TestClient10\" } ``` If a flag variation does not already have users individually targeted, the path for the JSON Patch operation is: ```json [ { \"op\": \"add\", \"path\": \"/environments/devint/targets/-\", \"value\": { \"variation\": 0, \"values\": [\"TestClient10\"] } } ] ``` ## Using semantic patches on a feature flag To use a [semantic patch](/#section/Updates/Updates-via-semantic-patches) on a feature flag resource, you must include a header in the request. If you call a semantic patch resource without this header, you receive a `400` response as your semantic patch will be interpreted as a JSON patch. Use this header: ``` Content-Type: application/json; domain-model=launchdarkly.semanticpatch ``` The body of a semantic patch request takes the following three properties: 1. comment `string`: (Optional) A description of the update. 1. environmentKey `string`: (Required) The key of the LaunchDarkly environment. 1. instructions `array`: (Required) The action or list of actions to be performed by the update. Each update action in the list must be an object/hash table with a `kind` property, although depending on the action, other properties may be necessary. Read below for more information on the specific supported semantic patch instructions. If any instruction in the patch encounters an error, the error will be returned and the flag will not be changed. In general, instructions will silently do nothing if the flag is already in the state requested by the patch instruction. For example, `removeUserTargets` does nothing when the targets have already been removed). They will generally error if a parameter refers to something that does not exist, like a variation ID that doesn't correspond to a variation on the flag or a rule ID that doesn't belong to a rule on the flag. Other specific error conditions are noted in the instruction descriptions. ### Instructions #### `turnFlagOn` Sets the flag's targeting state to on. #### `turnFlagOff` Sets the flag's targeting state to off. #### `addUserTargets` Adds the user keys in `values` to the individual user targets for the variation specified by `variationId`. Returns an error if this causes the same user key to be targeted in multiple variations. ##### Parameters - `values`: list of user keys - `variationId`: ID of a variation on the flag #### `removeUserTargets` Removes the user keys in `values` to the individual user targets for the variation specified by `variationId`. Does nothing if the user keys are not targeted. ##### Parameters - `values`: list of user keys - `variationId`: ID of a variation on the flag #### `replaceUserTargets` Completely replaces the existing set of user targeting. All variations must be provided. Example: ```json { \"kind\": \"replaceUserTargets\", \"targets\": [ { \"variationId\": \"variation-1\", \"values\": [\"blah\", \"foo\", \"bar\"] }, { \"variationId\": \"variation-2\", \"values\": [\"abc\", \"def\"] } ] } ``` ##### Parameters - `targets`: a list of user targeting #### `clearUserTargets` Removes all individual user targets from the variation specified by `variationId` ##### Parameters - `variationId`: ID of a variation on the flag #### `addPrerequisite` Adds the flag indicated by `key` with variation `variationId` as a prerequisite to the flag. ##### Parameters - `key`: flag key of another flag - `variationId`: ID of a variation of the flag with key `key` #### `removePrerequisite` Removes the prerequisite indicated by `key`. Does nothing if this prerequisite does not exist. ##### Parameters - `key`: flag key of an existing prerequisite #### `updatePrerequisite` Changes the prerequisite with flag key `key` to the variation indicated by `variationId`. Returns an error if this prerequisite does not exist. ##### Parameters - `key`: flag key of an existing prerequisite - `variationId`: ID of a variation of the flag with key `key` #### `replacePrerequisites` Completely replaces the existing set of prerequisites for a given flag. Example: ```json { \"kind\": \"replacePrerequisites\", \"prerequisites\": [ { \"key\": \"flag-key\", \"variationId\": \"variation-1\" }, { \"key\": \"another-flag\", \"variationId\": \"variation-2\" } ] } ``` ##### Parameters - `prerequisites`: a list of prerequisites #### `addRule` Adds a new rule to the flag with the given `clauses` which serves the variation indicated by `variationId` or the percent rollout indicated by `rolloutWeights` and `rolloutBucketBy`. If `beforeRuleId` is set, the rule will be added in the list of rules before the indicated rule. Otherwise, the rule will be added to the end of the list. ##### Parameters - `clauses`: Array of clauses (see `addClauses`) - `beforeRuleId`: Optional ID of a rule in the flag - `variationId`: ID of a variation of the flag - `rolloutWeights`: Map of variationId to weight in thousandths of a percent (0-100000) - `rolloutBucketBy`: Optional user attribute #### `removeRule` Removes the targeting rule specified by `ruleId`. Does nothing if the rule does not exist. ##### Parameters - `ruleId`: ID of a rule in the flag #### `replaceRules` Completely replaces the existing rules for a given flag. Example: ```json { \"kind\": \"replaceRules\", \"rules\": [ { \"variationId\": \"variation-1\", \"description\": \"myRule\", \"clauses\": [ { \"attribute\": \"segmentMatch\", \"op\": \"segmentMatch\", \"values\": [\"test\"] } ], \"trackEvents\": true } ] } ``` ##### Parameters - `rules`: a list of rules #### `addClauses` Adds the given clauses to the rule indicated by `ruleId`. ##### Parameters - `ruleId`: ID of a rule in the flag - `clauses`: Array of clause objects, with `attribute` (string), `op` (string), and `values` (array of strings, numbers, or dates) properties. #### `removeClauses` Removes the clauses specified by `clauseIds` from the rule indicated by `ruleId`. #### Parameters - `ruleId`: ID of a rule in the flag - `clauseIds`: Array of IDs of clauses in the rule #### `updateClause` Replaces the clause indicated by `ruleId` and `clauseId` with `clause`. ##### Parameters - `ruleId`: ID of a rule in the flag - `clauseId`: ID of a clause in that rule - `clause`: Clause object #### `addValuesToClause` Adds `values` to the values of the clause indicated by `ruleId` and `clauseId`. ##### Parameters - `ruleId`: ID of a rule in the flag - `clauseId`: ID of a clause in that rule - `values`: Array of strings #### `removeValuesFromClause` Removes `values` from the values of the clause indicated by `ruleId` and `clauseId`. ##### Parameters `ruleId`: ID of a rule in the flag `clauseId`: ID of a clause in that rule `values`: Array of strings #### `reorderRules` Rearranges the rules to match the order given in `ruleIds`. Will return an error if `ruleIds` does not match the current set of rules on the flag. ##### Parameters - `ruleIds`: Array of IDs of all rules in the flag #### `updateRuleVariationOrRollout` Updates what the rule indicated by `ruleId` serves if its clauses evaluate to true. Can either be a fixed variation indicated by `variationId` or a percent rollout indicated by `rolloutWeights` and `rolloutBucketBy`. ##### Parameters - `ruleId`: ID of a rule in the flag - `variationId`: ID of a variation of the flag or - `rolloutWeights`: Map of variationId to weight in thousandths of a percent (0-100000) - `rolloutBucketBy`: Optional user attribute #### `updateFallthroughVariationOrRollout` Updates the flag's fallthrough, which is served if none of the targeting rules match. Can either be a fixed variation indicated by `variationId` or a percent rollout indicated by `rolloutWeights` and `rolloutBucketBy`. ##### Parameters `variationId`: ID of a variation of the flag or `rolloutWeights`: Map of variationId to weight in thousandths of a percent (0-100000) `rolloutBucketBy`: Optional user attribute #### `updateOffVariation` Updates the variation served when the flag's targeting is off to the variation indicated by `variationId`. ##### Parameters `variationId`: ID of a variation of the flag ### Example ```json { \"environmentKey\": \"production\", \"instructions\": [ { \"kind\": \"turnFlagOn\" }, { \"kind\": \"turnFlagOff\" }, { \"kind\": \"addUserTargets\", \"variationId\": \"8bfb304e-d516-47e5-8727-e7f798e8992d\", \"values\": [\"userId\", \"userId2\"] }, { \"kind\": \"removeUserTargets\", \"variationId\": \"8bfb304e-d516-47e5-8727-e7f798e8992d\", \"values\": [\"userId3\", \"userId4\"] }, { \"kind\": \"updateFallthroughVariationOrRollout\", \"rolloutWeights\": { \"variationId\": 50000, \"variationId2\": 50000 }, \"rolloutBucketBy\": null }, { \"kind\": \"addRule\", \"clauses\": [ { \"attribute\": \"segmentMatch\", \"negate\": false, \"values\": [\"test-segment\"] } ], \"variationId\": null, \"rolloutWeights\": { \"variationId\": 50000, \"variationId2\": 50000 }, \"rolloutBucketBy\": \"key\" }, { \"kind\": \"removeRule\", \"ruleId\": \"99f12464-a429-40fc-86cc-b27612188955\" }, { \"kind\": \"reorderRules\", \"ruleIds\": [\"2f72974e-de68-4243-8dd3-739582147a1f\", \"8bfb304e-d516-47e5-8727-e7f798e8992d\"] }, { \"kind\": \"addClauses\", \"ruleId\": \"1134\", \"clauses\": [ { \"attribute\": \"email\", \"op\": \"in\", \"negate\": false, \"values\": [\"[email protected]\"] } ] }, { \"kind\": \"removeClauses\", \"ruleId\": \"1242529\", \"clauseIds\": [\"8bfb304e-d516-47e5-8727-e7f798e8992d\"] }, { \"kind\": \"updateClause\", \"ruleId\": \"2f72974e-de68-4243-8dd3-739582147a1f\", \"clauseId\": \"309845\", \"clause\": { \"attribute\": \"segmentMatch\", \"negate\": false, \"values\": [\"test-segment\"] } }, { \"kind\": \"updateRuleVariationOrRollout\", \"ruleId\": \"2342\", \"rolloutWeights\": null, \"rolloutBucketBy\": null }, { \"kind\": \"updateOffVariation\", \"variationId\": \"3242453\" }, { \"kind\": \"addPrerequisite\", \"variationId\": \"234235\", \"key\": \"flagKey2\" }, { \"kind\": \"updatePrerequisite\", \"variationId\": \"234235\", \"key\": \"flagKey2\" }, { \"kind\": \"removePrerequisite\", \"key\": \"flagKey\" } ] } ``` ## Using JSON patches on a feature flag If you do not include the header described above, you can use [JSON patch](/#section/Updates/Updates-via-JSON-Patch).
        Parameters:
        projKey - The project key. (required)
        key - The feature flag's key. The key identifies the flag in your code. (required)
        patchWithComment - (required)
        Returns:
        ApiResponse<FeatureFlag>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • patchFeatureFlagAsync

        public okhttp3.Call patchFeatureFlagAsync​(java.lang.String projKey,
                                                  java.lang.String key,
                                                  PatchWithComment patchWithComment,
                                                  ApiCallback<FeatureFlag> _callback)
                                           throws ApiException
        Update feature flag (asynchronously) Perform a partial update to a feature flag. ## Using JSON Patches on a feature flag When using the update feature flag endpoint to add individual users to a specific variation, there are two different patch documents, depending on whether users are already being individually targeted for the variation. If a flag variation already has users individually targeted, the path for the JSON Patch operation is: ```json { \"op\": \"add\", \"path\": \"/environments/devint/targets/0/values/-\", \"value\": \"TestClient10\" } ``` If a flag variation does not already have users individually targeted, the path for the JSON Patch operation is: ```json [ { \"op\": \"add\", \"path\": \"/environments/devint/targets/-\", \"value\": { \"variation\": 0, \"values\": [\"TestClient10\"] } } ] ``` ## Using semantic patches on a feature flag To use a [semantic patch](/#section/Updates/Updates-via-semantic-patches) on a feature flag resource, you must include a header in the request. If you call a semantic patch resource without this header, you receive a `400` response as your semantic patch will be interpreted as a JSON patch. Use this header: ``` Content-Type: application/json; domain-model=launchdarkly.semanticpatch ``` The body of a semantic patch request takes the following three properties: 1. comment `string`: (Optional) A description of the update. 1. environmentKey `string`: (Required) The key of the LaunchDarkly environment. 1. instructions `array`: (Required) The action or list of actions to be performed by the update. Each update action in the list must be an object/hash table with a `kind` property, although depending on the action, other properties may be necessary. Read below for more information on the specific supported semantic patch instructions. If any instruction in the patch encounters an error, the error will be returned and the flag will not be changed. In general, instructions will silently do nothing if the flag is already in the state requested by the patch instruction. For example, `removeUserTargets` does nothing when the targets have already been removed). They will generally error if a parameter refers to something that does not exist, like a variation ID that doesn't correspond to a variation on the flag or a rule ID that doesn't belong to a rule on the flag. Other specific error conditions are noted in the instruction descriptions. ### Instructions #### `turnFlagOn` Sets the flag's targeting state to on. #### `turnFlagOff` Sets the flag's targeting state to off. #### `addUserTargets` Adds the user keys in `values` to the individual user targets for the variation specified by `variationId`. Returns an error if this causes the same user key to be targeted in multiple variations. ##### Parameters - `values`: list of user keys - `variationId`: ID of a variation on the flag #### `removeUserTargets` Removes the user keys in `values` to the individual user targets for the variation specified by `variationId`. Does nothing if the user keys are not targeted. ##### Parameters - `values`: list of user keys - `variationId`: ID of a variation on the flag #### `replaceUserTargets` Completely replaces the existing set of user targeting. All variations must be provided. Example: ```json { \"kind\": \"replaceUserTargets\", \"targets\": [ { \"variationId\": \"variation-1\", \"values\": [\"blah\", \"foo\", \"bar\"] }, { \"variationId\": \"variation-2\", \"values\": [\"abc\", \"def\"] } ] } ``` ##### Parameters - `targets`: a list of user targeting #### `clearUserTargets` Removes all individual user targets from the variation specified by `variationId` ##### Parameters - `variationId`: ID of a variation on the flag #### `addPrerequisite` Adds the flag indicated by `key` with variation `variationId` as a prerequisite to the flag. ##### Parameters - `key`: flag key of another flag - `variationId`: ID of a variation of the flag with key `key` #### `removePrerequisite` Removes the prerequisite indicated by `key`. Does nothing if this prerequisite does not exist. ##### Parameters - `key`: flag key of an existing prerequisite #### `updatePrerequisite` Changes the prerequisite with flag key `key` to the variation indicated by `variationId`. Returns an error if this prerequisite does not exist. ##### Parameters - `key`: flag key of an existing prerequisite - `variationId`: ID of a variation of the flag with key `key` #### `replacePrerequisites` Completely replaces the existing set of prerequisites for a given flag. Example: ```json { \"kind\": \"replacePrerequisites\", \"prerequisites\": [ { \"key\": \"flag-key\", \"variationId\": \"variation-1\" }, { \"key\": \"another-flag\", \"variationId\": \"variation-2\" } ] } ``` ##### Parameters - `prerequisites`: a list of prerequisites #### `addRule` Adds a new rule to the flag with the given `clauses` which serves the variation indicated by `variationId` or the percent rollout indicated by `rolloutWeights` and `rolloutBucketBy`. If `beforeRuleId` is set, the rule will be added in the list of rules before the indicated rule. Otherwise, the rule will be added to the end of the list. ##### Parameters - `clauses`: Array of clauses (see `addClauses`) - `beforeRuleId`: Optional ID of a rule in the flag - `variationId`: ID of a variation of the flag - `rolloutWeights`: Map of variationId to weight in thousandths of a percent (0-100000) - `rolloutBucketBy`: Optional user attribute #### `removeRule` Removes the targeting rule specified by `ruleId`. Does nothing if the rule does not exist. ##### Parameters - `ruleId`: ID of a rule in the flag #### `replaceRules` Completely replaces the existing rules for a given flag. Example: ```json { \"kind\": \"replaceRules\", \"rules\": [ { \"variationId\": \"variation-1\", \"description\": \"myRule\", \"clauses\": [ { \"attribute\": \"segmentMatch\", \"op\": \"segmentMatch\", \"values\": [\"test\"] } ], \"trackEvents\": true } ] } ``` ##### Parameters - `rules`: a list of rules #### `addClauses` Adds the given clauses to the rule indicated by `ruleId`. ##### Parameters - `ruleId`: ID of a rule in the flag - `clauses`: Array of clause objects, with `attribute` (string), `op` (string), and `values` (array of strings, numbers, or dates) properties. #### `removeClauses` Removes the clauses specified by `clauseIds` from the rule indicated by `ruleId`. #### Parameters - `ruleId`: ID of a rule in the flag - `clauseIds`: Array of IDs of clauses in the rule #### `updateClause` Replaces the clause indicated by `ruleId` and `clauseId` with `clause`. ##### Parameters - `ruleId`: ID of a rule in the flag - `clauseId`: ID of a clause in that rule - `clause`: Clause object #### `addValuesToClause` Adds `values` to the values of the clause indicated by `ruleId` and `clauseId`. ##### Parameters - `ruleId`: ID of a rule in the flag - `clauseId`: ID of a clause in that rule - `values`: Array of strings #### `removeValuesFromClause` Removes `values` from the values of the clause indicated by `ruleId` and `clauseId`. ##### Parameters `ruleId`: ID of a rule in the flag `clauseId`: ID of a clause in that rule `values`: Array of strings #### `reorderRules` Rearranges the rules to match the order given in `ruleIds`. Will return an error if `ruleIds` does not match the current set of rules on the flag. ##### Parameters - `ruleIds`: Array of IDs of all rules in the flag #### `updateRuleVariationOrRollout` Updates what the rule indicated by `ruleId` serves if its clauses evaluate to true. Can either be a fixed variation indicated by `variationId` or a percent rollout indicated by `rolloutWeights` and `rolloutBucketBy`. ##### Parameters - `ruleId`: ID of a rule in the flag - `variationId`: ID of a variation of the flag or - `rolloutWeights`: Map of variationId to weight in thousandths of a percent (0-100000) - `rolloutBucketBy`: Optional user attribute #### `updateFallthroughVariationOrRollout` Updates the flag's fallthrough, which is served if none of the targeting rules match. Can either be a fixed variation indicated by `variationId` or a percent rollout indicated by `rolloutWeights` and `rolloutBucketBy`. ##### Parameters `variationId`: ID of a variation of the flag or `rolloutWeights`: Map of variationId to weight in thousandths of a percent (0-100000) `rolloutBucketBy`: Optional user attribute #### `updateOffVariation` Updates the variation served when the flag's targeting is off to the variation indicated by `variationId`. ##### Parameters `variationId`: ID of a variation of the flag ### Example ```json { \"environmentKey\": \"production\", \"instructions\": [ { \"kind\": \"turnFlagOn\" }, { \"kind\": \"turnFlagOff\" }, { \"kind\": \"addUserTargets\", \"variationId\": \"8bfb304e-d516-47e5-8727-e7f798e8992d\", \"values\": [\"userId\", \"userId2\"] }, { \"kind\": \"removeUserTargets\", \"variationId\": \"8bfb304e-d516-47e5-8727-e7f798e8992d\", \"values\": [\"userId3\", \"userId4\"] }, { \"kind\": \"updateFallthroughVariationOrRollout\", \"rolloutWeights\": { \"variationId\": 50000, \"variationId2\": 50000 }, \"rolloutBucketBy\": null }, { \"kind\": \"addRule\", \"clauses\": [ { \"attribute\": \"segmentMatch\", \"negate\": false, \"values\": [\"test-segment\"] } ], \"variationId\": null, \"rolloutWeights\": { \"variationId\": 50000, \"variationId2\": 50000 }, \"rolloutBucketBy\": \"key\" }, { \"kind\": \"removeRule\", \"ruleId\": \"99f12464-a429-40fc-86cc-b27612188955\" }, { \"kind\": \"reorderRules\", \"ruleIds\": [\"2f72974e-de68-4243-8dd3-739582147a1f\", \"8bfb304e-d516-47e5-8727-e7f798e8992d\"] }, { \"kind\": \"addClauses\", \"ruleId\": \"1134\", \"clauses\": [ { \"attribute\": \"email\", \"op\": \"in\", \"negate\": false, \"values\": [\"[email protected]\"] } ] }, { \"kind\": \"removeClauses\", \"ruleId\": \"1242529\", \"clauseIds\": [\"8bfb304e-d516-47e5-8727-e7f798e8992d\"] }, { \"kind\": \"updateClause\", \"ruleId\": \"2f72974e-de68-4243-8dd3-739582147a1f\", \"clauseId\": \"309845\", \"clause\": { \"attribute\": \"segmentMatch\", \"negate\": false, \"values\": [\"test-segment\"] } }, { \"kind\": \"updateRuleVariationOrRollout\", \"ruleId\": \"2342\", \"rolloutWeights\": null, \"rolloutBucketBy\": null }, { \"kind\": \"updateOffVariation\", \"variationId\": \"3242453\" }, { \"kind\": \"addPrerequisite\", \"variationId\": \"234235\", \"key\": \"flagKey2\" }, { \"kind\": \"updatePrerequisite\", \"variationId\": \"234235\", \"key\": \"flagKey2\" }, { \"kind\": \"removePrerequisite\", \"key\": \"flagKey\" } ] } ``` ## Using JSON patches on a feature flag If you do not include the header described above, you can use [JSON patch](/#section/Updates/Updates-via-JSON-Patch).
        Parameters:
        projKey - The project key. (required)
        key - The feature flag's key. The key identifies the flag in your code. (required)
        patchWithComment - (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
      • postFeatureFlagCall

        public okhttp3.Call postFeatureFlagCall​(java.lang.String projKey,
                                                FeatureFlagBody featureFlagBody,
                                                java.lang.String clone,
                                                ApiCallback _callback)
                                         throws ApiException
        Build call for postFeatureFlag
        Parameters:
        projKey - The project key. (required)
        featureFlagBody - (required)
        clone - The key of the feature flag to be cloned. The key identifies the flag in your code. For example, setting `clone=flagKey` copies the full targeting configuration for all environments, including `on/off` state, from the original flag to the new flag. (optional)
        _callback - Callback for upload/download progress
        Returns:
        Call to execute
        Throws:
        ApiException - If fail to serialize the request body object
      • postFeatureFlag

        public FeatureFlag postFeatureFlag​(java.lang.String projKey,
                                           FeatureFlagBody featureFlagBody,
                                           java.lang.String clone)
                                    throws ApiException
        Create a feature flag Create a feature flag with the given name, key, and variations
        Parameters:
        projKey - The project key. (required)
        featureFlagBody - (required)
        clone - The key of the feature flag to be cloned. The key identifies the flag in your code. For example, setting `clone=flagKey` copies the full targeting configuration for all environments, including `on/off` state, from the original flag to the new flag. (optional)
        Returns:
        FeatureFlag
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • postFeatureFlagWithHttpInfo

        public ApiResponse<FeatureFlag> postFeatureFlagWithHttpInfo​(java.lang.String projKey,
                                                                    FeatureFlagBody featureFlagBody,
                                                                    java.lang.String clone)
                                                             throws ApiException
        Create a feature flag Create a feature flag with the given name, key, and variations
        Parameters:
        projKey - The project key. (required)
        featureFlagBody - (required)
        clone - The key of the feature flag to be cloned. The key identifies the flag in your code. For example, setting `clone=flagKey` copies the full targeting configuration for all environments, including `on/off` state, from the original flag to the new flag. (optional)
        Returns:
        ApiResponse<FeatureFlag>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • postFeatureFlagAsync

        public okhttp3.Call postFeatureFlagAsync​(java.lang.String projKey,
                                                 FeatureFlagBody featureFlagBody,
                                                 java.lang.String clone,
                                                 ApiCallback<FeatureFlag> _callback)
                                          throws ApiException
        Create a feature flag (asynchronously) Create a feature flag with the given name, key, and variations
        Parameters:
        projKey - The project key. (required)
        featureFlagBody - (required)
        clone - The key of the feature flag to be cloned. The key identifies the flag in your code. For example, setting `clone=flagKey` copies the full targeting configuration for all environments, including `on/off` state, from the original flag to the new flag. (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