[−][src]Struct octocrab::orgs::OrgHandler
A client to GitHub's organization API.
Created with Octocrab::orgs
.
Implementations
impl<'octo> OrgHandler<'octo>
[src]
pub async fn add_or_update_membership<'_>(
&'_ self,
username: impl AsRef<str>,
role: Option<Role>
) -> Result<MembershipInvitation>
[src]
&'_ self,
username: impl AsRef<str>,
role: Option<Role>
) -> Result<MembershipInvitation>
Add or update organization membership
Note
- 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 to admin, 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 to member, no email will be sent.
let invitation = octocrab.orgs("owner").add_or_update_membership("ferris", None).await?;
pub async fn check_membership<'_>(
&'_ self,
username: impl AsRef<str>
) -> Result<bool>
[src]
&'_ self,
username: impl AsRef<str>
) -> Result<bool>
Check if a user is, publicly or privately, a member of the organization.
assert!(octocrab.orgs("owner").check_membership("ferris").await?);
pub async fn get<'_>(&'_ self) -> Result<Organization>
[src]
Get an organization
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.
let org = octocrab.orgs("owner").get().await?;
pub fn list_repos(&self) -> ListReposBuilder<'_, '_>
[src]
List repos for the specified organization.
use octocrab::params; // Get the least active repos belonging to `owner`. let page = octocrab::instance() .orgs("owner") .list_repos() // Optional Parameters .repo_type(params::repos::Type::Sources) .sort(params::repos::Sort::Pushed) .direction(params::Direction::Descending) .per_page(25) .page(5u32) // Send the request. .send() .await?;
Auto Trait Implementations
impl<'octo> !RefUnwindSafe for OrgHandler<'octo>
[src]
impl<'octo> Send for OrgHandler<'octo>
[src]
impl<'octo> Sync for OrgHandler<'octo>
[src]
impl<'octo> Unpin for OrgHandler<'octo>
[src]
impl<'octo> !UnwindSafe for OrgHandler<'octo>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,