mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-03 19:11:30 +00:00
add active lock reason to PR (#2543)
* add active lock reason to PR * update docs * refactor: extract lock and unlock from IIssuesClient create ILockUnlockClient so both IIssuesClient and IPullRequestClient can access lock and unlock methods. * refactor LockUnlock for reactive clients * Update doc to include lock unlock sample code * Use Assert.Null to check null value in test Co-authored-by: notauserx <notauserx@users.noreply.github.com>
This commit is contained in:
@@ -120,3 +120,23 @@ Label changes probably requires some explanation:
|
||||
|
||||
If you're trying to populate the `Labels` collection by hand, you might hit
|
||||
some exceptional behaviour due to these rules.
|
||||
|
||||
### Lock / Unlock
|
||||
|
||||
The lock and unlock methods are available on the ILockUnlockClient on IIssuesClient.
|
||||
|
||||
Heres a sample code for locking an issue:
|
||||
|
||||
```csharp
|
||||
var issue = await client.Issue.Get("octokit", "octokit.net", 405);
|
||||
await client.LockUnlock.Lock("octokit", "octokit.net", 405, LockReason.OffTopic);
|
||||
```
|
||||
|
||||
The active lock reason can be accessed via the LockReason property on Issues class.
|
||||
|
||||
The code below demonstrates how to unlock an issue:
|
||||
|
||||
```csharp
|
||||
var issue = await client.Issue.Get("octokit", "octokit.net", 405);
|
||||
await client.LockUnlock.Unlock("octokit", "octokit.net", 405);
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user