### List repositories for installation Source: https://hexdocs.pm/tentacat/Tentacat.App.Installations.html Lists repositories available to the authenticated installation. ```elixir Tentacat.App.Installations.list_repositories ``` -------------------------------- ### Create a Tree Example Source: https://hexdocs.pm/tentacat/Tentacat.Trees.html Usage example for creating a tree in a repository. ```elixir Tentacat.Trees.create "elixir-lang", "elixir", body, client ``` -------------------------------- ### Get installation token Source: https://hexdocs.pm/tentacat/Tentacat.App.Installations.html Generates an authorization token for a specific installation. ```elixir Tentacat.App.Installations.token client, 12 ``` -------------------------------- ### start/0 - Starts HTTPoison Source: https://hexdocs.pm/tentacat/Tentacat.html Starts the HTTPoison client and its associated dependencies. ```APIDOC ## POST /start ### Description Starts HTTPoison and its dependencies. ### Method POST ### Endpoint /start ### Response #### Success Response (200) Indicates that HTTPoison has been successfully started. ``` -------------------------------- ### Example Elixir Console Output Source: https://hexdocs.pm/tentacat/readme.html This is an example of the output you might see when starting an Elixir console session after setting up Tentacat. ```text Erlang/OTP 17 [erts-6.0] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] Interactive Elixir (0.13.3) - press Ctrl+C to exit (type h() ENTER for help) iex(1)> ``` -------------------------------- ### Create a reaction example Source: https://hexdocs.pm/tentacat/Tentacat.Pulls.Comments.Reactions.html Example usage of the create function for a specific repository and comment. ```elixir Tentacat.Pulls.Comments.Reactions.create client, "elixir-lang", "elixir", "3" ``` -------------------------------- ### Find a Tree Example Source: https://hexdocs.pm/tentacat/Tentacat.Trees.html Usage examples for retrieving a tree, with and without an explicit client. ```elixir Tentacat.Trees.find "elixir-lang", "elixir", "eac64175b71fc598fa0b6e611dea6a58973170e9" Tentacat.Trees.find "elixir-lang", "elixir", "eac64175b71fc598fa0b6e611dea6a58973170e9", client ``` -------------------------------- ### List Repositories for the Authenticated Installation Source: https://hexdocs.pm/tentacat/Tentacat.App.Installations.html Lists all repositories associated with the authenticated app installation. ```APIDOC ## GET /installation/repositories ### Description List repositories for the authenticated installation. ### Method GET ### Endpoint `/installation/repositories` ### Parameters #### Query Parameters - **client** (Tentacat.Client.t()) - Required - The Tentacat client instance. ### Response #### Success Response (200) - **repositories** (array) - A list of repository objects. - **repository_selection** (string) - Indicates how repositories are selected ('all' or 'selected'). ### Response Example ```json { "total_count": 2, "repositories": [ { "id": 12345, "name": "octocat.github.io", "full_name": "octocat/octocat.github.io", "private": false, "owner": { "login": "octocat", "id": 1, "type": "User", "avatar_url": "https://github.com/images/icons/icon-emoji.svg" }, "html_url": "https://github.com/octocat/octocat.github.io" } ], "repository_selection": "all" } ``` ``` -------------------------------- ### Get Authorization Token for an Installation Source: https://hexdocs.pm/tentacat/Tentacat.App.Installations.html Generates and retrieves an authorization token for a specific app installation. ```APIDOC ## POST /app/installations/{installation_id}/access_tokens ### Description Get an authorization token for an installation. ### Method POST ### Endpoint `/app/installations/{installation_id}/access_tokens` ### Parameters #### Path Parameters - **installation_id** (integer) - Required - The ID of the installation for which to generate a token. #### Query Parameters - **client** (Tentacat.Client.t()) - Required - The Tentacat client instance. ### Response #### Success Response (201) - **token** (string) - The generated authorization token. - **expires_at** (string) - The expiration date and time of the token. ### Response Example ```json { "token": "v1.1f671c340c...", "expires_at": "2023-10-27T10:00:00Z" } ``` ``` -------------------------------- ### List repositories for user in installation Source: https://hexdocs.pm/tentacat/Tentacat.App.Installations.html Lists repositories within a specific installation accessible to the authenticated user. ```elixir Tentacat.App.Installations.list_repositories_for_user client, 154 ``` -------------------------------- ### List installations for user Source: https://hexdocs.pm/tentacat/Tentacat.App.Installations.html Lists installations accessible to the authenticated app user. ```elixir Tentacat.App.Installations.list_for_user client ``` -------------------------------- ### Find a specific installation Source: https://hexdocs.pm/tentacat/Tentacat.App.Installations.html Retrieves details for a specific installation by ID. ```elixir Tentacat.App.Installations.find client, 12 ``` -------------------------------- ### List installations for authorized app Source: https://hexdocs.pm/tentacat/Tentacat.App.Installations.html Lists all installations associated with the authorized app. ```elixir Tentacat.App.Installations.list_mine client ``` -------------------------------- ### List Repositories for a User in an Installation Source: https://hexdocs.pm/tentacat/Tentacat.App.Installations.html Lists repositories within a specific installation that are accessible to the authenticated app user. ```APIDOC ## GET /app/installations/{installation_id}/repositories ### Description List repositories in an installation that are accessible with to the authenticated app user. ### Method GET ### Endpoint `/app/installations/{installation_id}/repositories` ### Parameters #### Path Parameters - **installation_id** (integer) - Required - The ID of the installation. #### Query Parameters - **client** (Tentacat.Client.t()) - Required - The Tentacat client instance. ### Response #### Success Response (200) - **repositories** (array) - A list of repository objects. - **repository_selection** (string) - Indicates how repositories are selected ('all' or 'selected'). ### Response Example ```json { "total_count": 1, "repositories": [ { "id": 12345, "name": "octocat.github.io", "full_name": "octocat/octocat.github.io", "private": false, "owner": { "login": "octocat", "id": 1, "type": "User", "avatar_url": "https://github.com/images/icons/icon-emoji.svg" }, "html_url": "https://github.com/octocat/octocat.github.io" } ], "repository_selection": "all" } ``` ``` -------------------------------- ### Fetch Dependencies and Start Elixir Console Source: https://hexdocs.pm/tentacat/readme.html Run these commands in your terminal to fetch project dependencies and start an interactive Elixir session. ```bash mix deps.get iex -S mix ``` -------------------------------- ### List reactions example Source: https://hexdocs.pm/tentacat/Tentacat.Pulls.Comments.Reactions.html Example usage of the list function for a specific repository and comment. ```elixir Tentacat.Pulls.Comments.Reactions.list "elixir-lang" , "elixir", "3" ``` -------------------------------- ### Find Recursive Tree Example Source: https://hexdocs.pm/tentacat/Tentacat.Trees.html Usage examples for retrieving a tree recursively, with and without an explicit client. ```elixir Tentacat.Trees.find_recursive "elixir-lang", "elixir", "eac64175b71fc598fa0b6e611dea6a58973170e9" Tentacat.Trees.find_recursive "elixir-lang", "elixir", "eac64175b71fc598fa0b6e611dea6a58973170e9", client ``` -------------------------------- ### List Installations for the Authorized App Source: https://hexdocs.pm/tentacat/Tentacat.App.Installations.html Lists all app installations associated with the authorized application. ```APIDOC ## GET /app/installations ### Description List installations for the authorized app. ### Method GET ### Endpoint `/app/installations` ### Parameters #### Query Parameters - **client** (Tentacat.Client.t()) - Required - The Tentacat client instance. ### Response #### Success Response (200) - **installations** (array) - A list of installation objects. ### Response Example ```json { "installations": [ { "id": 123, "account": { "login": "octocat", "id": 1, "type": "User", "avatar_url": "https://github.com/images/icons/icon-emoji.svg" }, "repository_selection": "all", "access_tokens_url": "https://api.github.com/app/installations/123/access_tokens", "repositories_url": "https://api.github.com/installation/repositories", "html_url": "https://github.com/settings/installations/123" } ] } ``` ``` -------------------------------- ### List Installations for Authenticated User Source: https://hexdocs.pm/tentacat/Tentacat.App.Installations.html Lists all app installations accessible by the currently authenticated app user. ```APIDOC ## GET /user/installations ### Description List installations accessible with the authenticated app user. ### Method GET ### Endpoint `/user/installations` ### Parameters #### Query Parameters - **client** (Tentacat.Client.t()) - Required - The Tentacat client instance. ### Response #### Success Response (200) - **installations** (array) - A list of installation objects. ### Response Example ```json { "installations": [ { "id": 123, "account": { "login": "octocat", "id": 1, "type": "User", "avatar_url": "https://github.com/images/icons/icon-emoji.svg" }, "repository_selection": "all", "access_tokens_url": "https://api.github.com/app/installations/123/access_tokens", "repositories_url": "https://api.github.com/installation/repositories", "html_url": "https://github.com/settings/installations/123" } ] } ``` ``` -------------------------------- ### Find a Specific Installation Source: https://hexdocs.pm/tentacat/Tentacat.App.Installations.html Retrieves details for a specific app installation using its ID. ```APIDOC ## GET /app/installations/{installation_id} ### Description Get a specific installation. ### Method GET ### Endpoint `/app/installations/{installation_id}` ### Parameters #### Path Parameters - **installation_id** (integer) - Required - The ID of the installation to retrieve. ### Response #### Success Response (200) - **installation** (object) - Details of the installation. ### Response Example ```json { "installation": { "id": 123, "account": { "login": "octocat", "id": 1, "type": "User", "avatar_url": "https://github.com/images/icons/icon-emoji.svg" }, "repository_selection": "all", "access_tokens_url": "https://api.github.com/app/installations/123/access_tokens", "repositories_url": "https://api.github.com/installation/repositories", "html_url": "https://github.com/settings/installations/123" } } ``` ``` -------------------------------- ### Webhook Update Body Example Source: https://hexdocs.pm/tentacat/Tentacat.Hooks.html An example of the map structure required for updating a webhook's configuration, including its name, active status, subscribed events, and URL. ```elixir hook_body = %{ "name" => "web", "active" => true, "events" => [ "push", "pull_request" ], "config" => { "url" => "http://example.com/webhook", "content_type" => "json" } } ``` -------------------------------- ### GET /users/:user/projects Source: https://hexdocs.pm/tentacat/Tentacat.Users.Projects.html Lists the projects for a specific user. ```APIDOC ## GET /users/:user/projects ### Description Lists the projects for a user. ### Method GET ### Parameters #### Path Parameters - **user** (binary) - Required - The username of the user whose projects are being listed ### Request Example Tentacat.Organizations.Projects.list client, "achiurizo" ``` -------------------------------- ### Get repository README Source: https://hexdocs.pm/tentacat/Tentacat.Contents.html Fetches the contents of the README.md file for a repository. ```elixir @spec readme(Tentacat.Client.t(), binary(), binary()) :: Tentacat.response() ``` ```elixir Tentacat.Contents.readme "elixir-lang", "elixir" Tentacat.Contents.readme client, "elixir-lang", "elixir" ``` -------------------------------- ### GET /repos/:owner/:repo/deployments Source: https://hexdocs.pm/tentacat/Tentacat.Repositories.Deployments.html Lists all deployments for a given repository. ```APIDOC ## GET /repos/:owner/:repo/deployments ### Description List Deployments for a repository. ### Method GET ### Endpoint /repos/:owner/:repo/deployments ### Parameters #### Path Parameters - **owner** (binary) - Required - The account owner of the repository. - **repo** (binary) - Required - The name of the repository. ``` -------------------------------- ### GET /repos/{owner}/{repo}/projects Source: https://hexdocs.pm/tentacat/Tentacat.Repositories.Projects.html Lists all the projects in a given repository. ```APIDOC ## GET /repos/{owner}/{repo}/projects ### Description Lists the projects in a repository. ### Method GET ### Endpoint /repos/{owner}/{repo}/projects ### Parameters #### Path Parameters - **owner** (string) - Required - The owner of the repository. - **repo** (string) - Required - The name of the repository. ### Response #### Success Response (200 OK) - **Array of projects** (array) - A list of project objects. - **id** (integer) - The unique identifier of the project. - **name** (string) - The name of the project. - **body** (string) - The description of the project. #### Response Example ```json [ { "id": 123, "name": "tentacat", "body": "project board for tentacat" } ] ``` ``` -------------------------------- ### GET /repos/:owner/:repo/releases Source: https://hexdocs.pm/tentacat/Tentacat.Releases.html List all releases for a repository. ```APIDOC ## GET /repos/:owner/:repo/releases ### Description Get all releases from the given repository. ### Method GET ### Endpoint /repos/:owner/:repo/releases ### Parameters #### Path Parameters - **owner** (binary) - Required - The repository owner - **repo** (binary) - Required - The repository name ``` -------------------------------- ### GET /repos/:owner/:repo/git/refs Source: https://hexdocs.pm/tentacat/Tentacat.References.html List all references for a given repository. ```APIDOC ## GET /repos/:owner/:repo/git/refs ### Description Get all references for the repository. ### Method GET ### Endpoint /repos/:owner/:repo/git/refs ### Parameters #### Path Parameters - **owner** (binary) - Required - The account owner of the repository. - **repo** (binary) - Required - The name of the repository. ``` -------------------------------- ### Initialize new client Source: https://hexdocs.pm/tentacat/Tentacat.Client.html Creates a new client instance with default settings. ```elixir @spec new() :: t() ``` -------------------------------- ### GET /repos/{owner}/{repo}/labels Source: https://hexdocs.pm/tentacat/Tentacat.Repositories.Labels.html Lists all labels for a repository. ```APIDOC ## GET /repos/{owner}/{repo}/labels ### Description Lists all labels for a repository. ### Method GET ### Endpoint /repos/{owner}/{repo}/labels ### Parameters #### Path Parameters - **owner** (string) - Required - The owner of the repository. - **repo** (string) - Required - The name of the repository. ### Response #### Success Response (200) - **Array of labels**: Each label object contains: - **name** (string) - The name of the label. - **color** (string) - The color of the label. - **url** (string) - The URL of the label. #### Response Example ```json [ { "name": "Important", "color": "f29513", "url": "https://api.github.com/repos/elixir-lang/elixir/labels/Important" }, { "name": "WIP", "color": "ffffff", "url": "https://api.github.com/repos/elixir-lang/elixir/labels/WIP" } ] ``` ``` -------------------------------- ### GET /repos/:owner/:repo/readme Source: https://hexdocs.pm/tentacat/Tentacat.Contents.html Retrieves the README file of a repository. ```APIDOC ## GET /repos/:owner/:repo/readme ### Description Get the contents of README.md for the repository. ### Parameters #### Path Parameters - **owner** (binary) - Required - The repository owner - **repo** (binary) - Required - The repository name ``` -------------------------------- ### Get a Git Blob Source: https://hexdocs.pm/tentacat/Tentacat.Git.Blobs.html Defines the specification for retrieving a blob and provides an example of the function call using a specific SHA. ```elixir @spec get(Tentacat.Client.t(), binary(), binary(), binary()) :: Tentacat.response() ``` ```elixir Tentacat.Git.Blobs.get "elixir-lang", "elixir", "7491bda5196f78536e5acc9b7c90a97170e4db0a" ``` -------------------------------- ### GET /user Source: https://hexdocs.pm/tentacat/Tentacat.Users.html Get the currently authenticated user. ```APIDOC ## GET /user ### Description Get the authenticated user passing a client with necessary credentials. ### Method GET ### Endpoint /user ``` -------------------------------- ### Create client with username and password Source: https://hexdocs.pm/tentacat/getting_started.html Initialize a client using basic authentication. Note that this may fail if multi-factor authentication is enabled. ```elixir client = Tentacat.Client.new(%{user: "user", password: "password"}) ``` -------------------------------- ### GET Request Source: https://hexdocs.pm/tentacat/Tentacat.html Issues a GET request to a specified URL. ```APIDOC ## GET /api/resource ### Description Issues a GET request to the given url. Returns `{:ok, response}` on success or `{:error, reason}` on failure. ### Method GET ### Endpoint /api/resource ### Parameters #### Path Parameters - **url** (binary) - Required - The URL to send the GET request to. - **headers** (list) - Optional - A list of headers to include in the request. Defaults to `[]`. - **options** (Keyword.t()) - Optional - Additional options for the request. Defaults to `[]`. ### Request Example ```elixir Tentacat.Client.get("http://api.example.com/items", [{"X-Api-Key", "your_key"}]) ``` ### Response #### Success Response - **{:ok, response}** - Where `response` is `HTTPoison.Response.t()` or `HTTPoison.AsyncResponse.t()`. #### Error Response - **{:error, reason}** - Where `reason` is an `HTTPoison.Error.t()`. #### Response Example (Success) ```elixir {:ok, %HTTPoison.Response{status_code: 200, body: "[{"id": 1, "name": "Item 1"}]"}} ``` ``` -------------------------------- ### GET /teams/:team_id/memberships/:username Source: https://hexdocs.pm/tentacat/Tentacat.Teams.Members.html Get a team membership. ```APIDOC ## GET /teams/:team_id/memberships/:username ### Description Get a team membership. ### Method GET ### Parameters #### Path Parameters - **team_id** (integer) - Required - The ID of the team. - **username** (binary) - Required - The username of the member. ``` -------------------------------- ### Initialize client with auth and endpoint Source: https://hexdocs.pm/tentacat/Tentacat.Client.html Creates a new client instance with provided authentication and endpoint configuration. ```elixir @spec new(map(), binary()) :: t() ``` ```elixir @spec new(auth(), binary()) :: t() ``` -------------------------------- ### GET /repos/:owner/:repo/releases/latest Source: https://hexdocs.pm/tentacat/Tentacat.Releases.html Get the latest release for a repository. ```APIDOC ## GET /repos/:owner/:repo/releases/latest ### Description Get the latest release. ### Method GET ### Endpoint /repos/:owner/:repo/releases/latest ### Parameters #### Path Parameters - **owner** (binary) - Required - The repository owner - **repo** (binary) - Required - The repository name ``` -------------------------------- ### List pull request files examples Source: https://hexdocs.pm/tentacat/Tentacat.Pulls.Files.html Demonstrates how to list files for a specific pull request using either a default or custom client. ```elixir Tentacat.Pulls.Files.list "elixir-lang", "elixir", "2974" Tentacat.Pulls.Files.list client, "elixir-lang", "elixir", "2974" ``` -------------------------------- ### GET /repos/{owner}/{repo}/milestones Source: https://hexdocs.pm/tentacat/Tentacat.Milestones.html List all milestones for a repository. ```APIDOC ## GET /repos/{owner}/{repo}/milestones ### Description List all milestones for a repository. ### Method GET ### Endpoint /repos/{owner}/{repo}/milestones ### Parameters #### Path Parameters - **owner** (string) - Required - The owner of the repository. - **repo** (string) - Required - The name of the repository. #### Query Parameters - **state** (string) - Optional - The state of the milestones to return. Can be `open` or `closed`. - **sort** (string) - Optional - The way to sort the milestones. Can be `due_date` or `created_at`. - **direction** (string) - Optional - The direction of the sort. Can be `asc` or `desc`. ### Response #### Success Response (200) - **id** (integer) - The unique identifier of the milestone. - **url** (string) - The URL of the milestone. - **html_url** (string) - The HTML URL of the milestone. - **labels_url** (string) - The URL for the labels associated with the milestone. - **issue_url** (string) - The URL for the issues associated with the milestone. - **state** (string) - The state of the milestone (`open` or `closed`). - **title** (string) - The title of the milestone. - **description** (string) - The description of the milestone. - **creator** (object) - The user who created the milestone. - **open_issues** (integer) - The number of open issues associated with the milestone. - **closed_issues** (integer) - The number of closed issues associated with the milestone. - **created_at** (string) - The timestamp when the milestone was created. - **updated_at** (string) - The timestamp when the milestone was last updated. - **due_on** (string) - The due date for the milestone. #### Response Example ```json [ { "url": "https://api.github.com/repos/octocat/Spoon-Knife/milestones/1", "html_url": "https://github.com/octocat/Spoon-Knife/milestones/1", "labels_url": "https://api.github.com/repos/octocat/Spoon-Knife/milestones/1/labels", "id": 1, "node_id": "MDk6TWlsZXN0b25lMQ==", "number": 1, "title": "v1.0", "description": "Tracking milestone for version 1.0", "creator": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/icons/icon-deleted-avatar.svg", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "user", "site_admin": false }, "open_issues": 0, "closed_issues": 0, "state": "open", "created_at": "2011-04-22T13:33:48Z", "updated_at": "2011-04-22T13:33:48Z", "due_on": "2012-10-09T23:39:01Z" } ] ``` ``` -------------------------------- ### List Repository Tags Example Source: https://hexdocs.pm/tentacat/Tentacat.Repositories.Tags.html Demonstrates how to retrieve a list of tags for a specific repository. ```elixir Tentacat.Repositories.Tags.list "elixir-lang", "elixir" ``` -------------------------------- ### GET /repos/:owner/:repo/contents/:path Source: https://hexdocs.pm/tentacat/Tentacat.Contents.html Retrieves the contents of a file or directory. ```APIDOC ## GET /repos/:owner/:repo/contents/:path ### Description Get the contents of a file or directory in a repository. ### Parameters #### Path Parameters - **owner** (binary) - Required - The repository owner - **repo** (binary) - Required - The repository name - **path** (binary) - Required - The file path ### Query Parameters - **ref** (binary) - Optional - The name of the commit/branch/tag ``` -------------------------------- ### Create a user project Source: https://hexdocs.pm/tentacat/Tentacat.Users.Projects.html Creates a new project for the authenticated user. Requires a client with appropriate credentials. ```elixir @spec create(Tentacat.Client.t(), list()) :: Tentacat.response() ``` ```elixir Tentacat.Users.Projects.create client, name: "tentacat", body: "project board for tentacat" ``` -------------------------------- ### GET / Source: https://hexdocs.pm/tentacat/Tentacat.html Issues a GET request to the specified URL, raising an exception on failure. ```APIDOC ## GET / ### Description Issues a GET request to the given url, raising an exception in case of failure. ### Method GET ### Endpoint / ### Parameters #### Path Parameters - **url** (binary) - Required - The target URL #### Query Parameters - **headers** (headers) - Optional - Request headers - **options** (Keyword.t) - Optional - Request options including :pagination (:none, :manual, :stream, :auto) ### Response #### Success Response (200) - **response** (HTTPoison.Response.t | HTTPoison.AsyncResponse.t) - The successful response object ``` -------------------------------- ### GET /repos/:owner/:repo/releases/:id Source: https://hexdocs.pm/tentacat/Tentacat.Releases.html Get a single release by its ID. ```APIDOC ## GET /repos/:owner/:repo/releases/:id ### Description Get a single release. ### Method GET ### Endpoint /repos/:owner/:repo/releases/:id ### Parameters #### Path Parameters - **id** (any) - Required - The release ID - **owner** (binary) - Required - The repository owner - **repo** (binary) - Required - The repository name ``` -------------------------------- ### Fetch dependencies Source: https://hexdocs.pm/tentacat/getting_started.html Command to download the project dependencies. ```bash $ mix deps.get ``` -------------------------------- ### Create client with personal access token Source: https://hexdocs.pm/tentacat/getting_started.html Initialize a client using a GitHub personal access token. ```elixir client = Tentacat.Client.new(%{access_token: "928392873982932"}) ``` -------------------------------- ### GET /orgs/{org}/hooks/{hook_id} Source: https://hexdocs.pm/tentacat/Tentacat.Organizations.Hooks.html Get a webhook for an organization by its ID. ```APIDOC ## GET /orgs/{org}/hooks/{hook_id} ### Description Get a webhook for an organization by id. ### Method GET ### Endpoint /orgs/{org}/hooks/{hook_id} ### Parameters #### Path Parameters - **organization** (string) - Required - The organization name. - **hook_id** (integer | string) - Required - The ID of the webhook. ### Response #### Success Response (200 OK) - **id** (integer) - The ID of the webhook. - **url** (string) - The URL of the webhook. - **test_url** (string) - The URL to send test events to. - **ping_url** (string) - The URL to ping the webhook. - **created_at** (string) - The timestamp when the webhook was created. - **updated_at** (string) - The timestamp when the webhook was last updated. - **type** (string) - The type of webhook (e.g., "Webhook"). - **name** (string) - The name of the webhook. - **active** (boolean) - Whether the webhook is active. - **events** (array) - A list of events that trigger the webhook. - **config** (object) - The configuration for the webhook. - **url** (string) - The URL to send events to. - **content_type** (string) - The content type of the payload. - **secret** (string) - The secret used for HMAC signature verification (if provided). - **insecure_ssl** (boolean) - Whether to ignore SSL certificate errors (if provided). #### Response Example ```json { "id": 1234567, "url": "https://api.github.com/orgs/github/hooks/1234567", "test_url": "https://api.github.com/orgs/github/hooks/1234567/test", "ping_url": "https://api.github.com/orgs/github/hooks/1234567/ping", "created_at": "2023-01-01T12:00:00Z", "updated_at": "2023-01-01T12:00:00Z", "type": "Webhook", "name": "web", "active": true, "events": [ "push", "pull_request" ], "config": { "url": "http://example.com/webhook", "content_type": "json" } } ``` More info at: http://developer.github.com/v3/orgs/hooks/#get-single-hook ``` -------------------------------- ### List repository contributors examples Source: https://hexdocs.pm/tentacat/Tentacat.Repositories.Contributors.html Demonstrates how to call the list function with or without an explicit client. ```elixir Tentacat.Repositories.Contributors.list "elixir-lang", "elixir" Tentacat.Repositories.Contributors.list client, "elixir-lang", "elixir" ``` -------------------------------- ### GET /repos/{owner}/{repo}/milestones/{number} Source: https://hexdocs.pm/tentacat/Tentacat.Milestones.html Get a single milestone by its number. ```APIDOC ## GET /repos/{owner}/{repo}/milestones/{number} ### Description Get a single milestone by its number. ### Method GET ### Endpoint /repos/{owner}/{repo}/milestones/{number} ### Parameters #### Path Parameters - **owner** (string) - Required - The owner of the repository. - **repo** (string) - Required - The name of the repository. - **number** (integer) - Required - The milestone number. ### Response #### Success Response (200) - **id** (integer) - The unique identifier of the milestone. - **url** (string) - The URL of the milestone. - **html_url** (string) - The HTML URL of the milestone. - **labels_url** (string) - The URL for the labels associated with the milestone. - **issue_url** (string) - The URL for the issues associated with the milestone. - **state** (string) - The state of the milestone (`open` or `closed`). - **title** (string) - The title of the milestone. - **description** (string) - The description of the milestone. - **creator** (object) - The user who created the milestone. - **open_issues** (integer) - The number of open issues associated with the milestone. - **closed_issues** (integer) - The number of closed issues associated with the milestone. - **created_at** (string) - The timestamp when the milestone was created. - **updated_at** (string) - The timestamp when the milestone was last updated. - **due_on** (string) - The due date for the milestone. #### Response Example ```json { "url": "https://api.github.com/repos/octocat/Spoon-Knife/milestones/1", "html_url": "https://github.com/octocat/Spoon-Knife/milestones/1", "labels_url": "https://api.github.com/repos/octocat/Spoon-Knife/milestones/1/labels", "id": 1, "node_id": "MDk6TWlsZXN0b25lMQ==", "number": 1, "title": "v1.0", "description": "Tracking milestone for version 1.0", "creator": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/icons/icon-deleted-avatar.svg", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "user", "site_admin": false }, "open_issues": 0, "closed_issues": 0, "state": "open", "created_at": "2011-04-22T13:33:48Z", "updated_at": "2011-04-22T13:33:48Z", "due_on": "2012-10-09T23:39:01Z" } ``` ``` -------------------------------- ### Create a repository project Source: https://hexdocs.pm/tentacat/Tentacat.Repositories.Projects.html Creates a new project board for a specified repository. ```elixir @spec create(Tentacat.Client.t(), binary(), binary(), map()) :: Tentacat.response() ``` ```elixir Tentacat.Repositories.Projects.create client, "elixir-lang", "elixir", %{name: "tentacat", body: "project board for tentacat"} ``` -------------------------------- ### Fetch Dependencies and Run Tests Source: https://hexdocs.pm/tentacat/readme.html Fetch project dependencies and run tests using Mix. This command is typically used in a CI/CD environment or for local development setup. ```bash MIX_ENV=test mix do deps.get, test ``` -------------------------------- ### Create a file in a repository Source: https://hexdocs.pm/tentacat/Tentacat.Contents.html Defines the specification for creating a file and provides an example of the required body map and function call. ```elixir @spec create(Tentacat.Client.t(), binary(), binary(), binary(), map()) :: Tentacat.response() ``` ```elixir %{ "message" => "my commit message", "committer" => %{ "name" => "Grigory Starinkin", "email" => "starinkin@gmail.com" }, "content" => "bXkgbmV3IGZpbGUgY29udGVudHM=", "branch" => "cool-feature" } ``` ```elixir Tentacat.Contents.create client, "elixir-lang", "elixir", "lib/elixir.ex", body ``` -------------------------------- ### Initialize client with endpoint Source: https://hexdocs.pm/tentacat/Tentacat.Client.html Creates a new client instance using a specific endpoint or map configuration. ```elixir @spec new(binary()) :: t() ``` ```elixir @spec new(map()) :: t() ``` -------------------------------- ### Create client for alternative endpoint Source: https://hexdocs.pm/tentacat/getting_started.html Initialize a client pointing to a custom API URL, such as a GitHub Enterprise instance. ```elixir client = Tentacat.Client.new(%{access_token: "928392873982932"}, "https://ghe.example.com/api/v3/") ``` -------------------------------- ### GET Request with Client and Params Source: https://hexdocs.pm/tentacat/Tentacat.html Underlying utility for GET requests, allowing client specification and parameters, potentially returning paginated results. ```APIDOC ## GET /api/resource ### Description Underlying utility retrieval function for GET requests. The options passed affect both the return value and, ultimately, the number of requests made to GitHub. Can return `response()`, `Enumerable.t()`, or `pagination_response()`. ### Method GET ### Endpoint /api/resource ### Parameters #### Path Parameters - **path** (binary) - Required - The API path to retrieve. - **client** (Tentacat.Client.t()) - Required - The client instance to use for the request. - **params** (keyword()) - Optional - Query parameters to include in the request. Defaults to `[]`. - **options** (keyword()) - Optional - Options that affect the request and response. Defaults to `[]`. ### Request Example ```elixir client = Tentacat.Client.new(access_token: "YOUR_ACCESS_TOKEN") Tentacat.Client.get("/users/octocat/repos", client, [per_page: 100]) ``` ### Response #### Success Response - **response()** - Standard response tuple `{:ok, response}` or `{:error, reason}`. - **Enumerable.t()** - If pagination is handled, an enumerable collection of results. - **pagination_response()** - A tuple containing the response, next page cursor, and auth information for paginated results. #### Response Example (Paginated) ```elixir {{:ok, response}, next_page_cursor, auth_info} ``` ``` -------------------------------- ### Create a Deployment Source: https://hexdocs.pm/tentacat/Tentacat.Repositories.Deployments.html Use this function to create a new deployment for a repository. Requires a client, owner, repository name, and a deployment body map. ```elixir Tentacat.Repositories.Deployments.create client, "elixir-lang", "elixir", deployment_body ``` -------------------------------- ### Create a New Repository Source: https://hexdocs.pm/tentacat/Tentacat.Repositories.html Use this function to create a new repository for the authenticated user. Ensure the client has the necessary permissions. Options can specify details like description, homepage, privacy, and more. ```elixir Tentacat.Repositories.create(client, "tentacat", %{private: false}) ``` -------------------------------- ### GET /gists/starred Source: https://hexdocs.pm/tentacat/Tentacat.Gists.html List starred gists. ```APIDOC ## GET /gists/starred ### Description List starred gists. ### Method GET ### Endpoint /gists/starred ``` -------------------------------- ### GET /gists/public Source: https://hexdocs.pm/tentacat/Tentacat.Gists.html List all public gists. ```APIDOC ## GET /gists/public ### Description List all public gists. ### Method GET ### Endpoint /gists/public ``` -------------------------------- ### POST /repos/{owner}/{repo}/projects Source: https://hexdocs.pm/tentacat/Tentacat.Repositories.Projects.html Creates a new project board for a given repository. ```APIDOC ## POST /repos/{owner}/{repo}/projects ### Description Create a new project for a repository. ### Method POST ### Endpoint /repos/{owner}/{repo}/projects ### Parameters #### Path Parameters - **owner** (string) - Required - The owner of the repository. - **repo** (string) - Required - The name of the repository. #### Request Body - **name** (string) - Required - The name of the project board. - **body** (string) - Optional - The description of the project. ### Request Example ```json { "name": "name of project board", "body": "description of the project" } ``` ### Response #### Success Response (201 Created) - **id** (integer) - The unique identifier of the created project. - **name** (string) - The name of the project. - **body** (string) - The description of the project. #### Response Example ```json { "id": 123, "name": "tentacat", "body": "project board for tentacat" } ``` ``` -------------------------------- ### GET /user/followers Source: https://hexdocs.pm/tentacat/Tentacat.Users.Followers.html Lists followers of the authenticated user. ```APIDOC ## GET /user/followers ### Description List followers for the authenticated user. ### Method GET ### Endpoint /user/followers ### Request Example Tentacat.Users.Followers.followers client ``` -------------------------------- ### GET /teams/:team_id/members Source: https://hexdocs.pm/tentacat/Tentacat.Teams.Members.html List all team members. ```APIDOC ## GET /teams/:team_id/members ### Description List all team members. ### Method GET ### Parameters #### Path Parameters - **team_id** (integer) - Required - The ID of the team. ``` -------------------------------- ### GET /user/following Source: https://hexdocs.pm/tentacat/Tentacat.Users.Followers.html Lists users that the authenticated user follows. ```APIDOC ## GET /user/following ### Description List users the authenticated user follows. ### Method GET ### Endpoint /user/following ### Request Example Tentacat.Users.Followers.following client ``` -------------------------------- ### List repository deploy keys Source: https://hexdocs.pm/tentacat/Tentacat.Repositories.DeployKeys.html Lists all deploy keys associated with a repository. ```elixir @spec list(Tentacat.Client.t(), binary(), binary()) :: Tentacat.response() ``` ```elixir Tentacat.Repositories.DeployKeys.list(client, "elixir-lang", "elixir") ``` -------------------------------- ### GET /user/starred Source: https://hexdocs.pm/tentacat/Tentacat.Users.Starring.html List starred repositories for the authenticated user. ```APIDOC ## GET /user/starred ### Description List starred repositories for the authenticated user. ### Method GET ### Endpoint /user/starred ``` -------------------------------- ### POST /user/projects Source: https://hexdocs.pm/tentacat/Tentacat.Users.Projects.html Creates a new project for the authenticated user. ```APIDOC ## POST /user/projects ### Description Create a new project for the authenticated user. ### Method POST ### Request Body - **name** (string) - Required - Name of the project board - **body** (string) - Optional - Description of the project ### Request Example Tentacat.Users.Projects.create client, name: "tentacat", body: "project board for tentacat" ``` -------------------------------- ### GET /users/:user Source: https://hexdocs.pm/tentacat/Tentacat.Users.html Retrieve a single user by their username. ```APIDOC ## GET /users/:user ### Description Get a single user. ### Method GET ### Endpoint /users/:user ### Parameters #### Path Parameters - **user** (binary) - Required - The username of the user to retrieve. ``` -------------------------------- ### Create a repository label Source: https://hexdocs.pm/tentacat/Tentacat.Repositories.Labels.html Creates a new label on a repository. The body map requires both name and color keys. ```elixir @spec create(Tentacat.Client.t(), binary(), binary(), map()) :: Tentacat.response() ``` ```elixir Tentacat.Repositories.Labels.create "elixir-lang", "elixir", %{name: "Important", color: "f29513"} ``` -------------------------------- ### GET /users/emails Source: https://hexdocs.pm/tentacat/Tentacat.Users.Emails.html List all email addresses for the authenticated user. ```APIDOC ## GET /users/emails ### Description List all email addresses for the authenticated user. ### Method GET ### Endpoint /users/emails ### Response #### Success Response (200) - **emails** (array[object]) - A list of email objects, each containing `email`, `verified`, and `primary` fields. #### Response Example ```json { "emails": [ { "email": "ed@gurgel.me", "verified": false, "primary": false } ] } ``` ``` -------------------------------- ### Merge branch examples Source: https://hexdocs.pm/tentacat/Tentacat.Repositories.Merges.html Demonstrates merging branches or commit SHAs with optional custom commit messages. ```elixir Tentacat.Repositories.Merges.merge client, "elixir-lang", "elixir", "master", "123-another-feature", "" Tentacat.Repositories.Merges.merge client, "elixir-lang", "elixir", "master", "123-another-feature", "not the default commit_message" Tentacat.Repositories.Merges.merge client, "elixir-lang", "elixir", "8e50d79f2ba0d665b9966908cbf22c6f463228d6", "bafdae8b93e74738c12515c14c7cf9acc652650a", "" ``` -------------------------------- ### GET /gists Source: https://hexdocs.pm/tentacat/Tentacat.Gists.html List the current user's gists. ```APIDOC ## GET /gists ### Description List current user's gists. ### Method GET ### Endpoint /gists ``` -------------------------------- ### GET /gists/:gist_id/forks Source: https://hexdocs.pm/tentacat/Tentacat.Gists.html List forks of a specific gist. ```APIDOC ## GET /gists/:gist_id/forks ### Description List forks of a specific gist. ### Method GET ### Endpoint /gists/:gist_id/forks ### Parameters #### Path Parameters - **gist_id** (binary) - Required - The ID of the gist. ``` -------------------------------- ### Create a Reference Source: https://hexdocs.pm/tentacat/Tentacat.References.html Use this function to create a new reference (e.g., a branch or tag). Requires a client, owner, repository, and a map containing the reference details like 'ref' and 'sha'. ```elixir @spec create(Tentacat.Client.t(), binary(), binary(), map()) :: Tentacat.response() ``` ```elixir %{ "ref" => "refs/heads/emj-otp-18", "sha" => "aa218f56b14c9653891f9e74264a383fa43fefbd" } ``` ```elixir Tentacat.References.create client, "elixir-lang", "elixir", ref_body ``` -------------------------------- ### GET /gists/:gist_id/forks Source: https://hexdocs.pm/tentacat/Tentacat.Gists.html List the forks of a specific gist. ```APIDOC ## GET /gists/:gist_id/forks ### Description List forks. ### Method GET ### Endpoint /gists/:gist_id/forks ### Parameters #### Path Parameters - **gist_id** (binary) - Required - The ID of the gist. #### Query Parameters - **params** (Keyword.t) - Optional - Pagination or filtering parameters. ```