| 131 | } |
| 132 | |
| 133 | func (c *Client) PatchRoleIDPSyncSettings(ctx context.Context, orgID string, req RoleSyncSettings) (RoleSyncSettings, error) { |
| 134 | res, err := c.Request(ctx, http.MethodPatch, fmt.Sprintf("/api/v2/organizations/%s/settings/idpsync/roles", orgID), req) |
| 135 | if err != nil { |
| 136 | return RoleSyncSettings{}, xerrors.Errorf("make request: %w", err) |
| 137 | } |
| 138 | defer res.Body.Close() |
| 139 | |
| 140 | if res.StatusCode != http.StatusOK { |
| 141 | return RoleSyncSettings{}, ReadBodyAsError(res) |
| 142 | } |
| 143 | var resp RoleSyncSettings |
| 144 | return resp, json.NewDecoder(res.Body).Decode(&resp) |
| 145 | } |
| 146 | |
| 147 | type PatchRoleIDPSyncConfigRequest struct { |
| 148 | Field string `json:"field"` |