pub async fn create_label(
        &self,
        name: impl AsRef<str>,
        color: impl AsRef<str>,
        description: impl AsRef<str>,
    ) -> Result<models::Label> {
        let route = format!(
            "repos/{owner}/{repo}/labels",
            owner = self.owner,
            repo = self.repo,
        );

        self.crab
            .post(
                route,
                Some(&serde_json::json!({
                    "name": name.as_ref(),
                    "color": color.as_ref(),
                    "description": description.as_ref()
                })),
            )
            .await
    }
/// Creates a label in the repository.
/// ```no_run
/// # async fn run() -> octocrab::Result<()> {
/// let label = octocrab::instance()
///     .issues("owner", "repo")
///     .create_label("help wanted", "59dd5a", "")
///     .await?;
/// # Ok(())
/// # }
/// ```
Creates a label in the repository.
Creates a label in the repository .
pub async fn create_label(
        &self,
        name: impl AsRef<str>,
        color: impl AsRef<str>,
        description: impl AsRef<str>,
    ) -> Result<models::Label> {
        let route = format!(
            "repos/{owner}/{repo}/labels",
            owner = self.owner,
            repo = self.repo,
        );
        self.crab
            .post(
                route,
                Some(&serde_json::json!({
                    "name": name.as_ref(),
                    "color": color.as_ref(),
                    "description": description.as_ref()
                })),
            )
            .await
    }
pub async fn create_label ( & self , name : impl AsRef < str > , color : impl AsRef < str > , description : impl AsRef < str > , ) -> Result < models :: Label > { let route = format ! ( " " owner self owner repo self repo ) ; self . crab . post ( route , Some ( & serde_json :: json ! ( { " " name as_ref ( ) " " color as_ref ( ) " " description as_ref ( ) } ) ) , ) . await }
Creates a label in the repository.
Creates a label in the repository .
&self
name
impl AsRef<str>
color
impl AsRef<str>
description
impl AsRef<str>
&self
name
impl AsRef<str>
color
impl AsRef<str>
description
impl AsRef<str>
async fn run() -> octocrab::result<()> {
let label = octocrab::instance()
.issues("owner", "repo")
.create_label("help wanted", "59dd5a", "")
.await?.
let label = octocrab :: instance () . issues ( " owner " " repo " ) . create_label ( " help wanted " " 59dd5a " " " ) . await? .
ok(())
None
}
None