pub async fn check_manages(
        &self,
        repo_owner: impl Into<String>,
        repo_name: impl Into<String>,
    ) -> Result<Option<models::Repository>> {
        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 req = self
            .crab
            .client
            .get(self.crab.absolute_url(&url)?)
            .header(ACCEPT, "application/vnd.github.v3.repository+json");
        let res = self.crab.execute(req).await?;
        if res.status() == StatusCode::NOT_FOUND {
            return Ok(None);
        }
        Ok(Some(models::Repository::from_response(res).await?))
    }
/// Checks if a team manages a repository, returning the repository if it does.
/// ```no_run
/// # async fn run() -> octocrab::Result<()> {
/// let manages_repo = octocrab::instance()
///     .teams("owner")
///     .repos("team")
///     .check_manages("owner", "repo")
///     .await
///     .is_ok();
/// # Ok(())
/// # }
/// ```
Checks if a team manages a repository, returning the repository if it does.
Checks if a team manages a repository returning the repository if it does .
pub async fn check_manages(
        &self,
        repo_owner: impl Into<String>,
        repo_name: impl Into<String>,
    ) -> Result<Option<models::Repository>> {
        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 req = self
            .crab
            .client
            .get(self.crab.absolute_url(&url)?)
            .header(ACCEPT, "application/vnd.github.v3.repository+json");
        let res = self.crab.execute(req).await?;
        if res.status() == StatusCode::NOT_FOUND {
            return Ok(None);
        }
        Ok(Some(models::Repository::from_response(res).await?))
    }
pub async fn check_manages ( & self , repo_owner : impl Into < String > , repo_name : impl Into < String > , ) -> Result < Option < models :: Repository > > { let url = format ! ( " " org self org team self team owner repo_owner into ( ) repo repo_name into ( ) ) ; let req = self . crab . client . get ( self . crab . absolute_url ( & url ) ? ) . header ( ACCEPT , " " ) ; let res = self . crab . execute ( req ) . await ? ; if res . status ( ) == StatusCode :: NOT_FOUND { return Ok ( None ) ; } Ok ( Some ( models :: Repository :: from_response ( res ) . await ? ) ) }
Checks if a team manages a repository, returning the repository if it does.
Checks if a team manages a repository returning the repository if it does .
&self
repo_owner
impl Into<String>
repo_name
impl Into<String>
&self
repo_owner
impl Into<String>
repo_name
impl Into<String>
async fn run() -> octocrab::result<()> {
let manages_repo = octocrab::instance()
.teams("owner")
.repos("team")
.check_manages("owner", "repo")
.await
.is_ok().
let manages_repo = octocrab :: instance () . teams ( " owner " ) . repos ( " team " ) . check_manages ( " owner " " repo " ) . await . is_ok () .
ok(())
None
}
None