Skip to main content

lib/api/code_quality/code_quality.ex

# Generated by `mix github.gen` from docs/github-api/api.github.com.json.
# Do not edit by hand; re-run the task instead.

defmodule Noizu.Github.Api.CodeQuality do
  @moduledoc """
  GitHub `code-quality` API.
  """
  import Noizu.Github

  @doc """
  Get a code quality setup configuration

  @see https://docs.github.com/rest/code-quality/code-quality#get-a-code-quality-setup-configuration
  """
  def get_setup(options \\ nil) do
    owner = repo_owner(options)
    repo = repo_name(options)
    url = github_base() <> "/repos/#{owner}/#{repo}/code-quality/setup"
    body = %{}
    api_call(:get, url, body, Noizu.Github.CodeQualitySetup, options)
  end

  @doc """
  Update a code quality setup configuration

  @see https://docs.github.com/rest/code-quality/code-quality#update-a-code-quality-setup-configuration
  """
  def update_setup(body, options \\ nil) do
    owner = repo_owner(options)
    repo = repo_name(options)
    url = github_base() <> "/repos/#{owner}/#{repo}/code-quality/setup"
    body = body
    api_call(:patch, url, body, Noizu.Github.Raw, options)
  end
end