View Source GitHub.Activity (GitHub REST API Client v0.3.3)

Provides API endpoints related to activity

Link to this section Summary

Functions

Check if a repository is starred by the authenticated user

Delete a repository subscription

Get a repository subscription

Get a thread subscription for the authenticated user

List events for the authenticated user

List notifications for the authenticated user

List organization events for the authenticated user

List public events

List public events for a network of repositories

List public organization events

List events received by the authenticated user

List public events received by a user

List repository notifications for the authenticated user

List repositories starred by the authenticated user

List repositories starred by a user

List repositories watched by a user

List repositories watched by the authenticated user

Star a repository for the authenticated user

Unstar a repository for the authenticated user

Link to this section Types

Link to this type

mark_notifications_as_read_202_json_resp()

View Source
@type mark_notifications_as_read_202_json_resp() :: %{
  __info__: map(),
  message: String.t() | nil
}
Link to this type

mark_repo_notifications_as_read_202_json_resp()

View Source
@type mark_repo_notifications_as_read_202_json_resp() :: %{
  __info__: map(),
  message: String.t() | nil,
  url: String.t() | nil
}
@type t() :: %GitHub.Activity{
  __info__: map(),
  activity_type: String.t(),
  actor: GitHub.User.simple() | nil,
  after: String.t(),
  before: String.t(),
  id: integer(),
  node_id: String.t(),
  ref: String.t(),
  timestamp: DateTime.t()
}

Link to this section Functions

Link to this function

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

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

Check if a repository is starred by the authenticated user

Whether the authenticated user has starred the repository.

resources

Resources

Link to this function

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

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

Delete a repository subscription

This endpoint should only be used to stop watching a repository. To control whether or not you wish to receive notifications from a repository, set the repository's subscription manually.

resources

Resources

Link to this function

delete_thread_subscription(thread_id, opts \\ [])

View Source
@spec delete_thread_subscription(
  integer(),
  keyword()
) :: :ok | {:error, GitHub.Error.t()}

Delete a thread subscription

Mutes all future notifications for a conversation until you comment on the thread or get an @mention. If you are watching the repository of the thread, you will still receive notifications. To ignore future notifications for a repository you are watching, use the Set a thread subscription endpoint and set ignore to true.

resources

Resources

@spec get_feeds(keyword()) :: {:ok, GitHub.Feed.t()} | {:error, GitHub.Error.t()}

Get feeds

Lists the feeds available to the authenticated user. The response provides a URL for each feed. You can then get a specific feed by sending a request to one of the feed URLs.

  • Timeline: The GitHub global public timeline
  • User: The public timeline for any user, using uri_template. For more information, see "Hypermedia."
  • Current user public: The public timeline for the authenticated user
  • Current user: The private timeline for the authenticated user
  • Current user actor: The private timeline for activity created by the authenticated user
  • Current user organizations: The private timeline for the organizations the authenticated user is a member of.
  • Security advisories: A collection of public announcements that provide information about security-related vulnerabilities in software on GitHub.

By default, timeline resources are returned in JSON. You can specify the application/atom+xml type in the Accept header to return timeline resources in Atom format. For more information, see "Media types."

Note: Private feeds are only returned when authenticating via Basic Auth since current feed URIs use the older, non revocable auth tokens.

resources

Resources

Link to this function

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

View Source
@spec get_repo_subscription(String.t(), String.t(), keyword()) ::
  {:ok, GitHub.Repository.Subscription.t()} | {:error, GitHub.Error.t()}

Get a repository subscription

Gets information about whether the authenticated user is subscribed to the repository.

resources

Resources

Link to this function

get_thread(thread_id, opts \\ [])

View Source
@spec get_thread(
  integer(),
  keyword()
) :: {:ok, GitHub.Thread.t()} | {:error, GitHub.Error.t()}

Get a thread

Gets information about a notification thread.

resources

Resources

Link to this function

get_thread_subscription_for_authenticated_user(thread_id, opts \\ [])

View Source
@spec get_thread_subscription_for_authenticated_user(
  integer(),
  keyword()
) :: {:ok, GitHub.ThreadSubscription.t()} | {:error, GitHub.Error.t()}

Get a thread subscription for the authenticated user

This checks to see if the current user is subscribed to a thread. You can also get a repository subscription.

Note that subscriptions are only generated if a user is participating in a conversation--for example, they've replied to the thread, were @mentioned, or manually subscribe to a thread.

resources

Resources

Link to this function

list_events_for_authenticated_user(username, opts \\ [])

View Source
@spec list_events_for_authenticated_user(
  String.t(),
  keyword()
) :: {:ok, [GitHub.Event.t()]} | {:error, GitHub.Error.t()}

