pub async fn add_or_update(
        &self,
        repo_owner: impl Into<String>,
        repo_name: impl Into<String>,
        permission: impl Into<Option<params::teams::Permission>>,
    ) -> Result<()> {
        let url = format!(
            "orgs/{org}/teams/{team}/repos/{owner}/{repo}",
            org = self.org,
            team = self.team,
            owner = repo_owner.into(),
            repo = repo_name.into(),
        );
        let perm_body = permission
            .into()
            .map(|p| PermissionUpdateBody { permission: p });
        crate::map_github_error(
            self.crab
                ._put(self.crab.absolute_url(&url)?, perm_body.as_ref())
                .await?,
        )
        .await
        .map(drop)
    }
/// Updates a team's permissions for a repository.
/// ```no_run
/// # async fn run() -> octocrab::Result<()> {
/// use octocrab::params;
///
/// octocrab::instance()
///     .teams("owner")
///     .repos("team")
///     .add_or_update("owner", "repo", params::teams::Permission::Maintain)
///     .await?;
/// # Ok(())
/// # }
/// ```
Updates a team's permissions for a repository.
Updates a team ' s permissions for a repository .
pub async fn add_or_update(
        &self,
        repo_owner: impl Into<String>,
        repo_name: impl Into<String>,
        permission: impl Into<Option<params::teams::Permission>>,
    ) -> Result<()> {
        let url = format!(
            "orgs/{org}/teams/{team}/repos/{owner}/{repo}",
            org = self.org,
            team = self.team,
            owner = repo_owner.into(),
            repo = repo_name.into(),
        );
        let perm_body = permission
            .into()
            .map(|p| PermissionUpdateBody { permission: p });
        crate::map_github_error(
            self.crab
                ._put(self.crab.absolute_url(&url)?, perm_body.as_ref())
                .await?,
        )
        .await
        .map(drop)
    }
pub async fn add_or_update ( & self , repo_owner : impl Into < String > , repo_name : impl Into < String > , permission : impl Into < Option < params :: teams :: Permission > > , ) -> Result < ( ) > { let url = format ! ( " " org self org team self team owner repo_owner into ( ) repo repo_name into ( ) ) ; let perm_body = permission . into ( ) . map ( | p | PermissionUpdateBody { permission : p } ) ; crate :: map_github_error ( self . crab . _put ( self . crab . absolute_url ( & url ) ? , perm_body . as_ref ( ) ) . await ? , ) . await . map ( drop ) }
Updates a team's permissions for a repository.
Updates a team ' s permissions for a repository .
&self
repo_owner
impl Into<String>
repo_name
impl Into<String>
permission
impl Into<Option<params::teams::Permission>>
&self
repo_owner
impl Into<String>
repo_name
impl Into<String>
permission
impl Into<Option<params::teams::Permission>>
async fn run() -> octocrab::result<()> {
use octocrab::params.

:instance()
.teams("owner")
.repos("team")
.add_or_update("owner", "repo", params::teams::Permission::Maintain)
.await?.
use octocrab :: params . : instance () . teams ( " owner " ) . repos ( " team " ) . add_or_update ( " owner " " repo " params :: teams :: Permission :: Maintain ) . await? .
ok(())
None
}
None