class LaunchDarklyApi::CodeReferencesApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

delete_branches(repo, request_body, opts = {}) click to toggle source

Delete branches Asynchronously delete a number of branches. @param repo [String] The repository name to delete branches for. @param request_body [Array<String>] @param [Hash] opts the optional parameters @return [nil]

# File lib/launchdarkly_api/api/code_references_api.rb, line 28
def delete_branches(repo, request_body, opts = {})
  delete_branches_with_http_info(repo, request_body, opts)
  nil
end
delete_branches_with_http_info(repo, request_body, opts = {}) click to toggle source

Delete branches Asynchronously delete a number of branches. @param repo [String] The repository name to delete branches for. @param request_body [Array<String>] @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/launchdarkly_api/api/code_references_api.rb, line 39
def delete_branches_with_http_info(repo, request_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CodeReferencesApi.delete_branches ...'
  end
  # verify the required parameter 'repo' is set
  if @api_client.config.client_side_validation && repo.nil?
    fail ArgumentError, "Missing the required parameter 'repo' when calling CodeReferencesApi.delete_branches"
  end
  # verify the required parameter 'request_body' is set
  if @api_client.config.client_side_validation && request_body.nil?
    fail ArgumentError, "Missing the required parameter 'request_body' when calling CodeReferencesApi.delete_branches"
  end
  # resource path
  local_var_path = '/api/v2/code-refs/repositories/{repo}/branch-delete-tasks'.sub('{' + 'repo' + '}', CGI.escape(repo.to_s))

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

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

  # return_type
  return_type = opts[:debug_return_type]

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

  new_options = opts.merge(
    :operation => :"CodeReferencesApi.delete_branches",
    :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: CodeReferencesApi#delete_branches\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_repository(repo, opts = {}) click to toggle source

Delete repository Delete a repository with the specified name @param repo [String] The repository name @param [Hash] opts the optional parameters @return [nil]

# File lib/launchdarkly_api/api/code_references_api.rb, line 96
def delete_repository(repo, opts = {})
  delete_repository_with_http_info(repo, opts)
  nil
end
delete_repository_with_http_info(repo, opts = {}) click to toggle source

Delete repository Delete a repository with the specified name @param repo [String] The repository name @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/launchdarkly_api/api/code_references_api.rb, line 106
def delete_repository_with_http_info(repo, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CodeReferencesApi.delete_repository ...'
  end
  # verify the required parameter 'repo' is set
  if @api_client.config.client_side_validation && repo.nil?
    fail ArgumentError, "Missing the required parameter 'repo' when calling CodeReferencesApi.delete_repository"
  end
  # resource path
  local_var_path = '/api/v2/code-refs/repositories/{repo}'.sub('{' + 'repo' + '}', CGI.escape(repo.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 => :"CodeReferencesApi.delete_repository",
    :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: CodeReferencesApi#delete_repository\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_branch(repo, branch, opts = {}) click to toggle source

Get branch Get a specific branch in a repository @param repo [String] The repository name @param branch [String] The url-encoded branch name @param [Hash] opts the optional parameters @option opts [String] :proj_key Filter results to a specific project @option opts [String] :flag_key Filter results to a specific flag key @return [BranchRep]

# File lib/launchdarkly_api/api/code_references_api.rb, line 160
def get_branch(repo, branch, opts = {})
  data, _status_code, _headers = get_branch_with_http_info(repo, branch, opts)
  data
end
get_branch_with_http_info(repo, branch, opts = {}) click to toggle source

Get branch Get a specific branch in a repository @param repo [String] The repository name @param branch [String] The url-encoded branch name @param [Hash] opts the optional parameters @option opts [String] :proj_key Filter results to a specific project @option opts [String] :flag_key Filter results to a specific flag key @return [Array<(BranchRep, Integer, Hash)>] BranchRep data, response status code and response headers

# File lib/launchdarkly_api/api/code_references_api.rb, line 173
def get_branch_with_http_info(repo, branch, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CodeReferencesApi.get_branch ...'
  end
  # verify the required parameter 'repo' is set
  if @api_client.config.client_side_validation && repo.nil?
    fail ArgumentError, "Missing the required parameter 'repo' when calling CodeReferencesApi.get_branch"
  end
  # verify the required parameter 'branch' is set
  if @api_client.config.client_side_validation && branch.nil?
    fail ArgumentError, "Missing the required parameter 'branch' when calling CodeReferencesApi.get_branch"
  end
  # resource path
  local_var_path = '/api/v2/code-refs/repositories/{repo}/branches/{branch}'.sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'branch' + '}', CGI.escape(branch.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'projKey'] = opts[:'proj_key'] if !opts[:'proj_key'].nil?
  query_params[:'flagKey'] = opts[:'flag_key'] if !opts[:'flag_key'].nil?

  # 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] || 'BranchRep'

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

  new_options = opts.merge(
    :operation => :"CodeReferencesApi.get_branch",
    :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: CodeReferencesApi#get_branch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_branches(repo, opts = {}) click to toggle source

List branches Get a list of branches. @param repo [String] The repository name @param [Hash] opts the optional parameters @return [BranchCollectionRep]

# File lib/launchdarkly_api/api/code_references_api.rb, line 232
def get_branches(repo, opts = {})
  data, _status_code, _headers = get_branches_with_http_info(repo, opts)
  data
end
get_branches_with_http_info(repo, opts = {}) click to toggle source

List branches Get a list of branches. @param repo [String] The repository name @param [Hash] opts the optional parameters @return [Array<(BranchCollectionRep, Integer, Hash)>] BranchCollectionRep data, response status code and response headers

# File lib/launchdarkly_api/api/code_references_api.rb, line 242
def get_branches_with_http_info(repo, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CodeReferencesApi.get_branches ...'
  end
  # verify the required parameter 'repo' is set
  if @api_client.config.client_side_validation && repo.nil?
    fail ArgumentError, "Missing the required parameter 'repo' when calling CodeReferencesApi.get_branches"
  end
  # resource path
  local_var_path = '/api/v2/code-refs/repositories/{repo}/branches'.sub('{' + 'repo' + '}', CGI.escape(repo.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] || 'BranchCollectionRep'

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

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

List extinctions Get a list of all extinctions. @param [Hash] opts the optional parameters @option opts [String] :repo_name Filter results to a specific repository @option opts [String] :branch_name Filter results to a specific branch @option opts [String] :proj_key Filter results to a specific project @option opts [String] :flag_key Filter results to a specific flag key @return [ExtinctionCollectionRep]

# File lib/launchdarkly_api/api/code_references_api.rb, line 298
def get_extinctions(opts = {})
  data, _status_code, _headers = get_extinctions_with_http_info(opts)
  data
end
get_extinctions_with_http_info(opts = {}) click to toggle source

List extinctions Get a list of all extinctions. @param [Hash] opts the optional parameters @option opts [String] :repo_name Filter results to a specific repository @option opts [String] :branch_name Filter results to a specific branch @option opts [String] :proj_key Filter results to a specific project @option opts [String] :flag_key Filter results to a specific flag key @return [Array<(ExtinctionCollectionRep, Integer, Hash)>] ExtinctionCollectionRep data, response status code and response headers

# File lib/launchdarkly_api/api/code_references_api.rb, line 311
def get_extinctions_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CodeReferencesApi.get_extinctions ...'
  end
  # resource path
  local_var_path = '/api/v2/code-refs/extinctions'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'repoName'] = opts[:'repo_name'] if !opts[:'repo_name'].nil?
  query_params[:'branchName'] = opts[:'branch_name'] if !opts[:'branch_name'].nil?
  query_params[:'projKey'] = opts[:'proj_key'] if !opts[:'proj_key'].nil?
  query_params[:'flagKey'] = opts[:'flag_key'] if !opts[:'flag_key'].nil?

  # 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] || 'ExtinctionCollectionRep'

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

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

List repositories Get a list of connected repositories. Optionally, you can include branch metadata with the `withBranches` query parameter. Embed references for the default branch with `ReferencesForDefaultBranch`. You can also filter the list of code references by project key and flag key. @param [Hash] opts the optional parameters @option opts [String] :with_branches If set to any value, the endpoint returns repositories with associated branch data @option opts [String] :with_references_for_default_branch If set to any value, the endpoint returns repositories with associated branch data, as well as code references for the default git branch @option opts [String] :proj_key A LaunchDarkly project key. If provided, this filters code reference results to the specified project. @option opts [String] :flag_key If set to any value, the endpoint returns repositories with associated branch data, as well as code references for the default git branch @return [RepositoryCollectionRep]

# File lib/launchdarkly_api/api/code_references_api.rb, line 367
def get_repositories(opts = {})
  data, _status_code, _headers = get_repositories_with_http_info(opts)
  data
end
get_repositories_with_http_info(opts = {}) click to toggle source

List repositories Get a list of connected repositories. Optionally, you can include branch metadata with the &#x60;withBranches&#x60; query parameter. Embed references for the default branch with &#x60;ReferencesForDefaultBranch&#x60;. You can also filter the list of code references by project key and flag key. @param [Hash] opts the optional parameters @option opts [String] :with_branches If set to any value, the endpoint returns repositories with associated branch data @option opts [String] :with_references_for_default_branch If set to any value, the endpoint returns repositories with associated branch data, as well as code references for the default git branch @option opts [String] :proj_key A LaunchDarkly project key. If provided, this filters code reference results to the specified project. @option opts [String] :flag_key If set to any value, the endpoint returns repositories with associated branch data, as well as code references for the default git branch @return [Array<(RepositoryCollectionRep, Integer, Hash)>] RepositoryCollectionRep data, response status code and response headers

# File lib/launchdarkly_api/api/code_references_api.rb, line 380
def get_repositories_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CodeReferencesApi.get_repositories ...'
  end
  # resource path
  local_var_path = '/api/v2/code-refs/repositories'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'withBranches'] = opts[:'with_branches'] if !opts[:'with_branches'].nil?
  query_params[:'withReferencesForDefaultBranch'] = opts[:'with_references_for_default_branch'] if !opts[:'with_references_for_default_branch'].nil?
  query_params[:'projKey'] = opts[:'proj_key'] if !opts[:'proj_key'].nil?
  query_params[:'flagKey'] = opts[:'flag_key'] if !opts[:'flag_key'].nil?

  # 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] || 'RepositoryCollectionRep'

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

  new_options = opts.merge(
    :operation => :"CodeReferencesApi.get_repositories",
    :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: CodeReferencesApi#get_repositories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_repository(repo, opts = {}) click to toggle source

Get repository Get a single repository by name. @param repo [String] The repository name @param [Hash] opts the optional parameters @return [RepositoryRep]

# File lib/launchdarkly_api/api/code_references_api.rb, line 433
def get_repository(repo, opts = {})
  data, _status_code, _headers = get_repository_with_http_info(repo, opts)
  data
end
get_repository_with_http_info(repo, opts = {}) click to toggle source

Get repository Get a single repository by name. @param repo [String] The repository name @param [Hash] opts the optional parameters @return [Array<(RepositoryRep, Integer, Hash)>] RepositoryRep data, response status code and response headers

# File lib/launchdarkly_api/api/code_references_api.rb, line 443
def get_repository_with_http_info(repo, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CodeReferencesApi.get_repository ...'
  end
  # verify the required parameter 'repo' is set
  if @api_client.config.client_side_validation && repo.nil?
    fail ArgumentError, "Missing the required parameter 'repo' when calling CodeReferencesApi.get_repository"
  end
  # resource path
  local_var_path = '/api/v2/code-refs/repositories/{repo}'.sub('{' + 'repo' + '}', CGI.escape(repo.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] || 'RepositoryRep'

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

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

Get number of code references for flags Get links for all projects that have Code References. @param [Hash] opts the optional parameters @return [StatisticsRoot]

# File lib/launchdarkly_api/api/code_references_api.rb, line 495
def get_root_statistic(opts = {})
  data, _status_code, _headers = get_root_statistic_with_http_info(opts)
  data
end
get_root_statistic_with_http_info(opts = {}) click to toggle source

Get number of code references for flags Get links for all projects that have Code References. @param [Hash] opts the optional parameters @return [Array<(StatisticsRoot, Integer, Hash)>] StatisticsRoot data, response status code and response headers

# File lib/launchdarkly_api/api/code_references_api.rb, line 504
def get_root_statistic_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CodeReferencesApi.get_root_statistic ...'
  end
  # resource path
  local_var_path = '/api/v2/code-refs/statistics'

  # 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] || 'StatisticsRoot'

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

  new_options = opts.merge(
    :operation => :"CodeReferencesApi.get_root_statistic",
    :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: CodeReferencesApi#get_root_statistic\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_statistics(proj_key, opts = {}) click to toggle source

Get number of code references for flags Get the number of code references across repositories for all flags in your project that have code references in the default branch (for example: master). You can optionally include the `flagKey` query parameter to get the number of code references across repositories for a single flag. This endpoint returns the number of times your flag keys are referenced in your repositories. You can filter to a single flag with by passing in a flag key. @param proj_key [String] The project key @param [Hash] opts the optional parameters @option opts [String] :flag_key Filter results to a specific flag key @return [StatisticCollectionRep]

# File lib/launchdarkly_api/api/code_references_api.rb, line 554
def get_statistics(proj_key, opts = {})
  data, _status_code, _headers = get_statistics_with_http_info(proj_key, opts)
  data
end
get_statistics_with_http_info(proj_key, opts = {}) click to toggle source

Get number of code references for flags Get the number of code references across repositories for all flags in your project that have code references in the default branch (for example: master). You can optionally include the &#x60;flagKey&#x60; query parameter to get the number of code references across repositories for a single flag. This endpoint returns the number of times your flag keys are referenced in your repositories. You can filter to a single flag with by passing in a flag key. @param proj_key [String] The project key @param [Hash] opts the optional parameters @option opts [String] :flag_key Filter results to a specific flag key @return [Array<(StatisticCollectionRep, Integer, Hash)>] StatisticCollectionRep data, response status code and response headers

# File lib/launchdarkly_api/api/code_references_api.rb, line 565
def get_statistics_with_http_info(proj_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CodeReferencesApi.get_statistics ...'
  end
  # verify the required parameter 'proj_key' is set
  if @api_client.config.client_side_validation && proj_key.nil?
    fail ArgumentError, "Missing the required parameter 'proj_key' when calling CodeReferencesApi.get_statistics"
  end
  # resource path
  local_var_path = '/api/v2/code-refs/statistics/{projKey}'.sub('{' + 'projKey' + '}', CGI.escape(proj_key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'flagKey'] = opts[:'flag_key'] if !opts[:'flag_key'].nil?

  # 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] || 'StatisticCollectionRep'

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

  new_options = opts.merge(
    :operation => :"CodeReferencesApi.get_statistics",
    :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: CodeReferencesApi#get_statistics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
patch_repository(repo, patch_operation, opts = {}) click to toggle source

Update repository Update a repository's settings. The request must be a valid JSON Patch document describing the changes to be made to the repository. @param repo [String] The repository name @param patch_operation [Array<PatchOperation>] @param [Hash] opts the optional parameters @return [RepositoryRep]

# File lib/launchdarkly_api/api/code_references_api.rb, line 620
def patch_repository(repo, patch_operation, opts = {})
  data, _status_code, _headers = patch_repository_with_http_info(repo, patch_operation, opts)
  data
end
patch_repository_with_http_info(repo, patch_operation, opts = {}) click to toggle source

Update repository Update a repository&#39;s settings. The request must be a valid JSON Patch document describing the changes to be made to the repository. @param repo [String] The repository name @param patch_operation [Array<PatchOperation>] @param [Hash] opts the optional parameters @return [Array<(RepositoryRep, Integer, Hash)>] RepositoryRep data, response status code and response headers

# File lib/launchdarkly_api/api/code_references_api.rb, line 631
def patch_repository_with_http_info(repo, patch_operation, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CodeReferencesApi.patch_repository ...'
  end
  # verify the required parameter 'repo' is set
  if @api_client.config.client_side_validation && repo.nil?
    fail ArgumentError, "Missing the required parameter 'repo' when calling CodeReferencesApi.patch_repository"
  end
  # verify the required parameter 'patch_operation' is set
  if @api_client.config.client_side_validation && patch_operation.nil?
    fail ArgumentError, "Missing the required parameter 'patch_operation' when calling CodeReferencesApi.patch_repository"
  end
  # resource path
  local_var_path = '/api/v2/code-refs/repositories/{repo}'.sub('{' + 'repo' + '}', CGI.escape(repo.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(patch_operation)

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

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

  new_options = opts.merge(
    :operation => :"CodeReferencesApi.patch_repository",
    :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: CodeReferencesApi#patch_repository\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
post_extinction(repo, branch, inline_object, opts = {}) click to toggle source

Create extinction Create a new extinction @param repo [String] The repository name @param branch [String] The url-encoded branch name @param inline_object [Array<InlineObject>] @param [Hash] opts the optional parameters @return [nil]

# File lib/launchdarkly_api/api/code_references_api.rb, line 692
def post_extinction(repo, branch, inline_object, opts = {})
  post_extinction_with_http_info(repo, branch, inline_object, opts)
  nil
end
post_extinction_with_http_info(repo, branch, inline_object, opts = {}) click to toggle source

Create extinction Create a new extinction @param repo [String] The repository name @param branch [String] The url-encoded branch name @param inline_object [Array<InlineObject>] @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/launchdarkly_api/api/code_references_api.rb, line 704
def post_extinction_with_http_info(repo, branch, inline_object, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CodeReferencesApi.post_extinction ...'
  end
  # verify the required parameter 'repo' is set
  if @api_client.config.client_side_validation && repo.nil?
    fail ArgumentError, "Missing the required parameter 'repo' when calling CodeReferencesApi.post_extinction"
  end
  # verify the required parameter 'branch' is set
  if @api_client.config.client_side_validation && branch.nil?
    fail ArgumentError, "Missing the required parameter 'branch' when calling CodeReferencesApi.post_extinction"
  end
  # verify the required parameter 'inline_object' is set
  if @api_client.config.client_side_validation && inline_object.nil?
    fail ArgumentError, "Missing the required parameter 'inline_object' when calling CodeReferencesApi.post_extinction"
  end
  # resource path
  local_var_path = '/api/v2/code-refs/repositories/{repo}/branches/{branch}'.sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'branch' + '}', CGI.escape(branch.to_s))

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

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

  # return_type
  return_type = opts[:debug_return_type]

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

  new_options = opts.merge(
    :operation => :"CodeReferencesApi.post_extinction",
    :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: CodeReferencesApi#post_extinction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
post_repository(repository_post, opts = {}) click to toggle source

Create repository Create a repository with the specified name. @param repository_post [RepositoryPost] @param [Hash] opts the optional parameters @return [nil]

# File lib/launchdarkly_api/api/code_references_api.rb, line 765
def post_repository(repository_post, opts = {})
  post_repository_with_http_info(repository_post, opts)
  nil
end
post_repository_with_http_info(repository_post, opts = {}) click to toggle source

Create repository Create a repository with the specified name. @param repository_post [RepositoryPost] @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/launchdarkly_api/api/code_references_api.rb, line 775
def post_repository_with_http_info(repository_post, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CodeReferencesApi.post_repository ...'
  end
  # verify the required parameter 'repository_post' is set
  if @api_client.config.client_side_validation && repository_post.nil?
    fail ArgumentError, "Missing the required parameter 'repository_post' when calling CodeReferencesApi.post_repository"
  end
  # resource path
  local_var_path = '/api/v2/code-refs/repositories'

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

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

  # return_type
  return_type = opts[:debug_return_type]

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

  new_options = opts.merge(
    :operation => :"CodeReferencesApi.post_repository",
    :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: CodeReferencesApi#post_repository\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
put_branch(repo, branch, branch_rep, opts = {}) click to toggle source

Upsert branch Create a new branch if it doesn't exist, or updates the branch if it already exists. @param repo [String] The repository name @param branch [String] The url-encoded branch name @param branch_rep [BranchRep] @param [Hash] opts the optional parameters @return [nil]

# File lib/launchdarkly_api/api/code_references_api.rb, line 830
def put_branch(repo, branch, branch_rep, opts = {})
  put_branch_with_http_info(repo, branch, branch_rep, opts)
  nil
end
put_branch_with_http_info(repo, branch, branch_rep, opts = {}) click to toggle source

Upsert branch Create a new branch if it doesn&#39;t exist, or updates the branch if it already exists. @param repo [String] The repository name @param branch [String] The url-encoded branch name @param branch_rep [BranchRep] @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/launchdarkly_api/api/code_references_api.rb, line 842
def put_branch_with_http_info(repo, branch, branch_rep, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CodeReferencesApi.put_branch ...'
  end
  # verify the required parameter 'repo' is set
  if @api_client.config.client_side_validation && repo.nil?
    fail ArgumentError, "Missing the required parameter 'repo' when calling CodeReferencesApi.put_branch"
  end
  # verify the required parameter 'branch' is set
  if @api_client.config.client_side_validation && branch.nil?
    fail ArgumentError, "Missing the required parameter 'branch' when calling CodeReferencesApi.put_branch"
  end
  # verify the required parameter 'branch_rep' is set
  if @api_client.config.client_side_validation && branch_rep.nil?
    fail ArgumentError, "Missing the required parameter 'branch_rep' when calling CodeReferencesApi.put_branch"
  end
  # resource path
  local_var_path = '/api/v2/code-refs/repositories/{repo}/branches/{branch}'.sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'branch' + '}', CGI.escape(branch.to_s))

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

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

  # return_type
  return_type = opts[:debug_return_type]

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

  new_options = opts.merge(
    :operation => :"CodeReferencesApi.put_branch",
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CodeReferencesApi#put_branch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end