=begin #LaunchDarkly REST API #Build custom integrations with the LaunchDarkly REST API OpenAPI spec version: 3.9.1 Contact: support@launchdarkly.com Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.8 =end require 'uri' module LaunchDarklyApi class FeatureFlagsApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Copies the feature flag configuration from one environment to the same feature flag in another environment. # @param project_key The project key, used to tie the flags together under one project so they can be managed together. # @param feature_flag_key The feature flag's key. The key identifies the flag in your code. # @param feature_flag_copy_body Copy feature flag configurations between environments. # @param [Hash] opts the optional parameters # @return [FeatureFlag] def copy_feature_flag(project_key, feature_flag_key, feature_flag_copy_body, opts = {}) data, _status_code, _headers = copy_feature_flag_with_http_info(project_key, feature_flag_key, feature_flag_copy_body, opts) data end # Copies the feature flag configuration from one environment to the same feature flag in another environment. # @param project_key The project key, used to tie the flags together under one project so they can be managed together. # @param feature_flag_key The feature flag's key. The key identifies the flag in your code. # @param feature_flag_copy_body Copy feature flag configurations between environments. # @param [Hash] opts the optional parameters # @return [Array<(FeatureFlag, Fixnum, Hash)>] FeatureFlag data, response status code and response headers def copy_feature_flag_with_http_info(project_key, feature_flag_key, feature_flag_copy_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FeatureFlagsApi.copy_feature_flag ...' end # verify the required parameter 'project_key' is set if @api_client.config.client_side_validation && project_key.nil? fail ArgumentError, "Missing the required parameter 'project_key' when calling FeatureFlagsApi.copy_feature_flag" end # verify the required parameter 'feature_flag_key' is set if @api_client.config.client_side_validation && feature_flag_key.nil? fail ArgumentError, "Missing the required parameter 'feature_flag_key' when calling FeatureFlagsApi.copy_feature_flag" end # verify the required parameter 'feature_flag_copy_body' is set if @api_client.config.client_side_validation && feature_flag_copy_body.nil? fail ArgumentError, "Missing the required parameter 'feature_flag_copy_body' when calling FeatureFlagsApi.copy_feature_flag" end # resource path local_var_path = '/flags/{projectKey}/{featureFlagKey}/copy'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'featureFlagKey' + '}', feature_flag_key.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(feature_flag_copy_body) auth_names = ['Token'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'FeatureFlag') if @api_client.config.debugging @api_client.config.logger.debug "API called: FeatureFlagsApi#copy_feature_flag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a feature flag in all environments. Be careful-- only delete feature flags that are no longer being used by your application. # @param project_key The project key, used to tie the flags together under one project so they can be managed together. # @param feature_flag_key The feature flag's key. The key identifies the flag in your code. # @param [Hash] opts the optional parameters # @return [nil] def delete_feature_flag(project_key, feature_flag_key, opts = {}) delete_feature_flag_with_http_info(project_key, feature_flag_key, opts) nil end # Delete a feature flag in all environments. Be careful-- only delete feature flags that are no longer being used by your application. # @param project_key The project key, used to tie the flags together under one project so they can be managed together. # @param feature_flag_key The feature flag's key. The key identifies the flag in your code. # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_feature_flag_with_http_info(project_key, feature_flag_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FeatureFlagsApi.delete_feature_flag ...' end # verify the required parameter 'project_key' is set if @api_client.config.client_side_validation && project_key.nil? fail ArgumentError, "Missing the required parameter 'project_key' when calling FeatureFlagsApi.delete_feature_flag" end # verify the required parameter 'feature_flag_key' is set if @api_client.config.client_side_validation && feature_flag_key.nil? fail ArgumentError, "Missing the required parameter 'feature_flag_key' when calling FeatureFlagsApi.delete_feature_flag" end # resource path local_var_path = '/flags/{projectKey}/{featureFlagKey}'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'featureFlagKey' + '}', feature_flag_key.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['Token'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: FeatureFlagsApi#delete_feature_flag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get expiring user targets for feature flag # @param project_key The project key, used to tie the flags together under one project so they can be managed together. # @param environment_key The environment key, used to tie together flag configuration and users under one environment so they can be managed together. # @param feature_flag_key The feature flag's key. The key identifies the flag in your code. # @param [Hash] opts the optional parameters # @return [UserTargetingExpirationForFlags] def get_expiring_user_targets(project_key, environment_key, feature_flag_key, opts = {}) data, _status_code, _headers = get_expiring_user_targets_with_http_info(project_key, environment_key, feature_flag_key, opts) data end # Get expiring user targets for feature flag # @param project_key The project key, used to tie the flags together under one project so they can be managed together. # @param environment_key The environment key, used to tie together flag configuration and users under one environment so they can be managed together. # @param feature_flag_key The feature flag's key. The key identifies the flag in your code. # @param [Hash] opts the optional parameters # @return [Array<(UserTargetingExpirationForFlags, Fixnum, Hash)>] UserTargetingExpirationForFlags data, response status code and response headers def get_expiring_user_targets_with_http_info(project_key, environment_key, feature_flag_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FeatureFlagsApi.get_expiring_user_targets ...' end # verify the required parameter 'project_key' is set if @api_client.config.client_side_validation && project_key.nil? fail ArgumentError, "Missing the required parameter 'project_key' when calling FeatureFlagsApi.get_expiring_user_targets" end # verify the required parameter 'environment_key' is set if @api_client.config.client_side_validation && environment_key.nil? fail ArgumentError, "Missing the required parameter 'environment_key' when calling FeatureFlagsApi.get_expiring_user_targets" end # verify the required parameter 'feature_flag_key' is set if @api_client.config.client_side_validation && feature_flag_key.nil? fail ArgumentError, "Missing the required parameter 'feature_flag_key' when calling FeatureFlagsApi.get_expiring_user_targets" end # resource path local_var_path = '/flags/{projectKey}/{featureFlagKey}/expiring-user-targets/{environmentKey}'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'environmentKey' + '}', environment_key.to_s).sub('{' + 'featureFlagKey' + '}', feature_flag_key.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['Token'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'UserTargetingExpirationForFlags') if @api_client.config.debugging @api_client.config.logger.debug "API called: FeatureFlagsApi#get_expiring_user_targets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a single feature flag by key. # @param project_key The project key, used to tie the flags together under one project so they can be managed together. # @param feature_flag_key The feature flag's key. The key identifies the flag in your code. # @param [Hash] opts the optional parameters # @option opts [Array] :env By default, each feature will include configurations for each environment. You can filter environments with the env query parameter. For example, setting env=[\"production\"] will restrict the returned configurations to just your production environment. # @return [FeatureFlag] def get_feature_flag(project_key, feature_flag_key, opts = {}) data, _status_code, _headers = get_feature_flag_with_http_info(project_key, feature_flag_key, opts) data end # Get a single feature flag by key. # @param project_key The project key, used to tie the flags together under one project so they can be managed together. # @param feature_flag_key The feature flag's key. The key identifies the flag in your code. # @param [Hash] opts the optional parameters # @option opts [Array] :env By default, each feature will include configurations for each environment. You can filter environments with the env query parameter. For example, setting env=[\"production\"] will restrict the returned configurations to just your production environment. # @return [Array<(FeatureFlag, Fixnum, Hash)>] FeatureFlag data, response status code and response headers def get_feature_flag_with_http_info(project_key, feature_flag_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FeatureFlagsApi.get_feature_flag ...' end # verify the required parameter 'project_key' is set if @api_client.config.client_side_validation && project_key.nil? fail ArgumentError, "Missing the required parameter 'project_key' when calling FeatureFlagsApi.get_feature_flag" end # verify the required parameter 'feature_flag_key' is set if @api_client.config.client_side_validation && feature_flag_key.nil? fail ArgumentError, "Missing the required parameter 'feature_flag_key' when calling FeatureFlagsApi.get_feature_flag" end # resource path local_var_path = '/flags/{projectKey}/{featureFlagKey}'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'featureFlagKey' + '}', feature_flag_key.to_s) # query parameters query_params = {} query_params[:'env'] = @api_client.build_collection_param(opts[:'env'], :multi) if !opts[:'env'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['Token'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'FeatureFlag') if @api_client.config.debugging @api_client.config.logger.debug "API called: FeatureFlagsApi#get_feature_flag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a single change request for a feature flag # @param project_key The project key, used to tie the flags together under one project so they can be managed together. # @param feature_flag_key The feature flag's key. The key identifies the flag in your code. # @param environment_key The environment key, used to tie together flag configuration and users under one environment so they can be managed together. # @param feature_flag_change_request_id The feature flag change request ID # @param [Hash] opts the optional parameters # @return [FeatureFlagChangeRequests] def get_feature_flag_change_request(project_key, feature_flag_key, environment_key, feature_flag_change_request_id, opts = {}) data, _status_code, _headers = get_feature_flag_change_request_with_http_info(project_key, feature_flag_key, environment_key, feature_flag_change_request_id, opts) data end # Get a single change request for a feature flag # @param project_key The project key, used to tie the flags together under one project so they can be managed together. # @param feature_flag_key The feature flag's key. The key identifies the flag in your code. # @param environment_key The environment key, used to tie together flag configuration and users under one environment so they can be managed together. # @param feature_flag_change_request_id The feature flag change request ID # @param [Hash] opts the optional parameters # @return [Array<(FeatureFlagChangeRequests, Fixnum, Hash)>] FeatureFlagChangeRequests data, response status code and response headers def get_feature_flag_change_request_with_http_info(project_key, feature_flag_key, environment_key, feature_flag_change_request_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FeatureFlagsApi.get_feature_flag_change_request ...' end # verify the required parameter 'project_key' is set if @api_client.config.client_side_validation && project_key.nil? fail ArgumentError, "Missing the required parameter 'project_key' when calling FeatureFlagsApi.get_feature_flag_change_request" end # verify the required parameter 'feature_flag_key' is set if @api_client.config.client_side_validation && feature_flag_key.nil? fail ArgumentError, "Missing the required parameter 'feature_flag_key' when calling FeatureFlagsApi.get_feature_flag_change_request" end # verify the required parameter 'environment_key' is set if @api_client.config.client_side_validation && environment_key.nil? fail ArgumentError, "Missing the required parameter 'environment_key' when calling FeatureFlagsApi.get_feature_flag_change_request" end # verify the required parameter 'feature_flag_change_request_id' is set if @api_client.config.client_side_validation && feature_flag_change_request_id.nil? fail ArgumentError, "Missing the required parameter 'feature_flag_change_request_id' when calling FeatureFlagsApi.get_feature_flag_change_request" end # resource path local_var_path = '/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{featureFlagChangeRequestId}'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'featureFlagKey' + '}', feature_flag_key.to_s).sub('{' + 'environmentKey' + '}', environment_key.to_s).sub('{' + 'featureFlagChangeRequestId' + '}', feature_flag_change_request_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['Token'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'FeatureFlagChangeRequests') if @api_client.config.debugging @api_client.config.logger.debug "API called: FeatureFlagsApi#get_feature_flag_change_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get all change requests for a feature flag # @param project_key The project key, used to tie the flags together under one project so they can be managed together. # @param feature_flag_key The feature flag's key. The key identifies the flag in your code. # @param environment_key The environment key, used to tie together flag configuration and users under one environment so they can be managed together. # @param [Hash] opts the optional parameters # @return [FeatureFlagChangeRequests] def get_feature_flag_change_requests(project_key, feature_flag_key, environment_key, opts = {}) data, _status_code, _headers = get_feature_flag_change_requests_with_http_info(project_key, feature_flag_key, environment_key, opts) data end # Get all change requests for a feature flag # @param project_key The project key, used to tie the flags together under one project so they can be managed together. # @param feature_flag_key The feature flag's key. The key identifies the flag in your code. # @param environment_key The environment key, used to tie together flag configuration and users under one environment so they can be managed together. # @param [Hash] opts the optional parameters # @return [Array<(FeatureFlagChangeRequests, Fixnum, Hash)>] FeatureFlagChangeRequests data, response status code and response headers def get_feature_flag_change_requests_with_http_info(project_key, feature_flag_key, environment_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FeatureFlagsApi.get_feature_flag_change_requests ...' end # verify the required parameter 'project_key' is set if @api_client.config.client_side_validation && project_key.nil? fail ArgumentError, "Missing the required parameter 'project_key' when calling FeatureFlagsApi.get_feature_flag_change_requests" end # verify the required parameter 'feature_flag_key' is set if @api_client.config.client_side_validation && feature_flag_key.nil? fail ArgumentError, "Missing the required parameter 'feature_flag_key' when calling FeatureFlagsApi.get_feature_flag_change_requests" end # verify the required parameter 'environment_key' is set if @api_client.config.client_side_validation && environment_key.nil? fail ArgumentError, "Missing the required parameter 'environment_key' when calling FeatureFlagsApi.get_feature_flag_change_requests" end # resource path local_var_path = '/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'featureFlagKey' + '}', feature_flag_key.to_s).sub('{' + 'environmentKey' + '}', environment_key.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['Token'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'FeatureFlagChangeRequests') if @api_client.config.debugging @api_client.config.logger.debug "API called: FeatureFlagsApi#get_feature_flag_change_requests\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get the status for a particular feature flag. # @param project_key The project key, used to tie the flags together under one project so they can be managed together. # @param environment_key The environment key, used to tie together flag configuration and users under one environment so they can be managed together. # @param feature_flag_key The feature flag's key. The key identifies the flag in your code. # @param [Hash] opts the optional parameters # @return [FeatureFlagStatus] def get_feature_flag_status(project_key, environment_key, feature_flag_key, opts = {}) data, _status_code, _headers = get_feature_flag_status_with_http_info(project_key, environment_key, feature_flag_key, opts) data end # Get the status for a particular feature flag. # @param project_key The project key, used to tie the flags together under one project so they can be managed together. # @param environment_key The environment key, used to tie together flag configuration and users under one environment so they can be managed together. # @param feature_flag_key The feature flag's key. The key identifies the flag in your code. # @param [Hash] opts the optional parameters # @return [Array<(FeatureFlagStatus, Fixnum, Hash)>] FeatureFlagStatus data, response status code and response headers def get_feature_flag_status_with_http_info(project_key, environment_key, feature_flag_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FeatureFlagsApi.get_feature_flag_status ...' end # verify the required parameter 'project_key' is set if @api_client.config.client_side_validation && project_key.nil? fail ArgumentError, "Missing the required parameter 'project_key' when calling FeatureFlagsApi.get_feature_flag_status" end # verify the required parameter 'environment_key' is set if @api_client.config.client_side_validation && environment_key.nil? fail ArgumentError, "Missing the required parameter 'environment_key' when calling FeatureFlagsApi.get_feature_flag_status" end # verify the required parameter 'feature_flag_key' is set if @api_client.config.client_side_validation && feature_flag_key.nil? fail ArgumentError, "Missing the required parameter 'feature_flag_key' when calling FeatureFlagsApi.get_feature_flag_status" end # resource path local_var_path = '/flag-statuses/{projectKey}/{environmentKey}/{featureFlagKey}'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'environmentKey' + '}', environment_key.to_s).sub('{' + 'featureFlagKey' + '}', feature_flag_key.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['Token'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'FeatureFlagStatus') if @api_client.config.debugging @api_client.config.logger.debug "API called: FeatureFlagsApi#get_feature_flag_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get the status for a particular feature flag across environments # @param project_key The project key, used to tie the flags together under one project so they can be managed together. # @param feature_flag_key The feature flag's key. The key identifies the flag in your code. # @param [Hash] opts the optional parameters # @return [FeatureFlagStatusAcrossEnvironments] def get_feature_flag_status_across_environments(project_key, feature_flag_key, opts = {}) data, _status_code, _headers = get_feature_flag_status_across_environments_with_http_info(project_key, feature_flag_key, opts) data end # Get the status for a particular feature flag across environments # @param project_key The project key, used to tie the flags together under one project so they can be managed together. # @param feature_flag_key The feature flag's key. The key identifies the flag in your code. # @param [Hash] opts the optional parameters # @return [Array<(FeatureFlagStatusAcrossEnvironments, Fixnum, Hash)>] FeatureFlagStatusAcrossEnvironments data, response status code and response headers def get_feature_flag_status_across_environments_with_http_info(project_key, feature_flag_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FeatureFlagsApi.get_feature_flag_status_across_environments ...' end # verify the required parameter 'project_key' is set if @api_client.config.client_side_validation && project_key.nil? fail ArgumentError, "Missing the required parameter 'project_key' when calling FeatureFlagsApi.get_feature_flag_status_across_environments" end # verify the required parameter 'feature_flag_key' is set if @api_client.config.client_side_validation && feature_flag_key.nil? fail ArgumentError, "Missing the required parameter 'feature_flag_key' when calling FeatureFlagsApi.get_feature_flag_status_across_environments" end # resource path local_var_path = '/flag-status/{projectKey}/{featureFlagKey}'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'featureFlagKey' + '}', feature_flag_key.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['Token'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'FeatureFlagStatusAcrossEnvironments') if @api_client.config.debugging @api_client.config.logger.debug "API called: FeatureFlagsApi#get_feature_flag_status_across_environments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a list of statuses for all feature flags. The status includes the last time the feature flag was requested, as well as the state of the flag. # @param project_key The project key, used to tie the flags together under one project so they can be managed together. # @param environment_key The environment key, used to tie together flag configuration and users under one environment so they can be managed together. # @param [Hash] opts the optional parameters # @return [FeatureFlagStatuses] def get_feature_flag_statuses(project_key, environment_key, opts = {}) data, _status_code, _headers = get_feature_flag_statuses_with_http_info(project_key, environment_key, opts) data end # Get a list of statuses for all feature flags. The status includes the last time the feature flag was requested, as well as the state of the flag. # @param project_key The project key, used to tie the flags together under one project so they can be managed together. # @param environment_key The environment key, used to tie together flag configuration and users under one environment so they can be managed together. # @param [Hash] opts the optional parameters # @return [Array<(FeatureFlagStatuses, Fixnum, Hash)>] FeatureFlagStatuses data, response status code and response headers def get_feature_flag_statuses_with_http_info(project_key, environment_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FeatureFlagsApi.get_feature_flag_statuses ...' end # verify the required parameter 'project_key' is set if @api_client.config.client_side_validation && project_key.nil? fail ArgumentError, "Missing the required parameter 'project_key' when calling FeatureFlagsApi.get_feature_flag_statuses" end # verify the required parameter 'environment_key' is set if @api_client.config.client_side_validation && environment_key.nil? fail ArgumentError, "Missing the required parameter 'environment_key' when calling FeatureFlagsApi.get_feature_flag_statuses" end # resource path local_var_path = '/flag-statuses/{projectKey}/{environmentKey}'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'environmentKey' + '}', environment_key.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['Token'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'FeatureFlagStatuses') if @api_client.config.debugging @api_client.config.logger.debug "API called: FeatureFlagsApi#get_feature_flag_statuses\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a list of all features in the given project. # @param project_key The project key, used to tie the flags together under one project so they can be managed together. # @param [Hash] opts the optional parameters # @option opts [Array] :env By default, each feature will include configurations for each environment. You can filter environments with the env query parameter. For example, setting env=[\"production\"] will restrict the returned configurations to just your production environment. # @option opts [BOOLEAN] :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. # @option opts [BOOLEAN] :archived When set to 1, only archived flags will be included in the list of flags returned. By default, archived flags are not included in the list of flags. # @option opts [Float] :limit The number of objects to return. Defaults to -1, which returns everything. # @option opts [Float] :offset Where to start in the list. This is for use with pagination. For example, an offset of 10 would skip the first 10 items and then return the next limit items. # @option opts [String] :filter A comma-separated list of filters. Each filter is of the form field:value. # @option opts [String] :sort A comma-separated list of fields to sort by. A field prefixed by a - will be sorted in descending order. # @option opts [String] :tag Filter by tag. A tag can be used to group flags across projects. # @return [FeatureFlags] def get_feature_flags(project_key, opts = {}) data, _status_code, _headers = get_feature_flags_with_http_info(project_key, opts) data end # Get a list of all features in the given project. # @param project_key The project key, used to tie the flags together under one project so they can be managed together. # @param [Hash] opts the optional parameters # @option opts [Array] :env By default, each feature will include configurations for each environment. You can filter environments with the env query parameter. For example, setting env=[\"production\"] will restrict the returned configurations to just your production environment. # @option opts [BOOLEAN] :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. # @option opts [BOOLEAN] :archived When set to 1, only archived flags will be included in the list of flags returned. By default, archived flags are not included in the list of flags. # @option opts [Float] :limit The number of objects to return. Defaults to -1, which returns everything. # @option opts [Float] :offset Where to start in the list. This is for use with pagination. For example, an offset of 10 would skip the first 10 items and then return the next limit items. # @option opts [String] :filter A comma-separated list of filters. Each filter is of the form field:value. # @option opts [String] :sort A comma-separated list of fields to sort by. A field prefixed by a - will be sorted in descending order. # @option opts [String] :tag Filter by tag. A tag can be used to group flags across projects. # @return [Array<(FeatureFlags, Fixnum, Hash)>] FeatureFlags data, response status code and response headers def get_feature_flags_with_http_info(project_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FeatureFlagsApi.get_feature_flags ...' end # verify the required parameter 'project_key' is set if @api_client.config.client_side_validation && project_key.nil? fail ArgumentError, "Missing the required parameter 'project_key' when calling FeatureFlagsApi.get_feature_flags" end # resource path local_var_path = '/flags/{projectKey}'.sub('{' + 'projectKey' + '}', project_key.to_s) # query parameters query_params = {} query_params[:'env'] = @api_client.build_collection_param(opts[:'env'], :multi) if !opts[:'env'].nil? query_params[:'summary'] = opts[:'summary'] if !opts[:'summary'].nil? query_params[:'archived'] = opts[:'archived'] if !opts[:'archived'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'tag'] = opts[:'tag'] if !opts[:'tag'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['Token'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'FeatureFlags') if @api_client.config.debugging @api_client.config.logger.debug "API called: FeatureFlagsApi#get_feature_flags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update, add, or delete expiring user targets on feature flag # @param project_key The project key, used to tie the flags together under one project so they can be managed together. # @param environment_key The environment key, used to tie together flag configuration and users under one environment so they can be managed together. # @param feature_flag_key The feature flag's key. The key identifies the flag in your code. # @param semantic_patch_with_comment Requires a Semantic Patch representation of the desired changes to the resource. 'https://apidocs.launchdarkly.com/reference#updates-via-semantic-patches'. The addition of comments is also supported. # @param [Hash] opts the optional parameters # @return [UserTargetingExpirationForFlags] def patch_expiring_user_targets(project_key, environment_key, feature_flag_key, semantic_patch_with_comment, opts = {}) data, _status_code, _headers = patch_expiring_user_targets_with_http_info(project_key, environment_key, feature_flag_key, semantic_patch_with_comment, opts) data end # Update, add, or delete expiring user targets on feature flag # @param project_key The project key, used to tie the flags together under one project so they can be managed together. # @param environment_key The environment key, used to tie together flag configuration and users under one environment so they can be managed together. # @param feature_flag_key The feature flag's key. The key identifies the flag in your code. # @param semantic_patch_with_comment Requires a Semantic Patch representation of the desired changes to the resource. 'https://apidocs.launchdarkly.com/reference#updates-via-semantic-patches'. The addition of comments is also supported. # @param [Hash] opts the optional parameters # @return [Array<(UserTargetingExpirationForFlags, Fixnum, Hash)>] UserTargetingExpirationForFlags data, response status code and response headers def patch_expiring_user_targets_with_http_info(project_key, environment_key, feature_flag_key, semantic_patch_with_comment, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FeatureFlagsApi.patch_expiring_user_targets ...' end # verify the required parameter 'project_key' is set if @api_client.config.client_side_validation && project_key.nil? fail ArgumentError, "Missing the required parameter 'project_key' when calling FeatureFlagsApi.patch_expiring_user_targets" end # verify the required parameter 'environment_key' is set if @api_client.config.client_side_validation && environment_key.nil? fail ArgumentError, "Missing the required parameter 'environment_key' when calling FeatureFlagsApi.patch_expiring_user_targets" end # verify the required parameter 'feature_flag_key' is set if @api_client.config.client_side_validation && feature_flag_key.nil? fail ArgumentError, "Missing the required parameter 'feature_flag_key' when calling FeatureFlagsApi.patch_expiring_user_targets" end # verify the required parameter 'semantic_patch_with_comment' is set if @api_client.config.client_side_validation && semantic_patch_with_comment.nil? fail ArgumentError, "Missing the required parameter 'semantic_patch_with_comment' when calling FeatureFlagsApi.patch_expiring_user_targets" end # resource path local_var_path = '/flags/{projectKey}/{featureFlagKey}/expiring-user-targets/{environmentKey}'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'environmentKey' + '}', environment_key.to_s).sub('{' + 'featureFlagKey' + '}', feature_flag_key.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(semantic_patch_with_comment) auth_names = ['Token'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'UserTargetingExpirationForFlags') if @api_client.config.debugging @api_client.config.logger.debug "API called: FeatureFlagsApi#patch_expiring_user_targets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Perform a partial update to a feature. # @param project_key The project key, used to tie the flags together under one project so they can be managed together. # @param feature_flag_key The feature flag's key. The key identifies the flag in your code. # @param patch_comment Requires a JSON Patch representation of the desired changes to the project, and an optional comment. 'http://jsonpatch.com/' Feature flag patches also support JSON Merge Patch format. 'https://tools.ietf.org/html/rfc7386' The addition of comments is also supported. # @param [Hash] opts the optional parameters # @return [FeatureFlag] def patch_feature_flag(project_key, feature_flag_key, patch_comment, opts = {}) data, _status_code, _headers = patch_feature_flag_with_http_info(project_key, feature_flag_key, patch_comment, opts) data end # Perform a partial update to a feature. # @param project_key The project key, used to tie the flags together under one project so they can be managed together. # @param feature_flag_key The feature flag's key. The key identifies the flag in your code. # @param patch_comment Requires a JSON Patch representation of the desired changes to the project, and an optional comment. 'http://jsonpatch.com/' Feature flag patches also support JSON Merge Patch format. 'https://tools.ietf.org/html/rfc7386' The addition of comments is also supported. # @param [Hash] opts the optional parameters # @return [Array<(FeatureFlag, Fixnum, Hash)>] FeatureFlag data, response status code and response headers def patch_feature_flag_with_http_info(project_key, feature_flag_key, patch_comment, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FeatureFlagsApi.patch_feature_flag ...' end # verify the required parameter 'project_key' is set if @api_client.config.client_side_validation && project_key.nil? fail ArgumentError, "Missing the required parameter 'project_key' when calling FeatureFlagsApi.patch_feature_flag" end # verify the required parameter 'feature_flag_key' is set if @api_client.config.client_side_validation && feature_flag_key.nil? fail ArgumentError, "Missing the required parameter 'feature_flag_key' when calling FeatureFlagsApi.patch_feature_flag" end # verify the required parameter 'patch_comment' is set if @api_client.config.client_side_validation && patch_comment.nil? fail ArgumentError, "Missing the required parameter 'patch_comment' when calling FeatureFlagsApi.patch_feature_flag" end # resource path local_var_path = '/flags/{projectKey}/{featureFlagKey}'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'featureFlagKey' + '}', feature_flag_key.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(patch_comment) auth_names = ['Token'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'FeatureFlag') if @api_client.config.debugging @api_client.config.logger.debug "API called: FeatureFlagsApi#patch_feature_flag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Apply change request for a feature flag # @param project_key The project key, used to tie the flags together under one project so they can be managed together. # @param feature_flag_key The feature flag's key. The key identifies the flag in your code. # @param environment_key The environment key, used to tie together flag configuration and users under one environment so they can be managed together. # @param feature_flag_change_request_id The feature flag change request ID # @param feature_flag_change_request_apply_config_body Apply a new feature flag change request # @param [Hash] opts the optional parameters # @return [FeatureFlagChangeRequests] def post_apply_feature_flag_change_request(project_key, feature_flag_key, environment_key, feature_flag_change_request_id, feature_flag_change_request_apply_config_body, opts = {}) data, _status_code, _headers = post_apply_feature_flag_change_request_with_http_info(project_key, feature_flag_key, environment_key, feature_flag_change_request_id, feature_flag_change_request_apply_config_body, opts) data end # Apply change request for a feature flag # @param project_key The project key, used to tie the flags together under one project so they can be managed together. # @param feature_flag_key The feature flag's key. The key identifies the flag in your code. # @param environment_key The environment key, used to tie together flag configuration and users under one environment so they can be managed together. # @param feature_flag_change_request_id The feature flag change request ID # @param feature_flag_change_request_apply_config_body Apply a new feature flag change request # @param [Hash] opts the optional parameters # @return [Array<(FeatureFlagChangeRequests, Fixnum, Hash)>] FeatureFlagChangeRequests data, response status code and response headers def post_apply_feature_flag_change_request_with_http_info(project_key, feature_flag_key, environment_key, feature_flag_change_request_id, feature_flag_change_request_apply_config_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FeatureFlagsApi.post_apply_feature_flag_change_request ...' end # verify the required parameter 'project_key' is set if @api_client.config.client_side_validation && project_key.nil? fail ArgumentError, "Missing the required parameter 'project_key' when calling FeatureFlagsApi.post_apply_feature_flag_change_request" end # verify the required parameter 'feature_flag_key' is set if @api_client.config.client_side_validation && feature_flag_key.nil? fail ArgumentError, "Missing the required parameter 'feature_flag_key' when calling FeatureFlagsApi.post_apply_feature_flag_change_request" end # verify the required parameter 'environment_key' is set if @api_client.config.client_side_validation && environment_key.nil? fail ArgumentError, "Missing the required parameter 'environment_key' when calling FeatureFlagsApi.post_apply_feature_flag_change_request" end # verify the required parameter 'feature_flag_change_request_id' is set if @api_client.config.client_side_validation && feature_flag_change_request_id.nil? fail ArgumentError, "Missing the required parameter 'feature_flag_change_request_id' when calling FeatureFlagsApi.post_apply_feature_flag_change_request" end # verify the required parameter 'feature_flag_change_request_apply_config_body' is set if @api_client.config.client_side_validation && feature_flag_change_request_apply_config_body.nil? fail ArgumentError, "Missing the required parameter 'feature_flag_change_request_apply_config_body' when calling FeatureFlagsApi.post_apply_feature_flag_change_request" end # resource path local_var_path = '/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{featureFlagChangeRequestId}/apply'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'featureFlagKey' + '}', feature_flag_key.to_s).sub('{' + 'environmentKey' + '}', environment_key.to_s).sub('{' + 'featureFlagChangeRequestId' + '}', feature_flag_change_request_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(feature_flag_change_request_apply_config_body) auth_names = ['Token'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'FeatureFlagChangeRequests') if @api_client.config.debugging @api_client.config.logger.debug "API called: FeatureFlagsApi#post_apply_feature_flag_change_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Creates a new feature flag. # @param project_key The project key, used to tie the flags together under one project so they can be managed together. # @param feature_flag_body Create a new feature flag. # @param [Hash] opts the optional parameters # @option opts [String] :clone The key of the feature flag to be cloned. The key identifies the flag in your code. For example, setting clone=flagKey will copy the full targeting configuration for all environments (including on/off state) from the original flag to the new flag. # @return [FeatureFlag] def post_feature_flag(project_key, feature_flag_body, opts = {}) data, _status_code, _headers = post_feature_flag_with_http_info(project_key, feature_flag_body, opts) data end # Creates a new feature flag. # @param project_key The project key, used to tie the flags together under one project so they can be managed together. # @param feature_flag_body Create a new feature flag. # @param [Hash] opts the optional parameters # @option opts [String] :clone The key of the feature flag to be cloned. The key identifies the flag in your code. For example, setting clone=flagKey will copy the full targeting configuration for all environments (including on/off state) from the original flag to the new flag. # @return [Array<(FeatureFlag, Fixnum, Hash)>] FeatureFlag data, response status code and response headers def post_feature_flag_with_http_info(project_key, feature_flag_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FeatureFlagsApi.post_feature_flag ...' end # verify the required parameter 'project_key' is set if @api_client.config.client_side_validation && project_key.nil? fail ArgumentError, "Missing the required parameter 'project_key' when calling FeatureFlagsApi.post_feature_flag" end # verify the required parameter 'feature_flag_body' is set if @api_client.config.client_side_validation && feature_flag_body.nil? fail ArgumentError, "Missing the required parameter 'feature_flag_body' when calling FeatureFlagsApi.post_feature_flag" end # resource path local_var_path = '/flags/{projectKey}'.sub('{' + 'projectKey' + '}', project_key.to_s) # query parameters query_params = {} query_params[:'clone'] = opts[:'clone'] if !opts[:'clone'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(feature_flag_body) auth_names = ['Token'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'FeatureFlag') if @api_client.config.debugging @api_client.config.logger.debug "API called: FeatureFlagsApi#post_feature_flag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # @param project_key The project key, used to tie the flags together under one project so they can be managed together. # @param feature_flag_key The feature flag's key. The key identifies the flag in your code. # @param environment_key The environment key, used to tie together flag configuration and users under one environment so they can be managed together. # @param [Hash] opts the optional parameters # @option opts [FeatureFlagChangeRequestConfigBody] :feature_flag_change_request_config_body Create a new feature flag change request # @return [FeatureFlagChangeRequest] def post_feature_flag_change_request(project_key, feature_flag_key, environment_key, opts = {}) data, _status_code, _headers = post_feature_flag_change_request_with_http_info(project_key, feature_flag_key, environment_key, opts) data end # @param project_key The project key, used to tie the flags together under one project so they can be managed together. # @param feature_flag_key The feature flag's key. The key identifies the flag in your code. # @param environment_key The environment key, used to tie together flag configuration and users under one environment so they can be managed together. # @param [Hash] opts the optional parameters # @option opts [FeatureFlagChangeRequestConfigBody] :feature_flag_change_request_config_body Create a new feature flag change request # @return [Array<(FeatureFlagChangeRequest, Fixnum, Hash)>] FeatureFlagChangeRequest data, response status code and response headers def post_feature_flag_change_request_with_http_info(project_key, feature_flag_key, environment_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FeatureFlagsApi.post_feature_flag_change_request ...' end # verify the required parameter 'project_key' is set if @api_client.config.client_side_validation && project_key.nil? fail ArgumentError, "Missing the required parameter 'project_key' when calling FeatureFlagsApi.post_feature_flag_change_request" end # verify the required parameter 'feature_flag_key' is set if @api_client.config.client_side_validation && feature_flag_key.nil? fail ArgumentError, "Missing the required parameter 'feature_flag_key' when calling FeatureFlagsApi.post_feature_flag_change_request" end # verify the required parameter 'environment_key' is set if @api_client.config.client_side_validation && environment_key.nil? fail ArgumentError, "Missing the required parameter 'environment_key' when calling FeatureFlagsApi.post_feature_flag_change_request" end # resource path local_var_path = '/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'featureFlagKey' + '}', feature_flag_key.to_s).sub('{' + 'environmentKey' + '}', environment_key.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'feature_flag_change_request_config_body']) auth_names = ['Token'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'FeatureFlagChangeRequest') if @api_client.config.debugging @api_client.config.logger.debug "API called: FeatureFlagsApi#post_feature_flag_change_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Review change request for a feature flag # @param project_key The project key, used to tie the flags together under one project so they can be managed together. # @param feature_flag_key The feature flag's key. The key identifies the flag in your code. # @param environment_key The environment key, used to tie together flag configuration and users under one environment so they can be managed together. # @param feature_flag_change_request_id The feature flag change request ID # @param feature_flag_change_request_review_config_body Review a feature flag change request # @param [Hash] opts the optional parameters # @return [FeatureFlagChangeRequests] def post_review_feature_flag_change_request(project_key, feature_flag_key, environment_key, feature_flag_change_request_id, feature_flag_change_request_review_config_body, opts = {}) data, _status_code, _headers = post_review_feature_flag_change_request_with_http_info(project_key, feature_flag_key, environment_key, feature_flag_change_request_id, feature_flag_change_request_review_config_body, opts) data end # Review change request for a feature flag # @param project_key The project key, used to tie the flags together under one project so they can be managed together. # @param feature_flag_key The feature flag's key. The key identifies the flag in your code. # @param environment_key The environment key, used to tie together flag configuration and users under one environment so they can be managed together. # @param feature_flag_change_request_id The feature flag change request ID # @param feature_flag_change_request_review_config_body Review a feature flag change request # @param [Hash] opts the optional parameters # @return [Array<(FeatureFlagChangeRequests, Fixnum, Hash)>] FeatureFlagChangeRequests data, response status code and response headers def post_review_feature_flag_change_request_with_http_info(project_key, feature_flag_key, environment_key, feature_flag_change_request_id, feature_flag_change_request_review_config_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FeatureFlagsApi.post_review_feature_flag_change_request ...' end # verify the required parameter 'project_key' is set if @api_client.config.client_side_validation && project_key.nil? fail ArgumentError, "Missing the required parameter 'project_key' when calling FeatureFlagsApi.post_review_feature_flag_change_request" end # verify the required parameter 'feature_flag_key' is set if @api_client.config.client_side_validation && feature_flag_key.nil? fail ArgumentError, "Missing the required parameter 'feature_flag_key' when calling FeatureFlagsApi.post_review_feature_flag_change_request" end # verify the required parameter 'environment_key' is set if @api_client.config.client_side_validation && environment_key.nil? fail ArgumentError, "Missing the required parameter 'environment_key' when calling FeatureFlagsApi.post_review_feature_flag_change_request" end # verify the required parameter 'feature_flag_change_request_id' is set if @api_client.config.client_side_validation && feature_flag_change_request_id.nil? fail ArgumentError, "Missing the required parameter 'feature_flag_change_request_id' when calling FeatureFlagsApi.post_review_feature_flag_change_request" end # verify the required parameter 'feature_flag_change_request_review_config_body' is set if @api_client.config.client_side_validation && feature_flag_change_request_review_config_body.nil? fail ArgumentError, "Missing the required parameter 'feature_flag_change_request_review_config_body' when calling FeatureFlagsApi.post_review_feature_flag_change_request" end # resource path local_var_path = '/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{featureFlagChangeRequestId}/review'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'featureFlagKey' + '}', feature_flag_key.to_s).sub('{' + 'environmentKey' + '}', environment_key.to_s).sub('{' + 'featureFlagChangeRequestId' + '}', feature_flag_change_request_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(feature_flag_change_request_review_config_body) auth_names = ['Token'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'FeatureFlagChangeRequests') if @api_client.config.debugging @api_client.config.logger.debug "API called: FeatureFlagsApi#post_review_feature_flag_change_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end