class LaunchDarklyApi::ApprovalsApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/launchdarkly_api/api/approvals_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

delete_approval_request(project_key, feature_flag_key, environment_key, id, opts = {}) click to toggle source

Delete approval request Delete an approval request for a feature flag @param project_key [String] The project key @param feature_flag_key [String] The feature flag's key @param environment_key [String] The environment key @param id [String] The feature flag approval request ID @param [Hash] opts the optional parameters @return [nil]

# File lib/launchdarkly_api/api/approvals_api.rb, line 30
def delete_approval_request(project_key, feature_flag_key, environment_key, id, opts = {})
  delete_approval_request_with_http_info(project_key, feature_flag_key, environment_key, id, opts)
  nil
end
delete_approval_request_with_http_info(project_key, feature_flag_key, environment_key, id, opts = {}) click to toggle source

Delete approval request Delete an approval request for a feature flag @param project_key [String] The project key @param feature_flag_key [String] The feature flag&#39;s key @param environment_key [String] The environment key @param id [String] The feature flag approval request ID @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/launchdarkly_api/api/approvals_api.rb, line 43
def delete_approval_request_with_http_info(project_key, feature_flag_key, environment_key, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ApprovalsApi.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 ApprovalsApi.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 ApprovalsApi.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 ApprovalsApi.delete_approval_request"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ApprovalsApi.delete_approval_request"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{id}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'featureFlagKey' + '}', CGI.escape(feature_flag_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKey']

  new_options = opts.merge(
    :operation => :"ApprovalsApi.delete_approval_request",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ApprovalsApi#delete_approval_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_approval(project_key, feature_flag_key, environment_key, id, opts = {}) click to toggle source

Get approval request Get a single approval request for a feature flag @param project_key [String] The project key @param feature_flag_key [String] The feature flag&#39;s key @param environment_key [String] The environment key @param id [String] The feature flag approval request ID @param [Hash] opts the optional parameters @return [FlagConfigApprovalRequestResponse]

# File lib/launchdarkly_api/api/approvals_api.rb, line 109
def get_approval(project_key, feature_flag_key, environment_key, id, opts = {})
  data, _status_code, _headers = get_approval_with_http_info(project_key, feature_flag_key, environment_key, id, opts)
  data
end
get_approval_with_http_info(project_key, feature_flag_key, environment_key, id, opts = {}) click to toggle source

Get approval request Get a single approval request for a feature flag @param project_key [String] The project key @param feature_flag_key [String] The feature flag&#39;s key @param environment_key [String] The environment key @param id [String] The feature flag approval request ID @param [Hash] opts the optional parameters @return [Array<(FlagConfigApprovalRequestResponse, Integer, Hash)>] FlagConfigApprovalRequestResponse data, response status code and response headers

# File lib/launchdarkly_api/api/approvals_api.rb, line 122
def get_approval_with_http_info(project_key, feature_flag_key, environment_key, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ApprovalsApi.get_approval ...'
  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 ApprovalsApi.get_approval"
  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 ApprovalsApi.get_approval"
  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 ApprovalsApi.get_approval"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ApprovalsApi.get_approval"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{id}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'featureFlagKey' + '}', CGI.escape(feature_flag_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'FlagConfigApprovalRequestResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKey']

  new_options = opts.merge(
    :operation => :"ApprovalsApi.get_approval",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ApprovalsApi#get_approval\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_approvals(project_key, feature_flag_key, environment_key, opts = {}) click to toggle source

List all approval requests Get all approval requests for a feature flag @param project_key [String] The project key @param feature_flag_key [String] The feature flag&#39;s key @param environment_key [String] The environment key @param [Hash] opts the optional parameters @return [FlagConfigApprovalRequestsResponse]

# File lib/launchdarkly_api/api/approvals_api.rb, line 189
def get_approvals(project_key, feature_flag_key, environment_key, opts = {})
  data, _status_code, _headers = get_approvals_with_http_info(project_key, feature_flag_key, environment_key, opts)
  data
end
get_approvals_with_http_info(project_key, feature_flag_key, environment_key, opts = {}) click to toggle source

List all approval requests Get all approval requests for a feature flag @param project_key [String] The project key @param feature_flag_key [String] The feature flag&#39;s key @param environment_key [String] The environment key @param [Hash] opts the optional parameters @return [Array<(FlagConfigApprovalRequestsResponse, Integer, Hash)>] FlagConfigApprovalRequestsResponse data, response status code and response headers

# File lib/launchdarkly_api/api/approvals_api.rb, line 201
def get_approvals_with_http_info(project_key, feature_flag_key, environment_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ApprovalsApi.get_approvals ...'
  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 ApprovalsApi.get_approvals"
  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 ApprovalsApi.get_approvals"
  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 ApprovalsApi.get_approvals"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'featureFlagKey' + '}', CGI.escape(feature_flag_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'FlagConfigApprovalRequestsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKey']

  new_options = opts.merge(
    :operation => :"ApprovalsApi.get_approvals",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ApprovalsApi#get_approvals\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
post_approval_request(project_key, feature_flag_key, environment_key, create_flag_config_approval_request_request, opts = {}) click to toggle source

Create approval request Create an approval request for a feature flag @param project_key [String] The project key @param feature_flag_key [String] The feature flag&#39;s key @param environment_key [String] The environment key @param create_flag_config_approval_request_request [CreateFlagConfigApprovalRequestRequest] @param [Hash] opts the optional parameters @return [FlagConfigApprovalRequestResponse]

# File lib/launchdarkly_api/api/approvals_api.rb, line 265
def post_approval_request(project_key, feature_flag_key, environment_key, create_flag_config_approval_request_request, opts = {})
  data, _status_code, _headers = post_approval_request_with_http_info(project_key, feature_flag_key, environment_key, create_flag_config_approval_request_request, opts)
  data
end
post_approval_request_apply_request(project_key, feature_flag_key, environment_key, id, post_approval_request_apply_request, opts = {}) click to toggle source

Apply approval request Apply approval request by either approving or declining changes. @param project_key [String] The project key @param feature_flag_key [String] The feature flag&#39;s key @param environment_key [String] The environment key @param id [String] The feature flag approval request ID @param post_approval_request_apply_request [PostApprovalRequestApplyRequest] @param [Hash] opts the optional parameters @return [FlagConfigApprovalRequestResponse]

# File lib/launchdarkly_api/api/approvals_api.rb, line 349
def post_approval_request_apply_request(project_key, feature_flag_key, environment_key, id, post_approval_request_apply_request, opts = {})
  data, _status_code, _headers = post_approval_request_apply_request_with_http_info(project_key, feature_flag_key, environment_key, id, post_approval_request_apply_request, opts)
  data
end
post_approval_request_apply_request_with_http_info(project_key, feature_flag_key, environment_key, id, post_approval_request_apply_request, opts = {}) click to toggle source

Apply approval request Apply approval request by either approving or declining changes. @param project_key [String] The project key @param feature_flag_key [String] The feature flag&#39;s key @param environment_key [String] The environment key @param id [String] The feature flag approval request ID @param post_approval_request_apply_request [PostApprovalRequestApplyRequest] @param [Hash] opts the optional parameters @return [Array<(FlagConfigApprovalRequestResponse, Integer, Hash)>] FlagConfigApprovalRequestResponse data, response status code and response headers

# File lib/launchdarkly_api/api/approvals_api.rb, line 363
def post_approval_request_apply_request_with_http_info(project_key, feature_flag_key, environment_key, id, post_approval_request_apply_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ApprovalsApi.post_approval_request_apply_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 ApprovalsApi.post_approval_request_apply_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 ApprovalsApi.post_approval_request_apply_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 ApprovalsApi.post_approval_request_apply_request"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ApprovalsApi.post_approval_request_apply_request"
  end
  # verify the required parameter 'post_approval_request_apply_request' is set
  if @api_client.config.client_side_validation && post_approval_request_apply_request.nil?
    fail ArgumentError, "Missing the required parameter 'post_approval_request_apply_request' when calling ApprovalsApi.post_approval_request_apply_request"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{id}/apply'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'featureFlagKey' + '}', CGI.escape(feature_flag_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[: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 = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(post_approval_request_apply_request)

  # return_type
  return_type = opts[:debug_return_type] || 'FlagConfigApprovalRequestResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKey']

  new_options = opts.merge(
    :operation => :"ApprovalsApi.post_approval_request_apply_request",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ApprovalsApi#post_approval_request_apply_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
post_approval_request_review(project_key, feature_flag_key, environment_key, id, post_approval_request_review_request, opts = {}) click to toggle source

Review approval request Review approval request by either approving or declining changes. @param project_key [String] The project key @param feature_flag_key [String] The feature flag&#39;s key @param environment_key [String] The environment key @param id [String] The feature flag approval request ID @param post_approval_request_review_request [PostApprovalRequestReviewRequest] @param [Hash] opts the optional parameters @return [FlagConfigApprovalRequestResponse]

# File lib/launchdarkly_api/api/approvals_api.rb, line 438
def post_approval_request_review(project_key, feature_flag_key, environment_key, id, post_approval_request_review_request, opts = {})
  data, _status_code, _headers = post_approval_request_review_with_http_info(project_key, feature_flag_key, environment_key, id, post_approval_request_review_request, opts)
  data
end
post_approval_request_review_with_http_info(project_key, feature_flag_key, environment_key, id, post_approval_request_review_request, opts = {}) click to toggle source

Review approval request Review approval request by either approving or declining changes. @param project_key [String] The project key @param feature_flag_key [String] The feature flag&#39;s key @param environment_key [String] The environment key @param id [String] The feature flag approval request ID @param post_approval_request_review_request [PostApprovalRequestReviewRequest] @param [Hash] opts the optional parameters @return [Array<(FlagConfigApprovalRequestResponse, Integer, Hash)>] FlagConfigApprovalRequestResponse data, response status code and response headers

# File lib/launchdarkly_api/api/approvals_api.rb, line 452
def post_approval_request_review_with_http_info(project_key, feature_flag_key, environment_key, id, post_approval_request_review_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ApprovalsApi.post_approval_request_review ...'
  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 ApprovalsApi.post_approval_request_review"
  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 ApprovalsApi.post_approval_request_review"
  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 ApprovalsApi.post_approval_request_review"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ApprovalsApi.post_approval_request_review"
  end
  # verify the required parameter 'post_approval_request_review_request' is set
  if @api_client.config.client_side_validation && post_approval_request_review_request.nil?
    fail ArgumentError, "Missing the required parameter 'post_approval_request_review_request' when calling ApprovalsApi.post_approval_request_review"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{id}/reviews'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'featureFlagKey' + '}', CGI.escape(feature_flag_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[: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 = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(post_approval_request_review_request)

  # return_type
  return_type = opts[:debug_return_type] || 'FlagConfigApprovalRequestResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKey']

  new_options = opts.merge(
    :operation => :"ApprovalsApi.post_approval_request_review",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ApprovalsApi#post_approval_request_review\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
post_approval_request_with_http_info(project_key, feature_flag_key, environment_key, create_flag_config_approval_request_request, opts = {}) click to toggle source

Create approval request Create an approval request for a feature flag @param project_key [String] The project key @param feature_flag_key [String] The feature flag&#39;s key @param environment_key [String] The environment key @param create_flag_config_approval_request_request [CreateFlagConfigApprovalRequestRequest] @param [Hash] opts the optional parameters @return [Array<(FlagConfigApprovalRequestResponse, Integer, Hash)>] FlagConfigApprovalRequestResponse data, response status code and response headers

# File lib/launchdarkly_api/api/approvals_api.rb, line 278
def post_approval_request_with_http_info(project_key, feature_flag_key, environment_key, create_flag_config_approval_request_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ApprovalsApi.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 ApprovalsApi.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 ApprovalsApi.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 ApprovalsApi.post_approval_request"
  end
  # verify the required parameter 'create_flag_config_approval_request_request' is set
  if @api_client.config.client_side_validation && create_flag_config_approval_request_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_flag_config_approval_request_request' when calling ApprovalsApi.post_approval_request"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'featureFlagKey' + '}', CGI.escape(feature_flag_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[: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 = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_flag_config_approval_request_request)

  # return_type
  return_type = opts[:debug_return_type] || 'FlagConfigApprovalRequestResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKey']

  new_options = opts.merge(
    :operation => :"ApprovalsApi.post_approval_request",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ApprovalsApi#post_approval_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
post_flag_copy_config_approval_request(project_key, feature_flag_key, environment_key, create_copy_flag_config_approval_request_request, opts = {}) click to toggle source

Create approval request to copy flag configurations across environments Create an approval request to copy a feature flag's configuration across environments. @param project_key [String] The project key @param feature_flag_key [String] The feature flag&#39;s key @param environment_key [String] The environment key @param create_copy_flag_config_approval_request_request [CreateCopyFlagConfigApprovalRequestRequest] @param [Hash] opts the optional parameters @return [FlagConfigApprovalRequestResponse]

# File lib/launchdarkly_api/api/approvals_api.rb, line 526
def post_flag_copy_config_approval_request(project_key, feature_flag_key, environment_key, create_copy_flag_config_approval_request_request, opts = {})
  data, _status_code, _headers = post_flag_copy_config_approval_request_with_http_info(project_key, feature_flag_key, environment_key, create_copy_flag_config_approval_request_request, opts)
  data
end
post_flag_copy_config_approval_request_with_http_info(project_key, feature_flag_key, environment_key, create_copy_flag_config_approval_request_request, opts = {}) click to toggle source

Create approval request to copy flag configurations across environments Create an approval request to copy a feature flag&#39;s configuration across environments. @param project_key [String] The project key @param feature_flag_key [String] The feature flag&#39;s key @param environment_key [String] The environment key @param create_copy_flag_config_approval_request_request [CreateCopyFlagConfigApprovalRequestRequest] @param [Hash] opts the optional parameters @return [Array<(FlagConfigApprovalRequestResponse, Integer, Hash)>] FlagConfigApprovalRequestResponse data, response status code and response headers

# File lib/launchdarkly_api/api/approvals_api.rb, line 539
def post_flag_copy_config_approval_request_with_http_info(project_key, feature_flag_key, environment_key, create_copy_flag_config_approval_request_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ApprovalsApi.post_flag_copy_config_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 ApprovalsApi.post_flag_copy_config_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 ApprovalsApi.post_flag_copy_config_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 ApprovalsApi.post_flag_copy_config_approval_request"
  end
  # verify the required parameter 'create_copy_flag_config_approval_request_request' is set
  if @api_client.config.client_side_validation && create_copy_flag_config_approval_request_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_copy_flag_config_approval_request_request' when calling ApprovalsApi.post_flag_copy_config_approval_request"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/flags/{featureFlagKey}/copy/environments/{environmentKey}/approval-requests-flag-copy'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'featureFlagKey' + '}', CGI.escape(feature_flag_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[: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 = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_copy_flag_config_approval_request_request)

  # return_type
  return_type = opts[:debug_return_type] || 'FlagConfigApprovalRequestResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKey']

  new_options = opts.merge(
    :operation => :"ApprovalsApi.post_flag_copy_config_approval_request",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ApprovalsApi#post_flag_copy_config_approval_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end