pub async fn lock(
        &self,
        number: u64,
        reason: impl Into<Option<params::LockReason>>,
    ) -> Result<bool> {
        let route = format!(
            "repos/{owner}/{repo}/issues/{number}/lock",
            owner = self.owner,
            repo = self.repo,
            number = number,
        );

        let response = self
            .crab
            ._put(
                self.crab.absolute_url(route)?,
                reason
                    .into()
                    .map(|reason| {
                        serde_json::json!({
                            "lock_reason": reason,
                        })
                    })
                    .as_ref(),
            )
            .await?;

        Ok(response.status() == 204)
    }
/// Users with push access can lock an issue or pull request's conversation.
///
/// *Note* Providing a reason requires the `sailor-v` preview to enabled.
///
/// See also: https://developer.github.com/v3/issues/#lock-an-issue
/// ```no_run
/// # async fn run() -> octocrab::Result<()> {
/// use octocrab::params;
///
/// assert!(octocrab::instance().issues("owner", "repo").lock(404, params::LockReason::OffTopic).await?);
/// # Ok(())
/// # }
/// ```
Users with push access can lock an issue or pull request's conversation.
Note* Providing a reason requires the `sailor-v` preview to enabled.


Users with push access can lock an issue or pull request ' s conversation . Note * Providing a reason requires the ` sailor - v ` preview to enabled .
pub async fn lock(
        &self,
        number: u64,
        reason: impl Into<Option<params::LockReason>>,
    ) -> Result<bool> {
        let route = format!(
            "repos/{owner}/{repo}/issues/{number}/lock",
            owner = self.owner,
            repo = self.repo,
            number = number,
        );
        let response = self
            .crab
            ._put(
                self.crab.absolute_url(route)?,
                reason
                    .into()
                    .map(|reason| {
                        serde_json::json!({
                            "lock_reason": reason,
                        })
                    })
                    .as_ref(),
            )
            .await?;
        Ok(response.status() == 204)
    }
pub async fn lock ( & self , number : u64 , reason : impl Into < Option < params :: LockReason > > , ) -> Result < bool > { let route = format ! ( " " owner self owner repo self repo number number ) ; let response = self . crab . _put ( self . crab . absolute_url ( route ) ? , reason . into ( ) . map ( | reason | { serde_json :: json ! ( { " " reason } ) } ) . as_ref ( ) , ) . await ? ; Ok ( response . status ( ) == 204 ) }
Users with push access can lock an issue or pull request's conversation.
Users with push access can lock an issue or pull request ' s conversation .
&self
number
u64
reason
impl Into<Option<params::LockReason>>
&self
number
u64
reason
impl Into<Option<params::LockReason>>
async fn run() -> octocrab::result<()> {
use octocrab::params.

assert!(octocrab::instance().issues("owner", "repo").lock(404, params::LockReason::OffTopic).await?).
use octocrab :: params . assert! ( octocrab :: instance () . issues ( " owner " " repo " ) . lock ( 404 params :: LockReason :: OffTopic ) . await? ) .
ok(())
None
}
None