class LaunchDarklyApi::ScheduledChangesApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

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

Delete scheduled changes workflow Delete a scheduled changes workflow @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 scheduled change id @param [Hash] opts the optional parameters @return [nil]

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

Delete scheduled changes workflow Delete a scheduled changes workflow @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 scheduled change id @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/launchdarkly_api/api/scheduled_changes_api.rb, line 43
def delete_flag_config_scheduled_changes_with_http_info(project_key, feature_flag_key, environment_key, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ScheduledChangesApi.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 ScheduledChangesApi.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 ScheduledChangesApi.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 ScheduledChangesApi.delete_flag_config_scheduled_changes"
  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 ScheduledChangesApi.delete_flag_config_scheduled_changes"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/scheduled-changes/{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 => :"ScheduledChangesApi.delete_flag_config_scheduled_changes",
    :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: ScheduledChangesApi#delete_flag_config_scheduled_changes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_feature_flag_scheduled_change(project_key, feature_flag_key, environment_key, id, opts = {}) click to toggle source

Get a scheduled change Get a scheduled change that will be applied to the feature flag by ID @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 scheduled change id @param [Hash] opts the optional parameters @return [FeatureFlagScheduledChange]

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

Get a scheduled change Get a scheduled change that will be applied to the feature flag by ID @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 scheduled change id @param [Hash] opts the optional parameters @return [Array<(FeatureFlagScheduledChange, Integer, Hash)>] FeatureFlagScheduledChange data, response status code and response headers

# File lib/launchdarkly_api/api/scheduled_changes_api.rb, line 122
def get_feature_flag_scheduled_change_with_http_info(project_key, feature_flag_key, environment_key, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ScheduledChangesApi.get_feature_flag_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 ScheduledChangesApi.get_feature_flag_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 ScheduledChangesApi.get_feature_flag_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 ScheduledChangesApi.get_feature_flag_scheduled_change"
  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 ScheduledChangesApi.get_feature_flag_scheduled_change"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/scheduled-changes/{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] || 'FeatureFlagScheduledChange'

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

  new_options = opts.merge(
    :operation => :"ScheduledChangesApi.get_feature_flag_scheduled_change",
    :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: ScheduledChangesApi#get_feature_flag_scheduled_change\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_flag_config_scheduled_changes(project_key, feature_flag_key, environment_key, opts = {}) click to toggle source

List scheduled changes Get a list of scheduled changes that will be applied to the 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 [FeatureFlagScheduledChanges]

# File lib/launchdarkly_api/api/scheduled_changes_api.rb, line 189
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_flag_config_scheduled_changes_with_http_info(project_key, feature_flag_key, environment_key, opts = {}) click to toggle source

List scheduled changes Get a list of scheduled changes that will be applied to the 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<(FeatureFlagScheduledChanges, Integer, Hash)>] FeatureFlagScheduledChanges data, response status code and response headers

# File lib/launchdarkly_api/api/scheduled_changes_api.rb, line 201
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: ScheduledChangesApi.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 ScheduledChangesApi.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 ScheduledChangesApi.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 ScheduledChangesApi.get_flag_config_scheduled_changes"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/scheduled-changes'.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] || 'FeatureFlagScheduledChanges'

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

  new_options = opts.merge(
    :operation => :"ScheduledChangesApi.get_flag_config_scheduled_changes",
    :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: ScheduledChangesApi#get_flag_config_scheduled_changes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
patch_flag_config_scheduled_change(project_key, feature_flag_key, environment_key, id, flag_scheduled_changes_input, opts = {}) click to toggle source

Update scheduled changes workflow Update a scheduled change, overriding existing instructions with the new ones.<br /><br />Requires a semantic patch representation of the desired changes to the resource. To learn more about semantic patches, read [Updates](/#section/Updates/Updates-via-semantic-patches) @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 scheduled change ID @param flag_scheduled_changes_input [FlagScheduledChangesInput] @param [Hash] opts the optional parameters @option opts [Boolean] :ignore_conflicts Whether or not to succeed or fail when the new instructions conflict with existing scheduled changes @return [FeatureFlagScheduledChange]

# File lib/launchdarkly_api/api/scheduled_changes_api.rb, line 267
def patch_flag_config_scheduled_change(project_key, feature_flag_key, environment_key, id, flag_scheduled_changes_input, opts = {})
  data, _status_code, _headers = patch_flag_config_scheduled_change_with_http_info(project_key, feature_flag_key, environment_key, id, flag_scheduled_changes_input, opts)
  data
end
patch_flag_config_scheduled_change_with_http_info(project_key, feature_flag_key, environment_key, id, flag_scheduled_changes_input, opts = {}) click to toggle source

Update scheduled changes workflow Update a scheduled change, overriding existing instructions with the new ones.&lt;br /&gt;&lt;br /&gt;Requires a semantic patch representation of the desired changes to the resource. To learn more about semantic patches, read [Updates](/#section/Updates/Updates-via-semantic-patches) @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 scheduled change ID @param flag_scheduled_changes_input [FlagScheduledChangesInput] @param [Hash] opts the optional parameters @option opts [Boolean] :ignore_conflicts Whether or not to succeed or fail when the new instructions conflict with existing scheduled changes @return [Array<(FeatureFlagScheduledChange, Integer, Hash)>] FeatureFlagScheduledChange data, response status code and response headers

# File lib/launchdarkly_api/api/scheduled_changes_api.rb, line 282
def patch_flag_config_scheduled_change_with_http_info(project_key, feature_flag_key, environment_key, id, flag_scheduled_changes_input, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ScheduledChangesApi.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 ScheduledChangesApi.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 ScheduledChangesApi.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 ScheduledChangesApi.patch_flag_config_scheduled_change"
  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 ScheduledChangesApi.patch_flag_config_scheduled_change"
  end
  # verify the required parameter 'flag_scheduled_changes_input' is set
  if @api_client.config.client_side_validation && flag_scheduled_changes_input.nil?
    fail ArgumentError, "Missing the required parameter 'flag_scheduled_changes_input' when calling ScheduledChangesApi.patch_flag_config_scheduled_change"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/scheduled-changes/{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] || {}
  query_params[:'ignoreConflicts'] = opts[:'ignore_conflicts'] if !opts[:'ignore_conflicts'].nil?

  # 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(flag_scheduled_changes_input)

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

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

  new_options = opts.merge(
    :operation => :"ScheduledChangesApi.patch_flag_config_scheduled_change",
    :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(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScheduledChangesApi#patch_flag_config_scheduled_change\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
post_flag_config_scheduled_changes(project_key, feature_flag_key, environment_key, post_flag_scheduled_changes_input, opts = {}) click to toggle source

Create scheduled changes workflow Create scheduled changes for a feature flag. If the ignoreConficts query parameter is false and the new instructions would conflict with the current state of the feature flag or any existing scheduled changes, the request will fail. If the parameter is true and there are conflicts, the request will succeed as normal. @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 post_flag_scheduled_changes_input [PostFlagScheduledChangesInput] @param [Hash] opts the optional parameters @option opts [Boolean] :ignore_conflicts Whether or not to succeed or fail when the new instructions conflict with existing scheduled changes @return [FeatureFlagScheduledChange]

# File lib/launchdarkly_api/api/scheduled_changes_api.rb, line 358
def post_flag_config_scheduled_changes(project_key, feature_flag_key, environment_key, post_flag_scheduled_changes_input, opts = {})
  data, _status_code, _headers = post_flag_config_scheduled_changes_with_http_info(project_key, feature_flag_key, environment_key, post_flag_scheduled_changes_input, opts)
  data
end
post_flag_config_scheduled_changes_with_http_info(project_key, feature_flag_key, environment_key, post_flag_scheduled_changes_input, opts = {}) click to toggle source

Create scheduled changes workflow Create scheduled changes for a feature flag. If the ignoreConficts query parameter is false and the new instructions would conflict with the current state of the feature flag or any existing scheduled changes, the request will fail. If the parameter is true and there are conflicts, the request will succeed as normal. @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 post_flag_scheduled_changes_input [PostFlagScheduledChangesInput] @param [Hash] opts the optional parameters @option opts [Boolean] :ignore_conflicts Whether or not to succeed or fail when the new instructions conflict with existing scheduled changes @return [Array<(FeatureFlagScheduledChange, Integer, Hash)>] FeatureFlagScheduledChange data, response status code and response headers

# File lib/launchdarkly_api/api/scheduled_changes_api.rb, line 372
def post_flag_config_scheduled_changes_with_http_info(project_key, feature_flag_key, environment_key, post_flag_scheduled_changes_input, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ScheduledChangesApi.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 ScheduledChangesApi.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 ScheduledChangesApi.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 ScheduledChangesApi.post_flag_config_scheduled_changes"
  end
  # verify the required parameter 'post_flag_scheduled_changes_input' is set
  if @api_client.config.client_side_validation && post_flag_scheduled_changes_input.nil?
    fail ArgumentError, "Missing the required parameter 'post_flag_scheduled_changes_input' when calling ScheduledChangesApi.post_flag_config_scheduled_changes"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/scheduled-changes'.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] || {}
  query_params[:'ignoreConflicts'] = opts[:'ignore_conflicts'] if !opts[:'ignore_conflicts'].nil?

  # 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_flag_scheduled_changes_input)

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

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

  new_options = opts.merge(
    :operation => :"ScheduledChangesApi.post_flag_config_scheduled_changes",
    :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: ScheduledChangesApi#post_flag_config_scheduled_changes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end