TemplateVersionExternalAuth returns authentication providers for the requested template version.
(ctx context.Context, version uuid.UUID)
| 145 | |
| 146 | // TemplateVersionExternalAuth returns authentication providers for the requested template version. |
| 147 | func (c *Client) TemplateVersionExternalAuth(ctx context.Context, version uuid.UUID) ([]TemplateVersionExternalAuth, error) { |
| 148 | res, err := c.Request(ctx, http.MethodGet, fmt.Sprintf("/api/v2/templateversions/%s/external-auth", version), nil) |
| 149 | if err != nil { |
| 150 | return nil, err |
| 151 | } |
| 152 | defer res.Body.Close() |
| 153 | if res.StatusCode != http.StatusOK { |
| 154 | return nil, ReadBodyAsError(res) |
| 155 | } |
| 156 | var extAuth []TemplateVersionExternalAuth |
| 157 | return extAuth, json.NewDecoder(res.Body).Decode(&extAuth) |
| 158 | } |
| 159 | |
| 160 | // TemplateVersionResources returns resources a template version declares. |
| 161 | func (c *Client) TemplateVersionResources(ctx context.Context, version uuid.UUID) ([]WorkspaceResource, error) { |