[][src]Struct octocrab::teams::TeamHandler

pub struct TeamHandler<'octo> { /* fields omitted */ }

Handler for GitHub's teams API.

Created with Octocrab::teams.

Implementations

impl<'octo> TeamHandler<'octo>[src]

pub fn list(&self) -> ListTeamsBuilder[src]

Lists teams in the organization.

let teams = octocrab::instance()
    .teams("owner")
    .list()
    .per_page(10)
    .page(1u8)
    .send()
    .await?;

pub async fn get<'_>(&'_ self, team_slug: impl Into<String>) -> Result<Team>[src]

Gets a team from its slug.

let team = octocrab::instance()
    .teams("owner")
    .get("team")
    .await?;

pub fn create(&self, name: impl Into<String>) -> CreateTeamBuilder[src]

Creates a new team in the organization.

use octocrab::params;

octocrab::instance()
    .teams("owner")
    .create("new-team")
    .description("My team created from Octocrab!")
    .maintainers(&vec![String::from("ferris")])
    .repo_names(&vec![String::from("crab-stuff")])
    .privacy(params::teams::Privacy::Closed)
    .parent_team_id(1u64)
    .send()
    .await?;

pub fn edit(
    &self,
    team_slug: impl Into<String>,
    name: impl Into<String>
) -> EditTeamBuilder
[src]

Creates a new team in the organization.

use octocrab::params;

octocrab::instance()
    .teams("owner")
    .edit("some-team", "Some Team")
    .description("I edited from Octocrab!")
    .privacy(params::teams::Privacy::Secret)
    .parent_team_id(2u64)
    .send()
    .await?;

pub async fn delete<'_>(&'_ self, team_slug: impl Into<String>) -> Result<()>[src]

Deletes a team from the organization.

octocrab::instance().teams("owner").delete("some-team").await?;

pub fn list_children(
    &self,
    team_slug: impl Into<String>
) -> ListChildTeamsBuilder
[src]

List the child teams of a team in the organization.

octocrab::instance()
    .teams("owner")
    .list_children("parent-team")
    .per_page(5)
    .page(1u8)
    .send()
    .await?;

pub fn repos(&self, team_slug: impl Into<String>) -> TeamRepoHandler[src]

Creates a new TeamRepoHandler for the specified team, that allows you to manage this team's repositories.

Auto Trait Implementations

impl<'octo> !RefUnwindSafe for TeamHandler<'octo>

impl<'octo> Send for TeamHandler<'octo>

impl<'octo> Sync for TeamHandler<'octo>

impl<'octo> Unpin for TeamHandler<'octo>

impl<'octo> !UnwindSafe for TeamHandler<'octo>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.