List events for the authenticated user

If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events.

options

Options

resources

Resources

Link to this function

list_notifications_for_authenticated_user(opts \\ [])

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

List notifications for the authenticated user

List all notifications for the current user, sorted by most recently updated.

options

Options

  • all: If true, show notifications marked as read.
  • participating: If true, only shows notifications in which the user is directly participating or mentioned.
  • since: Only show results that were last updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
  • before: Only show notifications updated before the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
  • page: The page number of the results to fetch. For more information, see "Using pagination in the REST API."
  • per_page: The number of results per page (max 50). For more information, see "Using pagination in the REST API."

resources

Resources

Link to this function

list_org_events_for_authenticated_user(username, org, opts \\ [])

View Source
@spec list_org_events_for_authenticated_user(String.t(), String.t(), keyword()) ::
  {:ok, [GitHub.Event.t()]} | {:error, GitHub.Error.t()}

List organization events for the authenticated user

This is the user's organization dashboard. You must be authenticated as the user to view this.

options

Options

resources

Resources

Link to this function

list_public_events(opts \\ [])

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

List public events

We delay the public events feed by five minutes, which means the most recent event returned by the public events API actually occurred at least five minutes ago.

options

Options

resources

Resources

Link to this function

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

View Source
@spec list_public_events_for_repo_network(String.t(), String.t(), keyword()) ::
  {:ok, [GitHub.Event.t()]} | {:error, GitHub.Error.t()}

List public events for a network of repositories

options

Options

resources

Resources

Link to this function

list_public_events_for_user(username, opts \\ [])

View Source
@spec list_public_events_for_user(
  String.t(),
  keyword()
) :: {:ok, [GitHub.Event.t()]} | {:error, GitHub.Error.t()}

List public events for a user

options

Options

resources

Resources

Link to this function

list_public_org_events(org, opts \\ [])

View Source
@spec list_public_org_events(
  String.t(),
  keyword()
) :: {:ok, [GitHub.Event.t()]} | {:error, GitHub.Error.t()}

List public organization events

options

Options

resources

Resources

Link to this function

list_received_events_for_user(username, opts \\ [])

View Source
@spec list_received_events_for_user(
  String.t(),
  keyword()
) :: {:ok, [GitHub.Event.t()]} | {:error, GitHub.Error.t()}

List events received by the authenticated user

These are events that you've received by watching repositories and following users. If you are authenticated as the given user, you will see private events. Otherwise, you'll only see public events.

options

Options

resources

Resources

Link to this function

list_received_public_events_for_user(username, opts \\ [])

View Source
@spec list_received_public_events_for_user(
  String.t(),
  keyword()
) :: {:ok, [GitHub.Event.t()]} | {:error, GitHub.Error.t()}

List public events received by a user

options

Options

resources

Resources

Link to this function

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

View Source
@spec list_repo_events(String.t(), String.t(), keyword()) ::
  {:ok, [GitHub.Event.t()]} | {:error, GitHub.Error.t()}

List repository events

Note: This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h.

options

Options

resources

Resources

Link to this function

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

View Source
@spec list_repo_notifications_for_authenticated_user(
  String.t(),
  String.t(),
  keyword()
) ::
  {:ok, [GitHub.Thread.t()]} | {:error, GitHub.Error.t()}

List repository notifications for the authenticated user

Lists all notifications for the current user in the specified repository.

options

Options

  • all: If true, show notifications marked as read.
  • participating: If true, only shows notifications in which the user is directly participating or mentioned.
  • since: Only show results that were last updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
  • before: Only show notifications updated before the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
  • per_page: The number of results per page (max 100). For more information, see "Using pagination in the REST API."
  • page: The page number of the results to fetch. For more information, see "Using pagination in the REST API."

resources

Resources

Link to this function

list_repos_starred_by_authenticated_user(opts \\ [])

View Source
@spec list_repos_starred_by_authenticated_user(keyword()) ::
  {:ok, [GitHub.Repository.t()] | [GitHub.StarredRepository.t()]}
  | {:error, GitHub.Error.t()}

List repositories starred by the authenticated user

Lists repositories the authenticated user has starred.

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

  • application/vnd.github.star+json: Includes a timestamp of when the star was created.

options

Options

  • sort: The property to sort the results by. created means when the repository was starred. updated means when the repository was last pushed to.
  • direction: The direction to sort the results by.
  • per_page: The number of results per page (max 100). For more information, see "Using pagination in the REST API."
  • page: The page number of the results to fetch. For more information, see "Using pagination in the REST API."

resources

Resources

Link to this function

list_repos_starred_by_user(username, opts \\ [])

