Class WorkflowsApi


  • public class WorkflowsApi
    extends java.lang.Object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void deleteWorkflow​(java.lang.String projectKey, java.lang.String featureFlagKey, java.lang.String environmentKey, java.lang.String workflowId)
      Delete workflow Delete a workflow from a feature flag.
      okhttp3.Call deleteWorkflowAsync​(java.lang.String projectKey, java.lang.String featureFlagKey, java.lang.String environmentKey, java.lang.String workflowId, ApiCallback<java.lang.Void> _callback)
      Delete workflow (asynchronously) Delete a workflow from a feature flag.
      okhttp3.Call deleteWorkflowCall​(java.lang.String projectKey, java.lang.String featureFlagKey, java.lang.String environmentKey, java.lang.String workflowId, ApiCallback _callback)
      Build call for deleteWorkflow
      ApiResponse<java.lang.Void> deleteWorkflowWithHttpInfo​(java.lang.String projectKey, java.lang.String featureFlagKey, java.lang.String environmentKey, java.lang.String workflowId)
      Delete workflow Delete a workflow from a feature flag.
      ApiClient getApiClient()  
      java.lang.String getCustomBaseUrl()  
      CustomWorkflowOutput getCustomWorkflow​(java.lang.String projectKey, java.lang.String featureFlagKey, java.lang.String environmentKey, java.lang.String workflowId)
      Get custom workflow Get a specific workflow by ID.
      okhttp3.Call getCustomWorkflowAsync​(java.lang.String projectKey, java.lang.String featureFlagKey, java.lang.String environmentKey, java.lang.String workflowId, ApiCallback<CustomWorkflowOutput> _callback)
      Get custom workflow (asynchronously) Get a specific workflow by ID.
      okhttp3.Call getCustomWorkflowCall​(java.lang.String projectKey, java.lang.String featureFlagKey, java.lang.String environmentKey, java.lang.String workflowId, ApiCallback _callback)
      Build call for getCustomWorkflow
      ApiResponse<CustomWorkflowOutput> getCustomWorkflowWithHttpInfo​(java.lang.String projectKey, java.lang.String featureFlagKey, java.lang.String environmentKey, java.lang.String workflowId)
      Get custom workflow Get a specific workflow by ID.
      int getHostIndex()  
      CustomWorkflowsListingOutput getWorkflows​(java.lang.String projectKey, java.lang.String featureFlagKey, java.lang.String environmentKey, java.lang.String status, java.lang.String sort, java.lang.Long limit, java.lang.Long offset)
      Get workflows Display workflows associated with a feature flag.
      okhttp3.Call getWorkflowsAsync​(java.lang.String projectKey, java.lang.String featureFlagKey, java.lang.String environmentKey, java.lang.String status, java.lang.String sort, java.lang.Long limit, java.lang.Long offset, ApiCallback<CustomWorkflowsListingOutput> _callback)
      Get workflows (asynchronously) Display workflows associated with a feature flag.
      okhttp3.Call getWorkflowsCall​(java.lang.String projectKey, java.lang.String featureFlagKey, java.lang.String environmentKey, java.lang.String status, java.lang.String sort, java.lang.Long limit, java.lang.Long offset, ApiCallback _callback)
      Build call for getWorkflows
      ApiResponse<CustomWorkflowsListingOutput> getWorkflowsWithHttpInfo​(java.lang.String projectKey, java.lang.String featureFlagKey, java.lang.String environmentKey, java.lang.String status, java.lang.String sort, java.lang.Long limit, java.lang.Long offset)
      Get workflows Display workflows associated with a feature flag.
      CustomWorkflowOutput postWorkflow​(java.lang.String projectKey, java.lang.String featureFlagKey, java.lang.String environmentKey, CustomWorkflowInput customWorkflowInput, java.lang.String templateKey, java.lang.Boolean dryRun)
      Create workflow Create a workflow for a feature flag.
      okhttp3.Call postWorkflowAsync​(java.lang.String projectKey, java.lang.String featureFlagKey, java.lang.String environmentKey, CustomWorkflowInput customWorkflowInput, java.lang.String templateKey, java.lang.Boolean dryRun, ApiCallback<CustomWorkflowOutput> _callback)
      Create workflow (asynchronously) Create a workflow for a feature flag.
      okhttp3.Call postWorkflowCall​(java.lang.String projectKey, java.lang.String featureFlagKey, java.lang.String environmentKey, CustomWorkflowInput customWorkflowInput, java.lang.String templateKey, java.lang.Boolean dryRun, ApiCallback _callback)
      Build call for postWorkflow
      ApiResponse<CustomWorkflowOutput> postWorkflowWithHttpInfo​(java.lang.String projectKey, java.lang.String featureFlagKey, java.lang.String environmentKey, CustomWorkflowInput customWorkflowInput, java.lang.String templateKey, java.lang.Boolean dryRun)
      Create workflow Create a workflow for a feature flag.
      void setApiClient​(ApiClient apiClient)  
      void setCustomBaseUrl​(java.lang.String customBaseUrl)  
      void setHostIndex​(int hostIndex)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WorkflowsApi

        public WorkflowsApi()
      • WorkflowsApi

        public WorkflowsApi​(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)
      • deleteWorkflowCall

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

        public void deleteWorkflow​(java.lang.String projectKey,
                                   java.lang.String featureFlagKey,
                                   java.lang.String environmentKey,
                                   java.lang.String workflowId)
                            throws ApiException
        Delete workflow Delete a workflow from a feature flag.
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key (required)
        environmentKey - The environment key (required)
        workflowId - The workflow id (required)
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • deleteWorkflowWithHttpInfo

        public ApiResponse<java.lang.Void> deleteWorkflowWithHttpInfo​(java.lang.String projectKey,
                                                                      java.lang.String featureFlagKey,
                                                                      java.lang.String environmentKey,
                                                                      java.lang.String workflowId)
                                                               throws ApiException
        Delete workflow Delete a workflow from a feature flag.
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key (required)
        environmentKey - The environment key (required)
        workflowId - The workflow id (required)
        Returns:
        ApiResponse<Void>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • deleteWorkflowAsync

        public okhttp3.Call deleteWorkflowAsync​(java.lang.String projectKey,
                                                java.lang.String featureFlagKey,
                                                java.lang.String environmentKey,
                                                java.lang.String workflowId,
                                                ApiCallback<java.lang.Void> _callback)
                                         throws ApiException
        Delete workflow (asynchronously) Delete a workflow from a feature flag.
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key (required)
        environmentKey - The environment key (required)
        workflowId - The workflow id (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
      • getCustomWorkflowCall

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

        public CustomWorkflowOutput getCustomWorkflow​(java.lang.String projectKey,
                                                      java.lang.String featureFlagKey,
                                                      java.lang.String environmentKey,
                                                      java.lang.String workflowId)
                                               throws ApiException
        Get custom workflow Get a specific workflow by ID.
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key (required)
        environmentKey - The environment key (required)
        workflowId - The workflow ID (required)
        Returns:
        CustomWorkflowOutput
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • getCustomWorkflowWithHttpInfo

        public ApiResponse<CustomWorkflowOutput> getCustomWorkflowWithHttpInfo​(java.lang.String projectKey,
                                                                               java.lang.String featureFlagKey,
                                                                               java.lang.String environmentKey,
                                                                               java.lang.String workflowId)
                                                                        throws ApiException
        Get custom workflow Get a specific workflow by ID.
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key (required)
        environmentKey - The environment key (required)
        workflowId - The workflow ID (required)
        Returns:
        ApiResponse<CustomWorkflowOutput>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • getCustomWorkflowAsync

        public okhttp3.Call getCustomWorkflowAsync​(java.lang.String projectKey,
                                                   java.lang.String featureFlagKey,
                                                   java.lang.String environmentKey,
                                                   java.lang.String workflowId,
                                                   ApiCallback<CustomWorkflowOutput> _callback)
                                            throws ApiException
        Get custom workflow (asynchronously) Get a specific workflow by ID.
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key (required)
        environmentKey - The environment key (required)
        workflowId - The workflow ID (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
      • getWorkflowsCall

        public okhttp3.Call getWorkflowsCall​(java.lang.String projectKey,
                                             java.lang.String featureFlagKey,
                                             java.lang.String environmentKey,
                                             java.lang.String status,
                                             java.lang.String sort,
                                             java.lang.Long limit,
                                             java.lang.Long offset,
                                             ApiCallback _callback)
                                      throws ApiException
        Build call for getWorkflows
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key (required)
        environmentKey - The environment key (required)
        status - Filter results by workflow status. Valid status filters are `active`, `completed`, and `failed`. (optional)
        sort - A field to sort the items by. Prefix field by a dash ( - ) to sort in descending order. This endpoint supports sorting by `creationDate` or `stopDate`. (optional)
        limit - The maximum number of workflows to return. Defaults to 20. (optional)
        offset - Where to start in the list. Defaults to 0. Use this 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)
        _callback - Callback for upload/download progress
        Returns:
        Call to execute
        Throws:
        ApiException - If fail to serialize the request body object
      • getWorkflows

        public CustomWorkflowsListingOutput getWorkflows​(java.lang.String projectKey,
                                                         java.lang.String featureFlagKey,
                                                         java.lang.String environmentKey,
                                                         java.lang.String status,
                                                         java.lang.String sort,
                                                         java.lang.Long limit,
                                                         java.lang.Long offset)
                                                  throws ApiException
        Get workflows Display workflows associated with a feature flag.
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key (required)
        environmentKey - The environment key (required)
        status - Filter results by workflow status. Valid status filters are `active`, `completed`, and `failed`. (optional)
        sort - A field to sort the items by. Prefix field by a dash ( - ) to sort in descending order. This endpoint supports sorting by `creationDate` or `stopDate`. (optional)
        limit - The maximum number of workflows to return. Defaults to 20. (optional)
        offset - Where to start in the list. Defaults to 0. Use this 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)
        Returns:
        CustomWorkflowsListingOutput
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • getWorkflowsWithHttpInfo

        public ApiResponse<CustomWorkflowsListingOutput> getWorkflowsWithHttpInfo​(java.lang.String projectKey,
                                                                                  java.lang.String featureFlagKey,
                                                                                  java.lang.String environmentKey,
                                                                                  java.lang.String status,
                                                                                  java.lang.String sort,
                                                                                  java.lang.Long limit,
                                                                                  java.lang.Long offset)
                                                                           throws ApiException
        Get workflows Display workflows associated with a feature flag.
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key (required)
        environmentKey - The environment key (required)
        status - Filter results by workflow status. Valid status filters are `active`, `completed`, and `failed`. (optional)
        sort - A field to sort the items by. Prefix field by a dash ( - ) to sort in descending order. This endpoint supports sorting by `creationDate` or `stopDate`. (optional)
        limit - The maximum number of workflows to return. Defaults to 20. (optional)
        offset - Where to start in the list. Defaults to 0. Use this 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)
        Returns:
        ApiResponse<CustomWorkflowsListingOutput>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • getWorkflowsAsync

        public okhttp3.Call getWorkflowsAsync​(java.lang.String projectKey,
                                              java.lang.String featureFlagKey,
                                              java.lang.String environmentKey,
                                              java.lang.String status,
                                              java.lang.String sort,
                                              java.lang.Long limit,
                                              java.lang.Long offset,
                                              ApiCallback<CustomWorkflowsListingOutput> _callback)
                                       throws ApiException
        Get workflows (asynchronously) Display workflows associated with a feature flag.
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key (required)
        environmentKey - The environment key (required)
        status - Filter results by workflow status. Valid status filters are `active`, `completed`, and `failed`. (optional)
        sort - A field to sort the items by. Prefix field by a dash ( - ) to sort in descending order. This endpoint supports sorting by `creationDate` or `stopDate`. (optional)
        limit - The maximum number of workflows to return. Defaults to 20. (optional)
        offset - Where to start in the list. Defaults to 0. Use this 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)
        _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
      • postWorkflowCall

        public okhttp3.Call postWorkflowCall​(java.lang.String projectKey,
                                             java.lang.String featureFlagKey,
                                             java.lang.String environmentKey,
                                             CustomWorkflowInput customWorkflowInput,
                                             java.lang.String templateKey,
                                             java.lang.Boolean dryRun,
                                             ApiCallback _callback)
                                      throws ApiException
        Build call for postWorkflow
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key (required)
        environmentKey - The environment key (required)
        customWorkflowInput - (required)
        templateKey - The template key to apply as a starting point for the new workflow (optional)
        dryRun - Whether to call the endpoint in dry-run mode (optional)
        _callback - Callback for upload/download progress
        Returns:
        Call to execute
        Throws:
        ApiException - If fail to serialize the request body object
      • postWorkflow

        public CustomWorkflowOutput postWorkflow​(java.lang.String projectKey,
                                                 java.lang.String featureFlagKey,
                                                 java.lang.String environmentKey,
                                                 CustomWorkflowInput customWorkflowInput,
                                                 java.lang.String templateKey,
                                                 java.lang.Boolean dryRun)
                                          throws ApiException
        Create workflow Create a workflow for a feature flag. You can create a workflow directly, or you can apply a template to create a new workflow. ### Creating a workflow You can use the create workflow endpoint to create a workflow directly by adding a `stages` array to the request body. For each stage, define the `name`, `conditions` when the stage should be executed, and `action` that describes the stage. <details> <summary>Click to expand example</summary> _Example request body_ ```json { \"name\": \"Progressive rollout starting in two days\", \"description\": \"Turn flag targeting on and increase feature rollout in 10% increments each day\", \"stages\": [ { \"name\": \"10% rollout on day 1\", \"conditions\": [ { \"kind\": \"schedule\", \"scheduleKind\": \"relative\", // or \"absolute\" // If \"scheduleKind\" is \"absolute\", set \"executionDate\"; // \"waitDuration\" and \"waitDurationUnit\" will be ignored \"waitDuration\": 2, \"waitDurationUnit\": \"calendarDay\" }, { \"kind\": \"ld-approval\", \"notifyMemberIds\": [ \"507f1f77bcf86cd799439011\" ], \"notifyTeamKeys\": [ \"team-key-123abc\" ] } ], \"action\": { \"instructions\": [ { \"kind\": \"turnFlagOn\" }, { \"kind\": \"updateFallthroughVariationOrRollout\", \"rolloutWeights\": { \"452f5fb5-7320-4ba3-81a1-8f4324f79d49\": 90000, \"fc15f6a4-05d3-4aa4-a997-446be461345d\": 10000 } } ] } } ] } ``` </details> ### Creating a workflow by applying a workflow template You can also create a workflow by applying a workflow template. If you pass a valid workflow template key as the `templateKey` query parameter with the request, the API will attempt to create a new workflow with the stages defined in the workflow template with the corresponding key. #### Applicability of stages Templates are created in the context of a particular flag in a particular environment in a particular project. However, because workflows created from a template can be applied to any project, environment, and flag, some steps of the workflow may need to be updated in order to be applicable for the target resource. You can pass a `dryRun` query parameter to tell the API to return a report of which steps of the workflow template are applicable in the target project/environment/flag, and which will need to be updated. When the `dryRun` query parameter is present the response body includes a `meta` property that holds a list of parameters that could potentially be inapplicable for the target resource. Each of these parameters will include a `valid` field. You will need to update any invalid parameters in order to create the new workflow. You can do this using the `parameters` property, which overrides the workflow template parameters. #### Overriding template parameters You can use the `parameters` property in the request body to tell the API to override the specified workflow template parameters with new values that are specific to your target project/environment/flag. <details> <summary>Click to expand example</summary> _Example request body_ ```json { \"name\": \"workflow created from my-template\", \"description\": \"description of my workflow\", \"parameters\": [ { \"_id\": \"62cf2bc4cadbeb7697943f3b\", \"path\": \"/clauses/0/values\", \"default\": { \"value\": [\"updated-segment\"] } }, { \"_id\": \"62cf2bc4cadbeb7697943f3d\", \"path\": \"/variationId\", \"default\": { \"value\": \"abcd1234-abcd-1234-abcd-1234abcd12\" } } ] } ``` </details> If there are any steps in the template that are not applicable to the target resource, the workflow will not be created, and the `meta` property will be included in the response body detailing which parameters need to be updated.
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key (required)
        environmentKey - The environment key (required)
        customWorkflowInput - (required)
        templateKey - The template key to apply as a starting point for the new workflow (optional)
        dryRun - Whether to call the endpoint in dry-run mode (optional)
        Returns:
        CustomWorkflowOutput
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • postWorkflowWithHttpInfo

        public ApiResponse<CustomWorkflowOutput> postWorkflowWithHttpInfo​(java.lang.String projectKey,
                                                                          java.lang.String featureFlagKey,
                                                                          java.lang.String environmentKey,
                                                                          CustomWorkflowInput customWorkflowInput,
                                                                          java.lang.String templateKey,
                                                                          java.lang.Boolean dryRun)
                                                                   throws ApiException
        Create workflow Create a workflow for a feature flag. You can create a workflow directly, or you can apply a template to create a new workflow. ### Creating a workflow You can use the create workflow endpoint to create a workflow directly by adding a `stages` array to the request body. For each stage, define the `name`, `conditions` when the stage should be executed, and `action` that describes the stage. <details> <summary>Click to expand example</summary> _Example request body_ ```json { \"name\": \"Progressive rollout starting in two days\", \"description\": \"Turn flag targeting on and increase feature rollout in 10% increments each day\", \"stages\": [ { \"name\": \"10% rollout on day 1\", \"conditions\": [ { \"kind\": \"schedule\", \"scheduleKind\": \"relative\", // or \"absolute\" // If \"scheduleKind\" is \"absolute\", set \"executionDate\"; // \"waitDuration\" and \"waitDurationUnit\" will be ignored \"waitDuration\": 2, \"waitDurationUnit\": \"calendarDay\" }, { \"kind\": \"ld-approval\", \"notifyMemberIds\": [ \"507f1f77bcf86cd799439011\" ], \"notifyTeamKeys\": [ \"team-key-123abc\" ] } ], \"action\": { \"instructions\": [ { \"kind\": \"turnFlagOn\" }, { \"kind\": \"updateFallthroughVariationOrRollout\", \"rolloutWeights\": { \"452f5fb5-7320-4ba3-81a1-8f4324f79d49\": 90000, \"fc15f6a4-05d3-4aa4-a997-446be461345d\": 10000 } } ] } } ] } ``` </details> ### Creating a workflow by applying a workflow template You can also create a workflow by applying a workflow template. If you pass a valid workflow template key as the `templateKey` query parameter with the request, the API will attempt to create a new workflow with the stages defined in the workflow template with the corresponding key. #### Applicability of stages Templates are created in the context of a particular flag in a particular environment in a particular project. However, because workflows created from a template can be applied to any project, environment, and flag, some steps of the workflow may need to be updated in order to be applicable for the target resource. You can pass a `dryRun` query parameter to tell the API to return a report of which steps of the workflow template are applicable in the target project/environment/flag, and which will need to be updated. When the `dryRun` query parameter is present the response body includes a `meta` property that holds a list of parameters that could potentially be inapplicable for the target resource. Each of these parameters will include a `valid` field. You will need to update any invalid parameters in order to create the new workflow. You can do this using the `parameters` property, which overrides the workflow template parameters. #### Overriding template parameters You can use the `parameters` property in the request body to tell the API to override the specified workflow template parameters with new values that are specific to your target project/environment/flag. <details> <summary>Click to expand example</summary> _Example request body_ ```json { \"name\": \"workflow created from my-template\", \"description\": \"description of my workflow\", \"parameters\": [ { \"_id\": \"62cf2bc4cadbeb7697943f3b\", \"path\": \"/clauses/0/values\", \"default\": { \"value\": [\"updated-segment\"] } }, { \"_id\": \"62cf2bc4cadbeb7697943f3d\", \"path\": \"/variationId\", \"default\": { \"value\": \"abcd1234-abcd-1234-abcd-1234abcd12\" } } ] } ``` </details> If there are any steps in the template that are not applicable to the target resource, the workflow will not be created, and the `meta` property will be included in the response body detailing which parameters need to be updated.
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key (required)
        environmentKey - The environment key (required)
        customWorkflowInput - (required)
        templateKey - The template key to apply as a starting point for the new workflow (optional)
        dryRun - Whether to call the endpoint in dry-run mode (optional)
        Returns:
        ApiResponse<CustomWorkflowOutput>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      • postWorkflowAsync

        public okhttp3.Call postWorkflowAsync​(java.lang.String projectKey,
                                              java.lang.String featureFlagKey,
                                              java.lang.String environmentKey,
                                              CustomWorkflowInput customWorkflowInput,
                                              java.lang.String templateKey,
                                              java.lang.Boolean dryRun,
                                              ApiCallback<CustomWorkflowOutput> _callback)
                                       throws ApiException
        Create workflow (asynchronously) Create a workflow for a feature flag. You can create a workflow directly, or you can apply a template to create a new workflow. ### Creating a workflow You can use the create workflow endpoint to create a workflow directly by adding a `stages` array to the request body. For each stage, define the `name`, `conditions` when the stage should be executed, and `action` that describes the stage. <details> <summary>Click to expand example</summary> _Example request body_ ```json { \"name\": \"Progressive rollout starting in two days\", \"description\": \"Turn flag targeting on and increase feature rollout in 10% increments each day\", \"stages\": [ { \"name\": \"10% rollout on day 1\", \"conditions\": [ { \"kind\": \"schedule\", \"scheduleKind\": \"relative\", // or \"absolute\" // If \"scheduleKind\" is \"absolute\", set \"executionDate\"; // \"waitDuration\" and \"waitDurationUnit\" will be ignored \"waitDuration\": 2, \"waitDurationUnit\": \"calendarDay\" }, { \"kind\": \"ld-approval\", \"notifyMemberIds\": [ \"507f1f77bcf86cd799439011\" ], \"notifyTeamKeys\": [ \"team-key-123abc\" ] } ], \"action\": { \"instructions\": [ { \"kind\": \"turnFlagOn\" }, { \"kind\": \"updateFallthroughVariationOrRollout\", \"rolloutWeights\": { \"452f5fb5-7320-4ba3-81a1-8f4324f79d49\": 90000, \"fc15f6a4-05d3-4aa4-a997-446be461345d\": 10000 } } ] } } ] } ``` </details> ### Creating a workflow by applying a workflow template You can also create a workflow by applying a workflow template. If you pass a valid workflow template key as the `templateKey` query parameter with the request, the API will attempt to create a new workflow with the stages defined in the workflow template with the corresponding key. #### Applicability of stages Templates are created in the context of a particular flag in a particular environment in a particular project. However, because workflows created from a template can be applied to any project, environment, and flag, some steps of the workflow may need to be updated in order to be applicable for the target resource. You can pass a `dryRun` query parameter to tell the API to return a report of which steps of the workflow template are applicable in the target project/environment/flag, and which will need to be updated. When the `dryRun` query parameter is present the response body includes a `meta` property that holds a list of parameters that could potentially be inapplicable for the target resource. Each of these parameters will include a `valid` field. You will need to update any invalid parameters in order to create the new workflow. You can do this using the `parameters` property, which overrides the workflow template parameters. #### Overriding template parameters You can use the `parameters` property in the request body to tell the API to override the specified workflow template parameters with new values that are specific to your target project/environment/flag. <details> <summary>Click to expand example</summary> _Example request body_ ```json { \"name\": \"workflow created from my-template\", \"description\": \"description of my workflow\", \"parameters\": [ { \"_id\": \"62cf2bc4cadbeb7697943f3b\", \"path\": \"/clauses/0/values\", \"default\": { \"value\": [\"updated-segment\"] } }, { \"_id\": \"62cf2bc4cadbeb7697943f3d\", \"path\": \"/variationId\", \"default\": { \"value\": \"abcd1234-abcd-1234-abcd-1234abcd12\" } } ] } ``` </details> If there are any steps in the template that are not applicable to the target resource, the workflow will not be created, and the `meta` property will be included in the response body detailing which parameters need to be updated.
        Parameters:
        projectKey - The project key (required)
        featureFlagKey - The feature flag key (required)
        environmentKey - The environment key (required)
        customWorkflowInput - (required)
        templateKey - The template key to apply as a starting point for the new workflow (optional)
        dryRun - Whether to call the endpoint in dry-run mode (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