View Source GitHub.Licenses (GitHub REST API Client v0.3.0)

Provides API endpoints related to licenses

Link to this section Summary

Functions

Get a license

Get all commonly used licenses

Get the license for a repository

Link to this section Functions

Link to this function

get(license, opts \\ [])

View Source
@spec get(
  String.t(),
  keyword()
) :: {:ok, GitHub.License.t()} | {:error, GitHub.Error.t()}

Get a license

Gets information about a specific license. For more information, see "Licensing a repository ."

resources

Resources

Link to this function

get_all_commonly_used(opts \\ [])

View Source
@spec get_all_commonly_used(keyword()) ::
  {:ok, [GitHub.License.simple()]} | {:error, GitHub.Error.t()}

Get all commonly used licenses

Lists the most commonly used licenses on GitHub. For more information, see "Licensing a repository ."

options

Options

resources

Resources

Link to this function

get_for_repo(owner, repo, opts \\ [])

View Source
@spec get_for_repo(String.t(), String.t(), keyword()) ::
  {:ok, GitHub.License.Content.t()} | {:error, GitHub.Error.t()}

Get the license for a repository

This method returns the contents of the repository's license file, if one is detected.

This endpoint supports the following custom media types. For more information, see "Media types."

  • application/vnd.github.raw+json: Returns the raw contents of the license.
  • application/vnd.github.html+json: Returns the license contents in HTML. Markup languages are rendered to HTML using GitHub's open-source Markup library.

options

Options

  • ref: The Git reference for the results you want to list. The ref for a branch can be formatted either as refs/heads/<branch name> or simply <branch name>. To reference a pull request use refs/pull/<number>/merge.

resources

Resources