GetEdit returns an existing edit by ID
(editID string)
| 185 | |
| 186 | // GetEdit returns an existing edit by ID |
| 187 | func (c *Client) GetEdit(editID string) (*Edit, error) { |
| 188 | ctx, cancel := c.Context() |
| 189 | |
| 190 | edit, err := c.service.Edits.Get(c.packageName, editID).Context(ctx).Do() |
| 191 | if err != nil { |
| 192 | cancel() |
| 193 | return nil, fmt.Errorf("failed to get edit: %w", err) |
| 194 | } |
| 195 | |
| 196 | return &Edit{ |
| 197 | client: c, |
| 198 | editID: edit.Id, |
| 199 | ctx: ctx, |
| 200 | cancel: cancel, |
| 201 | }, nil |
| 202 | } |
| 203 | |
| 204 | // ID returns the edit ID |
| 205 | func (e *Edit) ID() string { |