lockLockable will lock an issue or pull request
(httpClient *http.Client, repo ghrepo.Interface, lockable *api.Issue, opts *LockOptions)
| 306 | |
| 307 | // lockLockable will lock an issue or pull request |
| 308 | func lockLockable(httpClient *http.Client, repo ghrepo.Interface, lockable *api.Issue, opts *LockOptions) error { |
| 309 | var mutation struct { |
| 310 | LockLockable struct { |
| 311 | LockedRecord struct { |
| 312 | Locked bool |
| 313 | } |
| 314 | } `graphql:"lockLockable(input: $input)"` |
| 315 | } |
| 316 | |
| 317 | variables := map[string]interface{}{ |
| 318 | "input": githubv4.LockLockableInput{ |
| 319 | LockableID: lockable.ID, |
| 320 | LockReason: reasonsMap[opts.Reason], |
| 321 | }, |
| 322 | } |
| 323 | |
| 324 | gql := api.NewClientFromHTTP(httpClient) |
| 325 | return gql.Mutate(repo.RepoHost(), "LockLockable", &mutation, variables) |
| 326 | } |
| 327 | |
| 328 | // unlockLockable will unlock an issue or pull request |
| 329 | func unlockLockable(httpClient *http.Client, repo ghrepo.Interface, lockable *api.Issue) error { |
no test coverage detected