Module: Octokit::Client::Integrations

Included in:
Octokit::Client
Defined in:
lib/octokit/client/integrations.rb

Overview

Methods for the Integrations API

Instance Method Summary collapse

Instance Method Details

#add_repository_to_integration_installation(installation, repo, options = {}) ⇒ Boolean Also known as: add_repo_to_installation

Add a single repository to an installation

Parameters:

  • installation (Integer)

    The id of a a GitHub Integration Installation

  • repo (Integer)

    The id of the GitHub repository

  • options (Hash) (defaults to: {})

    An customizable set of options

Returns:

  • (Boolean)

    Success

See Also:



55
56
57
58
# File 'lib/octokit/client/integrations.rb', line 55

def add_repository_to_integration_installation(installation, repo, options = {})
  opts = ensure_api_media_type(:integrations, options)
  boolean_from_response :put, "/installations/#{installation}/repositories/#{repo}", opts
end

#create_integration_installation_access_token(installation, options = {}) ⇒ <Sawyer::Resource> Also known as: create_installation_access_token

Create a new installation token

Parameters:

  • installation (Integer)

    The id of a a GitHub Integration Installation

  • options (Hash) (defaults to: {})

    An customizable set of options

Returns:

  • (<Sawyer::Resource>)

    An installation token

See Also:



28
29
30
31
# File 'lib/octokit/client/integrations.rb', line 28

def create_integration_installation_access_token(installation, options = {})
  opts = ensure_api_media_type(:integrations, options)
  post "/installations/#{installation}/access_tokens", opts
end

#find_integration_installations(options = {}) ⇒ Array<Sawyer::Resource> Also known as: find_installations

Find all installations that belong to an Integration

Parameters:

  • options (Hash) (defaults to: {})

    An customizable set of options

Returns:

  • (Array<Sawyer::Resource>)

    A list of installations

See Also:



14
15
16
17
# File 'lib/octokit/client/integrations.rb', line 14

def find_integration_installations(options = {})
  opts = ensure_api_media_type(:integrations, options)
  paginate "/integration/installations", opts
end

#list_integration_installation_repositories(options = {}) ⇒ Array<Sawyer::Resource> Also known as: list_installation_repos

List repositories that are accessible to the authenticated installation

Parameters:

  • options (Hash) (defaults to: {})

    An customizable set of options

Returns:

  • (Array<Sawyer::Resource>)

    A list of repositories

See Also:



40
41
42
43
# File 'lib/octokit/client/integrations.rb', line 40

def list_integration_installation_repositories(options = {})
  opts = ensure_api_media_type(:integrations, options)
  paginate "/installation/repositories", opts
end

#remove_repository_from_integration_installation(installation, repo, options = {}) ⇒ Boolean Also known as: remove_repo_from_installation

Remove a single repository to an installation

Parameters:

  • installation (Integer)

    The id of a a GitHub Integration Installation

  • repo (Integer)

    The id of the GitHub repository

  • options (Hash) (defaults to: {})

    An customizable set of options

Returns:

  • (Boolean)

    Success

See Also:



70
71
72
73
# File 'lib/octokit/client/integrations.rb', line 70

def remove_repository_from_integration_installation(installation, repo, options = {})
  opts = ensure_api_media_type(:integrations, options)
  boolean_from_response :delete, "/installations/#{installation}/repositories/#{repo}", opts
end