Stop stops a codespace. You must authenticate using an access token with the codespace scope to use this endpoint. GitHub Apps must have write access to the codespaces_lifecycle_admin repository permission to use this endpoint. GitHub API docs: https://docs.github.com/rest/codespaces/codespaces?ap
(ctx context.Context, codespaceName string)
| 322 | // |
| 323 | //meta:operation POST /user/codespaces/{codespace_name}/stop |
| 324 | func (s *CodespacesService) Stop(ctx context.Context, codespaceName string) (*Codespace, *Response, error) { |
| 325 | u := fmt.Sprintf("user/codespaces/%v/stop", codespaceName) |
| 326 | req, err := s.client.NewRequest(ctx, "POST", u, nil) |
| 327 | if err != nil { |
| 328 | return nil, nil, err |
| 329 | } |
| 330 | |
| 331 | var codespace *Codespace |
| 332 | resp, err := s.client.Do(req, &codespace) |
| 333 | if err != nil { |
| 334 | return nil, resp, err |
| 335 | } |
| 336 | |
| 337 | return codespace, resp, nil |
| 338 | } |
| 339 | |
| 340 | // Delete deletes a codespace. |
| 341 | // |