=begin #LaunchDarkly REST API #Build custom integrations with the LaunchDarkly REST API OpenAPI spec version: 5.4.0 Contact: support@launchdarkly.com Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.17 =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 an approval request for a feature flag config # @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 approval_request_id The approval request ID # @param [Hash] opts the optional parameters # @option opts [ApprovalRequestConfigBody] :approval_request_config_body Create a new approval request # @return [nil] def delete_approval_request(project_key, environment_key, feature_flag_key, approval_request_id, opts = {}) delete_approval_request_with_http_info(project_key, environment_key, feature_flag_key, approval_request_id, opts) nil end # Delete an approval request for a feature flag config # @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 approval_request_id The approval request ID # @param [Hash] opts the optional parameters # @option opts [ApprovalRequestConfigBody] :approval_request_config_body Create a new approval request # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_approval_request_with_http_info(project_key, environment_key, feature_flag_key, approval_request_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FeatureFlagsApi.delete_approval_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.delete_approval_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.delete_approval_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.delete_approval_request" end # verify the required parameter 'approval_request_id' is set if @api_client.config.client_side_validation && approval_request_id.nil? fail ArgumentError, "Missing the required parameter 'approval_request_id' when calling FeatureFlagsApi.delete_approval_request" end # resource path local_var_path = '/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{approvalRequestId}'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'environmentKey' + '}', environment_key.to_s).sub('{' + 'featureFlagKey' + '}', feature_flag_key.to_s).sub('{' + 'approvalRequestId' + '}', approval_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(opts[:'approval_request_config_body']) 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_approval_request\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 # Delete a scheduled change on a feature flag in an 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 environment_key The environment key, used to tie together flag configuration and users under one environment so they can be managed together. # @param scheduled_change_id The id of the scheduled change # @param [Hash] opts the optional parameters # @return [nil] def delete_flag_config_scheduled_changes(project_key, feature_flag_key, environment_key, scheduled_change_id, opts = {}) delete_flag_config_scheduled_changes_with_http_info(project_key, feature_flag_key, environment_key, scheduled_change_id, opts) nil end # Delete a scheduled change on a feature flag in an 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 environment_key The environment key, used to tie together flag configuration and users under one environment so they can be managed together. # @param scheduled_change_id The id of the scheduled change # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_flag_config_scheduled_changes_with_http_info(project_key, feature_flag_key, environment_key, scheduled_change_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FeatureFlagsApi.delete_flag_config_scheduled_changes ...' 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_flag_config_scheduled_changes" 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_flag_config_scheduled_changes" 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.delete_flag_config_scheduled_changes" end # verify the required parameter 'scheduled_change_id' is set if @api_client.config.client_side_validation && scheduled_change_id.nil? fail ArgumentError, "Missing the required parameter 'scheduled_change_id' when calling FeatureFlagsApi.delete_flag_config_scheduled_changes" end # resource path local_var_path = '/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/scheduled-changes/{scheduledChangeId}'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'featureFlagKey' + '}', feature_flag_key.to_s).sub('{' + 'environmentKey' + '}', environment_key.to_s).sub('{' + 'scheduledChangeId' + '}', scheduled_change_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(: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_flag_config_scheduled_changes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get dependent flags for the flag in the environment specified in path parameters # @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 [DependentFlagsByEnvironment] def flags_project_key_environment_key_feature_flag_key_dependent_flags_get(project_key, environment_key, feature_flag_key, opts = {}) data, _status_code, _headers = flags_project_key_environment_key_feature_flag_key_dependent_flags_get_with_http_info(project_key, environment_key, feature_flag_key, opts) data end # Get dependent flags for the flag in the environment specified in path parameters # @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<(DependentFlagsByEnvironment, Fixnum, Hash)>] DependentFlagsByEnvironment data, response status code and response headers def flags_project_key_environment_key_feature_flag_key_dependent_flags_get_with_http_info(project_key, environment_key, feature_flag_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FeatureFlagsApi.flags_project_key_environment_key_feature_flag_key_dependent_flags_get ...' 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.flags_project_key_environment_key_feature_flag_key_dependent_flags_get" 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.flags_project_key_environment_key_feature_flag_key_dependent_flags_get" 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.flags_project_key_environment_key_feature_flag_key_dependent_flags_get" end # resource path local_var_path = '/flags/{projectKey}/{environmentKey}/{featureFlagKey}/dependent-flags'.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 => 'DependentFlagsByEnvironment') if @api_client.config.debugging @api_client.config.logger.debug "API called: FeatureFlagsApi#flags_project_key_environment_key_feature_flag_key_dependent_flags_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get dependent flags across all environments for the flag specified in the path parameters # @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 [MultiEnvironmentDependentFlags] def flags_project_key_feature_flag_key_dependent_flags_get(project_key, feature_flag_key, opts = {}) data, _status_code, _headers = flags_project_key_feature_flag_key_dependent_flags_get_with_http_info(project_key, feature_flag_key, opts) data end # Get dependent flags across all environments for the flag specified in the path parameters # @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<(MultiEnvironmentDependentFlags, Fixnum, Hash)>] MultiEnvironmentDependentFlags data, response status code and response headers def flags_project_key_feature_flag_key_dependent_flags_get_with_http_info(project_key, feature_flag_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FeatureFlagsApi.flags_project_key_feature_flag_key_dependent_flags_get ...' 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.flags_project_key_feature_flag_key_dependent_flags_get" 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.flags_project_key_feature_flag_key_dependent_flags_get" end # resource path local_var_path = '/flags/{projectKey}/{featureFlagKey}/dependent-flags'.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 => 'MultiEnvironmentDependentFlags') if @api_client.config.debugging @api_client.config.logger.debug "API called: FeatureFlagsApi#flags_project_key_feature_flag_key_dependent_flags_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a single approval request for a feature flag config # @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 approval_request_id The approval request ID # @param [Hash] opts the optional parameters # @return [ApprovalRequest] def get_approval_request(project_key, feature_flag_key, environment_key, approval_request_id, opts = {}) data, _status_code, _headers = get_approval_request_with_http_info(project_key, feature_flag_key, environment_key, approval_request_id, opts) data end # Get a single approval request for a feature flag config # @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 approval_request_id The approval request ID # @param [Hash] opts the optional parameters # @return [Array<(ApprovalRequest, Fixnum, Hash)>] ApprovalRequest data, response status code and response headers def get_approval_request_with_http_info(project_key, feature_flag_key, environment_key, approval_request_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FeatureFlagsApi.get_approval_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_approval_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_approval_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_approval_request" end # verify the required parameter 'approval_request_id' is set if @api_client.config.client_side_validation && approval_request_id.nil? fail ArgumentError, "Missing the required parameter 'approval_request_id' when calling FeatureFlagsApi.get_approval_request" end # resource path local_var_path = '/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{approvalRequestId}'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'featureFlagKey' + '}', feature_flag_key.to_s).sub('{' + 'environmentKey' + '}', environment_key.to_s).sub('{' + 'approvalRequestId' + '}', approval_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 => 'ApprovalRequest') if @api_client.config.debugging @api_client.config.logger.debug "API called: FeatureFlagsApi#get_approval_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get all approval requests for a feature flag config # @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 [ApprovalRequests] def get_approval_requests(project_key, feature_flag_key, environment_key, opts = {}) data, _status_code, _headers = get_approval_requests_with_http_info(project_key, feature_flag_key, environment_key, opts) data end # Get all approval requests for a feature flag config # @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<(ApprovalRequests, Fixnum, Hash)>] ApprovalRequests data, response status code and response headers def get_approval_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_approval_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_approval_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_approval_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_approval_requests" end # resource path local_var_path = '/projects/{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 => 'ApprovalRequests') if @api_client.config.debugging @api_client.config.logger.debug "API called: FeatureFlagsApi#get_approval_requests\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 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 # Get a scheduled change on a feature flag by id. # @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 scheduled_change_id The id of the scheduled change # @param [Hash] opts the optional parameters # @return [FeatureFlagScheduledChange] def get_flag_config_scheduled_change(project_key, feature_flag_key, environment_key, scheduled_change_id, opts = {}) data, _status_code, _headers = get_flag_config_scheduled_change_with_http_info(project_key, feature_flag_key, environment_key, scheduled_change_id, opts) data end # Get a scheduled change on a feature flag by id. # @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 scheduled_change_id The id of the scheduled change # @param [Hash] opts the optional parameters # @return [Array<(FeatureFlagScheduledChange, Fixnum, Hash)>] FeatureFlagScheduledChange data, response status code and response headers def get_flag_config_scheduled_change_with_http_info(project_key, feature_flag_key, environment_key, scheduled_change_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FeatureFlagsApi.get_flag_config_scheduled_change ...' 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_flag_config_scheduled_change" 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_flag_config_scheduled_change" 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_flag_config_scheduled_change" end # verify the required parameter 'scheduled_change_id' is set if @api_client.config.client_side_validation && scheduled_change_id.nil? fail ArgumentError, "Missing the required parameter 'scheduled_change_id' when calling FeatureFlagsApi.get_flag_config_scheduled_change" end # resource path local_var_path = '/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/scheduled-changes/{scheduledChangeId}'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'featureFlagKey' + '}', feature_flag_key.to_s).sub('{' + 'environmentKey' + '}', environment_key.to_s).sub('{' + 'scheduledChangeId' + '}', scheduled_change_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 => 'FeatureFlagScheduledChange') if @api_client.config.debugging @api_client.config.logger.debug "API called: FeatureFlagsApi#get_flag_config_scheduled_change\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get all scheduled workflows for a 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 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 [FeatureFlagScheduledChanges] def get_flag_config_scheduled_changes(project_key, feature_flag_key, environment_key, opts = {}) data, _status_code, _headers = get_flag_config_scheduled_changes_with_http_info(project_key, feature_flag_key, environment_key, opts) data end # Get all scheduled workflows for a 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 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<(FeatureFlagScheduledChanges, Fixnum, Hash)>] FeatureFlagScheduledChanges data, response status code and response headers def get_flag_config_scheduled_changes_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_flag_config_scheduled_changes ...' 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_flag_config_scheduled_changes" 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_flag_config_scheduled_changes" 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_flag_config_scheduled_changes" end # resource path local_var_path = '/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/scheduled-changes'.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 => 'FeatureFlagScheduledChanges') if @api_client.config.debugging @api_client.config.logger.debug "API called: FeatureFlagsApi#get_flag_config_scheduled_changes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Lists conflicts between the given instructions and any existing scheduled changes for the feature flag. The actual HTTP verb should be REPORT, not POST. # @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 flag_config_scheduled_changes_conflicts_body Used to determine if a semantic patch will result in conflicts with scheduled changes on a feature flag. # @param [Hash] opts the optional parameters # @return [FeatureFlagScheduledChangesConflicts] def get_flag_config_scheduled_changes_conflicts(project_key, feature_flag_key, environment_key, flag_config_scheduled_changes_conflicts_body, opts = {}) data, _status_code, _headers = get_flag_config_scheduled_changes_conflicts_with_http_info(project_key, feature_flag_key, environment_key, flag_config_scheduled_changes_conflicts_body, opts) data end # Lists conflicts between the given instructions and any existing scheduled changes for the feature flag. The actual HTTP verb should be REPORT, not POST. # @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 flag_config_scheduled_changes_conflicts_body Used to determine if a semantic patch will result in conflicts with scheduled changes on a feature flag. # @param [Hash] opts the optional parameters # @return [Array<(FeatureFlagScheduledChangesConflicts, Fixnum, Hash)>] FeatureFlagScheduledChangesConflicts data, response status code and response headers def get_flag_config_scheduled_changes_conflicts_with_http_info(project_key, feature_flag_key, environment_key, flag_config_scheduled_changes_conflicts_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FeatureFlagsApi.get_flag_config_scheduled_changes_conflicts ...' 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_flag_config_scheduled_changes_conflicts" 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_flag_config_scheduled_changes_conflicts" 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_flag_config_scheduled_changes_conflicts" end # verify the required parameter 'flag_config_scheduled_changes_conflicts_body' is set if @api_client.config.client_side_validation && flag_config_scheduled_changes_conflicts_body.nil? fail ArgumentError, "Missing the required parameter 'flag_config_scheduled_changes_conflicts_body' when calling FeatureFlagsApi.get_flag_config_scheduled_changes_conflicts" end # resource path local_var_path = '/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/scheduled-changes-conflicts'.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(flag_config_scheduled_changes_conflicts_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 => 'FeatureFlagScheduledChangesConflicts') if @api_client.config.debugging @api_client.config.logger.debug "API called: FeatureFlagsApi#get_flag_config_scheduled_changes_conflicts\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 # Updates an existing scheduled-change on a feature flag in an 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 flag_config_scheduled_changes_patch_body Update scheduled changes on a feature flag. # @param environment_key The environment key, used to tie together flag configuration and users under one environment so they can be managed together. # @param scheduled_change_id The id of the scheduled change # @param [Hash] opts the optional parameters # @return [FeatureFlagScheduledChange] def patch_flag_config_scheduled_change(project_key, feature_flag_key, flag_config_scheduled_changes_patch_body, environment_key, scheduled_change_id, opts = {}) data, _status_code, _headers = patch_flag_config_scheduled_change_with_http_info(project_key, feature_flag_key, flag_config_scheduled_changes_patch_body, environment_key, scheduled_change_id, opts) data end # Updates an existing scheduled-change on a feature flag in an 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 flag_config_scheduled_changes_patch_body Update scheduled changes on a feature flag. # @param environment_key The environment key, used to tie together flag configuration and users under one environment so they can be managed together. # @param scheduled_change_id The id of the scheduled change # @param [Hash] opts the optional parameters # @return [Array<(FeatureFlagScheduledChange, Fixnum, Hash)>] FeatureFlagScheduledChange data, response status code and response headers def patch_flag_config_scheduled_change_with_http_info(project_key, feature_flag_key, flag_config_scheduled_changes_patch_body, environment_key, scheduled_change_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FeatureFlagsApi.patch_flag_config_scheduled_change ...' 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_flag_config_scheduled_change" 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_flag_config_scheduled_change" end # verify the required parameter 'flag_config_scheduled_changes_patch_body' is set if @api_client.config.client_side_validation && flag_config_scheduled_changes_patch_body.nil? fail ArgumentError, "Missing the required parameter 'flag_config_scheduled_changes_patch_body' when calling FeatureFlagsApi.patch_flag_config_scheduled_change" 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_flag_config_scheduled_change" end # verify the required parameter 'scheduled_change_id' is set if @api_client.config.client_side_validation && scheduled_change_id.nil? fail ArgumentError, "Missing the required parameter 'scheduled_change_id' when calling FeatureFlagsApi.patch_flag_config_scheduled_change" end # resource path local_var_path = '/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/scheduled-changes/{scheduledChangeId}'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'featureFlagKey' + '}', feature_flag_key.to_s).sub('{' + 'environmentKey' + '}', environment_key.to_s).sub('{' + 'scheduledChangeId' + '}', scheduled_change_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(flag_config_scheduled_changes_patch_body) 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 => 'FeatureFlagScheduledChange') if @api_client.config.debugging @api_client.config.logger.debug "API called: FeatureFlagsApi#patch_flag_config_scheduled_change\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Apply approval request for a feature flag config # @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 approval_request_id The approval request ID # @param approval_request_apply_config_body Apply an approval request # @param [Hash] opts the optional parameters # @return [ApprovalRequest] def post_apply_approval_request(project_key, feature_flag_key, environment_key, approval_request_id, approval_request_apply_config_body, opts = {}) data, _status_code, _headers = post_apply_approval_request_with_http_info(project_key, feature_flag_key, environment_key, approval_request_id, approval_request_apply_config_body, opts) data end # Apply approval request for a feature flag config # @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 approval_request_id The approval request ID # @param approval_request_apply_config_body Apply an approval request # @param [Hash] opts the optional parameters # @return [Array<(ApprovalRequest, Fixnum, Hash)>] ApprovalRequest data, response status code and response headers def post_apply_approval_request_with_http_info(project_key, feature_flag_key, environment_key, approval_request_id, approval_request_apply_config_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FeatureFlagsApi.post_apply_approval_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_approval_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_approval_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_approval_request" end # verify the required parameter 'approval_request_id' is set if @api_client.config.client_side_validation && approval_request_id.nil? fail ArgumentError, "Missing the required parameter 'approval_request_id' when calling FeatureFlagsApi.post_apply_approval_request" end # verify the required parameter 'approval_request_apply_config_body' is set if @api_client.config.client_side_validation && approval_request_apply_config_body.nil? fail ArgumentError, "Missing the required parameter 'approval_request_apply_config_body' when calling FeatureFlagsApi.post_apply_approval_request" end # resource path local_var_path = '/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{approvalRequestId}/apply'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'featureFlagKey' + '}', feature_flag_key.to_s).sub('{' + 'environmentKey' + '}', environment_key.to_s).sub('{' + 'approvalRequestId' + '}', approval_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(approval_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 => 'ApprovalRequest') if @api_client.config.debugging @api_client.config.logger.debug "API called: FeatureFlagsApi#post_apply_approval_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create an approval request for a feature flag config # @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 approval_request_id The approval request ID # @param [Hash] opts the optional parameters # @option opts [ApprovalRequestConfigBody] :approval_request_config_body Create a new approval request # @return [ApprovalRequest] def post_approval_request(project_key, feature_flag_key, environment_key, approval_request_id, opts = {}) data, _status_code, _headers = post_approval_request_with_http_info(project_key, feature_flag_key, environment_key, approval_request_id, opts) data end # Create an approval request for a feature flag config # @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 approval_request_id The approval request ID # @param [Hash] opts the optional parameters # @option opts [ApprovalRequestConfigBody] :approval_request_config_body Create a new approval request # @return [Array<(ApprovalRequest, Fixnum, Hash)>] ApprovalRequest data, response status code and response headers def post_approval_request_with_http_info(project_key, feature_flag_key, environment_key, approval_request_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FeatureFlagsApi.post_approval_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_approval_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_approval_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_approval_request" end # verify the required parameter 'approval_request_id' is set if @api_client.config.client_side_validation && approval_request_id.nil? fail ArgumentError, "Missing the required parameter 'approval_request_id' when calling FeatureFlagsApi.post_approval_request" end # resource path local_var_path = '/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{approvalRequestId}'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'featureFlagKey' + '}', feature_flag_key.to_s).sub('{' + 'environmentKey' + '}', environment_key.to_s).sub('{' + 'approvalRequestId' + '}', approval_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(opts[:'approval_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 => 'ApprovalRequest') if @api_client.config.debugging @api_client.config.logger.debug "API called: FeatureFlagsApi#post_approval_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create an approval request to copy feature flag config # @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 [ApprovalRequestFlagConfigCopyBody] :approval_request_flag_config_copy_body Create a new approval request # @return [ApprovalRequest] def post_approval_request_flag_copy(project_key, feature_flag_key, environment_key, opts = {}) data, _status_code, _headers = post_approval_request_flag_copy_with_http_info(project_key, feature_flag_key, environment_key, opts) data end # Create an approval request to copy feature flag config # @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 [ApprovalRequestFlagConfigCopyBody] :approval_request_flag_config_copy_body Create a new approval request # @return [Array<(ApprovalRequest, Fixnum, Hash)>] ApprovalRequest data, response status code and response headers def post_approval_request_flag_copy_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_approval_request_flag_copy ...' 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_approval_request_flag_copy" 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_approval_request_flag_copy" 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_approval_request_flag_copy" end # resource path local_var_path = '/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests-flag-copy'.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[:'approval_request_flag_config_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 => 'ApprovalRequest') if @api_client.config.debugging @api_client.config.logger.debug "API called: FeatureFlagsApi#post_approval_request_flag_copy\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 # Creates a new scheduled change 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 flag_config_scheduled_changes_post_body Create scheduled changes on a feature flag. # @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 [FeatureFlagScheduledChange] def post_flag_config_scheduled_changes(project_key, flag_config_scheduled_changes_post_body, feature_flag_key, environment_key, opts = {}) data, _status_code, _headers = post_flag_config_scheduled_changes_with_http_info(project_key, flag_config_scheduled_changes_post_body, feature_flag_key, environment_key, opts) data end # Creates a new scheduled change 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 flag_config_scheduled_changes_post_body Create scheduled changes on a feature flag. # @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<(FeatureFlagScheduledChange, Fixnum, Hash)>] FeatureFlagScheduledChange data, response status code and response headers def post_flag_config_scheduled_changes_with_http_info(project_key, flag_config_scheduled_changes_post_body, feature_flag_key, environment_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FeatureFlagsApi.post_flag_config_scheduled_changes ...' 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_flag_config_scheduled_changes" end # verify the required parameter 'flag_config_scheduled_changes_post_body' is set if @api_client.config.client_side_validation && flag_config_scheduled_changes_post_body.nil? fail ArgumentError, "Missing the required parameter 'flag_config_scheduled_changes_post_body' when calling FeatureFlagsApi.post_flag_config_scheduled_changes" 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_flag_config_scheduled_changes" 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_flag_config_scheduled_changes" end # resource path local_var_path = '/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/scheduled-changes'.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(flag_config_scheduled_changes_post_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 => 'FeatureFlagScheduledChange') if @api_client.config.debugging @api_client.config.logger.debug "API called: FeatureFlagsApi#post_flag_config_scheduled_changes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Review approval request for a feature flag config # @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 approval_request_id The approval request ID # @param approval_request_review_config_body Review an approval request # @param [Hash] opts the optional parameters # @return [ApprovalRequest] def post_review_approval_request(project_key, feature_flag_key, environment_key, approval_request_id, approval_request_review_config_body, opts = {}) data, _status_code, _headers = post_review_approval_request_with_http_info(project_key, feature_flag_key, environment_key, approval_request_id, approval_request_review_config_body, opts) data end # Review approval request for a feature flag config # @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 approval_request_id The approval request ID # @param approval_request_review_config_body Review an approval request # @param [Hash] opts the optional parameters # @return [Array<(ApprovalRequest, Fixnum, Hash)>] ApprovalRequest data, response status code and response headers def post_review_approval_request_with_http_info(project_key, feature_flag_key, environment_key, approval_request_id, approval_request_review_config_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FeatureFlagsApi.post_review_approval_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_approval_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_approval_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_approval_request" end # verify the required parameter 'approval_request_id' is set if @api_client.config.client_side_validation && approval_request_id.nil? fail ArgumentError, "Missing the required parameter 'approval_request_id' when calling FeatureFlagsApi.post_review_approval_request" end # verify the required parameter 'approval_request_review_config_body' is set if @api_client.config.client_side_validation && approval_request_review_config_body.nil? fail ArgumentError, "Missing the required parameter 'approval_request_review_config_body' when calling FeatureFlagsApi.post_review_approval_request" end # resource path local_var_path = '/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{approvalRequestId}/review'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'featureFlagKey' + '}', feature_flag_key.to_s).sub('{' + 'environmentKey' + '}', environment_key.to_s).sub('{' + 'approvalRequestId' + '}', approval_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(approval_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 => 'ApprovalRequest') if @api_client.config.debugging @api_client.config.logger.debug "API called: FeatureFlagsApi#post_review_approval_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end