View Source GitHub.Activity (GitHub REST API Client v0.2.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
Delete a thread subscription
Get feeds
Get a repository subscription
Get a thread
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 events for a user
List public organization events
List events received by the authenticated user
List public events received by a user
List repository events
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 stargazers
List repositories watched by the authenticated user
List watchers
Mark notifications as read
Mark repository notifications as read
Mark a thread as read
Set a repository subscription
Set a thread subscription
Star a repository for the authenticated user
Unstar a repository for the authenticated user
Link to this section Types
@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
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
@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
@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
GitHub provides several timeline resources in Atom format. The Feeds API lists all the feeds available to the authenticated user:
- Timeline: The GitHub global public timeline
- User: The public timeline for any user, using URI template
- 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.
Note: Private feeds are only returned when authenticating via Basic Auth since current feed URIs use the older, non revocable auth tokens.
resources
Resources
@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
@spec get_thread( integer(), keyword() ) :: {:ok, GitHub.Thread.t()} | {:error, GitHub.Error.t()}
Get a thread
Gets information about a notification thread.
resources
Resources
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
@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
per_page
: The number of results per page (max 100).page
: Page number of the results to fetch.
resources
Resources
@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
: Iftrue
, show notifications marked as read.participating
: Iftrue
, 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
: Page number of the results to fetch.per_page
: The number of results per page (max 50).
resources
Resources
@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
per_page
: The number of results per page (max 100).page
: Page number of the results to fetch.
resources
Resources
@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
per_page
: The number of results per page (max 100).page
: Page number of the results to fetch.
resources
Resources
@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
per_page
: The number of results per page (max 100).page
: Page number of the results to fetch.
resources
Resources
@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
per_page
: The number of results per page (max 100).page
: Page number of the results to fetch.
resources
Resources
@spec list_public_org_events( String.t(), keyword() ) :: {:ok, [GitHub.Event.t()]} | {:error, GitHub.Error.t()}
List public organization events
options
Options
per_page
: The number of results per page (max 100).page
: Page number of the results to fetch.
resources
Resources
@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 repos 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
per_page
: The number of results per page (max 100).page
: Page number of the results to fetch.
resources
Resources
@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
per_page
: The number of results per page (max 100).page
: Page number of the results to fetch.
resources
Resources
@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
per_page
: The number of results per page (max 100).page
: Page number of the results to fetch.
resources
Resources
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
: Iftrue
, show notifications marked as read.participating
: Iftrue
, 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).page
: Page number of the results to fetch.
resources
Resources
@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.
You can also find out when stars were created by passing the following custom media type via the Accept
header: application/vnd.github.star+json
.
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).page
: Page number of the results to fetch.
resources
Resources
@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.
You can also find out when stars were created by passing the following custom media type via the Accept
header: application/vnd.github.star+json
.
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).page
: Page number of the results to fetch.
resources
Resources
@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
per_page
: The number of results per page (max 100).page
: Page number of the results to fetch.
resources
Resources
@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.
You can also find out when stars were created by passing the following custom media type via the Accept
header: application/vnd.github.star+json
.
options
Options
per_page
: The number of results per page (max 100).page
: Page number of the results to fetch.
resources
Resources
@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
per_page
: The number of results per page (max 100).page
: Page number of the results to fetch.
resources
Resources
@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
per_page
: The number of results per page (max 100).page
: Page number of the results to fetch.
resources
Resources
@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
@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
@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
@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
@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
@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 verbs."
resources
Resources
@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.