asRequestOption returns a function that can be used in (*Client).Request. It modifies the request query parameters.
()
| 145 | // asRequestOption returns a function that can be used in (*Client).Request. |
| 146 | // It modifies the request query parameters. |
| 147 | func (o WorkspaceOptions) asRequestOption() RequestOption { |
| 148 | return func(r *http.Request) { |
| 149 | q := r.URL.Query() |
| 150 | if o.IncludeDeleted { |
| 151 | q.Set("include_deleted", "true") |
| 152 | } |
| 153 | r.URL.RawQuery = q.Encode() |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | // Workspace returns a single workspace. |
| 158 | func (c *Client) Workspace(ctx context.Context, id uuid.UUID) (Workspace, error) { |
no test coverage detected