Struct octorust::orgs::Orgs [−][src]
pub struct Orgs { /* fields omitted */ }
Implementations
List organizations.
This function performs a GET
to the /organizations
endpoint.
Lists all organizations, in the order that they were created on GitHub.
Note: Pagination is powered exclusively by the since
parameter. Use the Link header to get the URL for the next page of organizations.
FROM: https://docs.github.com/rest/reference/orgs#list-organizations
Parameters:
since: i64
– An organization ID. Only return organizations with an ID greater than this ID.per_page: i64
– Results per page (max 100).
List organizations.
This function performs a GET
to the /organizations
endpoint.
As opposed to list
, this function returns all the pages of the request at once.
Lists all organizations, in the order that they were created on GitHub.
Note: Pagination is powered exclusively by the since
parameter. Use the Link header to get the URL for the next page of organizations.
FROM: https://docs.github.com/rest/reference/orgs#list-organizations
Get an organization.
This function performs a GET
to the /orgs/{org}
endpoint.
To see many of the organization response values, you need to be an authenticated organization owner with the admin:org
scope. When the value of two_factor_requirement_enabled
is true
, the organization requires all members, billing managers, and outside collaborators to enable two-factor authentication.
GitHub Apps with the Organization plan
permission can use this endpoint to retrieve information about an organization’s GitHub plan. See “Authenticating with GitHub Apps” for details. For an example response, see ‘Response with GitHub plan information’ below.“
FROM: https://docs.github.com/rest/reference/orgs#get-an-organization
Parameters:
org: &str
Update an organization.
This function performs a PATCH
to the /orgs/{org}
endpoint.
Parameter Deprecation Notice: GitHub will replace and discontinue members_allowed_repository_creation_type
in favor of more granular permissions. The new input parameters are members_can_create_public_repositories
, members_can_create_private_repositories
for all organizations and members_can_create_internal_repositories
for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the blog post.
Enables an authenticated organization owner with the admin:org
scope to update the organization’s profile and member privileges.
FROM: https://docs.github.com/rest/reference/orgs/#update-an-organization
Parameters:
org: &str
Get the audit log for an organization.
This function performs a GET
to the /orgs/{org}/audit-log
endpoint.
Gets the audit log for an organization. For more information, see “Reviewing the audit log for your organization.”
To use this endpoint, you must be an organization owner, and you must use an access token with the admin:org
scope. GitHub Apps must have the organization_administration
read permission to use this endpoint.
FROM: https://docs.github.com/rest/reference/orgs#get-audit-log
Parameters:
org: &str
phrase: &str
– A search phrase. For more information, see Searching the audit log.include: crate::types::Include
– The event types to include:
web
- returns web (non-Git) eventsgit
- returns Git eventsall
- returns both web and Git events
The default is web
.
after: &str
– A cursor, as given in the Link header. If specified, the query only searches for events after this cursor.before: &str
– A cursor, as given in the Link header. If specified, the query only searches for events before this cursor.order: crate::types::Order
– The order of audit log events. To list newest events first, specifydesc
. To list oldest events first, specifyasc
.
The default is desc
.
per_page: i64
– Results per page (max 100).page: i64
– Page number of the results to fetch.
Get the audit log for an organization.
This function performs a GET
to the /orgs/{org}/audit-log
endpoint.
As opposed to get_audit_log
, this function returns all the pages of the request at once.
Gets the audit log for an organization. For more information, see “Reviewing the audit log for your organization.”
To use this endpoint, you must be an organization owner, and you must use an access token with the admin:org
scope. GitHub Apps must have the organization_administration
read permission to use this endpoint.
FROM: https://docs.github.com/rest/reference/orgs#get-audit-log
List users blocked by an organization.
This function performs a GET
to the /orgs/{org}/blocks
endpoint.
List the users blocked by an organization.
FROM: https://docs.github.com/rest/reference/orgs#list-users-blocked-by-an-organization
Parameters:
org: &str
List users blocked by an organization.
This function performs a GET
to the /orgs/{org}/blocks
endpoint.
As opposed to list_blocked_users
, this function returns all the pages of the request at once.
List the users blocked by an organization.
FROM: https://docs.github.com/rest/reference/orgs#list-users-blocked-by-an-organization
Check if a user is blocked by an organization.
This function performs a GET
to the /orgs/{org}/blocks/{username}
endpoint.
FROM: https://docs.github.com/rest/reference/orgs#check-if-a-user-is-blocked-by-an-organization
Parameters:
org: &str
username: &str
Block a user from an organization.
This function performs a PUT
to the /orgs/{org}/blocks/{username}
endpoint.
FROM: https://docs.github.com/rest/reference/orgs#block-a-user-from-an-organization
Parameters:
org: &str
username: &str
Unblock a user from an organization.
This function performs a DELETE
to the /orgs/{org}/blocks/{username}
endpoint.
FROM: https://docs.github.com/rest/reference/orgs#unblock-a-user-from-an-organization
Parameters:
org: &str
username: &str
List SAML SSO authorizations for an organization.
This function performs a GET
to the /orgs/{org}/credential-authorizations
endpoint.
Listing and deleting credential authorizations is available to organizations with GitHub Enterprise Cloud. For more information, see GitHub’s products.
An authenticated organization owner with the read:org
scope can list all credential authorizations for an organization that uses SAML single sign-on (SSO). The credentials are either personal access tokens or SSH keys that organization members have authorized for the organization. For more information, see About authentication with SAML single sign-on.
FROM: https://docs.github.com/rest/reference/orgs#list-saml-sso-authorizations-for-an-organization
Parameters:
org: &str
List SAML SSO authorizations for an organization.
This function performs a GET
to the /orgs/{org}/credential-authorizations
endpoint.
As opposed to list_saml_sso_authorizations
, this function returns all the pages of the request at once.
Listing and deleting credential authorizations is available to organizations with GitHub Enterprise Cloud. For more information, see GitHub’s products.
An authenticated organization owner with the read:org
scope can list all credential authorizations for an organization that uses SAML single sign-on (SSO). The credentials are either personal access tokens or SSH keys that organization members have authorized for the organization. For more information, see About authentication with SAML single sign-on.
FROM: https://docs.github.com/rest/reference/orgs#list-saml-sso-authorizations-for-an-organization
Remove a SAML SSO authorization for an organization.
This function performs a DELETE
to the /orgs/{org}/credential-authorizations/{credential_id}
endpoint.
Listing and deleting credential authorizations is available to organizations with GitHub Enterprise Cloud. For more information, see GitHub’s products.
An authenticated organization owner with the admin:org
scope can remove a credential authorization for an organization that uses SAML SSO. Once you remove someone’s credential authorization, they will need to create a new personal access token or SSH key and authorize it for the organization they want to access.
FROM: https://docs.github.com/rest/reference/orgs#remove-a-saml-sso-authorization-for-an-organization
Parameters:
org: &str
credential_id: i64
pub async fn list_failed_invitations(
&self,
org: &str,
per_page: i64,
page: i64
) -> Result<Vec<OrganizationInvitation>>
pub async fn list_failed_invitations(
&self,
org: &str,
per_page: i64,
page: i64
) -> Result<Vec<OrganizationInvitation>>
List failed organization invitations.
This function performs a GET
to the /orgs/{org}/failed_invitations
endpoint.
The return hash contains failed_at
and failed_reason
fields which represent the time at which the invitation failed and the reason for the failure.
FROM: https://docs.github.com/rest/reference/orgs#list-failed-organization-invitations
Parameters:
org: &str
per_page: i64
– Results per page (max 100).page: i64
– Page number of the results to fetch.
pub async fn list_all_failed_invitations(
&self,
org: &str
) -> Result<Vec<OrganizationInvitation>>
pub async fn list_all_failed_invitations(
&self,
org: &str
) -> Result<Vec<OrganizationInvitation>>
List failed organization invitations.
This function performs a GET
to the /orgs/{org}/failed_invitations
endpoint.
As opposed to list_failed_invitations
, this function returns all the pages of the request at once.
The return hash contains failed_at
and failed_reason
fields which represent the time at which the invitation failed and the reason for the failure.
FROM: https://docs.github.com/rest/reference/orgs#list-failed-organization-invitations
List organization webhooks.
This function performs a GET
to the /orgs/{org}/hooks
endpoint.
FROM: https://docs.github.com/rest/reference/orgs#list-organization-webhooks
Parameters:
org: &str
per_page: i64
– Results per page (max 100).page: i64
– Page number of the results to fetch.
List organization webhooks.
This function performs a GET
to the /orgs/{org}/hooks
endpoint.
As opposed to list_webhooks
, this function returns all the pages of the request at once.
FROM: https://docs.github.com/rest/reference/orgs#list-organization-webhooks
pub async fn create_webhook(
&self,
org: &str,
body: &OrgsCreateWebhookRequest
) -> Result<OrgHook>
pub async fn create_webhook(
&self,
org: &str,
body: &OrgsCreateWebhookRequest
) -> Result<OrgHook>
Create an organization webhook.
This function performs a POST
to the /orgs/{org}/hooks
endpoint.
Here’s how you can create a hook that posts payloads in JSON format:
FROM: https://docs.github.com/rest/reference/orgs#create-an-organization-webhook
Parameters:
org: &str
Get an organization webhook.
This function performs a GET
to the /orgs/{org}/hooks/{hook_id}
endpoint.
Returns a webhook configured in an organization. To get only the webhook config
properties, see “Get a webhook configuration for an organization.”
FROM: https://docs.github.com/rest/reference/orgs#get-an-organization-webhook
Parameters:
org: &str
hook_id: i64
Delete an organization webhook.
This function performs a DELETE
to the /orgs/{org}/hooks/{hook_id}
endpoint.
FROM: https://docs.github.com/rest/reference/orgs#delete-an-organization-webhook
Parameters:
org: &str
hook_id: i64
pub async fn update_webhook(
&self,
org: &str,
hook_id: i64,
body: &OrgsUpdateWebhookRequest
) -> Result<OrgHook>
pub async fn update_webhook(
&self,
org: &str,
hook_id: i64,
body: &OrgsUpdateWebhookRequest
) -> Result<OrgHook>
Update an organization webhook.
This function performs a PATCH
to the /orgs/{org}/hooks/{hook_id}
endpoint.
Updates a webhook configured in an organization. When you update a webhook, the secret
will be overwritten. If you previously had a secret
set, you must provide the same secret
or set a new secret
or the secret will be removed. If you are only updating individual webhook config
properties, use “Update a webhook configuration for an organization.”
FROM: https://docs.github.com/rest/reference/orgs#update-an-organization-webhook
Parameters:
org: &str
hook_id: i64
pub async fn get_webhook_config_for_org(
&self,
org: &str,
hook_id: i64
) -> Result<WebhookConfig>
pub async fn get_webhook_config_for_org(
&self,
org: &str,
hook_id: i64
) -> Result<WebhookConfig>
Get a webhook configuration for an organization.
This function performs a GET
to the /orgs/{org}/hooks/{hook_id}/config
endpoint.
Returns the webhook configuration for an organization. To get more information about the webhook, including the active
state and events
, use “Get an organization webhook .”
Access tokens must have the admin:org_hook
scope, and GitHub Apps must have the organization_hooks:read
permission.
FROM: https://docs.github.com/rest/reference/orgs#get-a-webhook-configuration-for-an-organization
Parameters:
org: &str
hook_id: i64
pub async fn update_webhook_config_for_org(
&self,
org: &str,
hook_id: i64,
body: &AppsUpdateWebhookConfigAppRequest
) -> Result<WebhookConfig>
pub async fn update_webhook_config_for_org(
&self,
org: &str,
hook_id: i64,
body: &AppsUpdateWebhookConfigAppRequest
) -> Result<WebhookConfig>
Update a webhook configuration for an organization.
This function performs a PATCH
to the /orgs/{org}/hooks/{hook_id}/config
endpoint.
Updates the webhook configuration for an organization. To update more information about the webhook, including the active
state and events
, use “Update an organization webhook .”
Access tokens must have the admin:org_hook
scope, and GitHub Apps must have the organization_hooks:write
permission.
FROM: https://docs.github.com/rest/reference/orgs#update-a-webhook-configuration-for-an-organization
Parameters:
org: &str
hook_id: i64
pub async fn list_webhook_deliveries(
&self,
org: &str,
hook_id: i64,
per_page: i64,
cursor: &str
) -> Result<Vec<HookDeliveryItem>>
pub async fn list_webhook_deliveries(
&self,
org: &str,
hook_id: i64,
per_page: i64,
cursor: &str
) -> Result<Vec<HookDeliveryItem>>
List deliveries for an organization webhook.
This function performs a GET
to the /orgs/{org}/hooks/{hook_id}/deliveries
endpoint.
Returns a list of webhook deliveries for a webhook configured in an organization.
FROM: https://docs.github.com/rest/reference/orgs#list-deliveries-for-an-organization-webhook
Parameters:
org: &str
hook_id: i64
per_page: i64
– Results per page (max 100).cursor: &str
– Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to thelink
header for the next and previous page cursors.
pub async fn list_all_webhook_deliveries(
&self,
org: &str,
hook_id: i64,
cursor: &str
) -> Result<Vec<HookDeliveryItem>>
pub async fn list_all_webhook_deliveries(
&self,
org: &str,
hook_id: i64,
cursor: &str
) -> Result<Vec<HookDeliveryItem>>
List deliveries for an organization webhook.
This function performs a GET
to the /orgs/{org}/hooks/{hook_id}/deliveries
endpoint.
As opposed to list_webhook_deliveries
, this function returns all the pages of the request at once.
Returns a list of webhook deliveries for a webhook configured in an organization.
FROM: https://docs.github.com/rest/reference/orgs#list-deliveries-for-an-organization-webhook
pub async fn get_webhook_delivery(
&self,
org: &str,
hook_id: i64,
delivery_id: i64
) -> Result<HookDelivery>
pub async fn get_webhook_delivery(
&self,
org: &str,
hook_id: i64,
delivery_id: i64
) -> Result<HookDelivery>
Get a webhook delivery for an organization webhook.
This function performs a GET
to the /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}
endpoint.
Returns a delivery for a webhook configured in an organization.
FROM: https://docs.github.com/rest/reference/orgs#get-a-webhook-delivery-for-an-organization-webhook
Parameters:
org: &str
hook_id: i64
delivery_id: i64
Redeliver a delivery for an organization webhook.
This function performs a POST
to the /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts
endpoint.
Redeliver a delivery for a webhook configured in an organization.
FROM: https://docs.github.com/rest/reference/orgs#redeliver-a-delivery-for-an-organization-webhook
Parameters:
org: &str
hook_id: i64
delivery_id: i64
Ping an organization webhook.
This function performs a POST
to the /orgs/{org}/hooks/{hook_id}/pings
endpoint.
This will trigger a ping event to be sent to the hook.
FROM: https://docs.github.com/rest/reference/orgs#ping-an-organization-webhook
Parameters:
org: &str
hook_id: i64
pub async fn list_app_installations(
&self,
org: &str,
per_page: i64,
page: i64
) -> Result<AppsListInstallationsResponse>
pub async fn list_app_installations(
&self,
org: &str,
per_page: i64,
page: i64
) -> Result<AppsListInstallationsResponse>
List app installations for an organization.
This function performs a GET
to the /orgs/{org}/installations
endpoint.
Lists all GitHub Apps in an organization. The installation count includes all GitHub Apps installed on repositories in the organization. You must be an organization owner with admin:read
scope to use this endpoint.
FROM: https://docs.github.com/rest/reference/orgs#list-app-installations-for-an-organization
Parameters:
org: &str
per_page: i64
– Results per page (max 100).page: i64
– Page number of the results to fetch.
pub async fn list_pending_invitations(
&self,
org: &str,
per_page: i64,
page: i64
) -> Result<Vec<OrganizationInvitation>>
pub async fn list_pending_invitations(
&self,
org: &str,
per_page: i64,
page: i64
) -> Result<Vec<OrganizationInvitation>>
List pending organization invitations.
This function performs a GET
to the /orgs/{org}/invitations
endpoint.
The return hash contains a role
field which refers to the Organization Invitation role and will be one of the following values: direct_member
, admin
, billing_manager
, hiring_manager
, or reinstate
. If the invitee is not a GitHub member, the login
field in the return hash will be null
.
FROM: https://docs.github.com/rest/reference/orgs#list-pending-organization-invitations
Parameters:
org: &str
per_page: i64
– Results per page (max 100).page: i64
– Page number of the results to fetch.
pub async fn list_all_pending_invitations(
&self,
org: &str
) -> Result<Vec<OrganizationInvitation>>
pub async fn list_all_pending_invitations(
&self,
org: &str
) -> Result<Vec<OrganizationInvitation>>
List pending organization invitations.
This function performs a GET
to the /orgs/{org}/invitations
endpoint.
As opposed to list_pending_invitations
, this function returns all the pages of the request at once.
The return hash contains a role
field which refers to the Organization Invitation role and will be one of the following values: direct_member
, admin
, billing_manager
, hiring_manager
, or reinstate
. If the invitee is not a GitHub member, the login
field in the return hash will be null
.
FROM: https://docs.github.com/rest/reference/orgs#list-pending-organization-invitations
pub async fn create_invitation(
&self,
org: &str,
body: &OrgsCreateInvitationRequest
) -> Result<OrganizationInvitation>
pub async fn create_invitation(
&self,
org: &str,
body: &OrgsCreateInvitationRequest
) -> Result<OrganizationInvitation>
Create an organization invitation.
This function performs a POST
to the /orgs/{org}/invitations
endpoint.
Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner.
This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. See “Secondary rate limits” and “Dealing with secondary rate limits” for details.
FROM: https://docs.github.com/rest/reference/orgs#create-an-organization-invitation
Parameters:
org: &str
Cancel an organization invitation.
This function performs a DELETE
to the /orgs/{org}/invitations/{invitation_id}
endpoint.
Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner.
This endpoint triggers notifications.
FROM: https://docs.github.com/rest/reference/orgs#cancel-an-organization-invitation
Parameters:
org: &str
invitation_id: i64
– invitation_id parameter.
List organization invitation teams.
This function performs a GET
to the /orgs/{org}/invitations/{invitation_id}/teams
endpoint.
List all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner.
FROM: https://docs.github.com/rest/reference/orgs#list-organization-invitation-teams
Parameters:
org: &str
invitation_id: i64
– invitation_id parameter.per_page: i64
– Results per page (max 100).page: i64
– Page number of the results to fetch.
List organization invitation teams.
This function performs a GET
to the /orgs/{org}/invitations/{invitation_id}/teams
endpoint.
As opposed to list_invitation_teams
, this function returns all the pages of the request at once.
List all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner.
FROM: https://docs.github.com/rest/reference/orgs#list-organization-invitation-teams
pub async fn list_members(
&self,
org: &str,
filter: OrgsListMembersFilter,
role: OrgsListMembersRole,
per_page: i64,
page: i64
) -> Result<Vec<SimpleUser>>
pub async fn list_members(
&self,
org: &str,
filter: OrgsListMembersFilter,
role: OrgsListMembersRole,
per_page: i64,
page: i64
) -> Result<Vec<SimpleUser>>
List organization members.
This function performs a GET
to the /orgs/{org}/members
endpoint.
List all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned.
FROM: https://docs.github.com/rest/reference/orgs#list-organization-members
Parameters:
org: &str
filter: crate::types::OrgsListMembersFilter
– Filter members returned in the list. Can be one of:
\*2fa_disabled
- Members without two-factor authentication enabled. Available for organization owners.
\*all
- All members the authenticated user can see.role: crate::types::OrgsListMembersRole
– Filter members returned by their role. Can be one of:
\*all
- All members of the organization, regardless of role.
\*admin
- Organization owners.
\*member
- Non-owner organization members.per_page: i64
– Results per page (max 100).page: i64
– Page number of the results to fetch.
pub async fn list_all_members(
&self,
org: &str,
filter: OrgsListMembersFilter,
role: OrgsListMembersRole
) -> Result<Vec<SimpleUser>>
pub async fn list_all_members(
&self,
org: &str,
filter: OrgsListMembersFilter,
role: OrgsListMembersRole
) -> Result<Vec<SimpleUser>>
List organization members.
This function performs a GET
to the /orgs/{org}/members
endpoint.
As opposed to list_members
, this function returns all the pages of the request at once.
List all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned.
FROM: https://docs.github.com/rest/reference/orgs#list-organization-members
Check organization membership for a user.
This function performs a GET
to the /orgs/{org}/members/{username}
endpoint.
Check if a user is, publicly or privately, a member of the organization.
FROM: https://docs.github.com/rest/reference/orgs#check-organization-membership-for-a-user
Parameters:
org: &str
username: &str
Remove an organization member.
This function performs a DELETE
to the /orgs/{org}/members/{username}
endpoint.
Removing a user from this list will remove them from all teams and they will no longer have any access to the organization’s repositories.
FROM: https://docs.github.com/rest/reference/orgs#remove-an-organization-member
Parameters:
org: &str
username: &str
pub async fn get_membership_for_user(
&self,
org: &str,
username: &str
) -> Result<OrgMembership>
pub async fn get_membership_for_user(
&self,
org: &str,
username: &str
) -> Result<OrgMembership>
Get organization membership for a user.
This function performs a GET
to the /orgs/{org}/memberships/{username}
endpoint.
In order to get a user’s membership with an organization, the authenticated user must be an organization member. The state
parameter in the response can be used to identify the user’s membership status.
FROM: https://docs.github.com/rest/reference/orgs#get-organization-membership-for-a-user
Parameters:
org: &str
username: &str
pub async fn set_membership_for_user(
&self,
org: &str,
username: &str,
body: &OrgsSetMembershipUserRequest
) -> Result<OrgMembership>
pub async fn set_membership_for_user(
&self,
org: &str,
username: &str,
body: &OrgsSetMembershipUserRequest
) -> Result<OrgMembership>
Set organization membership for a user.
This function performs a PUT
to the /orgs/{org}/memberships/{username}
endpoint.
Only authenticated organization owners can add a member to the organization or update the member’s role.
-
If the authenticated user is adding a member to the organization, the invited user will receive an email inviting them to the organization. The user’s membership status will be
pending
until they accept the invitation. -
Authenticated users can update a user’s membership by passing the
role
parameter. If the authenticated user changes a member’s role toadmin
, the affected user will receive an email notifying them that they’ve been made an organization owner. If the authenticated user changes an owner’s role tomember
, no email will be sent.
Rate limits
To prevent abuse, the authenticated user is limited to 50 organization invitations per 24 hour period. If the organization is more than one month old or on a paid plan, the limit is 500 invitations per 24 hour period.
FROM: https://docs.github.com/rest/reference/orgs#set-organization-membership-for-a-user
Parameters:
org: &str
username: &str
Remove organization membership for a user.
This function performs a DELETE
to the /orgs/{org}/memberships/{username}
endpoint.
In order to remove a user’s membership with an organization, the authenticated user must be an organization owner.
If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases.
FROM: https://docs.github.com/rest/reference/orgs#remove-organization-membership-for-a-user
Parameters:
org: &str
username: &str
pub async fn list_outside_collaborators(
&self,
org: &str,
filter: OrgsListMembersFilter,
per_page: i64,
page: i64
) -> Result<Vec<SimpleUser>>
pub async fn list_outside_collaborators(
&self,
org: &str,
filter: OrgsListMembersFilter,
per_page: i64,
page: i64
) -> Result<Vec<SimpleUser>>
List outside collaborators for an organization.
This function performs a GET
to the /orgs/{org}/outside_collaborators
endpoint.
List all users who are outside collaborators of an organization.
FROM: https://docs.github.com/rest/reference/orgs#list-outside-collaborators-for-an-organization
Parameters:
org: &str
filter: crate::types::OrgsListMembersFilter
– Filter members returned in the list. Can be one of:
\*2fa_disabled
- Members without two-factor authentication enabled. Available for organization owners.
\*all
- All members the authenticated user can see.per_page: i64
– Results per page (max 100).page: i64
– Page number of the results to fetch.
pub async fn list_all_outside_collaborators(
&self,
org: &str,
filter: OrgsListMembersFilter
) -> Result<Vec<SimpleUser>>
pub async fn list_all_outside_collaborators(
&self,
org: &str,
filter: OrgsListMembersFilter
) -> Result<Vec<SimpleUser>>
List outside collaborators for an organization.
This function performs a GET
to the /orgs/{org}/outside_collaborators
endpoint.
As opposed to list_outside_collaborators
, this function returns all the pages of the request at once.
List all users who are outside collaborators of an organization.
FROM: https://docs.github.com/rest/reference/orgs#list-outside-collaborators-for-an-organization
Convert an organization member to outside collaborator.
This function performs a PUT
to the /orgs/{org}/outside_collaborators/{username}
endpoint.
When an organization member is converted to an outside collaborator, they’ll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see “Converting an organization member to an outside collaborator”.
FROM: https://docs.github.com/rest/reference/orgs#convert-an-organization-member-to-outside-collaborator
Parameters:
org: &str
username: &str
Remove outside collaborator from an organization.
This function performs a DELETE
to the /orgs/{org}/outside_collaborators/{username}
endpoint.
Removing a user from this list will remove them from all the organization’s repositories.
FROM: https://docs.github.com/rest/reference/orgs#remove-outside-collaborator-from-an-organization
Parameters:
org: &str
username: &str
pub async fn list_public_members(
&self,
org: &str,
per_page: i64,
page: i64
) -> Result<Vec<SimpleUser>>
pub async fn list_public_members(
&self,
org: &str,
per_page: i64,
page: i64
) -> Result<Vec<SimpleUser>>
List public organization members.
This function performs a GET
to the /orgs/{org}/public_members
endpoint.
Members of an organization can choose to have their membership publicized or not.
FROM: https://docs.github.com/rest/reference/orgs#list-public-organization-members
Parameters:
org: &str
per_page: i64
– Results per page (max 100).page: i64
– Page number of the results to fetch.
List public organization members.
This function performs a GET
to the /orgs/{org}/public_members
endpoint.
As opposed to list_public_members
, this function returns all the pages of the request at once.
Members of an organization can choose to have their membership publicized or not.
FROM: https://docs.github.com/rest/reference/orgs#list-public-organization-members
Check public organization membership for a user.
This function performs a GET
to the /orgs/{org}/public_members/{username}
endpoint.
FROM: https://docs.github.com/rest/reference/orgs#check-public-organization-membership-for-a-user
Parameters:
org: &str
username: &str
Set public organization membership for the authenticated user.
This function performs a PUT
to the /orgs/{org}/public_members/{username}
endpoint.
The user can publicize their own membership. (A user cannot publicize the membership for another user.)
Note that you’ll need to set Content-Length
to zero when calling out to this endpoint. For more information, see “HTTP verbs.”
Parameters:
org: &str
username: &str
Remove public organization membership for the authenticated user.
This function performs a DELETE
to the /orgs/{org}/public_members/{username}
endpoint.
Parameters:
org: &str
username: &str
pub async fn list_memberships_for_authenticated_user(
&self,
state: OrgMembershipState,
per_page: i64,
page: i64
) -> Result<Vec<OrgMembership>>
pub async fn list_memberships_for_authenticated_user(
&self,
state: OrgMembershipState,
per_page: i64,
page: i64
) -> Result<Vec<OrgMembership>>
List organization memberships for the authenticated user.
This function performs a GET
to the /user/memberships/orgs
endpoint.
FROM: https://docs.github.com/rest/reference/orgs#list-organization-memberships-for-the-authenticated-user
Parameters:
state: crate::types::OrgMembershipState
– Indicates the state of the memberships to return. Can be eitheractive
orpending
. If not specified, the API returns both active and pending memberships.per_page: i64
– Results per page (max 100).page: i64
– Page number of the results to fetch.
pub async fn list_all_memberships_for_authenticated_user(
&self,
state: OrgMembershipState
) -> Result<Vec<OrgMembership>>
pub async fn list_all_memberships_for_authenticated_user(
&self,
state: OrgMembershipState
) -> Result<Vec<OrgMembership>>
List organization memberships for the authenticated user.
This function performs a GET
to the /user/memberships/orgs
endpoint.
As opposed to list_memberships_for_authenticated_user
, this function returns all the pages of the request at once.
FROM: https://docs.github.com/rest/reference/orgs#list-organization-memberships-for-the-authenticated-user
Get an organization membership for the authenticated user.
This function performs a GET
to the /user/memberships/orgs/{org}
endpoint.
Parameters:
org: &str
pub async fn update_membership_for_authenticated_user(
&self,
org: &str,
body: &OrgsUpdateMembershipRequest
) -> Result<OrgMembership>
pub async fn update_membership_for_authenticated_user(
&self,
org: &str,
body: &OrgsUpdateMembershipRequest
) -> Result<OrgMembership>
Update an organization membership for the authenticated user.
This function performs a PATCH
to the /user/memberships/orgs/{org}
endpoint.
Parameters:
org: &str
pub async fn list_for_authenticated_user(
&self,
per_page: i64,
page: i64
) -> Result<Vec<OrganizationSimple>>
pub async fn list_for_authenticated_user(
&self,
per_page: i64,
page: i64
) -> Result<Vec<OrganizationSimple>>
List organizations for the authenticated user.
This function performs a GET
to the /user/orgs
endpoint.
List organizations for the authenticated user.
OAuth scope requirements
This only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with read:org
scope, you can publicize your organization membership with user
scope, etc.). Therefore, this API requires at least user
or read:org
scope. OAuth requests with insufficient scope receive a 403 Forbidden
response.
FROM: https://docs.github.com/rest/reference/orgs#list-organizations-for-the-authenticated-user
Parameters:
per_page: i64
– Results per page (max 100).page: i64
– Page number of the results to fetch.
List organizations for the authenticated user.
This function performs a GET
to the /user/orgs
endpoint.
As opposed to list_for_authenticated_user
, this function returns all the pages of the request at once.
List organizations for the authenticated user.
OAuth scope requirements
This only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with read:org
scope, you can publicize your organization membership with user
scope, etc.). Therefore, this API requires at least user
or read:org
scope. OAuth requests with insufficient scope receive a 403 Forbidden
response.
FROM: https://docs.github.com/rest/reference/orgs#list-organizations-for-the-authenticated-user
pub async fn list_for_user(
&self,
username: &str,
per_page: i64,
page: i64
) -> Result<Vec<OrganizationSimple>>
pub async fn list_for_user(
&self,
username: &str,
per_page: i64,
page: i64
) -> Result<Vec<OrganizationSimple>>
List organizations for a user.
This function performs a GET
to the /users/{username}/orgs
endpoint.
List public organization memberships for the specified user.
This method only lists public memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the List organizations for the authenticated user API instead.
FROM: https://docs.github.com/rest/reference/orgs#list-organizations-for-a-user
Parameters:
username: &str
per_page: i64
– Results per page (max 100).page: i64
– Page number of the results to fetch.
List organizations for a user.
This function performs a GET
to the /users/{username}/orgs
endpoint.
As opposed to list_for_user
, this function returns all the pages of the request at once.
List public organization memberships for the specified user.
This method only lists public memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the List organizations for the authenticated user API instead.
FROM: https://docs.github.com/rest/reference/orgs#list-organizations-for-a-user