From 526d6b0a12f3edb0dadf38f2d78c0238fba097ff Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Thu, 23 Mar 2023 22:02:39 +0800 Subject: [PATCH 1/2] chore: update generated api spec --- api/beta.yaml | 592 ++++++++++++++++++- pkg/api/client.gen.go | 1248 ++++++++++++++++++++++++++++++++++++++++- pkg/api/types.gen.go | 231 +++++++- 3 files changed, 2041 insertions(+), 30 deletions(-) diff --git a/api/beta.yaml b/api/beta.yaml index 34effd603..f1f74615a 100644 --- a/api/beta.yaml +++ b/api/beta.yaml @@ -1002,6 +1002,280 @@ paths: description: Failed to activate project vanity subdomain configuration tags: *ref_24 security: *ref_25 + /v1/projects/{ref}/upgrade: + post: + operationId: upgradeProject + summary: Upgrades the project's Postgres version + parameters: + - name: ref + required: true + in: path + description: Project ref + schema: + minLength: 20 + maxLength: 20 + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpgradeDatabaseBody' + responses: + '201': + description: '' + '403': + description: '' + '500': + description: Failed to initiate project upgrade + tags: &ref_26 + - database version upgrade (beta) + security: &ref_27 + - bearer: [] + /v1/projects/{ref}/upgrade/eligibility: + get: + operationId: upgradeEligibilityInformation + summary: Returns the project's eligibility for upgrades + parameters: + - name: ref + required: true + in: path + description: Project ref + schema: + minLength: 20 + maxLength: 20 + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectUpgradeEligibilityResponse' + '403': + description: '' + '500': + description: Failed to determine project upgrade eligibility + tags: *ref_26 + security: *ref_27 + /v1/projects/{ref}/upgrade/status: + get: + operationId: getUpgradeStatus + summary: Gets the latest status of the project's upgrade + parameters: + - name: ref + required: true + in: path + description: Project ref + schema: + minLength: 20 + maxLength: 20 + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/DatabaseUpgradeStatusResponse' + '403': + description: '' + '500': + description: Failed to retrieve project upgrade status + tags: *ref_26 + security: *ref_27 + /v1/projects/{ref}/readonly: + get: + operationId: getReadOnlyModeStatus + summary: Returns project's readonly mode status + parameters: + - name: ref + required: true + in: path + description: Project ref + schema: + minLength: 20 + maxLength: 20 + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ReadOnlyStatusResponse' + '500': + description: Failed to get project readonly mode status + tags: &ref_28 + - database readonly mode + security: &ref_29 + - bearer: [] + /v1/projects/{ref}/readonly/temporary-disable: + post: + operationId: temporarilyDisableReadonlyMode + summary: Disables project's readonly mode for the next 15 minutes + parameters: + - name: ref + required: true + in: path + description: Project ref + schema: + minLength: 20 + maxLength: 20 + type: string + responses: + '201': + description: '' + '500': + description: Failed to disable project's readonly mode + tags: *ref_28 + security: *ref_29 + /v1/projects/{ref}/config/auth/sso/providers/{provider_id}: + get: + operationId: getProviderById + summary: Gets a SSO provider by its UUID + parameters: + - name: ref + required: true + in: path + description: Project ref + schema: + minLength: 20 + maxLength: 20 + type: string + - name: provider_id + required: true + in: path + schema: + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/GetProviderResponse' + '403': + description: '' + tags: &ref_30 + - sso + security: &ref_31 + - bearer: [] + put: + operationId: updateProviderById + summary: Updates a SSO provider by its UUID + parameters: + - name: ref + required: true + in: path + description: Project ref + schema: + minLength: 20 + maxLength: 20 + type: string + - name: provider_id + required: true + in: path + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateProviderBody' + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateProviderResponse' + '403': + description: '' + tags: *ref_30 + security: *ref_31 + delete: + operationId: removeProviderById + summary: Removes a SSO provider by its UUID + parameters: + - name: ref + required: true + in: path + description: Project ref + schema: + minLength: 20 + maxLength: 20 + type: string + - name: provider_id + required: true + in: path + schema: + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteProviderResponse' + '403': + description: '' + tags: *ref_30 + security: *ref_31 + /v1/projects/{ref}/config/auth/sso/providers: + post: + operationId: createProviderForProject + summary: Creates a new SSO provider + parameters: + - name: ref + required: true + in: path + description: Project ref + schema: + minLength: 20 + maxLength: 20 + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateProviderBody' + responses: + '201': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/CreateProviderResponse' + '403': + description: '' + tags: *ref_30 + security: *ref_31 + get: + operationId: listAllProviders + summary: Lists all SSO providers + parameters: + - name: ref + required: true + in: path + description: Project ref + schema: + minLength: 20 + maxLength: 20 + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ListProvidersResponse' + '403': + description: '' + tags: *ref_30 + security: *ref_31 info: title: Supabase API (v1) description: '' @@ -1070,6 +1344,7 @@ components: enum: - us-east-1 - us-west-1 + - us-west-2 - ap-southeast-1 - ap-northeast-1 - ap-northeast-2 @@ -1081,6 +1356,38 @@ components: - ca-central-1 - ap-south-1 - sa-east-1 + - ams + - arn + - bog + - bos + - cdg + - den + - dfw + - ewr + - fra + - gdl + - gig + - gru + - hkg + - iad + - jnb + - lax + - lhr + - maa + - mad + - mia + - nrt + - ord + - otp + - qro + - scl + - sea + - sin + - sjc + - syd + - waw + - yul + - yyz kps_enabled: type: boolean required: @@ -1132,7 +1439,7 @@ components: name: type: string status: - enum: &ref_26 + enum: &ref_32 - ACTIVE - REMOVED - THROTTLED @@ -1165,7 +1472,7 @@ components: name: type: string status: - enum: *ref_26 + enum: *ref_32 type: string version: type: number @@ -1177,8 +1484,6 @@ components: type: boolean import_map: type: boolean - body: - type: string required: - id - slug @@ -1259,6 +1564,8 @@ components: type: string config: $ref: '#/components/schemas/NetworkRestrictionsRequest' + old_config: + $ref: '#/components/schemas/NetworkRestrictionsRequest' status: enum: - stored @@ -1362,11 +1669,11 @@ components: type: object properties: status: - type: string enum: - not-used - custom-domain-used - active + type: string custom_domain: type: string required: @@ -1392,3 +1699,278 @@ components: type: string required: - custom_domain + UpgradeDatabaseBody: + type: object + properties: + target_version: + type: number + required: + - target_version + ProjectVersion: + type: object + properties: + postgres_version: + type: number + app_version: + type: string + required: + - postgres_version + - app_version + ProjectUpgradeEligibilityResponse: + type: object + properties: + eligible: + type: boolean + current_app_version: + type: string + latest_app_version: + type: string + target_upgrade_versions: + type: array + items: + $ref: '#/components/schemas/ProjectVersion' + requires_manual_intervention: + type: string + nullable: true + potential_breaking_changes: + type: array + items: + type: string + required: + - eligible + - current_app_version + - latest_app_version + - target_upgrade_versions + - requires_manual_intervention + - potential_breaking_changes + DatabaseUpgradeStatus: + type: object + properties: + initiated_at: + type: string + target_version: + type: number + error: + enum: + - 1_upgraded_instance_launch_failed + - 2_volume_detachchment_from_upgraded_instance_failed + - 3_volume_attachment_to_original_instance_failed + - 4_data_upgrade_initiation_failed + - 5_data_upgrade_completion_failed + - 6_volume_detachchment_from_original_instance_failed + - 7_volume_attachment_to_upgraded_instance_failed + - 8_upgrade_completion_failed + type: string + progress: + enum: + - 1_started + - 2_launched_upgraded_instance + - 3_detached_volume_from_upgraded_instance + - 4_attached_volume_to_original_instance + - 5_initiated_data_upgrade + - 6_completed_data_upgrade + - 7_detached_volume_from_original_instance + - 8_attached_volume_to_upgraded_instance + - 9_completed_upgrade + type: string + status: + enum: + - 0 + - 1 + - 2 + type: number + required: + - initiated_at + - target_version + - status + DatabaseUpgradeStatusResponse: + type: object + properties: + databaseUpgradeStatus: + nullable: true + allOf: + - $ref: '#/components/schemas/DatabaseUpgradeStatus' + required: + - databaseUpgradeStatus + ReadOnlyStatusResponse: + type: object + properties: + enabled: + type: boolean + override_enabled: + type: boolean + override_active_until: + type: string + required: + - enabled + - override_enabled + - override_active_until + AttributeValue: + type: object + properties: + name: + type: string + names: + type: array + items: + type: string + default: + type: object + AttributeMapping: + type: object + properties: + keys: + type: object + additionalProperties: + $ref: '#/components/schemas/AttributeValue' + required: + - keys + SamlDescriptor: + type: object + properties: + metadata_url: + type: string + metadata_xml: + type: string + attribute_mapping: + $ref: '#/components/schemas/AttributeMapping' + Domain: + type: object + properties: + id: + type: string + domain: + type: string + created_at: + type: string + updated_at: + type: string + required: + - id + GetProviderResponse: + type: object + properties: + id: + type: string + saml: + $ref: '#/components/schemas/SamlDescriptor' + domains: + type: array + items: + $ref: '#/components/schemas/Domain' + created_at: + type: string + updated_at: + type: string + required: + - id + UpdateProviderBody: + type: object + properties: + metadata_xml: + type: string + metadata_url: + type: string + domains: + type: array + items: + type: string + attribute_mapping: + $ref: '#/components/schemas/AttributeMapping' + UpdateProviderResponse: + type: object + properties: + id: + type: string + saml: + $ref: '#/components/schemas/SamlDescriptor' + domains: + type: array + items: + $ref: '#/components/schemas/Domain' + created_at: + type: string + updated_at: + type: string + required: + - id + DeleteProviderResponse: + type: object + properties: + id: + type: string + saml: + $ref: '#/components/schemas/SamlDescriptor' + domains: + type: array + items: + $ref: '#/components/schemas/Domain' + created_at: + type: string + updated_at: + type: string + required: + - id + CreateProviderBody: + type: object + properties: + type: + type: string + enum: + - saml + description: What type of provider will be created + metadata_xml: + type: string + metadata_url: + type: string + domains: + type: array + items: + type: string + attribute_mapping: + $ref: '#/components/schemas/AttributeMapping' + required: + - type + CreateProviderResponse: + type: object + properties: + id: + type: string + saml: + $ref: '#/components/schemas/SamlDescriptor' + domains: + type: array + items: + $ref: '#/components/schemas/Domain' + created_at: + type: string + updated_at: + type: string + required: + - id + Provider: + type: object + properties: + id: + type: string + saml: + $ref: '#/components/schemas/SamlDescriptor' + domains: + type: array + items: + $ref: '#/components/schemas/Domain' + created_at: + type: string + updated_at: + type: string + required: + - id + ListProvidersResponse: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/Provider' + required: + - items diff --git a/pkg/api/client.gen.go b/pkg/api/client.gen.go index e197c1dd9..9d6f0be10 100644 --- a/pkg/api/client.gen.go +++ b/pkg/api/client.gen.go @@ -105,6 +105,25 @@ type ClientInterface interface { CreateProject(ctx context.Context, body CreateProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // ListAllProviders request + ListAllProviders(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateProviderForProject request with any body + CreateProviderForProjectWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreateProviderForProject(ctx context.Context, ref string, body CreateProviderForProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RemoveProviderById request + RemoveProviderById(ctx context.Context, ref string, providerId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetProviderById request + GetProviderById(ctx context.Context, ref string, providerId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdateProviderById request with any body + UpdateProviderByIdWithBody(ctx context.Context, ref string, providerId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + UpdateProviderById(ctx context.Context, ref string, providerId string, body UpdateProviderByIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // RemoveCustomHostnameConfig request RemoveCustomHostnameConfig(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -176,6 +195,12 @@ type ClientInterface interface { UpdatePostgRESTConfig(ctx context.Context, ref string, body UpdatePostgRESTConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetReadOnlyModeStatus request + GetReadOnlyModeStatus(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // TemporarilyDisableReadonlyMode request + TemporarilyDisableReadonlyMode(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + // DeleteSecrets request with any body DeleteSecretsWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -200,6 +225,17 @@ type ClientInterface interface { // GetTypescriptTypes request GetTypescriptTypes(ctx context.Context, ref string, params *GetTypescriptTypesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // UpgradeProject request with any body + UpgradeProjectWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + UpgradeProject(ctx context.Context, ref string, body UpgradeProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpgradeEligibilityInformation request + UpgradeEligibilityInformation(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetUpgradeStatus request + GetUpgradeStatus(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) + // RemoveVanitySubdomainConfig request RemoveVanitySubdomainConfig(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -289,6 +325,90 @@ func (c *Client) CreateProject(ctx context.Context, body CreateProjectJSONReques return c.Client.Do(req) } +func (c *Client) ListAllProviders(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListAllProvidersRequest(c.Server, ref) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateProviderForProjectWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateProviderForProjectRequestWithBody(c.Server, ref, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateProviderForProject(ctx context.Context, ref string, body CreateProviderForProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateProviderForProjectRequest(c.Server, ref, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) RemoveProviderById(ctx context.Context, ref string, providerId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRemoveProviderByIdRequest(c.Server, ref, providerId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetProviderById(ctx context.Context, ref string, providerId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetProviderByIdRequest(c.Server, ref, providerId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdateProviderByIdWithBody(ctx context.Context, ref string, providerId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateProviderByIdRequestWithBody(c.Server, ref, providerId, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdateProviderById(ctx context.Context, ref string, providerId string, body UpdateProviderByIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateProviderByIdRequest(c.Server, ref, providerId, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) RemoveCustomHostnameConfig(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewRemoveCustomHostnameConfigRequest(c.Server, ref) if err != nil { @@ -601,6 +721,30 @@ func (c *Client) UpdatePostgRESTConfig(ctx context.Context, ref string, body Upd return c.Client.Do(req) } +func (c *Client) GetReadOnlyModeStatus(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetReadOnlyModeStatusRequest(c.Server, ref) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) TemporarilyDisableReadonlyMode(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewTemporarilyDisableReadonlyModeRequest(c.Server, ref) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) DeleteSecretsWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteSecretsRequestWithBody(c.Server, ref, contentType, body) if err != nil { @@ -709,6 +853,54 @@ func (c *Client) GetTypescriptTypes(ctx context.Context, ref string, params *Get return c.Client.Do(req) } +func (c *Client) UpgradeProjectWithBody(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpgradeProjectRequestWithBody(c.Server, ref, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpgradeProject(ctx context.Context, ref string, body UpgradeProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpgradeProjectRequest(c.Server, ref, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpgradeEligibilityInformation(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpgradeEligibilityInformationRequest(c.Server, ref) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetUpgradeStatus(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetUpgradeStatusRequest(c.Server, ref) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) RemoveVanitySubdomainConfig(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewRemoveVanitySubdomainConfigRequest(c.Server, ref) if err != nil { @@ -915,6 +1107,223 @@ func NewCreateProjectRequestWithBody(server string, contentType string, body io. return req, nil } +// NewListAllProvidersRequest generates requests for ListAllProviders +func NewListAllProvidersRequest(server string, ref string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/config/auth/sso/providers", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewCreateProviderForProjectRequest calls the generic CreateProviderForProject builder with application/json body +func NewCreateProviderForProjectRequest(server string, ref string, body CreateProviderForProjectJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateProviderForProjectRequestWithBody(server, ref, "application/json", bodyReader) +} + +// NewCreateProviderForProjectRequestWithBody generates requests for CreateProviderForProject with any type of body +func NewCreateProviderForProjectRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/config/auth/sso/providers", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewRemoveProviderByIdRequest generates requests for RemoveProviderById +func NewRemoveProviderByIdRequest(server string, ref string, providerId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "provider_id", runtime.ParamLocationPath, providerId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/config/auth/sso/providers/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetProviderByIdRequest generates requests for GetProviderById +func NewGetProviderByIdRequest(server string, ref string, providerId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "provider_id", runtime.ParamLocationPath, providerId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/config/auth/sso/providers/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewUpdateProviderByIdRequest calls the generic UpdateProviderById builder with application/json body +func NewUpdateProviderByIdRequest(server string, ref string, providerId string, body UpdateProviderByIdJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdateProviderByIdRequestWithBody(server, ref, providerId, "application/json", bodyReader) +} + +// NewUpdateProviderByIdRequestWithBody generates requests for UpdateProviderById with any type of body +func NewUpdateProviderByIdRequestWithBody(server string, ref string, providerId string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "provider_id", runtime.ParamLocationPath, providerId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/config/auth/sso/providers/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PUT", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + // NewRemoveCustomHostnameConfigRequest generates requests for RemoveCustomHostnameConfig func NewRemoveCustomHostnameConfigRequest(server string, ref string) (*http.Request, error) { var err error @@ -1816,6 +2225,74 @@ func NewUpdatePostgRESTConfigRequestWithBody(server string, ref string, contentT return req, nil } +// NewGetReadOnlyModeStatusRequest generates requests for GetReadOnlyModeStatus +func NewGetReadOnlyModeStatusRequest(server string, ref string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/readonly", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewTemporarilyDisableReadonlyModeRequest generates requests for TemporarilyDisableReadonlyMode +func NewTemporarilyDisableReadonlyModeRequest(server string, ref string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/readonly/temporary-disable", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + // NewDeleteSecretsRequest calls the generic DeleteSecrets builder with application/json body func NewDeleteSecretsRequest(server string, ref string, body DeleteSecretsJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader @@ -2069,7 +2546,122 @@ func NewGetTypescriptTypesRequest(server string, ref string, params *GetTypescri } - queryURL.RawQuery = queryValues.Encode() + queryURL.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewUpgradeProjectRequest calls the generic UpgradeProject builder with application/json body +func NewUpgradeProjectRequest(server string, ref string, body UpgradeProjectJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpgradeProjectRequestWithBody(server, ref, "application/json", bodyReader) +} + +// NewUpgradeProjectRequestWithBody generates requests for UpgradeProject with any type of body +func NewUpgradeProjectRequestWithBody(server string, ref string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/upgrade", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewUpgradeEligibilityInformationRequest generates requests for UpgradeEligibilityInformation +func NewUpgradeEligibilityInformationRequest(server string, ref string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/upgrade/eligibility", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetUpgradeStatusRequest generates requests for GetUpgradeStatus +func NewGetUpgradeStatusRequest(server string, ref string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ref", runtime.ParamLocationPath, ref) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/projects/%s/upgrade/status", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { @@ -2300,6 +2892,25 @@ type ClientWithResponsesInterface interface { CreateProjectWithResponse(ctx context.Context, body CreateProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateProjectResponse, error) + // ListAllProviders request + ListAllProvidersWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*ListAllProvidersResponse, error) + + // CreateProviderForProject request with any body + CreateProviderForProjectWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateProviderForProjectResponse, error) + + CreateProviderForProjectWithResponse(ctx context.Context, ref string, body CreateProviderForProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateProviderForProjectResponse, error) + + // RemoveProviderById request + RemoveProviderByIdWithResponse(ctx context.Context, ref string, providerId string, reqEditors ...RequestEditorFn) (*RemoveProviderByIdResponse, error) + + // GetProviderById request + GetProviderByIdWithResponse(ctx context.Context, ref string, providerId string, reqEditors ...RequestEditorFn) (*GetProviderByIdResponse, error) + + // UpdateProviderById request with any body + UpdateProviderByIdWithBodyWithResponse(ctx context.Context, ref string, providerId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateProviderByIdResponse, error) + + UpdateProviderByIdWithResponse(ctx context.Context, ref string, providerId string, body UpdateProviderByIdJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateProviderByIdResponse, error) + // RemoveCustomHostnameConfig request RemoveCustomHostnameConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*RemoveCustomHostnameConfigResponse, error) @@ -2371,6 +2982,12 @@ type ClientWithResponsesInterface interface { UpdatePostgRESTConfigWithResponse(ctx context.Context, ref string, body UpdatePostgRESTConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePostgRESTConfigResponse, error) + // GetReadOnlyModeStatus request + GetReadOnlyModeStatusWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetReadOnlyModeStatusResponse, error) + + // TemporarilyDisableReadonlyMode request + TemporarilyDisableReadonlyModeWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*TemporarilyDisableReadonlyModeResponse, error) + // DeleteSecrets request with any body DeleteSecretsWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeleteSecretsResponse, error) @@ -2395,6 +3012,17 @@ type ClientWithResponsesInterface interface { // GetTypescriptTypes request GetTypescriptTypesWithResponse(ctx context.Context, ref string, params *GetTypescriptTypesParams, reqEditors ...RequestEditorFn) (*GetTypescriptTypesResponse, error) + // UpgradeProject request with any body + UpgradeProjectWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpgradeProjectResponse, error) + + UpgradeProjectWithResponse(ctx context.Context, ref string, body UpgradeProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*UpgradeProjectResponse, error) + + // UpgradeEligibilityInformation request + UpgradeEligibilityInformationWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*UpgradeEligibilityInformationResponse, error) + + // GetUpgradeStatus request + GetUpgradeStatusWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetUpgradeStatusResponse, error) + // RemoveVanitySubdomainConfig request RemoveVanitySubdomainConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*RemoveVanitySubdomainConfigResponse, error) @@ -2500,6 +3128,116 @@ func (r CreateProjectResponse) StatusCode() int { return 0 } +type ListAllProvidersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ListProvidersResponse +} + +// Status returns HTTPResponse.Status +func (r ListAllProvidersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListAllProvidersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateProviderForProjectResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *CreateProviderResponse +} + +// Status returns HTTPResponse.Status +func (r CreateProviderForProjectResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateProviderForProjectResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type RemoveProviderByIdResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *DeleteProviderResponse +} + +// Status returns HTTPResponse.Status +func (r RemoveProviderByIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RemoveProviderByIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetProviderByIdResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *GetProviderResponse +} + +// Status returns HTTPResponse.Status +func (r GetProviderByIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetProviderByIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdateProviderByIdResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *UpdateProviderResponse +} + +// Status returns HTTPResponse.Status +func (r UpdateProviderByIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateProviderByIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type RemoveCustomHostnameConfigResponse struct { Body []byte HTTPResponse *http.Response @@ -2914,6 +3652,49 @@ func (r UpdatePostgRESTConfigResponse) StatusCode() int { return 0 } +type GetReadOnlyModeStatusResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ReadOnlyStatusResponse +} + +// Status returns HTTPResponse.Status +func (r GetReadOnlyModeStatusResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetReadOnlyModeStatusResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type TemporarilyDisableReadonlyModeResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r TemporarilyDisableReadonlyModeResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r TemporarilyDisableReadonlyModeResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type DeleteSecretsResponse struct { Body []byte HTTPResponse *http.Response @@ -3045,6 +3826,71 @@ func (r GetTypescriptTypesResponse) StatusCode() int { return 0 } +type UpgradeProjectResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r UpgradeProjectResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpgradeProjectResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpgradeEligibilityInformationResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ProjectUpgradeEligibilityResponse +} + +// Status returns HTTPResponse.Status +func (r UpgradeEligibilityInformationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpgradeEligibilityInformationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetUpgradeStatusResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *DatabaseUpgradeStatusResponse +} + +// Status returns HTTPResponse.Status +func (r GetUpgradeStatusResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetUpgradeStatusResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type RemoveVanitySubdomainConfigResponse struct { Body []byte HTTPResponse *http.Response @@ -3129,59 +3975,120 @@ func (r CheckVanitySubdomainAvailabilityResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } - return 0 + return 0 +} + +// GetOrganizationsWithResponse request returning *GetOrganizationsResponse +func (c *ClientWithResponses) GetOrganizationsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetOrganizationsResponse, error) { + rsp, err := c.GetOrganizations(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetOrganizationsResponse(rsp) +} + +// CreateOrganizationWithBodyWithResponse request with arbitrary body returning *CreateOrganizationResponse +func (c *ClientWithResponses) CreateOrganizationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOrganizationResponse, error) { + rsp, err := c.CreateOrganizationWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateOrganizationResponse(rsp) +} + +func (c *ClientWithResponses) CreateOrganizationWithResponse(ctx context.Context, body CreateOrganizationJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOrganizationResponse, error) { + rsp, err := c.CreateOrganization(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateOrganizationResponse(rsp) +} + +// GetProjectsWithResponse request returning *GetProjectsResponse +func (c *ClientWithResponses) GetProjectsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetProjectsResponse, error) { + rsp, err := c.GetProjects(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetProjectsResponse(rsp) +} + +// CreateProjectWithBodyWithResponse request with arbitrary body returning *CreateProjectResponse +func (c *ClientWithResponses) CreateProjectWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateProjectResponse, error) { + rsp, err := c.CreateProjectWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateProjectResponse(rsp) +} + +func (c *ClientWithResponses) CreateProjectWithResponse(ctx context.Context, body CreateProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateProjectResponse, error) { + rsp, err := c.CreateProject(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateProjectResponse(rsp) +} + +// ListAllProvidersWithResponse request returning *ListAllProvidersResponse +func (c *ClientWithResponses) ListAllProvidersWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*ListAllProvidersResponse, error) { + rsp, err := c.ListAllProviders(ctx, ref, reqEditors...) + if err != nil { + return nil, err + } + return ParseListAllProvidersResponse(rsp) } -// GetOrganizationsWithResponse request returning *GetOrganizationsResponse -func (c *ClientWithResponses) GetOrganizationsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetOrganizationsResponse, error) { - rsp, err := c.GetOrganizations(ctx, reqEditors...) +// CreateProviderForProjectWithBodyWithResponse request with arbitrary body returning *CreateProviderForProjectResponse +func (c *ClientWithResponses) CreateProviderForProjectWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateProviderForProjectResponse, error) { + rsp, err := c.CreateProviderForProjectWithBody(ctx, ref, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseGetOrganizationsResponse(rsp) + return ParseCreateProviderForProjectResponse(rsp) } -// CreateOrganizationWithBodyWithResponse request with arbitrary body returning *CreateOrganizationResponse -func (c *ClientWithResponses) CreateOrganizationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOrganizationResponse, error) { - rsp, err := c.CreateOrganizationWithBody(ctx, contentType, body, reqEditors...) +func (c *ClientWithResponses) CreateProviderForProjectWithResponse(ctx context.Context, ref string, body CreateProviderForProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateProviderForProjectResponse, error) { + rsp, err := c.CreateProviderForProject(ctx, ref, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateOrganizationResponse(rsp) + return ParseCreateProviderForProjectResponse(rsp) } -func (c *ClientWithResponses) CreateOrganizationWithResponse(ctx context.Context, body CreateOrganizationJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOrganizationResponse, error) { - rsp, err := c.CreateOrganization(ctx, body, reqEditors...) +// RemoveProviderByIdWithResponse request returning *RemoveProviderByIdResponse +func (c *ClientWithResponses) RemoveProviderByIdWithResponse(ctx context.Context, ref string, providerId string, reqEditors ...RequestEditorFn) (*RemoveProviderByIdResponse, error) { + rsp, err := c.RemoveProviderById(ctx, ref, providerId, reqEditors...) if err != nil { return nil, err } - return ParseCreateOrganizationResponse(rsp) + return ParseRemoveProviderByIdResponse(rsp) } -// GetProjectsWithResponse request returning *GetProjectsResponse -func (c *ClientWithResponses) GetProjectsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetProjectsResponse, error) { - rsp, err := c.GetProjects(ctx, reqEditors...) +// GetProviderByIdWithResponse request returning *GetProviderByIdResponse +func (c *ClientWithResponses) GetProviderByIdWithResponse(ctx context.Context, ref string, providerId string, reqEditors ...RequestEditorFn) (*GetProviderByIdResponse, error) { + rsp, err := c.GetProviderById(ctx, ref, providerId, reqEditors...) if err != nil { return nil, err } - return ParseGetProjectsResponse(rsp) + return ParseGetProviderByIdResponse(rsp) } -// CreateProjectWithBodyWithResponse request with arbitrary body returning *CreateProjectResponse -func (c *ClientWithResponses) CreateProjectWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateProjectResponse, error) { - rsp, err := c.CreateProjectWithBody(ctx, contentType, body, reqEditors...) +// UpdateProviderByIdWithBodyWithResponse request with arbitrary body returning *UpdateProviderByIdResponse +func (c *ClientWithResponses) UpdateProviderByIdWithBodyWithResponse(ctx context.Context, ref string, providerId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateProviderByIdResponse, error) { + rsp, err := c.UpdateProviderByIdWithBody(ctx, ref, providerId, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateProjectResponse(rsp) + return ParseUpdateProviderByIdResponse(rsp) } -func (c *ClientWithResponses) CreateProjectWithResponse(ctx context.Context, body CreateProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateProjectResponse, error) { - rsp, err := c.CreateProject(ctx, body, reqEditors...) +func (c *ClientWithResponses) UpdateProviderByIdWithResponse(ctx context.Context, ref string, providerId string, body UpdateProviderByIdJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateProviderByIdResponse, error) { + rsp, err := c.UpdateProviderById(ctx, ref, providerId, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateProjectResponse(rsp) + return ParseUpdateProviderByIdResponse(rsp) } // RemoveCustomHostnameConfigWithResponse request returning *RemoveCustomHostnameConfigResponse @@ -3411,6 +4318,24 @@ func (c *ClientWithResponses) UpdatePostgRESTConfigWithResponse(ctx context.Cont return ParseUpdatePostgRESTConfigResponse(rsp) } +// GetReadOnlyModeStatusWithResponse request returning *GetReadOnlyModeStatusResponse +func (c *ClientWithResponses) GetReadOnlyModeStatusWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetReadOnlyModeStatusResponse, error) { + rsp, err := c.GetReadOnlyModeStatus(ctx, ref, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetReadOnlyModeStatusResponse(rsp) +} + +// TemporarilyDisableReadonlyModeWithResponse request returning *TemporarilyDisableReadonlyModeResponse +func (c *ClientWithResponses) TemporarilyDisableReadonlyModeWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*TemporarilyDisableReadonlyModeResponse, error) { + rsp, err := c.TemporarilyDisableReadonlyMode(ctx, ref, reqEditors...) + if err != nil { + return nil, err + } + return ParseTemporarilyDisableReadonlyModeResponse(rsp) +} + // DeleteSecretsWithBodyWithResponse request with arbitrary body returning *DeleteSecretsResponse func (c *ClientWithResponses) DeleteSecretsWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeleteSecretsResponse, error) { rsp, err := c.DeleteSecretsWithBody(ctx, ref, contentType, body, reqEditors...) @@ -3489,6 +4414,41 @@ func (c *ClientWithResponses) GetTypescriptTypesWithResponse(ctx context.Context return ParseGetTypescriptTypesResponse(rsp) } +// UpgradeProjectWithBodyWithResponse request with arbitrary body returning *UpgradeProjectResponse +func (c *ClientWithResponses) UpgradeProjectWithBodyWithResponse(ctx context.Context, ref string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpgradeProjectResponse, error) { + rsp, err := c.UpgradeProjectWithBody(ctx, ref, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpgradeProjectResponse(rsp) +} + +func (c *ClientWithResponses) UpgradeProjectWithResponse(ctx context.Context, ref string, body UpgradeProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*UpgradeProjectResponse, error) { + rsp, err := c.UpgradeProject(ctx, ref, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpgradeProjectResponse(rsp) +} + +// UpgradeEligibilityInformationWithResponse request returning *UpgradeEligibilityInformationResponse +func (c *ClientWithResponses) UpgradeEligibilityInformationWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*UpgradeEligibilityInformationResponse, error) { + rsp, err := c.UpgradeEligibilityInformation(ctx, ref, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpgradeEligibilityInformationResponse(rsp) +} + +// GetUpgradeStatusWithResponse request returning *GetUpgradeStatusResponse +func (c *ClientWithResponses) GetUpgradeStatusWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*GetUpgradeStatusResponse, error) { + rsp, err := c.GetUpgradeStatus(ctx, ref, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetUpgradeStatusResponse(rsp) +} + // RemoveVanitySubdomainConfigWithResponse request returning *RemoveVanitySubdomainConfigResponse func (c *ClientWithResponses) RemoveVanitySubdomainConfigWithResponse(ctx context.Context, ref string, reqEditors ...RequestEditorFn) (*RemoveVanitySubdomainConfigResponse, error) { rsp, err := c.RemoveVanitySubdomainConfig(ctx, ref, reqEditors...) @@ -3645,6 +4605,136 @@ func ParseCreateProjectResponse(rsp *http.Response) (*CreateProjectResponse, err return response, nil } +// ParseListAllProvidersResponse parses an HTTP response from a ListAllProvidersWithResponse call +func ParseListAllProvidersResponse(rsp *http.Response) (*ListAllProvidersResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ListAllProvidersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ListProvidersResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseCreateProviderForProjectResponse parses an HTTP response from a CreateProviderForProjectWithResponse call +func ParseCreateProviderForProjectResponse(rsp *http.Response) (*CreateProviderForProjectResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &CreateProviderForProjectResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest CreateProviderResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + } + + return response, nil +} + +// ParseRemoveProviderByIdResponse parses an HTTP response from a RemoveProviderByIdWithResponse call +func ParseRemoveProviderByIdResponse(rsp *http.Response) (*RemoveProviderByIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &RemoveProviderByIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest DeleteProviderResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseGetProviderByIdResponse parses an HTTP response from a GetProviderByIdWithResponse call +func ParseGetProviderByIdResponse(rsp *http.Response) (*GetProviderByIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetProviderByIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest GetProviderResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseUpdateProviderByIdResponse parses an HTTP response from a UpdateProviderByIdWithResponse call +func ParseUpdateProviderByIdResponse(rsp *http.Response) (*UpdateProviderByIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &UpdateProviderByIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest UpdateProviderResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + // ParseRemoveCustomHostnameConfigResponse parses an HTTP response from a RemoveCustomHostnameConfigWithResponse call func ParseRemoveCustomHostnameConfigResponse(rsp *http.Response) (*RemoveCustomHostnameConfigResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) @@ -4099,6 +5189,48 @@ func ParseUpdatePostgRESTConfigResponse(rsp *http.Response) (*UpdatePostgRESTCon return response, nil } +// ParseGetReadOnlyModeStatusResponse parses an HTTP response from a GetReadOnlyModeStatusWithResponse call +func ParseGetReadOnlyModeStatusResponse(rsp *http.Response) (*GetReadOnlyModeStatusResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetReadOnlyModeStatusResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ReadOnlyStatusResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseTemporarilyDisableReadonlyModeResponse parses an HTTP response from a TemporarilyDisableReadonlyModeWithResponse call +func ParseTemporarilyDisableReadonlyModeResponse(rsp *http.Response) (*TemporarilyDisableReadonlyModeResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &TemporarilyDisableReadonlyModeResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + // ParseDeleteSecretsResponse parses an HTTP response from a DeleteSecretsWithResponse call func ParseDeleteSecretsResponse(rsp *http.Response) (*DeleteSecretsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) @@ -4245,6 +5377,74 @@ func ParseGetTypescriptTypesResponse(rsp *http.Response) (*GetTypescriptTypesRes return response, nil } +// ParseUpgradeProjectResponse parses an HTTP response from a UpgradeProjectWithResponse call +func ParseUpgradeProjectResponse(rsp *http.Response) (*UpgradeProjectResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &UpgradeProjectResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseUpgradeEligibilityInformationResponse parses an HTTP response from a UpgradeEligibilityInformationWithResponse call +func ParseUpgradeEligibilityInformationResponse(rsp *http.Response) (*UpgradeEligibilityInformationResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &UpgradeEligibilityInformationResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ProjectUpgradeEligibilityResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseGetUpgradeStatusResponse parses an HTTP response from a GetUpgradeStatusWithResponse call +func ParseGetUpgradeStatusResponse(rsp *http.Response) (*GetUpgradeStatusResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetUpgradeStatusResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest DatabaseUpgradeStatusResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + // ParseRemoveVanitySubdomainConfigResponse parses an HTTP response from a RemoveVanitySubdomainConfigWithResponse call func ParseRemoveVanitySubdomainConfigResponse(rsp *http.Response) (*RemoveVanitySubdomainConfigResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) diff --git a/pkg/api/types.gen.go b/pkg/api/types.gen.go index 562ddc4c1..6a3ff9ee8 100644 --- a/pkg/api/types.gen.go +++ b/pkg/api/types.gen.go @@ -17,19 +17,89 @@ const ( // Defines values for CreateProjectBodyRegion. const ( + Ams CreateProjectBodyRegion = "ams" ApNortheast1 CreateProjectBodyRegion = "ap-northeast-1" ApNortheast2 CreateProjectBodyRegion = "ap-northeast-2" ApSouth1 CreateProjectBodyRegion = "ap-south-1" ApSoutheast1 CreateProjectBodyRegion = "ap-southeast-1" ApSoutheast2 CreateProjectBodyRegion = "ap-southeast-2" + Arn CreateProjectBodyRegion = "arn" + Bog CreateProjectBodyRegion = "bog" + Bos CreateProjectBodyRegion = "bos" CaCentral1 CreateProjectBodyRegion = "ca-central-1" + Cdg CreateProjectBodyRegion = "cdg" + Den CreateProjectBodyRegion = "den" + Dfw CreateProjectBodyRegion = "dfw" EuCentral1 CreateProjectBodyRegion = "eu-central-1" EuWest1 CreateProjectBodyRegion = "eu-west-1" EuWest2 CreateProjectBodyRegion = "eu-west-2" EuWest3 CreateProjectBodyRegion = "eu-west-3" + Ewr CreateProjectBodyRegion = "ewr" + Fra CreateProjectBodyRegion = "fra" + Gdl CreateProjectBodyRegion = "gdl" + Gig CreateProjectBodyRegion = "gig" + Gru CreateProjectBodyRegion = "gru" + Hkg CreateProjectBodyRegion = "hkg" + Iad CreateProjectBodyRegion = "iad" + Jnb CreateProjectBodyRegion = "jnb" + Lax CreateProjectBodyRegion = "lax" + Lhr CreateProjectBodyRegion = "lhr" + Maa CreateProjectBodyRegion = "maa" + Mad CreateProjectBodyRegion = "mad" + Mia CreateProjectBodyRegion = "mia" + Nrt CreateProjectBodyRegion = "nrt" + Ord CreateProjectBodyRegion = "ord" + Otp CreateProjectBodyRegion = "otp" + Qro CreateProjectBodyRegion = "qro" SaEast1 CreateProjectBodyRegion = "sa-east-1" + Scl CreateProjectBodyRegion = "scl" + Sea CreateProjectBodyRegion = "sea" + Sin CreateProjectBodyRegion = "sin" + Sjc CreateProjectBodyRegion = "sjc" + Syd CreateProjectBodyRegion = "syd" UsEast1 CreateProjectBodyRegion = "us-east-1" UsWest1 CreateProjectBodyRegion = "us-west-1" + UsWest2 CreateProjectBodyRegion = "us-west-2" + Waw CreateProjectBodyRegion = "waw" + Yul CreateProjectBodyRegion = "yul" + Yyz CreateProjectBodyRegion = "yyz" +) + +// Defines values for CreateProviderBodyType. +const ( + Saml CreateProviderBodyType = "saml" +) + +// Defines values for DatabaseUpgradeStatusError. +const ( + N1UpgradedInstanceLaunchFailed DatabaseUpgradeStatusError = "1_upgraded_instance_launch_failed" + N2VolumeDetachchmentFromUpgradedInstanceFailed DatabaseUpgradeStatusError = "2_volume_detachchment_from_upgraded_instance_failed" + N3VolumeAttachmentToOriginalInstanceFailed DatabaseUpgradeStatusError = "3_volume_attachment_to_original_instance_failed" + N4DataUpgradeInitiationFailed DatabaseUpgradeStatusError = "4_data_upgrade_initiation_failed" + N5DataUpgradeCompletionFailed DatabaseUpgradeStatusError = "5_data_upgrade_completion_failed" + N6VolumeDetachchmentFromOriginalInstanceFailed DatabaseUpgradeStatusError = "6_volume_detachchment_from_original_instance_failed" + N7VolumeAttachmentToUpgradedInstanceFailed DatabaseUpgradeStatusError = "7_volume_attachment_to_upgraded_instance_failed" + N8UpgradeCompletionFailed DatabaseUpgradeStatusError = "8_upgrade_completion_failed" +) + +// Defines values for DatabaseUpgradeStatusProgress. +const ( + N1Started DatabaseUpgradeStatusProgress = "1_started" + N2LaunchedUpgradedInstance DatabaseUpgradeStatusProgress = "2_launched_upgraded_instance" + N3DetachedVolumeFromUpgradedInstance DatabaseUpgradeStatusProgress = "3_detached_volume_from_upgraded_instance" + N4AttachedVolumeToOriginalInstance DatabaseUpgradeStatusProgress = "4_attached_volume_to_original_instance" + N5InitiatedDataUpgrade DatabaseUpgradeStatusProgress = "5_initiated_data_upgrade" + N6CompletedDataUpgrade DatabaseUpgradeStatusProgress = "6_completed_data_upgrade" + N7DetachedVolumeFromOriginalInstance DatabaseUpgradeStatusProgress = "7_detached_volume_from_original_instance" + N8AttachedVolumeToUpgradedInstance DatabaseUpgradeStatusProgress = "8_attached_volume_to_upgraded_instance" + N9CompletedUpgrade DatabaseUpgradeStatusProgress = "9_completed_upgrade" +) + +// Defines values for DatabaseUpgradeStatusStatus. +const ( + N0 DatabaseUpgradeStatusStatus = 0 + N1 DatabaseUpgradeStatusStatus = 1 + N2 DatabaseUpgradeStatusStatus = 2 ) // Defines values for FunctionResponseStatus. @@ -79,6 +149,18 @@ type ActivateVanitySubdomainResponse struct { CustomDomain string `json:"custom_domain"` } +// AttributeMapping defines model for AttributeMapping. +type AttributeMapping struct { + Keys map[string]AttributeValue `json:"keys"` +} + +// AttributeValue defines model for AttributeValue. +type AttributeValue struct { + Default *map[string]interface{} `json:"default,omitempty"` + Name *string `json:"name,omitempty"` + Names *[]string `json:"names,omitempty"` +} + // CreateFunctionBody defines model for CreateFunctionBody. type CreateFunctionBody struct { Body string `json:"body"` @@ -108,6 +190,29 @@ type CreateProjectBodyPlan string // CreateProjectBodyRegion defines model for CreateProjectBody.Region. type CreateProjectBodyRegion string +// CreateProviderBody defines model for CreateProviderBody. +type CreateProviderBody struct { + AttributeMapping *AttributeMapping `json:"attribute_mapping,omitempty"` + Domains *[]string `json:"domains,omitempty"` + MetadataUrl *string `json:"metadata_url,omitempty"` + MetadataXml *string `json:"metadata_xml,omitempty"` + + // Type What type of provider will be created + Type CreateProviderBodyType `json:"type"` +} + +// CreateProviderBodyType What type of provider will be created +type CreateProviderBodyType string + +// CreateProviderResponse defines model for CreateProviderResponse. +type CreateProviderResponse struct { + CreatedAt *string `json:"created_at,omitempty"` + Domains *[]Domain `json:"domains,omitempty"` + Id string `json:"id"` + Saml *SamlDescriptor `json:"saml,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` +} + // CreateSecretBody defines model for CreateSecretBody. type CreateSecretBody struct { Name string `json:"name"` @@ -120,6 +225,46 @@ type DatabaseResponse struct { Version string `json:"version"` } +// DatabaseUpgradeStatus defines model for DatabaseUpgradeStatus. +type DatabaseUpgradeStatus struct { + Error *DatabaseUpgradeStatusError `json:"error,omitempty"` + InitiatedAt string `json:"initiated_at"` + Progress *DatabaseUpgradeStatusProgress `json:"progress,omitempty"` + Status DatabaseUpgradeStatusStatus `json:"status"` + TargetVersion float32 `json:"target_version"` +} + +// DatabaseUpgradeStatusError defines model for DatabaseUpgradeStatus.Error. +type DatabaseUpgradeStatusError string + +// DatabaseUpgradeStatusProgress defines model for DatabaseUpgradeStatus.Progress. +type DatabaseUpgradeStatusProgress string + +// DatabaseUpgradeStatusStatus defines model for DatabaseUpgradeStatus.Status. +type DatabaseUpgradeStatusStatus float32 + +// DatabaseUpgradeStatusResponse defines model for DatabaseUpgradeStatusResponse. +type DatabaseUpgradeStatusResponse struct { + DatabaseUpgradeStatus *DatabaseUpgradeStatus `json:"databaseUpgradeStatus"` +} + +// DeleteProviderResponse defines model for DeleteProviderResponse. +type DeleteProviderResponse struct { + CreatedAt *string `json:"created_at,omitempty"` + Domains *[]Domain `json:"domains,omitempty"` + Id string `json:"id"` + Saml *SamlDescriptor `json:"saml,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` +} + +// Domain defines model for Domain. +type Domain struct { + CreatedAt *string `json:"created_at,omitempty"` + Domain *string `json:"domain,omitempty"` + Id string `json:"id"` + UpdatedAt *string `json:"updated_at,omitempty"` +} + // FunctionResponse defines model for FunctionResponse. type FunctionResponse struct { CreatedAt float32 `json:"created_at"` @@ -138,7 +283,6 @@ type FunctionResponseStatus string // FunctionSlugResponse defines model for FunctionSlugResponse. type FunctionSlugResponse struct { - Body *string `json:"body,omitempty"` CreatedAt float32 `json:"created_at"` Id string `json:"id"` ImportMap *bool `json:"import_map,omitempty"` @@ -153,6 +297,20 @@ type FunctionSlugResponse struct { // FunctionSlugResponseStatus defines model for FunctionSlugResponse.Status. type FunctionSlugResponseStatus string +// GetProviderResponse defines model for GetProviderResponse. +type GetProviderResponse struct { + CreatedAt *string `json:"created_at,omitempty"` + Domains *[]Domain `json:"domains,omitempty"` + Id string `json:"id"` + Saml *SamlDescriptor `json:"saml,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` +} + +// ListProvidersResponse defines model for ListProvidersResponse. +type ListProvidersResponse struct { + Items []Provider `json:"items"` +} + // NetworkBanResponse defines model for NetworkBanResponse. type NetworkBanResponse struct { BannedIpv4Addresses []string `json:"banned_ipv4_addresses"` @@ -167,6 +325,7 @@ type NetworkRestrictionsRequest struct { type NetworkRestrictionsResponse struct { Config NetworkRestrictionsRequest `json:"config"` Entitlement NetworkRestrictionsResponseEntitlement `json:"entitlement"` + OldConfig *NetworkRestrictionsRequest `json:"old_config,omitempty"` Status NetworkRestrictionsResponseStatus `json:"status"` } @@ -204,11 +363,50 @@ type ProjectResponse struct { Region string `json:"region"` } +// ProjectUpgradeEligibilityResponse defines model for ProjectUpgradeEligibilityResponse. +type ProjectUpgradeEligibilityResponse struct { + CurrentAppVersion string `json:"current_app_version"` + Eligible bool `json:"eligible"` + LatestAppVersion string `json:"latest_app_version"` + PotentialBreakingChanges []string `json:"potential_breaking_changes"` + RequiresManualIntervention *string `json:"requires_manual_intervention"` + TargetUpgradeVersions []ProjectVersion `json:"target_upgrade_versions"` +} + +// ProjectVersion defines model for ProjectVersion. +type ProjectVersion struct { + AppVersion string `json:"app_version"` + PostgresVersion float32 `json:"postgres_version"` +} + +// Provider defines model for Provider. +type Provider struct { + CreatedAt *string `json:"created_at,omitempty"` + Domains *[]Domain `json:"domains,omitempty"` + Id string `json:"id"` + Saml *SamlDescriptor `json:"saml,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` +} + +// ReadOnlyStatusResponse defines model for ReadOnlyStatusResponse. +type ReadOnlyStatusResponse struct { + Enabled bool `json:"enabled"` + OverrideActiveUntil string `json:"override_active_until"` + OverrideEnabled bool `json:"override_enabled"` +} + // RemoveNetworkBanRequest defines model for RemoveNetworkBanRequest. type RemoveNetworkBanRequest struct { Ipv4Addresses []string `json:"ipv4_addresses"` } +// SamlDescriptor defines model for SamlDescriptor. +type SamlDescriptor struct { + AttributeMapping *AttributeMapping `json:"attribute_mapping,omitempty"` + MetadataUrl *string `json:"metadata_url,omitempty"` + MetadataXml *string `json:"metadata_xml,omitempty"` +} + // SecretResponse defines model for SecretResponse. type SecretResponse struct { Name string `json:"name"` @@ -275,6 +473,28 @@ type UpdatePostgrestConfigBody struct { MaxRows *int `json:"max_rows,omitempty"` } +// UpdateProviderBody defines model for UpdateProviderBody. +type UpdateProviderBody struct { + AttributeMapping *AttributeMapping `json:"attribute_mapping,omitempty"` + Domains *[]string `json:"domains,omitempty"` + MetadataUrl *string `json:"metadata_url,omitempty"` + MetadataXml *string `json:"metadata_xml,omitempty"` +} + +// UpdateProviderResponse defines model for UpdateProviderResponse. +type UpdateProviderResponse struct { + CreatedAt *string `json:"created_at,omitempty"` + Domains *[]Domain `json:"domains,omitempty"` + Id string `json:"id"` + Saml *SamlDescriptor `json:"saml,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` +} + +// UpgradeDatabaseBody defines model for UpgradeDatabaseBody. +type UpgradeDatabaseBody struct { + TargetVersion float32 `json:"target_version"` +} + // VanitySubdomainBody defines model for VanitySubdomainBody. type VanitySubdomainBody struct { VanitySubdomain string `json:"vanity_subdomain"` @@ -322,6 +542,12 @@ type CreateOrganizationJSONRequestBody = CreateOrganizationBody // CreateProjectJSONRequestBody defines body for CreateProject for application/json ContentType. type CreateProjectJSONRequestBody = CreateProjectBody +// CreateProviderForProjectJSONRequestBody defines body for CreateProviderForProject for application/json ContentType. +type CreateProviderForProjectJSONRequestBody = CreateProviderBody + +// UpdateProviderByIdJSONRequestBody defines body for UpdateProviderById for application/json ContentType. +type UpdateProviderByIdJSONRequestBody = UpdateProviderBody + // CreateCustomHostnameConfigJSONRequestBody defines body for CreateCustomHostnameConfig for application/json ContentType. type CreateCustomHostnameConfigJSONRequestBody = UpdateCustomHostnameBody @@ -352,6 +578,9 @@ type CreateSecretsJSONRequestBody = CreateSecretsJSONBody // UpdateSslEnforcementConfigJSONRequestBody defines body for UpdateSslEnforcementConfig for application/json ContentType. type UpdateSslEnforcementConfigJSONRequestBody = SslEnforcementRequest +// UpgradeProjectJSONRequestBody defines body for UpgradeProject for application/json ContentType. +type UpgradeProjectJSONRequestBody = UpgradeDatabaseBody + // ActivateVanitySubdomainPleaseJSONRequestBody defines body for ActivateVanitySubdomainPlease for application/json ContentType. type ActivateVanitySubdomainPleaseJSONRequestBody = VanitySubdomainBody From 19cd29b4f3b1377fb2367fd73c5e1dff1644220e Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Thu, 23 Mar 2023 22:18:06 +0800 Subject: [PATCH 2/2] chore: add oregon to region map --- internal/utils/api.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/utils/api.go b/internal/utils/api.go index bd9526f59..0e7fce13a 100644 --- a/internal/utils/api.go +++ b/internal/utils/api.go @@ -263,6 +263,7 @@ var RegionMap = map[string]string{ "sa-east-1": "South America (São Paulo)", "us-east-1": "East US (North Virginia)", "us-west-1": "West US (North California)", + "us-west-2": "West US (Oregon)", } func GetSupabaseAPIHost() string {