View Source
@spec list_repos_starred_by_user(
  String.t(),
  keyword()
) ::
  {:ok, [GitHub.Repository.t()] | [GitHub.StarredRepository.t()]}
  | {:error, GitHub.Error.t()}

List repositories starred by a user

Lists repositories a user has starred.

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

  • application/vnd.github.star+json: Includes a timestamp of when the star was created.

options

Options

  • sort: The property to sort the results by. created means when the repository was starred. updated means when the repository was last pushed to.
  • direction: The direction to sort the results by.
  • per_page: The number of results per page (max 100). For more information, see "Using pagination in the REST API."
  • page: The page number of the results to fetch. For more information, see "Using pagination in the REST API."

resources

Resources

Link to this function

list_repos_watched_by_user(username, opts \\ [])

View Source
@spec list_repos_watched_by_user(
  String.t(),
  keyword()
) :: {:ok, [GitHub.Repository.minimal()]} | {:error, GitHub.Error.t()}

List repositories watched by a user

Lists repositories a user is watching.

options

Options

resources

Resources

Link to this function

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

View Source
@spec list_stargazers_for_repo(String.t(), String.t(), keyword()) ::
  {:ok, [map()] | [GitHub.User.simple()]} | {:error, GitHub.Error.t()}

List stargazers

Lists the people that have starred the repository.

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

  • application/vnd.github.star+json: Includes a timestamp of when the star was created.

options

Options

resources

Resources

Link to this function

list_watched_repos_for_authenticated_user(opts \\ [])

View Source
@spec list_watched_repos_for_authenticated_user(keyword()) ::
  {:ok, [GitHub.Repository.minimal()]} | {:error, GitHub.Error.t()}

List repositories watched by the authenticated user

Lists repositories the authenticated user is watching.

options

Options

resources

Resources

Link to this function

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

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

List watchers

Lists the people watching the specified repository.

options

Options

resources

Resources

Link to this function

mark_notifications_as_read(body, opts \\ [])

View Source
@spec mark_notifications_as_read(
  map(),
  keyword()
) :: {:ok, map()} | {:error, GitHub.Error.t()}

Mark notifications as read

Marks all notifications as "read" for the current user. If the number of notifications is too large to complete in one request, you will receive a 202 Accepted status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the List notifications for the authenticated user endpoint and pass the query parameter all=false.

resources

Resources

Link to this function

mark_repo_notifications_as_read(owner, repo, body, opts \\ [])

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

Mark repository notifications as read

Marks all notifications in a repository as "read" for the current user. If the number of notifications is too large to complete in one request, you will receive a 202 Accepted status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the List repository notifications for the authenticated user endpoint and pass the query parameter all=false.

resources

Resources

Link to this function

mark_thread_as_done(thread_id, opts \\ [])

View Source
@spec mark_thread_as_done(
  integer(),
  keyword()
) :: :ok | {:error, GitHub.Error.t()}

Mark a thread as done

Marks a thread as "done." Marking a thread as "done" is equivalent to marking a notification in your notification inbox on GitHub as done: https://github.com/notifications.

resources

Resources

Link to this function

mark_thread_as_read(thread_id, opts \\ [])

View Source
@spec mark_thread_as_read(
  integer(),
  keyword()
) :: :ok | {:error, GitHub.Error.t()}

Mark a thread as read

Marks a thread as "read." Marking a thread as "read" is equivalent to clicking a notification in your notification inbox on GitHub: https://github.com/notifications.

resources

Resources

Link to this function

set_repo_subscription(owner, repo, body, opts \\ [])

View Source
@spec set_repo_subscription(String.t(), String.t(), map(), keyword()) ::
  {:ok, GitHub.Repository.Subscription.t()} | {:error, GitHub.Error.t()}

Set a repository subscription

If you would like to watch a repository, set subscribed to true. If you would like to ignore notifications made within a repository, set ignored to true. If you would like to stop watching a repository, delete the repository's subscription completely.

resources

Resources

Link to this function

set_thread_subscription(thread_id, body, opts \\ [])

View Source
@spec set_thread_subscription(integer(), map(), keyword()) ::
  {:ok, GitHub.ThreadSubscription.t()} | {:error, GitHub.Error.t()}

Set a thread subscription

If you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an @mention.

You can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored.

Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the Delete a thread subscription endpoint.

resources

Resources

Link to this function

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

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

Star a repository for the authenticated user

Note that you'll need to set Content-Length to zero when calling out to this endpoint. For more information, see "HTTP method."

resources

Resources

Link to this function

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

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

Unstar a repository for the authenticated user

Unstar a repository that the authenticated user has previously starred.

resources

Resources