From 3159c0abe109ea4e3832770278c4e9bc4ca3b3e1 Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Wed, 10 Feb 2021 16:16:55 +0100 Subject: [PATCH] fix: resolve potential fsnotify leaks --- .schema/api.swagger.json | 102 +++++------ cmd/identities/definitions.go | 4 +- cmd/identities/get.go | 2 +- cmd/identities/get_test.go | 2 +- go.mod | 2 +- go.sum | 2 + identity/handler.go | 1 + identity/pool.go | 2 +- .../admin/create_identity_parameters.go | 45 ++--- .../client/admin/create_identity_responses.go | 13 +- .../admin/create_recovery_link_parameters.go | 45 ++--- .../admin/create_recovery_link_responses.go | 13 +- .../admin/delete_identity_parameters.go | 46 ++--- .../client/admin/delete_identity_responses.go | 11 +- .../client/admin/get_identity_parameters.go | 46 ++--- .../client/admin/get_identity_responses.go | 49 ++++- .../admin/list_identities_parameters.go | 96 +++++----- .../client/admin/list_identities_responses.go | 7 +- .../client/admin/prometheus_parameters.go | 42 ++--- .../client/admin/prometheus_responses.go | 5 +- .../admin/update_identity_parameters.go | 50 ++---- .../client/admin/update_identity_responses.go | 13 +- .../health/is_instance_alive_parameters.go | 42 ++--- .../health/is_instance_alive_responses.go | 7 +- .../health/is_instance_ready_parameters.go | 42 ++--- .../health/is_instance_ready_responses.go | 7 +- ...ettings_o_id_c_settings_flow_parameters.go | 42 ++--- ...settings_o_id_c_settings_flow_responses.go | 8 +- ...in_flow_with_password_method_parameters.go | 51 ++---- ...gin_flow_with_password_method_responses.go | 14 +- ...covery_flow_with_link_method_parameters.go | 65 +++---- ...ecovery_flow_with_link_method_responses.go | 11 +- ...on_flow_with_password_method_parameters.go | 53 ++---- ...ion_flow_with_password_method_responses.go | 14 +- ...gs_flow_with_password_method_parameters.go | 53 ++---- ...ngs_flow_with_password_method_responses.go | 20 ++- ...ngs_flow_with_profile_method_parameters.go | 53 ++---- ...ings_flow_with_profile_method_responses.go | 20 ++- ...cation_flow_with_link_method_parameters.go | 65 +++---- ...ication_flow_with_link_method_responses.go | 11 +- .../client/public/get_schema_parameters.go | 46 ++--- .../client/public/get_schema_responses.go | 10 +- .../get_self_service_error_parameters.go | 47 ++--- .../get_self_service_error_responses.go | 13 +- .../get_self_service_login_flow_parameters.go | 49 ++--- .../get_self_service_login_flow_responses.go | 16 +- ...t_self_service_recovery_flow_parameters.go | 49 ++--- ...et_self_service_recovery_flow_responses.go | 13 +- ...lf_service_registration_flow_parameters.go | 49 ++--- ...elf_service_registration_flow_responses.go | 16 +- ...t_self_service_settings_flow_parameters.go | 49 ++--- ...et_self_service_settings_flow_responses.go | 16 +- ...lf_service_verification_flow_parameters.go | 49 ++--- ...elf_service_verification_flow_responses.go | 13 +- ..._service_browser_logout_flow_parameters.go | 42 ++--- ...f_service_browser_logout_flow_responses.go | 8 +- ...f_service_login_via_api_flow_parameters.go | 51 ++---- ...lf_service_login_via_api_flow_responses.go | 10 +- ...rvice_login_via_browser_flow_parameters.go | 42 ++--- ...ervice_login_via_browser_flow_responses.go | 8 +- ...ervice_recovery_via_api_flow_parameters.go | 42 ++--- ...service_recovery_via_api_flow_responses.go | 10 +- ...ce_recovery_via_browser_flow_parameters.go | 42 ++--- ...ice_recovery_via_browser_flow_responses.go | 8 +- ...ce_registration_via_api_flow_parameters.go | 42 ++--- ...ice_registration_via_api_flow_responses.go | 10 +- ...egistration_via_browser_flow_parameters.go | 42 ++--- ...registration_via_browser_flow_responses.go | 8 +- ...ervice_settings_via_api_flow_parameters.go | 42 ++--- ...service_settings_via_api_flow_responses.go | 10 +- ...ce_settings_via_browser_flow_parameters.go | 42 ++--- ...ice_settings_via_browser_flow_responses.go | 8 +- ...ce_verification_via_api_flow_parameters.go | 42 ++--- ...ice_verification_via_api_flow_responses.go | 10 +- ...erification_via_browser_flow_parameters.go | 42 ++--- ...verification_via_browser_flow_responses.go | 8 +- .../public/revoke_session_parameters.go | 45 ++--- .../client/public/revoke_session_responses.go | 11 +- .../client/public/whoami_parameters.go | 53 ++---- .../client/public/whoami_responses.go | 10 +- .../client/version/get_version_parameters.go | 42 ++--- .../client/version/get_version_responses.go | 4 +- ...service_login_flow_with_password_method.go | 9 +- ..._service_recovery_flow_with_link_method.go | 9 +- ...vice_settings_flow_with_password_method.go | 9 +- ...vice_verification_flow_with_link_method.go | 9 +- internal/httpclient/models/create_identity.go | 13 +- .../httpclient/models/create_recovery_link.go | 55 +----- .../httpclient/models/credentials_type.go | 7 - internal/httpclient/models/error_container.go | 56 +----- internal/httpclient/models/form_field.go | 31 +--- internal/httpclient/models/form_fields.go | 24 --- internal/httpclient/models/generic_error.go | 33 +--- .../models/generic_error_payload.go | 11 +- .../models/health_not_ready_status.go | 7 - internal/httpclient/models/health_status.go | 9 +- internal/httpclient/models/id.go | 9 +- internal/httpclient/models/identity.go | 101 ++--------- internal/httpclient/models/login_flow.go | 128 +------------ .../httpclient/models/login_flow_method.go | 70 +------- .../models/login_flow_method_config.go | 69 +------ .../models/login_via_api_response.go | 32 +--- internal/httpclient/models/message.go | 48 +---- internal/httpclient/models/messages.go | 26 +-- internal/httpclient/models/null_time.go | 7 - .../httpclient/models/recovery_address.go | 90 ++-------- .../models/recovery_address_type.go | 9 +- internal/httpclient/models/recovery_flow.go | 151 ++-------------- .../httpclient/models/recovery_flow_method.go | 32 +--- .../models/recovery_flow_method_config.go | 47 +---- internal/httpclient/models/recovery_link.go | 12 +- .../httpclient/models/registration_flow.go | 130 +------------- .../models/registration_flow_method.go | 68 +------ .../models/registration_flow_method_config.go | 69 +------ .../models/registration_via_api_response.go | 49 +---- internal/httpclient/models/revoke_session.go | 9 +- internal/httpclient/models/session.go | 70 +------- internal/httpclient/models/settings_flow.go | 169 ++---------------- .../httpclient/models/settings_flow_method.go | 30 ---- .../models/settings_flow_method_config.go | 47 +---- .../models/settings_via_api_response.go | 50 +----- internal/httpclient/models/state.go | 9 +- internal/httpclient/models/traits.go | 2 +- internal/httpclient/models/type.go | 7 - internal/httpclient/models/update_identity.go | 14 +- internal/httpclient/models/uuid.go | 7 - .../httpclient/models/verifiable_address.go | 141 ++------------- .../models/verifiable_address_status.go | 9 +- .../models/verifiable_address_type.go | 9 +- .../httpclient/models/verification_flow.go | 130 ++------------ .../models/verification_flow_method.go | 30 ---- .../models/verification_flow_method_config.go | 47 +---- internal/httpclient/models/version.go | 9 +- x/nosurf.go | 8 +- 134 files changed, 1171 insertions(+), 3400 deletions(-) diff --git a/.schema/api.swagger.json b/.schema/api.swagger.json index cc82c6c63fa..dc5304dfa22 100755 --- a/.schema/api.swagger.json +++ b/.schema/api.swagger.json @@ -220,6 +220,12 @@ "$ref": "#/definitions/genericError" } }, + "404": { + "description": "genericError", + "schema": { + "$ref": "#/definitions/genericError" + } + }, "500": { "description": "genericError", "schema": { @@ -1672,7 +1678,7 @@ }, "definitions": { "CompleteSelfServiceLoginFlowWithPasswordMethod": { - "description": "CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod complete self service login flow with password method", + "description": "CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod complete self service login flow with password method", "type": "object", "properties": { "csrf_token": { @@ -1690,7 +1696,7 @@ } }, "CompleteSelfServiceSettingsFlowWithPasswordMethod": { - "description": "CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod complete self service settings flow with password method", + "description": "CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod complete self service settings flow with password method", "type": "object", "required": [ "password" @@ -1707,7 +1713,7 @@ } }, "CreateIdentity": { - "description": "CreateIdentity CreateIdentity CreateIdentity CreateIdentity CreateIdentity CreateIdentity CreateIdentity CreateIdentity CreateIdentity CreateIdentity CreateIdentity create identity", + "description": "CreateIdentity CreateIdentity CreateIdentity CreateIdentity CreateIdentity CreateIdentity CreateIdentity CreateIdentity CreateIdentity CreateIdentity CreateIdentity CreateIdentity create identity", "type": "object", "required": [ "schema_id", @@ -1725,7 +1731,7 @@ } }, "CreateRecoveryLink": { - "description": "CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink create recovery link", + "description": "CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink create recovery link", "type": "object", "required": [ "identity_id" @@ -1747,12 +1753,12 @@ "title": "CredentialsType represents several different credential types, like password credentials, passwordless credentials," }, "ID": { - "description": "ID ID ID ID ID ID ID ID ID ID ID ID", + "description": "ID ID ID ID ID ID ID ID ID ID ID ID ID", "type": "integer", "format": "int64" }, "Identity": { - "description": "Identity Identity Identity Identity Identity Identity Identity Identity Identity Identity Identity identity", + "description": "Identity Identity Identity Identity Identity Identity Identity Identity Identity Identity Identity Identity identity", "type": "object", "required": [ "id", @@ -1794,7 +1800,7 @@ } }, "Message": { - "description": "Message Message Message Message Message Message Message Message Message Message Message message", + "description": "Message Message Message Message Message Message Message Message Message Message Message Message message", "type": "object", "properties": { "context": { @@ -1814,7 +1820,7 @@ } }, "Messages": { - "description": "Messages Messages Messages Messages Messages Messages Messages Messages Messages Messages Messages messages", + "description": "Messages Messages Messages Messages Messages Messages Messages Messages Messages Messages Messages Messages messages", "type": "array", "items": { "$ref": "#/definitions/Message" @@ -1826,7 +1832,7 @@ "title": "NullTime implements sql.NullTime functionality." }, "RecoveryAddress": { - "description": "RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress recovery address", + "description": "RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress recovery address", "type": "object", "required": [ "id", @@ -1846,15 +1852,15 @@ } }, "RecoveryAddressType": { - "description": "RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType recovery address type", + "description": "RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType recovery address type", "type": "string" }, "State": { - "description": "State State State State State State State State State State State state", + "description": "State State State State State State State State State State State State state", "type": "string" }, "Traits": { - "description": "Traits Traits Traits Traits Traits Traits Traits Traits Traits Traits Traits traits", + "description": "Traits Traits Traits Traits Traits Traits Traits Traits Traits Traits Traits Traits traits", "type": "object" }, "Type": { @@ -1867,7 +1873,7 @@ "format": "uuid4" }, "UpdateIdentity": { - "description": "UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity update identity", + "description": "UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity update identity", "type": "object", "required": [ "traits" @@ -1884,7 +1890,7 @@ } }, "VerifiableAddress": { - "description": "VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress verifiable address", + "description": "VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress verifiable address", "type": "object", "required": [ "id", @@ -1915,15 +1921,15 @@ } }, "VerifiableAddressStatus": { - "description": "VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus verifiable address status", + "description": "VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus verifiable address status", "type": "string" }, "VerifiableAddressType": { - "description": "VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType verifiable address type", + "description": "VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType verifiable address type", "type": "string" }, "completeSelfServiceRecoveryFlowWithLinkMethod": { - "description": "CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod complete self service recovery flow with link method", + "description": "CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod complete self service recovery flow with link method", "type": "object", "properties": { "csrf_token": { @@ -1937,7 +1943,7 @@ } }, "completeSelfServiceVerificationFlowWithLinkMethod": { - "description": "CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod complete self service verification flow with link method", + "description": "CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod complete self service verification flow with link method", "type": "object", "properties": { "csrf_token": { @@ -1967,7 +1973,7 @@ } }, "formField": { - "description": "FormField FormField FormField FormField Field represents a HTML Form Field", + "description": "Field represents a HTML Form Field", "type": "object", "required": [ "name", @@ -2004,7 +2010,7 @@ } }, "formFields": { - "description": "FormFields Fields contains multiple fields", + "description": "Fields contains multiple fields", "type": "array", "items": { "$ref": "#/definitions/formField" @@ -2013,7 +2019,7 @@ "genericError": { "description": "Error responses are sent when an error (e.g. unauthorized, bad request, ...) occurred.", "type": "object", - "title": "Error response", + "title": "GenericError Error response", "properties": { "error": { "$ref": "#/definitions/genericErrorPayload" @@ -2021,7 +2027,7 @@ } }, "genericErrorPayload": { - "description": "GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload generic error payload", + "description": "GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload generic error payload", "type": "object", "properties": { "code": { @@ -2059,7 +2065,6 @@ } }, "healthNotReadyStatus": { - "description": "HealthNotReadyStatus health not ready status", "type": "object", "properties": { "errors": { @@ -2148,12 +2153,11 @@ } }, "loginFlowMethodConfig": { - "description": "LoginFlowMethodConfig LoginFlowMethodConfig LoginFlowMethodConfig login flow method config", "type": "object", "required": [ "action", - "method", - "fields" + "fields", + "method" ], "properties": { "action": { @@ -2180,7 +2184,7 @@ } }, "loginViaApiResponse": { - "description": "LoginViaAPIResponse The Response for Login Flows via API", + "description": "LoginViaAPIResponse LoginViaAPIResponse The Response for Login Flows via API", "type": "object", "required": [ "session_token", @@ -2265,7 +2269,7 @@ } }, "recoveryFlowMethodConfig": { - "description": "RecoveryFlowMethodConfig recovery flow method config", + "description": "RecoveryFlowMethodConfig RecoveryFlowMethodConfig recovery flow method config", "type": "object", "required": [ "action", @@ -2290,14 +2294,14 @@ } }, "recoveryLink": { - "description": "RecoveryLink RecoveryLink recovery link", + "description": "RecoveryLink RecoveryLink RecoveryLink recovery link", "type": "object", "required": [ "recovery_link" ], "properties": { "expires_at": { - "description": "Recovery Link Expires At\n\nThe timestamp when the recovery link expires.\nFormat: date-time\nFormat: date-time", + "description": "Recovery Link Expires At\n\nThe timestamp when the recovery link expires.\nFormat: date-time\nFormat: date-time\nFormat: date-time", "type": "string", "format": "date-time" }, @@ -2308,7 +2312,7 @@ } }, "registrationFlow": { - "description": "RegistrationFlow RegistrationFlow RegistrationFlow RegistrationFlow registration flow", + "description": "RegistrationFlow registration flow", "type": "object", "required": [ "id", @@ -2354,11 +2358,10 @@ } }, "registrationFlowMethod": { - "description": "RegistrationFlowMethod registration flow method", "type": "object", "required": [ - "method", - "config" + "config", + "method" ], "properties": { "config": { @@ -2401,11 +2404,11 @@ } }, "registrationViaApiResponse": { - "description": "RegistrationViaAPIResponse The Response for Registration Flows via API", + "description": "The Response for Registration Flows via API", "type": "object", "required": [ - "session_token", - "identity" + "identity", + "session_token" ], "properties": { "identity": { @@ -2421,7 +2424,7 @@ } }, "revokeSession": { - "description": "RevokeSession RevokeSession RevokeSession RevokeSession RevokeSession RevokeSession RevokeSession RevokeSession RevokeSession RevokeSession RevokeSession revoke session", + "description": "RevokeSession RevokeSession RevokeSession RevokeSession RevokeSession RevokeSession RevokeSession RevokeSession RevokeSession RevokeSession RevokeSession RevokeSession revoke session", "type": "object", "required": [ "session_token" @@ -2474,14 +2477,14 @@ "settingsFlow": { "description": "This flow is used when an identity wants to update settings\n(e.g. profile data, passwords, ...) in a selfservice manner.\n\nWe recommend reading the [User Settings Documentation](../self-service/flows/user-settings)", "type": "object", - "title": "SettingsFlow SettingsFlow Flow represents a Settings Flow", + "title": "Flow represents a Settings Flow", "required": [ - "id", "expires_at", + "id", + "identity", "issued_at", - "request_url", "methods", - "identity", + "request_url", "state" ], "properties": { @@ -2568,7 +2571,7 @@ } }, "settingsViaApiResponse": { - "description": "SettingsViaAPIResponse SettingsViaAPIResponse SettingsViaAPIResponse The Response for Settings Flows via API", + "description": "The Response for Settings Flows via API", "type": "object", "required": [ "flow", @@ -2586,7 +2589,7 @@ "verificationFlow": { "description": "Used to verify an out-of-band communication\nchannel such as an email address or a phone number.\n\nFor more information head over to: https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation", "type": "object", - "title": "A Verification Flow", + "title": "VerificationFlow A Verification Flow", "required": [ "methods", "state" @@ -2597,7 +2600,7 @@ "type": "string" }, "expires_at": { - "description": "ExpiresAt is the time (UTC) when the request expires. If the user still wishes to verify the address,\na new request has to be initiated.", + "description": "ExpiresAt is the time (UTC) when the request expires. If the user still wishes to verify the address,\na new request has to be initiated.\nFormat: date-time", "type": "string", "format": "date-time" }, @@ -2605,7 +2608,7 @@ "$ref": "#/definitions/UUID" }, "issued_at": { - "description": "IssuedAt is the time (UTC) when the request occurred.", + "description": "IssuedAt is the time (UTC) when the request occurred.\nFormat: date-time", "type": "string", "format": "date-time" }, @@ -2632,11 +2635,10 @@ } }, "verificationFlowMethod": { - "description": "VerificationFlowMethod verification flow method", "type": "object", "required": [ - "method", - "config" + "config", + "method" ], "properties": { "config": { @@ -2674,7 +2676,7 @@ } }, "version": { - "description": "Version Version Version Version Version Version version", + "description": "Version version", "type": "object", "properties": { "version": { diff --git a/cmd/identities/definitions.go b/cmd/identities/definitions.go index 73d32bb8617..d12c8990f45 100644 --- a/cmd/identities/definitions.go +++ b/cmd/identities/definitions.go @@ -21,7 +21,7 @@ func (_ *outputIdentity) Header() []string { func (i *outputIdentity) Columns() []string { data := [5]string{ - string(*i.ID), + string(i.ID), cmdx.None, cmdx.None, cmdx.None, @@ -67,7 +67,7 @@ func (c *outputIdentityCollection) Table() [][]string { rows := make([][]string, len(c.identities)) for i, ident := range c.identities { data := [5]string{ - string(*ident.ID), + string(ident.ID), cmdx.None, cmdx.None, cmdx.None, diff --git a/cmd/identities/get.go b/cmd/identities/get.go index 6e8604a52ca..07e9fbccdc3 100644 --- a/cmd/identities/get.go +++ b/cmd/identities/get.go @@ -44,7 +44,7 @@ var GetCmd = &cobra.Command{ if len(identities) == 1 { cmdx.PrintRow(cmd, (*outputIdentity)(identities[0])) - } else { + } else if len(identities) > 1 { cmdx.PrintTable(cmd, &outputIdentityCollection{identities}) } cmdx.PrintErrors(cmd, failed) diff --git a/cmd/identities/get_test.go b/cmd/identities/get_test.go index fe5e3e2f6c1..be6a87a8185 100644 --- a/cmd/identities/get_test.go +++ b/cmd/identities/get_test.go @@ -43,6 +43,6 @@ func TestGetCmd(t *testing.T) { t.Run("case=fails with unknown ID", func(t *testing.T) { stdErr := execErr(t, GetCmd, x.NewUUID().String()) - assert.Contains(t, stdErr, "status 404", stdErr) + assert.Contains(t, stdErr, "getIdentityNotFound", stdErr) }) } diff --git a/go.mod b/go.mod index 56bf3179300..f6e7a566e6f 100644 --- a/go.mod +++ b/go.mod @@ -67,7 +67,7 @@ require ( github.com/ory/kratos/corp v0.0.0-00010101000000-000000000000 github.com/ory/mail/v3 v3.0.0 github.com/ory/nosurf v1.2.4 - github.com/ory/x v0.0.179 + github.com/ory/x v0.0.181 github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.4.0 diff --git a/go.sum b/go.sum index e1683a48b08..f30862dabe9 100644 --- a/go.sum +++ b/go.sum @@ -1163,6 +1163,8 @@ github.com/ory/x v0.0.127/go.mod h1:FwUujfFuCj5d+xgLn4fGMYPnzriR5bdAIulFXMtnK0M= github.com/ory/x v0.0.166/go.mod h1:gT/3K0mSFaPllJgoFrvKYIBYI5W1Nz5RxQTJCGrIwDY= github.com/ory/x v0.0.179 h1:ewzGC1n2uWEmGRDVzYYzHsbdHrxNtkCwGjbkpZeeNKI= github.com/ory/x v0.0.179/go.mod h1:SGETCUk1DgQC30bb7y4hjhkKGQ1x0YOsldrmGmy6MNc= +github.com/ory/x v0.0.181 h1:IWvv41/uAOO0gmZm4QL6NJEWTOH1GnVyaE9s8OPQPO8= +github.com/ory/x v0.0.181/go.mod h1:SGETCUk1DgQC30bb7y4hjhkKGQ1x0YOsldrmGmy6MNc= github.com/parnurzeal/gorequest v0.2.15/go.mod h1:3Kh2QUMJoqw3icWAecsyzkpY7UzRfDhbRdTjtNwNiUE= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c h1:Lgl0gzECD8GnQ5QCWA8o6BtfL6mDH5rQgM4/fX3avOs= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= diff --git a/identity/handler.go b/identity/handler.go index 908165b5872..85ae033ac12 100644 --- a/identity/handler.go +++ b/identity/handler.go @@ -150,6 +150,7 @@ type getIdentityParameters struct { // Responses: // 200: identityResponse // 400: genericError +// 404: genericError // 500: genericError func (h *Handler) get(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { i, err := h.r.IdentityPool().GetIdentity(r.Context(), x.ParseUUID(ps.ByName("id"))) diff --git a/identity/pool.go b/identity/pool.go index 8fc44379275..8721f1214bc 100644 --- a/identity/pool.go +++ b/identity/pool.go @@ -147,7 +147,7 @@ func TestPool(ctx context.Context, conf *config.Config, p interface { count, err := p.CountIdentities(ctx) require.NoError(t, err) - assert.EqualValues(t, 1, count) + assert.EqualValues(t, int64(1), count) }) t.Run("case=create with default values", func(t *testing.T) { diff --git a/internal/httpclient/client/admin/create_identity_parameters.go b/internal/httpclient/client/admin/create_identity_parameters.go index bb8ded64fc6..35faed1a07a 100644 --- a/internal/httpclient/client/admin/create_identity_parameters.go +++ b/internal/httpclient/client/admin/create_identity_parameters.go @@ -18,50 +18,51 @@ import ( "github.com/ory/kratos-client-go/models" ) -// NewCreateIdentityParams creates a new CreateIdentityParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewCreateIdentityParams creates a new CreateIdentityParams object +// with the default values initialized. func NewCreateIdentityParams() *CreateIdentityParams { + var () return &CreateIdentityParams{ + timeout: cr.DefaultTimeout, } } // NewCreateIdentityParamsWithTimeout creates a new CreateIdentityParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewCreateIdentityParamsWithTimeout(timeout time.Duration) *CreateIdentityParams { + var () return &CreateIdentityParams{ + timeout: timeout, } } // NewCreateIdentityParamsWithContext creates a new CreateIdentityParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewCreateIdentityParamsWithContext(ctx context.Context) *CreateIdentityParams { + var () return &CreateIdentityParams{ + Context: ctx, } } // NewCreateIdentityParamsWithHTTPClient creates a new CreateIdentityParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewCreateIdentityParamsWithHTTPClient(client *http.Client) *CreateIdentityParams { + var () return &CreateIdentityParams{ HTTPClient: client, } } -/* CreateIdentityParams contains all the parameters to send to the API endpoint - for the create identity operation. - - Typically these are written to a http.Request. +/*CreateIdentityParams contains all the parameters to send to the API endpoint +for the create identity operation typically these are written to a http.Request */ type CreateIdentityParams struct { - // Body. + /*Body*/ Body *models.CreateIdentity timeout time.Duration @@ -69,21 +70,6 @@ type CreateIdentityParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the create identity params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateIdentityParams) WithDefaults() *CreateIdentityParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create identity params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateIdentityParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the create identity params func (o *CreateIdentityParams) WithTimeout(timeout time.Duration) *CreateIdentityParams { o.SetTimeout(timeout) @@ -135,6 +121,7 @@ func (o *CreateIdentityParams) WriteToRequest(r runtime.ClientRequest, reg strfm return err } var res []error + if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/internal/httpclient/client/admin/create_identity_responses.go b/internal/httpclient/client/admin/create_identity_responses.go index 1cccf0ff98f..5ad478a57c0 100644 --- a/internal/httpclient/client/admin/create_identity_responses.go +++ b/internal/httpclient/client/admin/create_identity_responses.go @@ -47,6 +47,7 @@ func (o *CreateIdentityReader) ReadResponse(response runtime.ClientResponse, con return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -57,7 +58,7 @@ func NewCreateIdentityCreated() *CreateIdentityCreated { return &CreateIdentityCreated{} } -/* CreateIdentityCreated describes a response with status code 201, with default header values. +/*CreateIdentityCreated handles this case with default header values. A single identity. */ @@ -68,6 +69,7 @@ type CreateIdentityCreated struct { func (o *CreateIdentityCreated) Error() string { return fmt.Sprintf("[POST /identities][%d] createIdentityCreated %+v", 201, o.Payload) } + func (o *CreateIdentityCreated) GetPayload() *models.Identity { return o.Payload } @@ -89,7 +91,7 @@ func NewCreateIdentityBadRequest() *CreateIdentityBadRequest { return &CreateIdentityBadRequest{} } -/* CreateIdentityBadRequest describes a response with status code 400, with default header values. +/*CreateIdentityBadRequest handles this case with default header values. genericError */ @@ -100,6 +102,7 @@ type CreateIdentityBadRequest struct { func (o *CreateIdentityBadRequest) Error() string { return fmt.Sprintf("[POST /identities][%d] createIdentityBadRequest %+v", 400, o.Payload) } + func (o *CreateIdentityBadRequest) GetPayload() *models.GenericError { return o.Payload } @@ -121,7 +124,7 @@ func NewCreateIdentityConflict() *CreateIdentityConflict { return &CreateIdentityConflict{} } -/* CreateIdentityConflict describes a response with status code 409, with default header values. +/*CreateIdentityConflict handles this case with default header values. genericError */ @@ -132,6 +135,7 @@ type CreateIdentityConflict struct { func (o *CreateIdentityConflict) Error() string { return fmt.Sprintf("[POST /identities][%d] createIdentityConflict %+v", 409, o.Payload) } + func (o *CreateIdentityConflict) GetPayload() *models.GenericError { return o.Payload } @@ -153,7 +157,7 @@ func NewCreateIdentityInternalServerError() *CreateIdentityInternalServerError { return &CreateIdentityInternalServerError{} } -/* CreateIdentityInternalServerError describes a response with status code 500, with default header values. +/*CreateIdentityInternalServerError handles this case with default header values. genericError */ @@ -164,6 +168,7 @@ type CreateIdentityInternalServerError struct { func (o *CreateIdentityInternalServerError) Error() string { return fmt.Sprintf("[POST /identities][%d] createIdentityInternalServerError %+v", 500, o.Payload) } + func (o *CreateIdentityInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/admin/create_recovery_link_parameters.go b/internal/httpclient/client/admin/create_recovery_link_parameters.go index 7a9b7ff422c..43c1c4c7891 100644 --- a/internal/httpclient/client/admin/create_recovery_link_parameters.go +++ b/internal/httpclient/client/admin/create_recovery_link_parameters.go @@ -18,50 +18,51 @@ import ( "github.com/ory/kratos-client-go/models" ) -// NewCreateRecoveryLinkParams creates a new CreateRecoveryLinkParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewCreateRecoveryLinkParams creates a new CreateRecoveryLinkParams object +// with the default values initialized. func NewCreateRecoveryLinkParams() *CreateRecoveryLinkParams { + var () return &CreateRecoveryLinkParams{ + timeout: cr.DefaultTimeout, } } // NewCreateRecoveryLinkParamsWithTimeout creates a new CreateRecoveryLinkParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewCreateRecoveryLinkParamsWithTimeout(timeout time.Duration) *CreateRecoveryLinkParams { + var () return &CreateRecoveryLinkParams{ + timeout: timeout, } } // NewCreateRecoveryLinkParamsWithContext creates a new CreateRecoveryLinkParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewCreateRecoveryLinkParamsWithContext(ctx context.Context) *CreateRecoveryLinkParams { + var () return &CreateRecoveryLinkParams{ + Context: ctx, } } // NewCreateRecoveryLinkParamsWithHTTPClient creates a new CreateRecoveryLinkParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewCreateRecoveryLinkParamsWithHTTPClient(client *http.Client) *CreateRecoveryLinkParams { + var () return &CreateRecoveryLinkParams{ HTTPClient: client, } } -/* CreateRecoveryLinkParams contains all the parameters to send to the API endpoint - for the create recovery link operation. - - Typically these are written to a http.Request. +/*CreateRecoveryLinkParams contains all the parameters to send to the API endpoint +for the create recovery link operation typically these are written to a http.Request */ type CreateRecoveryLinkParams struct { - // Body. + /*Body*/ Body *models.CreateRecoveryLink timeout time.Duration @@ -69,21 +70,6 @@ type CreateRecoveryLinkParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the create recovery link params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateRecoveryLinkParams) WithDefaults() *CreateRecoveryLinkParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create recovery link params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateRecoveryLinkParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the create recovery link params func (o *CreateRecoveryLinkParams) WithTimeout(timeout time.Duration) *CreateRecoveryLinkParams { o.SetTimeout(timeout) @@ -135,6 +121,7 @@ func (o *CreateRecoveryLinkParams) WriteToRequest(r runtime.ClientRequest, reg s return err } var res []error + if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/internal/httpclient/client/admin/create_recovery_link_responses.go b/internal/httpclient/client/admin/create_recovery_link_responses.go index 78a14ce33b2..cdc7b9a3f63 100644 --- a/internal/httpclient/client/admin/create_recovery_link_responses.go +++ b/internal/httpclient/client/admin/create_recovery_link_responses.go @@ -47,6 +47,7 @@ func (o *CreateRecoveryLinkReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -57,7 +58,7 @@ func NewCreateRecoveryLinkOK() *CreateRecoveryLinkOK { return &CreateRecoveryLinkOK{} } -/* CreateRecoveryLinkOK describes a response with status code 200, with default header values. +/*CreateRecoveryLinkOK handles this case with default header values. recoveryLink */ @@ -68,6 +69,7 @@ type CreateRecoveryLinkOK struct { func (o *CreateRecoveryLinkOK) Error() string { return fmt.Sprintf("[POST /recovery/link][%d] createRecoveryLinkOK %+v", 200, o.Payload) } + func (o *CreateRecoveryLinkOK) GetPayload() *models.RecoveryLink { return o.Payload } @@ -89,7 +91,7 @@ func NewCreateRecoveryLinkBadRequest() *CreateRecoveryLinkBadRequest { return &CreateRecoveryLinkBadRequest{} } -/* CreateRecoveryLinkBadRequest describes a response with status code 400, with default header values. +/*CreateRecoveryLinkBadRequest handles this case with default header values. genericError */ @@ -100,6 +102,7 @@ type CreateRecoveryLinkBadRequest struct { func (o *CreateRecoveryLinkBadRequest) Error() string { return fmt.Sprintf("[POST /recovery/link][%d] createRecoveryLinkBadRequest %+v", 400, o.Payload) } + func (o *CreateRecoveryLinkBadRequest) GetPayload() *models.GenericError { return o.Payload } @@ -121,7 +124,7 @@ func NewCreateRecoveryLinkNotFound() *CreateRecoveryLinkNotFound { return &CreateRecoveryLinkNotFound{} } -/* CreateRecoveryLinkNotFound describes a response with status code 404, with default header values. +/*CreateRecoveryLinkNotFound handles this case with default header values. genericError */ @@ -132,6 +135,7 @@ type CreateRecoveryLinkNotFound struct { func (o *CreateRecoveryLinkNotFound) Error() string { return fmt.Sprintf("[POST /recovery/link][%d] createRecoveryLinkNotFound %+v", 404, o.Payload) } + func (o *CreateRecoveryLinkNotFound) GetPayload() *models.GenericError { return o.Payload } @@ -153,7 +157,7 @@ func NewCreateRecoveryLinkInternalServerError() *CreateRecoveryLinkInternalServe return &CreateRecoveryLinkInternalServerError{} } -/* CreateRecoveryLinkInternalServerError describes a response with status code 500, with default header values. +/*CreateRecoveryLinkInternalServerError handles this case with default header values. genericError */ @@ -164,6 +168,7 @@ type CreateRecoveryLinkInternalServerError struct { func (o *CreateRecoveryLinkInternalServerError) Error() string { return fmt.Sprintf("[POST /recovery/link][%d] createRecoveryLinkInternalServerError %+v", 500, o.Payload) } + func (o *CreateRecoveryLinkInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/admin/delete_identity_parameters.go b/internal/httpclient/client/admin/delete_identity_parameters.go index bc3bbc4fe8f..0c5d4083217 100644 --- a/internal/httpclient/client/admin/delete_identity_parameters.go +++ b/internal/httpclient/client/admin/delete_identity_parameters.go @@ -16,52 +16,53 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteIdentityParams creates a new DeleteIdentityParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewDeleteIdentityParams creates a new DeleteIdentityParams object +// with the default values initialized. func NewDeleteIdentityParams() *DeleteIdentityParams { + var () return &DeleteIdentityParams{ + timeout: cr.DefaultTimeout, } } // NewDeleteIdentityParamsWithTimeout creates a new DeleteIdentityParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewDeleteIdentityParamsWithTimeout(timeout time.Duration) *DeleteIdentityParams { + var () return &DeleteIdentityParams{ + timeout: timeout, } } // NewDeleteIdentityParamsWithContext creates a new DeleteIdentityParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewDeleteIdentityParamsWithContext(ctx context.Context) *DeleteIdentityParams { + var () return &DeleteIdentityParams{ + Context: ctx, } } // NewDeleteIdentityParamsWithHTTPClient creates a new DeleteIdentityParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewDeleteIdentityParamsWithHTTPClient(client *http.Client) *DeleteIdentityParams { + var () return &DeleteIdentityParams{ HTTPClient: client, } } -/* DeleteIdentityParams contains all the parameters to send to the API endpoint - for the delete identity operation. - - Typically these are written to a http.Request. +/*DeleteIdentityParams contains all the parameters to send to the API endpoint +for the delete identity operation typically these are written to a http.Request */ type DeleteIdentityParams struct { - /* ID. + /*ID + ID is the identity's ID. - ID is the identity's ID. */ ID string @@ -70,21 +71,6 @@ type DeleteIdentityParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the delete identity params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteIdentityParams) WithDefaults() *DeleteIdentityParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete identity params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteIdentityParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the delete identity params func (o *DeleteIdentityParams) WithTimeout(timeout time.Duration) *DeleteIdentityParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/admin/delete_identity_responses.go b/internal/httpclient/client/admin/delete_identity_responses.go index 6abd26ede27..eeb8be28fcc 100644 --- a/internal/httpclient/client/admin/delete_identity_responses.go +++ b/internal/httpclient/client/admin/delete_identity_responses.go @@ -41,6 +41,7 @@ func (o *DeleteIdentityReader) ReadResponse(response runtime.ClientResponse, con return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -51,9 +52,9 @@ func NewDeleteIdentityNoContent() *DeleteIdentityNoContent { return &DeleteIdentityNoContent{} } -/* DeleteIdentityNoContent describes a response with status code 204, with default header values. +/*DeleteIdentityNoContent handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type DeleteIdentityNoContent struct { @@ -73,7 +74,7 @@ func NewDeleteIdentityNotFound() *DeleteIdentityNotFound { return &DeleteIdentityNotFound{} } -/* DeleteIdentityNotFound describes a response with status code 404, with default header values. +/*DeleteIdentityNotFound handles this case with default header values. genericError */ @@ -84,6 +85,7 @@ type DeleteIdentityNotFound struct { func (o *DeleteIdentityNotFound) Error() string { return fmt.Sprintf("[DELETE /identities/{id}][%d] deleteIdentityNotFound %+v", 404, o.Payload) } + func (o *DeleteIdentityNotFound) GetPayload() *models.GenericError { return o.Payload } @@ -105,7 +107,7 @@ func NewDeleteIdentityInternalServerError() *DeleteIdentityInternalServerError { return &DeleteIdentityInternalServerError{} } -/* DeleteIdentityInternalServerError describes a response with status code 500, with default header values. +/*DeleteIdentityInternalServerError handles this case with default header values. genericError */ @@ -116,6 +118,7 @@ type DeleteIdentityInternalServerError struct { func (o *DeleteIdentityInternalServerError) Error() string { return fmt.Sprintf("[DELETE /identities/{id}][%d] deleteIdentityInternalServerError %+v", 500, o.Payload) } + func (o *DeleteIdentityInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/admin/get_identity_parameters.go b/internal/httpclient/client/admin/get_identity_parameters.go index b534966c2d7..b1a377d82ae 100644 --- a/internal/httpclient/client/admin/get_identity_parameters.go +++ b/internal/httpclient/client/admin/get_identity_parameters.go @@ -16,52 +16,53 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetIdentityParams creates a new GetIdentityParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewGetIdentityParams creates a new GetIdentityParams object +// with the default values initialized. func NewGetIdentityParams() *GetIdentityParams { + var () return &GetIdentityParams{ + timeout: cr.DefaultTimeout, } } // NewGetIdentityParamsWithTimeout creates a new GetIdentityParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewGetIdentityParamsWithTimeout(timeout time.Duration) *GetIdentityParams { + var () return &GetIdentityParams{ + timeout: timeout, } } // NewGetIdentityParamsWithContext creates a new GetIdentityParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewGetIdentityParamsWithContext(ctx context.Context) *GetIdentityParams { + var () return &GetIdentityParams{ + Context: ctx, } } // NewGetIdentityParamsWithHTTPClient creates a new GetIdentityParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewGetIdentityParamsWithHTTPClient(client *http.Client) *GetIdentityParams { + var () return &GetIdentityParams{ HTTPClient: client, } } -/* GetIdentityParams contains all the parameters to send to the API endpoint - for the get identity operation. - - Typically these are written to a http.Request. +/*GetIdentityParams contains all the parameters to send to the API endpoint +for the get identity operation typically these are written to a http.Request */ type GetIdentityParams struct { - /* ID. + /*ID + ID must be set to the ID of identity you want to get - ID must be set to the ID of identity you want to get */ ID string @@ -70,21 +71,6 @@ type GetIdentityParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the get identity params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetIdentityParams) WithDefaults() *GetIdentityParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get identity params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetIdentityParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the get identity params func (o *GetIdentityParams) WithTimeout(timeout time.Duration) *GetIdentityParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/admin/get_identity_responses.go b/internal/httpclient/client/admin/get_identity_responses.go index d7ee03e7e75..869aadc0afa 100644 --- a/internal/httpclient/client/admin/get_identity_responses.go +++ b/internal/httpclient/client/admin/get_identity_responses.go @@ -35,12 +35,19 @@ func (o *GetIdentityReader) ReadResponse(response runtime.ClientResponse, consum return nil, err } return nil, result + case 404: + result := NewGetIdentityNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 500: result := NewGetIdentityInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -51,7 +58,7 @@ func NewGetIdentityOK() *GetIdentityOK { return &GetIdentityOK{} } -/* GetIdentityOK describes a response with status code 200, with default header values. +/*GetIdentityOK handles this case with default header values. A single identity. */ @@ -62,6 +69,7 @@ type GetIdentityOK struct { func (o *GetIdentityOK) Error() string { return fmt.Sprintf("[GET /identities/{id}][%d] getIdentityOK %+v", 200, o.Payload) } + func (o *GetIdentityOK) GetPayload() *models.Identity { return o.Payload } @@ -83,7 +91,7 @@ func NewGetIdentityBadRequest() *GetIdentityBadRequest { return &GetIdentityBadRequest{} } -/* GetIdentityBadRequest describes a response with status code 400, with default header values. +/*GetIdentityBadRequest handles this case with default header values. genericError */ @@ -94,6 +102,7 @@ type GetIdentityBadRequest struct { func (o *GetIdentityBadRequest) Error() string { return fmt.Sprintf("[GET /identities/{id}][%d] getIdentityBadRequest %+v", 400, o.Payload) } + func (o *GetIdentityBadRequest) GetPayload() *models.GenericError { return o.Payload } @@ -110,12 +119,45 @@ func (o *GetIdentityBadRequest) readResponse(response runtime.ClientResponse, co return nil } +// NewGetIdentityNotFound creates a GetIdentityNotFound with default headers values +func NewGetIdentityNotFound() *GetIdentityNotFound { + return &GetIdentityNotFound{} +} + +/*GetIdentityNotFound handles this case with default header values. + +genericError +*/ +type GetIdentityNotFound struct { + Payload *models.GenericError +} + +func (o *GetIdentityNotFound) Error() string { + return fmt.Sprintf("[GET /identities/{id}][%d] getIdentityNotFound %+v", 404, o.Payload) +} + +func (o *GetIdentityNotFound) GetPayload() *models.GenericError { + return o.Payload +} + +func (o *GetIdentityNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GenericError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewGetIdentityInternalServerError creates a GetIdentityInternalServerError with default headers values func NewGetIdentityInternalServerError() *GetIdentityInternalServerError { return &GetIdentityInternalServerError{} } -/* GetIdentityInternalServerError describes a response with status code 500, with default header values. +/*GetIdentityInternalServerError handles this case with default header values. genericError */ @@ -126,6 +168,7 @@ type GetIdentityInternalServerError struct { func (o *GetIdentityInternalServerError) Error() string { return fmt.Sprintf("[GET /identities/{id}][%d] getIdentityInternalServerError %+v", 500, o.Payload) } + func (o *GetIdentityInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/admin/list_identities_parameters.go b/internal/httpclient/client/admin/list_identities_parameters.go index b9d9cb12db2..bd9b16269f7 100644 --- a/internal/httpclient/client/admin/list_identities_parameters.go +++ b/internal/httpclient/client/admin/list_identities_parameters.go @@ -17,65 +17,80 @@ import ( "github.com/go-openapi/swag" ) -// NewListIdentitiesParams creates a new ListIdentitiesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewListIdentitiesParams creates a new ListIdentitiesParams object +// with the default values initialized. func NewListIdentitiesParams() *ListIdentitiesParams { + var ( + pageDefault = int64(0) + perPageDefault = int64(100) + ) return &ListIdentitiesParams{ + Page: &pageDefault, + PerPage: &perPageDefault, + timeout: cr.DefaultTimeout, } } // NewListIdentitiesParamsWithTimeout creates a new ListIdentitiesParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewListIdentitiesParamsWithTimeout(timeout time.Duration) *ListIdentitiesParams { + var ( + pageDefault = int64(0) + perPageDefault = int64(100) + ) return &ListIdentitiesParams{ + Page: &pageDefault, + PerPage: &perPageDefault, + timeout: timeout, } } // NewListIdentitiesParamsWithContext creates a new ListIdentitiesParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewListIdentitiesParamsWithContext(ctx context.Context) *ListIdentitiesParams { + var ( + pageDefault = int64(0) + perPageDefault = int64(100) + ) return &ListIdentitiesParams{ + Page: &pageDefault, + PerPage: &perPageDefault, + Context: ctx, } } // NewListIdentitiesParamsWithHTTPClient creates a new ListIdentitiesParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewListIdentitiesParamsWithHTTPClient(client *http.Client) *ListIdentitiesParams { + var ( + pageDefault = int64(0) + perPageDefault = int64(100) + ) return &ListIdentitiesParams{ + Page: &pageDefault, + PerPage: &perPageDefault, HTTPClient: client, } } -/* ListIdentitiesParams contains all the parameters to send to the API endpoint - for the list identities operation. - - Typically these are written to a http.Request. +/*ListIdentitiesParams contains all the parameters to send to the API endpoint +for the list identities operation typically these are written to a http.Request */ type ListIdentitiesParams struct { - /* Page. - - Pagination Page + /*Page + Pagination Page - Format: int64 */ Page *int64 - - /* PerPage. - - Items per Page + /*PerPage + Items per Page This is the number of items per page. - Format: int64 - Default: 100 */ PerPage *int64 @@ -84,35 +99,6 @@ type ListIdentitiesParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the list identities params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListIdentitiesParams) WithDefaults() *ListIdentitiesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list identities params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListIdentitiesParams) SetDefaults() { - var ( - pageDefault = int64(0) - - perPageDefault = int64(100) - ) - - val := ListIdentitiesParams{ - Page: &pageDefault, - PerPage: &perPageDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - // WithTimeout adds the timeout to the list identities params func (o *ListIdentitiesParams) WithTimeout(timeout time.Duration) *ListIdentitiesParams { o.SetTimeout(timeout) @@ -180,34 +166,32 @@ func (o *ListIdentitiesParams) WriteToRequest(r runtime.ClientRequest, reg strfm // query param page var qrPage int64 - if o.Page != nil { qrPage = *o.Page } qPage := swag.FormatInt64(qrPage) if qPage != "" { - if err := r.SetQueryParam("page", qPage); err != nil { return err } } + } if o.PerPage != nil { // query param per_page var qrPerPage int64 - if o.PerPage != nil { qrPerPage = *o.PerPage } qPerPage := swag.FormatInt64(qrPerPage) if qPerPage != "" { - if err := r.SetQueryParam("per_page", qPerPage); err != nil { return err } } + } if len(res) > 0 { diff --git a/internal/httpclient/client/admin/list_identities_responses.go b/internal/httpclient/client/admin/list_identities_responses.go index 3e262d0c1ec..a0c151c1332 100644 --- a/internal/httpclient/client/admin/list_identities_responses.go +++ b/internal/httpclient/client/admin/list_identities_responses.go @@ -35,6 +35,7 @@ func (o *ListIdentitiesReader) ReadResponse(response runtime.ClientResponse, con return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -45,7 +46,7 @@ func NewListIdentitiesOK() *ListIdentitiesOK { return &ListIdentitiesOK{} } -/* ListIdentitiesOK describes a response with status code 200, with default header values. +/*ListIdentitiesOK handles this case with default header values. A list of identities. */ @@ -56,6 +57,7 @@ type ListIdentitiesOK struct { func (o *ListIdentitiesOK) Error() string { return fmt.Sprintf("[GET /identities][%d] listIdentitiesOK %+v", 200, o.Payload) } + func (o *ListIdentitiesOK) GetPayload() []*models.Identity { return o.Payload } @@ -75,7 +77,7 @@ func NewListIdentitiesInternalServerError() *ListIdentitiesInternalServerError { return &ListIdentitiesInternalServerError{} } -/* ListIdentitiesInternalServerError describes a response with status code 500, with default header values. +/*ListIdentitiesInternalServerError handles this case with default header values. genericError */ @@ -86,6 +88,7 @@ type ListIdentitiesInternalServerError struct { func (o *ListIdentitiesInternalServerError) Error() string { return fmt.Sprintf("[GET /identities][%d] listIdentitiesInternalServerError %+v", 500, o.Payload) } + func (o *ListIdentitiesInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/admin/prometheus_parameters.go b/internal/httpclient/client/admin/prometheus_parameters.go index 2173b8bd96b..03b76358d86 100644 --- a/internal/httpclient/client/admin/prometheus_parameters.go +++ b/internal/httpclient/client/admin/prometheus_parameters.go @@ -16,46 +16,47 @@ import ( "github.com/go-openapi/strfmt" ) -// NewPrometheusParams creates a new PrometheusParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewPrometheusParams creates a new PrometheusParams object +// with the default values initialized. func NewPrometheusParams() *PrometheusParams { + return &PrometheusParams{ + timeout: cr.DefaultTimeout, } } // NewPrometheusParamsWithTimeout creates a new PrometheusParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewPrometheusParamsWithTimeout(timeout time.Duration) *PrometheusParams { + return &PrometheusParams{ + timeout: timeout, } } // NewPrometheusParamsWithContext creates a new PrometheusParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewPrometheusParamsWithContext(ctx context.Context) *PrometheusParams { + return &PrometheusParams{ + Context: ctx, } } // NewPrometheusParamsWithHTTPClient creates a new PrometheusParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewPrometheusParamsWithHTTPClient(client *http.Client) *PrometheusParams { + return &PrometheusParams{ HTTPClient: client, } } -/* PrometheusParams contains all the parameters to send to the API endpoint - for the prometheus operation. - - Typically these are written to a http.Request. +/*PrometheusParams contains all the parameters to send to the API endpoint +for the prometheus operation typically these are written to a http.Request */ type PrometheusParams struct { timeout time.Duration @@ -63,21 +64,6 @@ type PrometheusParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the prometheus params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PrometheusParams) WithDefaults() *PrometheusParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the prometheus params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PrometheusParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the prometheus params func (o *PrometheusParams) WithTimeout(timeout time.Duration) *PrometheusParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/admin/prometheus_responses.go b/internal/httpclient/client/admin/prometheus_responses.go index 8c64703a610..aee4fb32838 100644 --- a/internal/httpclient/client/admin/prometheus_responses.go +++ b/internal/httpclient/client/admin/prometheus_responses.go @@ -26,6 +26,7 @@ func (o *PrometheusReader) ReadResponse(response runtime.ClientResponse, consume return nil, err } return result, nil + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -36,9 +37,9 @@ func NewPrometheusOK() *PrometheusOK { return &PrometheusOK{} } -/* PrometheusOK describes a response with status code 200, with default header values. +/*PrometheusOK handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type PrometheusOK struct { diff --git a/internal/httpclient/client/admin/update_identity_parameters.go b/internal/httpclient/client/admin/update_identity_parameters.go index 82f2cfe2100..2fe7bab078d 100644 --- a/internal/httpclient/client/admin/update_identity_parameters.go +++ b/internal/httpclient/client/admin/update_identity_parameters.go @@ -18,55 +18,55 @@ import ( "github.com/ory/kratos-client-go/models" ) -// NewUpdateIdentityParams creates a new UpdateIdentityParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewUpdateIdentityParams creates a new UpdateIdentityParams object +// with the default values initialized. func NewUpdateIdentityParams() *UpdateIdentityParams { + var () return &UpdateIdentityParams{ + timeout: cr.DefaultTimeout, } } // NewUpdateIdentityParamsWithTimeout creates a new UpdateIdentityParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewUpdateIdentityParamsWithTimeout(timeout time.Duration) *UpdateIdentityParams { + var () return &UpdateIdentityParams{ + timeout: timeout, } } // NewUpdateIdentityParamsWithContext creates a new UpdateIdentityParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewUpdateIdentityParamsWithContext(ctx context.Context) *UpdateIdentityParams { + var () return &UpdateIdentityParams{ + Context: ctx, } } // NewUpdateIdentityParamsWithHTTPClient creates a new UpdateIdentityParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewUpdateIdentityParamsWithHTTPClient(client *http.Client) *UpdateIdentityParams { + var () return &UpdateIdentityParams{ HTTPClient: client, } } -/* UpdateIdentityParams contains all the parameters to send to the API endpoint - for the update identity operation. - - Typically these are written to a http.Request. +/*UpdateIdentityParams contains all the parameters to send to the API endpoint +for the update identity operation typically these are written to a http.Request */ type UpdateIdentityParams struct { - // Body. + /*Body*/ Body *models.UpdateIdentity + /*ID + ID must be set to the ID of identity you want to update - /* ID. - - ID must be set to the ID of identity you want to update */ ID string @@ -75,21 +75,6 @@ type UpdateIdentityParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the update identity params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateIdentityParams) WithDefaults() *UpdateIdentityParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update identity params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateIdentityParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the update identity params func (o *UpdateIdentityParams) WithTimeout(timeout time.Duration) *UpdateIdentityParams { o.SetTimeout(timeout) @@ -152,6 +137,7 @@ func (o *UpdateIdentityParams) WriteToRequest(r runtime.ClientRequest, reg strfm return err } var res []error + if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/internal/httpclient/client/admin/update_identity_responses.go b/internal/httpclient/client/admin/update_identity_responses.go index fcc607fe55f..05c7f6a2044 100644 --- a/internal/httpclient/client/admin/update_identity_responses.go +++ b/internal/httpclient/client/admin/update_identity_responses.go @@ -47,6 +47,7 @@ func (o *UpdateIdentityReader) ReadResponse(response runtime.ClientResponse, con return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -57,7 +58,7 @@ func NewUpdateIdentityOK() *UpdateIdentityOK { return &UpdateIdentityOK{} } -/* UpdateIdentityOK describes a response with status code 200, with default header values. +/*UpdateIdentityOK handles this case with default header values. A single identity. */ @@ -68,6 +69,7 @@ type UpdateIdentityOK struct { func (o *UpdateIdentityOK) Error() string { return fmt.Sprintf("[PUT /identities/{id}][%d] updateIdentityOK %+v", 200, o.Payload) } + func (o *UpdateIdentityOK) GetPayload() *models.Identity { return o.Payload } @@ -89,7 +91,7 @@ func NewUpdateIdentityBadRequest() *UpdateIdentityBadRequest { return &UpdateIdentityBadRequest{} } -/* UpdateIdentityBadRequest describes a response with status code 400, with default header values. +/*UpdateIdentityBadRequest handles this case with default header values. genericError */ @@ -100,6 +102,7 @@ type UpdateIdentityBadRequest struct { func (o *UpdateIdentityBadRequest) Error() string { return fmt.Sprintf("[PUT /identities/{id}][%d] updateIdentityBadRequest %+v", 400, o.Payload) } + func (o *UpdateIdentityBadRequest) GetPayload() *models.GenericError { return o.Payload } @@ -121,7 +124,7 @@ func NewUpdateIdentityNotFound() *UpdateIdentityNotFound { return &UpdateIdentityNotFound{} } -/* UpdateIdentityNotFound describes a response with status code 404, with default header values. +/*UpdateIdentityNotFound handles this case with default header values. genericError */ @@ -132,6 +135,7 @@ type UpdateIdentityNotFound struct { func (o *UpdateIdentityNotFound) Error() string { return fmt.Sprintf("[PUT /identities/{id}][%d] updateIdentityNotFound %+v", 404, o.Payload) } + func (o *UpdateIdentityNotFound) GetPayload() *models.GenericError { return o.Payload } @@ -153,7 +157,7 @@ func NewUpdateIdentityInternalServerError() *UpdateIdentityInternalServerError { return &UpdateIdentityInternalServerError{} } -/* UpdateIdentityInternalServerError describes a response with status code 500, with default header values. +/*UpdateIdentityInternalServerError handles this case with default header values. genericError */ @@ -164,6 +168,7 @@ type UpdateIdentityInternalServerError struct { func (o *UpdateIdentityInternalServerError) Error() string { return fmt.Sprintf("[PUT /identities/{id}][%d] updateIdentityInternalServerError %+v", 500, o.Payload) } + func (o *UpdateIdentityInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/health/is_instance_alive_parameters.go b/internal/httpclient/client/health/is_instance_alive_parameters.go index 0cf82c0d9c4..7f882b77ed3 100644 --- a/internal/httpclient/client/health/is_instance_alive_parameters.go +++ b/internal/httpclient/client/health/is_instance_alive_parameters.go @@ -16,46 +16,47 @@ import ( "github.com/go-openapi/strfmt" ) -// NewIsInstanceAliveParams creates a new IsInstanceAliveParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewIsInstanceAliveParams creates a new IsInstanceAliveParams object +// with the default values initialized. func NewIsInstanceAliveParams() *IsInstanceAliveParams { + return &IsInstanceAliveParams{ + timeout: cr.DefaultTimeout, } } // NewIsInstanceAliveParamsWithTimeout creates a new IsInstanceAliveParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewIsInstanceAliveParamsWithTimeout(timeout time.Duration) *IsInstanceAliveParams { + return &IsInstanceAliveParams{ + timeout: timeout, } } // NewIsInstanceAliveParamsWithContext creates a new IsInstanceAliveParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewIsInstanceAliveParamsWithContext(ctx context.Context) *IsInstanceAliveParams { + return &IsInstanceAliveParams{ + Context: ctx, } } // NewIsInstanceAliveParamsWithHTTPClient creates a new IsInstanceAliveParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewIsInstanceAliveParamsWithHTTPClient(client *http.Client) *IsInstanceAliveParams { + return &IsInstanceAliveParams{ HTTPClient: client, } } -/* IsInstanceAliveParams contains all the parameters to send to the API endpoint - for the is instance alive operation. - - Typically these are written to a http.Request. +/*IsInstanceAliveParams contains all the parameters to send to the API endpoint +for the is instance alive operation typically these are written to a http.Request */ type IsInstanceAliveParams struct { timeout time.Duration @@ -63,21 +64,6 @@ type IsInstanceAliveParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the is instance alive params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *IsInstanceAliveParams) WithDefaults() *IsInstanceAliveParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the is instance alive params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *IsInstanceAliveParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the is instance alive params func (o *IsInstanceAliveParams) WithTimeout(timeout time.Duration) *IsInstanceAliveParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/health/is_instance_alive_responses.go b/internal/httpclient/client/health/is_instance_alive_responses.go index 8b0ea9e4e02..6a877735aa0 100644 --- a/internal/httpclient/client/health/is_instance_alive_responses.go +++ b/internal/httpclient/client/health/is_instance_alive_responses.go @@ -35,6 +35,7 @@ func (o *IsInstanceAliveReader) ReadResponse(response runtime.ClientResponse, co return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -45,7 +46,7 @@ func NewIsInstanceAliveOK() *IsInstanceAliveOK { return &IsInstanceAliveOK{} } -/* IsInstanceAliveOK describes a response with status code 200, with default header values. +/*IsInstanceAliveOK handles this case with default header values. healthStatus */ @@ -56,6 +57,7 @@ type IsInstanceAliveOK struct { func (o *IsInstanceAliveOK) Error() string { return fmt.Sprintf("[GET /health/alive][%d] isInstanceAliveOK %+v", 200, o.Payload) } + func (o *IsInstanceAliveOK) GetPayload() *models.HealthStatus { return o.Payload } @@ -77,7 +79,7 @@ func NewIsInstanceAliveInternalServerError() *IsInstanceAliveInternalServerError return &IsInstanceAliveInternalServerError{} } -/* IsInstanceAliveInternalServerError describes a response with status code 500, with default header values. +/*IsInstanceAliveInternalServerError handles this case with default header values. genericError */ @@ -88,6 +90,7 @@ type IsInstanceAliveInternalServerError struct { func (o *IsInstanceAliveInternalServerError) Error() string { return fmt.Sprintf("[GET /health/alive][%d] isInstanceAliveInternalServerError %+v", 500, o.Payload) } + func (o *IsInstanceAliveInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/health/is_instance_ready_parameters.go b/internal/httpclient/client/health/is_instance_ready_parameters.go index 1a72fdb5833..f03a934a861 100644 --- a/internal/httpclient/client/health/is_instance_ready_parameters.go +++ b/internal/httpclient/client/health/is_instance_ready_parameters.go @@ -16,46 +16,47 @@ import ( "github.com/go-openapi/strfmt" ) -// NewIsInstanceReadyParams creates a new IsInstanceReadyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewIsInstanceReadyParams creates a new IsInstanceReadyParams object +// with the default values initialized. func NewIsInstanceReadyParams() *IsInstanceReadyParams { + return &IsInstanceReadyParams{ + timeout: cr.DefaultTimeout, } } // NewIsInstanceReadyParamsWithTimeout creates a new IsInstanceReadyParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewIsInstanceReadyParamsWithTimeout(timeout time.Duration) *IsInstanceReadyParams { + return &IsInstanceReadyParams{ + timeout: timeout, } } // NewIsInstanceReadyParamsWithContext creates a new IsInstanceReadyParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewIsInstanceReadyParamsWithContext(ctx context.Context) *IsInstanceReadyParams { + return &IsInstanceReadyParams{ + Context: ctx, } } // NewIsInstanceReadyParamsWithHTTPClient creates a new IsInstanceReadyParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewIsInstanceReadyParamsWithHTTPClient(client *http.Client) *IsInstanceReadyParams { + return &IsInstanceReadyParams{ HTTPClient: client, } } -/* IsInstanceReadyParams contains all the parameters to send to the API endpoint - for the is instance ready operation. - - Typically these are written to a http.Request. +/*IsInstanceReadyParams contains all the parameters to send to the API endpoint +for the is instance ready operation typically these are written to a http.Request */ type IsInstanceReadyParams struct { timeout time.Duration @@ -63,21 +64,6 @@ type IsInstanceReadyParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the is instance ready params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *IsInstanceReadyParams) WithDefaults() *IsInstanceReadyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the is instance ready params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *IsInstanceReadyParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the is instance ready params func (o *IsInstanceReadyParams) WithTimeout(timeout time.Duration) *IsInstanceReadyParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/health/is_instance_ready_responses.go b/internal/httpclient/client/health/is_instance_ready_responses.go index d2f4703de90..44fc286205c 100644 --- a/internal/httpclient/client/health/is_instance_ready_responses.go +++ b/internal/httpclient/client/health/is_instance_ready_responses.go @@ -35,6 +35,7 @@ func (o *IsInstanceReadyReader) ReadResponse(response runtime.ClientResponse, co return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -45,7 +46,7 @@ func NewIsInstanceReadyOK() *IsInstanceReadyOK { return &IsInstanceReadyOK{} } -/* IsInstanceReadyOK describes a response with status code 200, with default header values. +/*IsInstanceReadyOK handles this case with default header values. healthStatus */ @@ -56,6 +57,7 @@ type IsInstanceReadyOK struct { func (o *IsInstanceReadyOK) Error() string { return fmt.Sprintf("[GET /health/ready][%d] isInstanceReadyOK %+v", 200, o.Payload) } + func (o *IsInstanceReadyOK) GetPayload() *models.HealthStatus { return o.Payload } @@ -77,7 +79,7 @@ func NewIsInstanceReadyServiceUnavailable() *IsInstanceReadyServiceUnavailable { return &IsInstanceReadyServiceUnavailable{} } -/* IsInstanceReadyServiceUnavailable describes a response with status code 503, with default header values. +/*IsInstanceReadyServiceUnavailable handles this case with default header values. healthNotReadyStatus */ @@ -88,6 +90,7 @@ type IsInstanceReadyServiceUnavailable struct { func (o *IsInstanceReadyServiceUnavailable) Error() string { return fmt.Sprintf("[GET /health/ready][%d] isInstanceReadyServiceUnavailable %+v", 503, o.Payload) } + func (o *IsInstanceReadyServiceUnavailable) GetPayload() *models.HealthNotReadyStatus { return o.Payload } diff --git a/internal/httpclient/client/public/complete_self_service_browser_settings_o_id_c_settings_flow_parameters.go b/internal/httpclient/client/public/complete_self_service_browser_settings_o_id_c_settings_flow_parameters.go index cf890af81df..8e832a3ea4f 100644 --- a/internal/httpclient/client/public/complete_self_service_browser_settings_o_id_c_settings_flow_parameters.go +++ b/internal/httpclient/client/public/complete_self_service_browser_settings_o_id_c_settings_flow_parameters.go @@ -16,46 +16,47 @@ import ( "github.com/go-openapi/strfmt" ) -// NewCompleteSelfServiceBrowserSettingsOIDCSettingsFlowParams creates a new CompleteSelfServiceBrowserSettingsOIDCSettingsFlowParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewCompleteSelfServiceBrowserSettingsOIDCSettingsFlowParams creates a new CompleteSelfServiceBrowserSettingsOIDCSettingsFlowParams object +// with the default values initialized. func NewCompleteSelfServiceBrowserSettingsOIDCSettingsFlowParams() *CompleteSelfServiceBrowserSettingsOIDCSettingsFlowParams { + return &CompleteSelfServiceBrowserSettingsOIDCSettingsFlowParams{ + timeout: cr.DefaultTimeout, } } // NewCompleteSelfServiceBrowserSettingsOIDCSettingsFlowParamsWithTimeout creates a new CompleteSelfServiceBrowserSettingsOIDCSettingsFlowParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewCompleteSelfServiceBrowserSettingsOIDCSettingsFlowParamsWithTimeout(timeout time.Duration) *CompleteSelfServiceBrowserSettingsOIDCSettingsFlowParams { + return &CompleteSelfServiceBrowserSettingsOIDCSettingsFlowParams{ + timeout: timeout, } } // NewCompleteSelfServiceBrowserSettingsOIDCSettingsFlowParamsWithContext creates a new CompleteSelfServiceBrowserSettingsOIDCSettingsFlowParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewCompleteSelfServiceBrowserSettingsOIDCSettingsFlowParamsWithContext(ctx context.Context) *CompleteSelfServiceBrowserSettingsOIDCSettingsFlowParams { + return &CompleteSelfServiceBrowserSettingsOIDCSettingsFlowParams{ + Context: ctx, } } // NewCompleteSelfServiceBrowserSettingsOIDCSettingsFlowParamsWithHTTPClient creates a new CompleteSelfServiceBrowserSettingsOIDCSettingsFlowParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewCompleteSelfServiceBrowserSettingsOIDCSettingsFlowParamsWithHTTPClient(client *http.Client) *CompleteSelfServiceBrowserSettingsOIDCSettingsFlowParams { + return &CompleteSelfServiceBrowserSettingsOIDCSettingsFlowParams{ HTTPClient: client, } } -/* CompleteSelfServiceBrowserSettingsOIDCSettingsFlowParams contains all the parameters to send to the API endpoint - for the complete self service browser settings o ID c settings flow operation. - - Typically these are written to a http.Request. +/*CompleteSelfServiceBrowserSettingsOIDCSettingsFlowParams contains all the parameters to send to the API endpoint +for the complete self service browser settings o ID c settings flow operation typically these are written to a http.Request */ type CompleteSelfServiceBrowserSettingsOIDCSettingsFlowParams struct { timeout time.Duration @@ -63,21 +64,6 @@ type CompleteSelfServiceBrowserSettingsOIDCSettingsFlowParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the complete self service browser settings o ID c settings flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CompleteSelfServiceBrowserSettingsOIDCSettingsFlowParams) WithDefaults() *CompleteSelfServiceBrowserSettingsOIDCSettingsFlowParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the complete self service browser settings o ID c settings flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CompleteSelfServiceBrowserSettingsOIDCSettingsFlowParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the complete self service browser settings o ID c settings flow params func (o *CompleteSelfServiceBrowserSettingsOIDCSettingsFlowParams) WithTimeout(timeout time.Duration) *CompleteSelfServiceBrowserSettingsOIDCSettingsFlowParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/public/complete_self_service_browser_settings_o_id_c_settings_flow_responses.go b/internal/httpclient/client/public/complete_self_service_browser_settings_o_id_c_settings_flow_responses.go index 5f4e8057084..4a758ae1820 100644 --- a/internal/httpclient/client/public/complete_self_service_browser_settings_o_id_c_settings_flow_responses.go +++ b/internal/httpclient/client/public/complete_self_service_browser_settings_o_id_c_settings_flow_responses.go @@ -35,6 +35,7 @@ func (o *CompleteSelfServiceBrowserSettingsOIDCSettingsFlowReader) ReadResponse( return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -45,9 +46,9 @@ func NewCompleteSelfServiceBrowserSettingsOIDCSettingsFlowFound() *CompleteSelfS return &CompleteSelfServiceBrowserSettingsOIDCSettingsFlowFound{} } -/* CompleteSelfServiceBrowserSettingsOIDCSettingsFlowFound describes a response with status code 302, with default header values. +/*CompleteSelfServiceBrowserSettingsOIDCSettingsFlowFound handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type CompleteSelfServiceBrowserSettingsOIDCSettingsFlowFound struct { @@ -67,7 +68,7 @@ func NewCompleteSelfServiceBrowserSettingsOIDCSettingsFlowInternalServerError() return &CompleteSelfServiceBrowserSettingsOIDCSettingsFlowInternalServerError{} } -/* CompleteSelfServiceBrowserSettingsOIDCSettingsFlowInternalServerError describes a response with status code 500, with default header values. +/*CompleteSelfServiceBrowserSettingsOIDCSettingsFlowInternalServerError handles this case with default header values. genericError */ @@ -78,6 +79,7 @@ type CompleteSelfServiceBrowserSettingsOIDCSettingsFlowInternalServerError struc func (o *CompleteSelfServiceBrowserSettingsOIDCSettingsFlowInternalServerError) Error() string { return fmt.Sprintf("[POST /self-service/browser/flows/registration/strategies/oidc/settings/connections][%d] completeSelfServiceBrowserSettingsOIdCSettingsFlowInternalServerError %+v", 500, o.Payload) } + func (o *CompleteSelfServiceBrowserSettingsOIDCSettingsFlowInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/public/complete_self_service_login_flow_with_password_method_parameters.go b/internal/httpclient/client/public/complete_self_service_login_flow_with_password_method_parameters.go index b3cfb127c63..b7a90d828bc 100644 --- a/internal/httpclient/client/public/complete_self_service_login_flow_with_password_method_parameters.go +++ b/internal/httpclient/client/public/complete_self_service_login_flow_with_password_method_parameters.go @@ -18,55 +18,55 @@ import ( "github.com/ory/kratos-client-go/models" ) -// NewCompleteSelfServiceLoginFlowWithPasswordMethodParams creates a new CompleteSelfServiceLoginFlowWithPasswordMethodParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewCompleteSelfServiceLoginFlowWithPasswordMethodParams creates a new CompleteSelfServiceLoginFlowWithPasswordMethodParams object +// with the default values initialized. func NewCompleteSelfServiceLoginFlowWithPasswordMethodParams() *CompleteSelfServiceLoginFlowWithPasswordMethodParams { + var () return &CompleteSelfServiceLoginFlowWithPasswordMethodParams{ + timeout: cr.DefaultTimeout, } } // NewCompleteSelfServiceLoginFlowWithPasswordMethodParamsWithTimeout creates a new CompleteSelfServiceLoginFlowWithPasswordMethodParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewCompleteSelfServiceLoginFlowWithPasswordMethodParamsWithTimeout(timeout time.Duration) *CompleteSelfServiceLoginFlowWithPasswordMethodParams { + var () return &CompleteSelfServiceLoginFlowWithPasswordMethodParams{ + timeout: timeout, } } // NewCompleteSelfServiceLoginFlowWithPasswordMethodParamsWithContext creates a new CompleteSelfServiceLoginFlowWithPasswordMethodParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewCompleteSelfServiceLoginFlowWithPasswordMethodParamsWithContext(ctx context.Context) *CompleteSelfServiceLoginFlowWithPasswordMethodParams { + var () return &CompleteSelfServiceLoginFlowWithPasswordMethodParams{ + Context: ctx, } } // NewCompleteSelfServiceLoginFlowWithPasswordMethodParamsWithHTTPClient creates a new CompleteSelfServiceLoginFlowWithPasswordMethodParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewCompleteSelfServiceLoginFlowWithPasswordMethodParamsWithHTTPClient(client *http.Client) *CompleteSelfServiceLoginFlowWithPasswordMethodParams { + var () return &CompleteSelfServiceLoginFlowWithPasswordMethodParams{ HTTPClient: client, } } -/* CompleteSelfServiceLoginFlowWithPasswordMethodParams contains all the parameters to send to the API endpoint - for the complete self service login flow with password method operation. - - Typically these are written to a http.Request. +/*CompleteSelfServiceLoginFlowWithPasswordMethodParams contains all the parameters to send to the API endpoint +for the complete self service login flow with password method operation typically these are written to a http.Request */ type CompleteSelfServiceLoginFlowWithPasswordMethodParams struct { - // Body. + /*Body*/ Body *models.CompleteSelfServiceLoginFlowWithPasswordMethod + /*Flow + The Flow ID - /* Flow. - - The Flow ID */ Flow string @@ -75,21 +75,6 @@ type CompleteSelfServiceLoginFlowWithPasswordMethodParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the complete self service login flow with password method params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CompleteSelfServiceLoginFlowWithPasswordMethodParams) WithDefaults() *CompleteSelfServiceLoginFlowWithPasswordMethodParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the complete self service login flow with password method params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CompleteSelfServiceLoginFlowWithPasswordMethodParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the complete self service login flow with password method params func (o *CompleteSelfServiceLoginFlowWithPasswordMethodParams) WithTimeout(timeout time.Duration) *CompleteSelfServiceLoginFlowWithPasswordMethodParams { o.SetTimeout(timeout) @@ -152,6 +137,7 @@ func (o *CompleteSelfServiceLoginFlowWithPasswordMethodParams) WriteToRequest(r return err } var res []error + if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err @@ -162,7 +148,6 @@ func (o *CompleteSelfServiceLoginFlowWithPasswordMethodParams) WriteToRequest(r qrFlow := o.Flow qFlow := qrFlow if qFlow != "" { - if err := r.SetQueryParam("flow", qFlow); err != nil { return err } diff --git a/internal/httpclient/client/public/complete_self_service_login_flow_with_password_method_responses.go b/internal/httpclient/client/public/complete_self_service_login_flow_with_password_method_responses.go index 93e70dfcedf..e1ac560e84e 100644 --- a/internal/httpclient/client/public/complete_self_service_login_flow_with_password_method_responses.go +++ b/internal/httpclient/client/public/complete_self_service_login_flow_with_password_method_responses.go @@ -47,6 +47,7 @@ func (o *CompleteSelfServiceLoginFlowWithPasswordMethodReader) ReadResponse(resp return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -57,7 +58,7 @@ func NewCompleteSelfServiceLoginFlowWithPasswordMethodOK() *CompleteSelfServiceL return &CompleteSelfServiceLoginFlowWithPasswordMethodOK{} } -/* CompleteSelfServiceLoginFlowWithPasswordMethodOK describes a response with status code 200, with default header values. +/*CompleteSelfServiceLoginFlowWithPasswordMethodOK handles this case with default header values. loginViaApiResponse */ @@ -68,6 +69,7 @@ type CompleteSelfServiceLoginFlowWithPasswordMethodOK struct { func (o *CompleteSelfServiceLoginFlowWithPasswordMethodOK) Error() string { return fmt.Sprintf("[POST /self-service/login/methods/password][%d] completeSelfServiceLoginFlowWithPasswordMethodOK %+v", 200, o.Payload) } + func (o *CompleteSelfServiceLoginFlowWithPasswordMethodOK) GetPayload() *models.LoginViaAPIResponse { return o.Payload } @@ -89,9 +91,9 @@ func NewCompleteSelfServiceLoginFlowWithPasswordMethodFound() *CompleteSelfServi return &CompleteSelfServiceLoginFlowWithPasswordMethodFound{} } -/* CompleteSelfServiceLoginFlowWithPasswordMethodFound describes a response with status code 302, with default header values. +/*CompleteSelfServiceLoginFlowWithPasswordMethodFound handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type CompleteSelfServiceLoginFlowWithPasswordMethodFound struct { @@ -111,7 +113,7 @@ func NewCompleteSelfServiceLoginFlowWithPasswordMethodBadRequest() *CompleteSelf return &CompleteSelfServiceLoginFlowWithPasswordMethodBadRequest{} } -/* CompleteSelfServiceLoginFlowWithPasswordMethodBadRequest describes a response with status code 400, with default header values. +/*CompleteSelfServiceLoginFlowWithPasswordMethodBadRequest handles this case with default header values. loginFlow */ @@ -122,6 +124,7 @@ type CompleteSelfServiceLoginFlowWithPasswordMethodBadRequest struct { func (o *CompleteSelfServiceLoginFlowWithPasswordMethodBadRequest) Error() string { return fmt.Sprintf("[POST /self-service/login/methods/password][%d] completeSelfServiceLoginFlowWithPasswordMethodBadRequest %+v", 400, o.Payload) } + func (o *CompleteSelfServiceLoginFlowWithPasswordMethodBadRequest) GetPayload() *models.LoginFlow { return o.Payload } @@ -143,7 +146,7 @@ func NewCompleteSelfServiceLoginFlowWithPasswordMethodInternalServerError() *Com return &CompleteSelfServiceLoginFlowWithPasswordMethodInternalServerError{} } -/* CompleteSelfServiceLoginFlowWithPasswordMethodInternalServerError describes a response with status code 500, with default header values. +/*CompleteSelfServiceLoginFlowWithPasswordMethodInternalServerError handles this case with default header values. genericError */ @@ -154,6 +157,7 @@ type CompleteSelfServiceLoginFlowWithPasswordMethodInternalServerError struct { func (o *CompleteSelfServiceLoginFlowWithPasswordMethodInternalServerError) Error() string { return fmt.Sprintf("[POST /self-service/login/methods/password][%d] completeSelfServiceLoginFlowWithPasswordMethodInternalServerError %+v", 500, o.Payload) } + func (o *CompleteSelfServiceLoginFlowWithPasswordMethodInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/public/complete_self_service_recovery_flow_with_link_method_parameters.go b/internal/httpclient/client/public/complete_self_service_recovery_flow_with_link_method_parameters.go index 441d49fd672..5ca309e27df 100644 --- a/internal/httpclient/client/public/complete_self_service_recovery_flow_with_link_method_parameters.go +++ b/internal/httpclient/client/public/complete_self_service_recovery_flow_with_link_method_parameters.go @@ -18,66 +18,65 @@ import ( "github.com/ory/kratos-client-go/models" ) -// NewCompleteSelfServiceRecoveryFlowWithLinkMethodParams creates a new CompleteSelfServiceRecoveryFlowWithLinkMethodParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewCompleteSelfServiceRecoveryFlowWithLinkMethodParams creates a new CompleteSelfServiceRecoveryFlowWithLinkMethodParams object +// with the default values initialized. func NewCompleteSelfServiceRecoveryFlowWithLinkMethodParams() *CompleteSelfServiceRecoveryFlowWithLinkMethodParams { + var () return &CompleteSelfServiceRecoveryFlowWithLinkMethodParams{ + timeout: cr.DefaultTimeout, } } // NewCompleteSelfServiceRecoveryFlowWithLinkMethodParamsWithTimeout creates a new CompleteSelfServiceRecoveryFlowWithLinkMethodParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewCompleteSelfServiceRecoveryFlowWithLinkMethodParamsWithTimeout(timeout time.Duration) *CompleteSelfServiceRecoveryFlowWithLinkMethodParams { + var () return &CompleteSelfServiceRecoveryFlowWithLinkMethodParams{ + timeout: timeout, } } // NewCompleteSelfServiceRecoveryFlowWithLinkMethodParamsWithContext creates a new CompleteSelfServiceRecoveryFlowWithLinkMethodParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewCompleteSelfServiceRecoveryFlowWithLinkMethodParamsWithContext(ctx context.Context) *CompleteSelfServiceRecoveryFlowWithLinkMethodParams { + var () return &CompleteSelfServiceRecoveryFlowWithLinkMethodParams{ + Context: ctx, } } // NewCompleteSelfServiceRecoveryFlowWithLinkMethodParamsWithHTTPClient creates a new CompleteSelfServiceRecoveryFlowWithLinkMethodParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewCompleteSelfServiceRecoveryFlowWithLinkMethodParamsWithHTTPClient(client *http.Client) *CompleteSelfServiceRecoveryFlowWithLinkMethodParams { + var () return &CompleteSelfServiceRecoveryFlowWithLinkMethodParams{ HTTPClient: client, } } -/* CompleteSelfServiceRecoveryFlowWithLinkMethodParams contains all the parameters to send to the API endpoint - for the complete self service recovery flow with link method operation. - - Typically these are written to a http.Request. +/*CompleteSelfServiceRecoveryFlowWithLinkMethodParams contains all the parameters to send to the API endpoint +for the complete self service recovery flow with link method operation typically these are written to a http.Request */ type CompleteSelfServiceRecoveryFlowWithLinkMethodParams struct { - // Body. + /*Body*/ Body *models.CompleteSelfServiceRecoveryFlowWithLinkMethod - - /* Flow. - - The Flow ID + /*Flow + The Flow ID format: uuid + */ Flow *string - - /* Token. - - Recovery Token + /*Token + Recovery Token The recovery token which completes the recovery request. If the token is invalid (e.g. expired) an error will be shown to the end-user. + */ Token *string @@ -86,21 +85,6 @@ type CompleteSelfServiceRecoveryFlowWithLinkMethodParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the complete self service recovery flow with link method params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CompleteSelfServiceRecoveryFlowWithLinkMethodParams) WithDefaults() *CompleteSelfServiceRecoveryFlowWithLinkMethodParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the complete self service recovery flow with link method params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CompleteSelfServiceRecoveryFlowWithLinkMethodParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the complete self service recovery flow with link method params func (o *CompleteSelfServiceRecoveryFlowWithLinkMethodParams) WithTimeout(timeout time.Duration) *CompleteSelfServiceRecoveryFlowWithLinkMethodParams { o.SetTimeout(timeout) @@ -174,6 +158,7 @@ func (o *CompleteSelfServiceRecoveryFlowWithLinkMethodParams) WriteToRequest(r r return err } var res []error + if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err @@ -184,34 +169,32 @@ func (o *CompleteSelfServiceRecoveryFlowWithLinkMethodParams) WriteToRequest(r r // query param flow var qrFlow string - if o.Flow != nil { qrFlow = *o.Flow } qFlow := qrFlow if qFlow != "" { - if err := r.SetQueryParam("flow", qFlow); err != nil { return err } } + } if o.Token != nil { // query param token var qrToken string - if o.Token != nil { qrToken = *o.Token } qToken := qrToken if qToken != "" { - if err := r.SetQueryParam("token", qToken); err != nil { return err } } + } if len(res) > 0 { diff --git a/internal/httpclient/client/public/complete_self_service_recovery_flow_with_link_method_responses.go b/internal/httpclient/client/public/complete_self_service_recovery_flow_with_link_method_responses.go index aed6efe73e0..eb47699cf06 100644 --- a/internal/httpclient/client/public/complete_self_service_recovery_flow_with_link_method_responses.go +++ b/internal/httpclient/client/public/complete_self_service_recovery_flow_with_link_method_responses.go @@ -41,6 +41,7 @@ func (o *CompleteSelfServiceRecoveryFlowWithLinkMethodReader) ReadResponse(respo return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -51,9 +52,9 @@ func NewCompleteSelfServiceRecoveryFlowWithLinkMethodFound() *CompleteSelfServic return &CompleteSelfServiceRecoveryFlowWithLinkMethodFound{} } -/* CompleteSelfServiceRecoveryFlowWithLinkMethodFound describes a response with status code 302, with default header values. +/*CompleteSelfServiceRecoveryFlowWithLinkMethodFound handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type CompleteSelfServiceRecoveryFlowWithLinkMethodFound struct { @@ -73,7 +74,7 @@ func NewCompleteSelfServiceRecoveryFlowWithLinkMethodBadRequest() *CompleteSelfS return &CompleteSelfServiceRecoveryFlowWithLinkMethodBadRequest{} } -/* CompleteSelfServiceRecoveryFlowWithLinkMethodBadRequest describes a response with status code 400, with default header values. +/*CompleteSelfServiceRecoveryFlowWithLinkMethodBadRequest handles this case with default header values. recoveryFlow */ @@ -84,6 +85,7 @@ type CompleteSelfServiceRecoveryFlowWithLinkMethodBadRequest struct { func (o *CompleteSelfServiceRecoveryFlowWithLinkMethodBadRequest) Error() string { return fmt.Sprintf("[POST /self-service/recovery/methods/link][%d] completeSelfServiceRecoveryFlowWithLinkMethodBadRequest %+v", 400, o.Payload) } + func (o *CompleteSelfServiceRecoveryFlowWithLinkMethodBadRequest) GetPayload() *models.RecoveryFlow { return o.Payload } @@ -105,7 +107,7 @@ func NewCompleteSelfServiceRecoveryFlowWithLinkMethodInternalServerError() *Comp return &CompleteSelfServiceRecoveryFlowWithLinkMethodInternalServerError{} } -/* CompleteSelfServiceRecoveryFlowWithLinkMethodInternalServerError describes a response with status code 500, with default header values. +/*CompleteSelfServiceRecoveryFlowWithLinkMethodInternalServerError handles this case with default header values. genericError */ @@ -116,6 +118,7 @@ type CompleteSelfServiceRecoveryFlowWithLinkMethodInternalServerError struct { func (o *CompleteSelfServiceRecoveryFlowWithLinkMethodInternalServerError) Error() string { return fmt.Sprintf("[POST /self-service/recovery/methods/link][%d] completeSelfServiceRecoveryFlowWithLinkMethodInternalServerError %+v", 500, o.Payload) } + func (o *CompleteSelfServiceRecoveryFlowWithLinkMethodInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/public/complete_self_service_registration_flow_with_password_method_parameters.go b/internal/httpclient/client/public/complete_self_service_registration_flow_with_password_method_parameters.go index e6bf4082fc1..128b02e5fe4 100644 --- a/internal/httpclient/client/public/complete_self_service_registration_flow_with_password_method_parameters.go +++ b/internal/httpclient/client/public/complete_self_service_registration_flow_with_password_method_parameters.go @@ -16,55 +16,55 @@ import ( "github.com/go-openapi/strfmt" ) -// NewCompleteSelfServiceRegistrationFlowWithPasswordMethodParams creates a new CompleteSelfServiceRegistrationFlowWithPasswordMethodParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewCompleteSelfServiceRegistrationFlowWithPasswordMethodParams creates a new CompleteSelfServiceRegistrationFlowWithPasswordMethodParams object +// with the default values initialized. func NewCompleteSelfServiceRegistrationFlowWithPasswordMethodParams() *CompleteSelfServiceRegistrationFlowWithPasswordMethodParams { + var () return &CompleteSelfServiceRegistrationFlowWithPasswordMethodParams{ + timeout: cr.DefaultTimeout, } } // NewCompleteSelfServiceRegistrationFlowWithPasswordMethodParamsWithTimeout creates a new CompleteSelfServiceRegistrationFlowWithPasswordMethodParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewCompleteSelfServiceRegistrationFlowWithPasswordMethodParamsWithTimeout(timeout time.Duration) *CompleteSelfServiceRegistrationFlowWithPasswordMethodParams { + var () return &CompleteSelfServiceRegistrationFlowWithPasswordMethodParams{ + timeout: timeout, } } // NewCompleteSelfServiceRegistrationFlowWithPasswordMethodParamsWithContext creates a new CompleteSelfServiceRegistrationFlowWithPasswordMethodParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewCompleteSelfServiceRegistrationFlowWithPasswordMethodParamsWithContext(ctx context.Context) *CompleteSelfServiceRegistrationFlowWithPasswordMethodParams { + var () return &CompleteSelfServiceRegistrationFlowWithPasswordMethodParams{ + Context: ctx, } } // NewCompleteSelfServiceRegistrationFlowWithPasswordMethodParamsWithHTTPClient creates a new CompleteSelfServiceRegistrationFlowWithPasswordMethodParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewCompleteSelfServiceRegistrationFlowWithPasswordMethodParamsWithHTTPClient(client *http.Client) *CompleteSelfServiceRegistrationFlowWithPasswordMethodParams { + var () return &CompleteSelfServiceRegistrationFlowWithPasswordMethodParams{ HTTPClient: client, } } -/* CompleteSelfServiceRegistrationFlowWithPasswordMethodParams contains all the parameters to send to the API endpoint - for the complete self service registration flow with password method operation. - - Typically these are written to a http.Request. +/*CompleteSelfServiceRegistrationFlowWithPasswordMethodParams contains all the parameters to send to the API endpoint +for the complete self service registration flow with password method operation typically these are written to a http.Request */ type CompleteSelfServiceRegistrationFlowWithPasswordMethodParams struct { - // Payload. + /*Payload*/ Payload interface{} + /*Flow + Flow is flow ID. - /* Flow. - - Flow is flow ID. */ Flow *string @@ -73,21 +73,6 @@ type CompleteSelfServiceRegistrationFlowWithPasswordMethodParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the complete self service registration flow with password method params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CompleteSelfServiceRegistrationFlowWithPasswordMethodParams) WithDefaults() *CompleteSelfServiceRegistrationFlowWithPasswordMethodParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the complete self service registration flow with password method params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CompleteSelfServiceRegistrationFlowWithPasswordMethodParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the complete self service registration flow with password method params func (o *CompleteSelfServiceRegistrationFlowWithPasswordMethodParams) WithTimeout(timeout time.Duration) *CompleteSelfServiceRegistrationFlowWithPasswordMethodParams { o.SetTimeout(timeout) @@ -150,6 +135,7 @@ func (o *CompleteSelfServiceRegistrationFlowWithPasswordMethodParams) WriteToReq return err } var res []error + if o.Payload != nil { if err := r.SetBodyParam(o.Payload); err != nil { return err @@ -160,17 +146,16 @@ func (o *CompleteSelfServiceRegistrationFlowWithPasswordMethodParams) WriteToReq // query param flow var qrFlow string - if o.Flow != nil { qrFlow = *o.Flow } qFlow := qrFlow if qFlow != "" { - if err := r.SetQueryParam("flow", qFlow); err != nil { return err } } + } if len(res) > 0 { diff --git a/internal/httpclient/client/public/complete_self_service_registration_flow_with_password_method_responses.go b/internal/httpclient/client/public/complete_self_service_registration_flow_with_password_method_responses.go index 6c18a1f9fc6..ff49c929636 100644 --- a/internal/httpclient/client/public/complete_self_service_registration_flow_with_password_method_responses.go +++ b/internal/httpclient/client/public/complete_self_service_registration_flow_with_password_method_responses.go @@ -47,6 +47,7 @@ func (o *CompleteSelfServiceRegistrationFlowWithPasswordMethodReader) ReadRespon return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -57,7 +58,7 @@ func NewCompleteSelfServiceRegistrationFlowWithPasswordMethodOK() *CompleteSelfS return &CompleteSelfServiceRegistrationFlowWithPasswordMethodOK{} } -/* CompleteSelfServiceRegistrationFlowWithPasswordMethodOK describes a response with status code 200, with default header values. +/*CompleteSelfServiceRegistrationFlowWithPasswordMethodOK handles this case with default header values. registrationViaApiResponse */ @@ -68,6 +69,7 @@ type CompleteSelfServiceRegistrationFlowWithPasswordMethodOK struct { func (o *CompleteSelfServiceRegistrationFlowWithPasswordMethodOK) Error() string { return fmt.Sprintf("[POST /self-service/registration/methods/password][%d] completeSelfServiceRegistrationFlowWithPasswordMethodOK %+v", 200, o.Payload) } + func (o *CompleteSelfServiceRegistrationFlowWithPasswordMethodOK) GetPayload() *models.RegistrationViaAPIResponse { return o.Payload } @@ -89,9 +91,9 @@ func NewCompleteSelfServiceRegistrationFlowWithPasswordMethodFound() *CompleteSe return &CompleteSelfServiceRegistrationFlowWithPasswordMethodFound{} } -/* CompleteSelfServiceRegistrationFlowWithPasswordMethodFound describes a response with status code 302, with default header values. +/*CompleteSelfServiceRegistrationFlowWithPasswordMethodFound handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type CompleteSelfServiceRegistrationFlowWithPasswordMethodFound struct { @@ -111,7 +113,7 @@ func NewCompleteSelfServiceRegistrationFlowWithPasswordMethodBadRequest() *Compl return &CompleteSelfServiceRegistrationFlowWithPasswordMethodBadRequest{} } -/* CompleteSelfServiceRegistrationFlowWithPasswordMethodBadRequest describes a response with status code 400, with default header values. +/*CompleteSelfServiceRegistrationFlowWithPasswordMethodBadRequest handles this case with default header values. registrationFlow */ @@ -122,6 +124,7 @@ type CompleteSelfServiceRegistrationFlowWithPasswordMethodBadRequest struct { func (o *CompleteSelfServiceRegistrationFlowWithPasswordMethodBadRequest) Error() string { return fmt.Sprintf("[POST /self-service/registration/methods/password][%d] completeSelfServiceRegistrationFlowWithPasswordMethodBadRequest %+v", 400, o.Payload) } + func (o *CompleteSelfServiceRegistrationFlowWithPasswordMethodBadRequest) GetPayload() *models.RegistrationFlow { return o.Payload } @@ -143,7 +146,7 @@ func NewCompleteSelfServiceRegistrationFlowWithPasswordMethodInternalServerError return &CompleteSelfServiceRegistrationFlowWithPasswordMethodInternalServerError{} } -/* CompleteSelfServiceRegistrationFlowWithPasswordMethodInternalServerError describes a response with status code 500, with default header values. +/*CompleteSelfServiceRegistrationFlowWithPasswordMethodInternalServerError handles this case with default header values. genericError */ @@ -154,6 +157,7 @@ type CompleteSelfServiceRegistrationFlowWithPasswordMethodInternalServerError st func (o *CompleteSelfServiceRegistrationFlowWithPasswordMethodInternalServerError) Error() string { return fmt.Sprintf("[POST /self-service/registration/methods/password][%d] completeSelfServiceRegistrationFlowWithPasswordMethodInternalServerError %+v", 500, o.Payload) } + func (o *CompleteSelfServiceRegistrationFlowWithPasswordMethodInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/public/complete_self_service_settings_flow_with_password_method_parameters.go b/internal/httpclient/client/public/complete_self_service_settings_flow_with_password_method_parameters.go index 1e12dbdeca8..cecae56f69e 100644 --- a/internal/httpclient/client/public/complete_self_service_settings_flow_with_password_method_parameters.go +++ b/internal/httpclient/client/public/complete_self_service_settings_flow_with_password_method_parameters.go @@ -18,55 +18,55 @@ import ( "github.com/ory/kratos-client-go/models" ) -// NewCompleteSelfServiceSettingsFlowWithPasswordMethodParams creates a new CompleteSelfServiceSettingsFlowWithPasswordMethodParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewCompleteSelfServiceSettingsFlowWithPasswordMethodParams creates a new CompleteSelfServiceSettingsFlowWithPasswordMethodParams object +// with the default values initialized. func NewCompleteSelfServiceSettingsFlowWithPasswordMethodParams() *CompleteSelfServiceSettingsFlowWithPasswordMethodParams { + var () return &CompleteSelfServiceSettingsFlowWithPasswordMethodParams{ + timeout: cr.DefaultTimeout, } } // NewCompleteSelfServiceSettingsFlowWithPasswordMethodParamsWithTimeout creates a new CompleteSelfServiceSettingsFlowWithPasswordMethodParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewCompleteSelfServiceSettingsFlowWithPasswordMethodParamsWithTimeout(timeout time.Duration) *CompleteSelfServiceSettingsFlowWithPasswordMethodParams { + var () return &CompleteSelfServiceSettingsFlowWithPasswordMethodParams{ + timeout: timeout, } } // NewCompleteSelfServiceSettingsFlowWithPasswordMethodParamsWithContext creates a new CompleteSelfServiceSettingsFlowWithPasswordMethodParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewCompleteSelfServiceSettingsFlowWithPasswordMethodParamsWithContext(ctx context.Context) *CompleteSelfServiceSettingsFlowWithPasswordMethodParams { + var () return &CompleteSelfServiceSettingsFlowWithPasswordMethodParams{ + Context: ctx, } } // NewCompleteSelfServiceSettingsFlowWithPasswordMethodParamsWithHTTPClient creates a new CompleteSelfServiceSettingsFlowWithPasswordMethodParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewCompleteSelfServiceSettingsFlowWithPasswordMethodParamsWithHTTPClient(client *http.Client) *CompleteSelfServiceSettingsFlowWithPasswordMethodParams { + var () return &CompleteSelfServiceSettingsFlowWithPasswordMethodParams{ HTTPClient: client, } } -/* CompleteSelfServiceSettingsFlowWithPasswordMethodParams contains all the parameters to send to the API endpoint - for the complete self service settings flow with password method operation. - - Typically these are written to a http.Request. +/*CompleteSelfServiceSettingsFlowWithPasswordMethodParams contains all the parameters to send to the API endpoint +for the complete self service settings flow with password method operation typically these are written to a http.Request */ type CompleteSelfServiceSettingsFlowWithPasswordMethodParams struct { - // Body. + /*Body*/ Body *models.CompleteSelfServiceSettingsFlowWithPasswordMethod + /*Flow + Flow is flow ID. - /* Flow. - - Flow is flow ID. */ Flow *string @@ -75,21 +75,6 @@ type CompleteSelfServiceSettingsFlowWithPasswordMethodParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the complete self service settings flow with password method params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CompleteSelfServiceSettingsFlowWithPasswordMethodParams) WithDefaults() *CompleteSelfServiceSettingsFlowWithPasswordMethodParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the complete self service settings flow with password method params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CompleteSelfServiceSettingsFlowWithPasswordMethodParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the complete self service settings flow with password method params func (o *CompleteSelfServiceSettingsFlowWithPasswordMethodParams) WithTimeout(timeout time.Duration) *CompleteSelfServiceSettingsFlowWithPasswordMethodParams { o.SetTimeout(timeout) @@ -152,6 +137,7 @@ func (o *CompleteSelfServiceSettingsFlowWithPasswordMethodParams) WriteToRequest return err } var res []error + if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err @@ -162,17 +148,16 @@ func (o *CompleteSelfServiceSettingsFlowWithPasswordMethodParams) WriteToRequest // query param flow var qrFlow string - if o.Flow != nil { qrFlow = *o.Flow } qFlow := qrFlow if qFlow != "" { - if err := r.SetQueryParam("flow", qFlow); err != nil { return err } } + } if len(res) > 0 { diff --git a/internal/httpclient/client/public/complete_self_service_settings_flow_with_password_method_responses.go b/internal/httpclient/client/public/complete_self_service_settings_flow_with_password_method_responses.go index 39d5281e74d..4f59b8e92aa 100644 --- a/internal/httpclient/client/public/complete_self_service_settings_flow_with_password_method_responses.go +++ b/internal/httpclient/client/public/complete_self_service_settings_flow_with_password_method_responses.go @@ -59,6 +59,7 @@ func (o *CompleteSelfServiceSettingsFlowWithPasswordMethodReader) ReadResponse(r return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -69,7 +70,7 @@ func NewCompleteSelfServiceSettingsFlowWithPasswordMethodOK() *CompleteSelfServi return &CompleteSelfServiceSettingsFlowWithPasswordMethodOK{} } -/* CompleteSelfServiceSettingsFlowWithPasswordMethodOK describes a response with status code 200, with default header values. +/*CompleteSelfServiceSettingsFlowWithPasswordMethodOK handles this case with default header values. settingsViaApiResponse */ @@ -80,6 +81,7 @@ type CompleteSelfServiceSettingsFlowWithPasswordMethodOK struct { func (o *CompleteSelfServiceSettingsFlowWithPasswordMethodOK) Error() string { return fmt.Sprintf("[POST /self-service/settings/methods/password][%d] completeSelfServiceSettingsFlowWithPasswordMethodOK %+v", 200, o.Payload) } + func (o *CompleteSelfServiceSettingsFlowWithPasswordMethodOK) GetPayload() *models.SettingsViaAPIResponse { return o.Payload } @@ -101,9 +103,9 @@ func NewCompleteSelfServiceSettingsFlowWithPasswordMethodFound() *CompleteSelfSe return &CompleteSelfServiceSettingsFlowWithPasswordMethodFound{} } -/* CompleteSelfServiceSettingsFlowWithPasswordMethodFound describes a response with status code 302, with default header values. +/*CompleteSelfServiceSettingsFlowWithPasswordMethodFound handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type CompleteSelfServiceSettingsFlowWithPasswordMethodFound struct { @@ -123,7 +125,7 @@ func NewCompleteSelfServiceSettingsFlowWithPasswordMethodBadRequest() *CompleteS return &CompleteSelfServiceSettingsFlowWithPasswordMethodBadRequest{} } -/* CompleteSelfServiceSettingsFlowWithPasswordMethodBadRequest describes a response with status code 400, with default header values. +/*CompleteSelfServiceSettingsFlowWithPasswordMethodBadRequest handles this case with default header values. settingsFlow */ @@ -134,6 +136,7 @@ type CompleteSelfServiceSettingsFlowWithPasswordMethodBadRequest struct { func (o *CompleteSelfServiceSettingsFlowWithPasswordMethodBadRequest) Error() string { return fmt.Sprintf("[POST /self-service/settings/methods/password][%d] completeSelfServiceSettingsFlowWithPasswordMethodBadRequest %+v", 400, o.Payload) } + func (o *CompleteSelfServiceSettingsFlowWithPasswordMethodBadRequest) GetPayload() *models.SettingsFlow { return o.Payload } @@ -155,7 +158,7 @@ func NewCompleteSelfServiceSettingsFlowWithPasswordMethodUnauthorized() *Complet return &CompleteSelfServiceSettingsFlowWithPasswordMethodUnauthorized{} } -/* CompleteSelfServiceSettingsFlowWithPasswordMethodUnauthorized describes a response with status code 401, with default header values. +/*CompleteSelfServiceSettingsFlowWithPasswordMethodUnauthorized handles this case with default header values. genericError */ @@ -166,6 +169,7 @@ type CompleteSelfServiceSettingsFlowWithPasswordMethodUnauthorized struct { func (o *CompleteSelfServiceSettingsFlowWithPasswordMethodUnauthorized) Error() string { return fmt.Sprintf("[POST /self-service/settings/methods/password][%d] completeSelfServiceSettingsFlowWithPasswordMethodUnauthorized %+v", 401, o.Payload) } + func (o *CompleteSelfServiceSettingsFlowWithPasswordMethodUnauthorized) GetPayload() *models.GenericError { return o.Payload } @@ -187,7 +191,7 @@ func NewCompleteSelfServiceSettingsFlowWithPasswordMethodForbidden() *CompleteSe return &CompleteSelfServiceSettingsFlowWithPasswordMethodForbidden{} } -/* CompleteSelfServiceSettingsFlowWithPasswordMethodForbidden describes a response with status code 403, with default header values. +/*CompleteSelfServiceSettingsFlowWithPasswordMethodForbidden handles this case with default header values. genericError */ @@ -198,6 +202,7 @@ type CompleteSelfServiceSettingsFlowWithPasswordMethodForbidden struct { func (o *CompleteSelfServiceSettingsFlowWithPasswordMethodForbidden) Error() string { return fmt.Sprintf("[POST /self-service/settings/methods/password][%d] completeSelfServiceSettingsFlowWithPasswordMethodForbidden %+v", 403, o.Payload) } + func (o *CompleteSelfServiceSettingsFlowWithPasswordMethodForbidden) GetPayload() *models.GenericError { return o.Payload } @@ -219,7 +224,7 @@ func NewCompleteSelfServiceSettingsFlowWithPasswordMethodInternalServerError() * return &CompleteSelfServiceSettingsFlowWithPasswordMethodInternalServerError{} } -/* CompleteSelfServiceSettingsFlowWithPasswordMethodInternalServerError describes a response with status code 500, with default header values. +/*CompleteSelfServiceSettingsFlowWithPasswordMethodInternalServerError handles this case with default header values. genericError */ @@ -230,6 +235,7 @@ type CompleteSelfServiceSettingsFlowWithPasswordMethodInternalServerError struct func (o *CompleteSelfServiceSettingsFlowWithPasswordMethodInternalServerError) Error() string { return fmt.Sprintf("[POST /self-service/settings/methods/password][%d] completeSelfServiceSettingsFlowWithPasswordMethodInternalServerError %+v", 500, o.Payload) } + func (o *CompleteSelfServiceSettingsFlowWithPasswordMethodInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/public/complete_self_service_settings_flow_with_profile_method_parameters.go b/internal/httpclient/client/public/complete_self_service_settings_flow_with_profile_method_parameters.go index 4016a104088..8c7507ba5aa 100644 --- a/internal/httpclient/client/public/complete_self_service_settings_flow_with_profile_method_parameters.go +++ b/internal/httpclient/client/public/complete_self_service_settings_flow_with_profile_method_parameters.go @@ -16,55 +16,55 @@ import ( "github.com/go-openapi/strfmt" ) -// NewCompleteSelfServiceSettingsFlowWithProfileMethodParams creates a new CompleteSelfServiceSettingsFlowWithProfileMethodParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewCompleteSelfServiceSettingsFlowWithProfileMethodParams creates a new CompleteSelfServiceSettingsFlowWithProfileMethodParams object +// with the default values initialized. func NewCompleteSelfServiceSettingsFlowWithProfileMethodParams() *CompleteSelfServiceSettingsFlowWithProfileMethodParams { + var () return &CompleteSelfServiceSettingsFlowWithProfileMethodParams{ + timeout: cr.DefaultTimeout, } } // NewCompleteSelfServiceSettingsFlowWithProfileMethodParamsWithTimeout creates a new CompleteSelfServiceSettingsFlowWithProfileMethodParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewCompleteSelfServiceSettingsFlowWithProfileMethodParamsWithTimeout(timeout time.Duration) *CompleteSelfServiceSettingsFlowWithProfileMethodParams { + var () return &CompleteSelfServiceSettingsFlowWithProfileMethodParams{ + timeout: timeout, } } // NewCompleteSelfServiceSettingsFlowWithProfileMethodParamsWithContext creates a new CompleteSelfServiceSettingsFlowWithProfileMethodParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewCompleteSelfServiceSettingsFlowWithProfileMethodParamsWithContext(ctx context.Context) *CompleteSelfServiceSettingsFlowWithProfileMethodParams { + var () return &CompleteSelfServiceSettingsFlowWithProfileMethodParams{ + Context: ctx, } } // NewCompleteSelfServiceSettingsFlowWithProfileMethodParamsWithHTTPClient creates a new CompleteSelfServiceSettingsFlowWithProfileMethodParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewCompleteSelfServiceSettingsFlowWithProfileMethodParamsWithHTTPClient(client *http.Client) *CompleteSelfServiceSettingsFlowWithProfileMethodParams { + var () return &CompleteSelfServiceSettingsFlowWithProfileMethodParams{ HTTPClient: client, } } -/* CompleteSelfServiceSettingsFlowWithProfileMethodParams contains all the parameters to send to the API endpoint - for the complete self service settings flow with profile method operation. - - Typically these are written to a http.Request. +/*CompleteSelfServiceSettingsFlowWithProfileMethodParams contains all the parameters to send to the API endpoint +for the complete self service settings flow with profile method operation typically these are written to a http.Request */ type CompleteSelfServiceSettingsFlowWithProfileMethodParams struct { - // Payload. + /*Payload*/ Payload interface{} + /*Flow + Flow is flow ID. - /* Flow. - - Flow is flow ID. */ Flow *string @@ -73,21 +73,6 @@ type CompleteSelfServiceSettingsFlowWithProfileMethodParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the complete self service settings flow with profile method params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CompleteSelfServiceSettingsFlowWithProfileMethodParams) WithDefaults() *CompleteSelfServiceSettingsFlowWithProfileMethodParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the complete self service settings flow with profile method params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CompleteSelfServiceSettingsFlowWithProfileMethodParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the complete self service settings flow with profile method params func (o *CompleteSelfServiceSettingsFlowWithProfileMethodParams) WithTimeout(timeout time.Duration) *CompleteSelfServiceSettingsFlowWithProfileMethodParams { o.SetTimeout(timeout) @@ -150,6 +135,7 @@ func (o *CompleteSelfServiceSettingsFlowWithProfileMethodParams) WriteToRequest( return err } var res []error + if o.Payload != nil { if err := r.SetBodyParam(o.Payload); err != nil { return err @@ -160,17 +146,16 @@ func (o *CompleteSelfServiceSettingsFlowWithProfileMethodParams) WriteToRequest( // query param flow var qrFlow string - if o.Flow != nil { qrFlow = *o.Flow } qFlow := qrFlow if qFlow != "" { - if err := r.SetQueryParam("flow", qFlow); err != nil { return err } } + } if len(res) > 0 { diff --git a/internal/httpclient/client/public/complete_self_service_settings_flow_with_profile_method_responses.go b/internal/httpclient/client/public/complete_self_service_settings_flow_with_profile_method_responses.go index 119f2628c58..04411685bae 100644 --- a/internal/httpclient/client/public/complete_self_service_settings_flow_with_profile_method_responses.go +++ b/internal/httpclient/client/public/complete_self_service_settings_flow_with_profile_method_responses.go @@ -59,6 +59,7 @@ func (o *CompleteSelfServiceSettingsFlowWithProfileMethodReader) ReadResponse(re return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -69,7 +70,7 @@ func NewCompleteSelfServiceSettingsFlowWithProfileMethodOK() *CompleteSelfServic return &CompleteSelfServiceSettingsFlowWithProfileMethodOK{} } -/* CompleteSelfServiceSettingsFlowWithProfileMethodOK describes a response with status code 200, with default header values. +/*CompleteSelfServiceSettingsFlowWithProfileMethodOK handles this case with default header values. settingsFlow */ @@ -80,6 +81,7 @@ type CompleteSelfServiceSettingsFlowWithProfileMethodOK struct { func (o *CompleteSelfServiceSettingsFlowWithProfileMethodOK) Error() string { return fmt.Sprintf("[POST /self-service/settings/methods/profile][%d] completeSelfServiceSettingsFlowWithProfileMethodOK %+v", 200, o.Payload) } + func (o *CompleteSelfServiceSettingsFlowWithProfileMethodOK) GetPayload() *models.SettingsFlow { return o.Payload } @@ -101,9 +103,9 @@ func NewCompleteSelfServiceSettingsFlowWithProfileMethodFound() *CompleteSelfSer return &CompleteSelfServiceSettingsFlowWithProfileMethodFound{} } -/* CompleteSelfServiceSettingsFlowWithProfileMethodFound describes a response with status code 302, with default header values. +/*CompleteSelfServiceSettingsFlowWithProfileMethodFound handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type CompleteSelfServiceSettingsFlowWithProfileMethodFound struct { @@ -123,7 +125,7 @@ func NewCompleteSelfServiceSettingsFlowWithProfileMethodBadRequest() *CompleteSe return &CompleteSelfServiceSettingsFlowWithProfileMethodBadRequest{} } -/* CompleteSelfServiceSettingsFlowWithProfileMethodBadRequest describes a response with status code 400, with default header values. +/*CompleteSelfServiceSettingsFlowWithProfileMethodBadRequest handles this case with default header values. settingsFlow */ @@ -134,6 +136,7 @@ type CompleteSelfServiceSettingsFlowWithProfileMethodBadRequest struct { func (o *CompleteSelfServiceSettingsFlowWithProfileMethodBadRequest) Error() string { return fmt.Sprintf("[POST /self-service/settings/methods/profile][%d] completeSelfServiceSettingsFlowWithProfileMethodBadRequest %+v", 400, o.Payload) } + func (o *CompleteSelfServiceSettingsFlowWithProfileMethodBadRequest) GetPayload() *models.SettingsFlow { return o.Payload } @@ -155,7 +158,7 @@ func NewCompleteSelfServiceSettingsFlowWithProfileMethodUnauthorized() *Complete return &CompleteSelfServiceSettingsFlowWithProfileMethodUnauthorized{} } -/* CompleteSelfServiceSettingsFlowWithProfileMethodUnauthorized describes a response with status code 401, with default header values. +/*CompleteSelfServiceSettingsFlowWithProfileMethodUnauthorized handles this case with default header values. genericError */ @@ -166,6 +169,7 @@ type CompleteSelfServiceSettingsFlowWithProfileMethodUnauthorized struct { func (o *CompleteSelfServiceSettingsFlowWithProfileMethodUnauthorized) Error() string { return fmt.Sprintf("[POST /self-service/settings/methods/profile][%d] completeSelfServiceSettingsFlowWithProfileMethodUnauthorized %+v", 401, o.Payload) } + func (o *CompleteSelfServiceSettingsFlowWithProfileMethodUnauthorized) GetPayload() *models.GenericError { return o.Payload } @@ -187,7 +191,7 @@ func NewCompleteSelfServiceSettingsFlowWithProfileMethodForbidden() *CompleteSel return &CompleteSelfServiceSettingsFlowWithProfileMethodForbidden{} } -/* CompleteSelfServiceSettingsFlowWithProfileMethodForbidden describes a response with status code 403, with default header values. +/*CompleteSelfServiceSettingsFlowWithProfileMethodForbidden handles this case with default header values. genericError */ @@ -198,6 +202,7 @@ type CompleteSelfServiceSettingsFlowWithProfileMethodForbidden struct { func (o *CompleteSelfServiceSettingsFlowWithProfileMethodForbidden) Error() string { return fmt.Sprintf("[POST /self-service/settings/methods/profile][%d] completeSelfServiceSettingsFlowWithProfileMethodForbidden %+v", 403, o.Payload) } + func (o *CompleteSelfServiceSettingsFlowWithProfileMethodForbidden) GetPayload() *models.GenericError { return o.Payload } @@ -219,7 +224,7 @@ func NewCompleteSelfServiceSettingsFlowWithProfileMethodInternalServerError() *C return &CompleteSelfServiceSettingsFlowWithProfileMethodInternalServerError{} } -/* CompleteSelfServiceSettingsFlowWithProfileMethodInternalServerError describes a response with status code 500, with default header values. +/*CompleteSelfServiceSettingsFlowWithProfileMethodInternalServerError handles this case with default header values. genericError */ @@ -230,6 +235,7 @@ type CompleteSelfServiceSettingsFlowWithProfileMethodInternalServerError struct func (o *CompleteSelfServiceSettingsFlowWithProfileMethodInternalServerError) Error() string { return fmt.Sprintf("[POST /self-service/settings/methods/profile][%d] completeSelfServiceSettingsFlowWithProfileMethodInternalServerError %+v", 500, o.Payload) } + func (o *CompleteSelfServiceSettingsFlowWithProfileMethodInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/public/complete_self_service_verification_flow_with_link_method_parameters.go b/internal/httpclient/client/public/complete_self_service_verification_flow_with_link_method_parameters.go index c7822e131d7..f99e828fb95 100644 --- a/internal/httpclient/client/public/complete_self_service_verification_flow_with_link_method_parameters.go +++ b/internal/httpclient/client/public/complete_self_service_verification_flow_with_link_method_parameters.go @@ -18,66 +18,65 @@ import ( "github.com/ory/kratos-client-go/models" ) -// NewCompleteSelfServiceVerificationFlowWithLinkMethodParams creates a new CompleteSelfServiceVerificationFlowWithLinkMethodParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewCompleteSelfServiceVerificationFlowWithLinkMethodParams creates a new CompleteSelfServiceVerificationFlowWithLinkMethodParams object +// with the default values initialized. func NewCompleteSelfServiceVerificationFlowWithLinkMethodParams() *CompleteSelfServiceVerificationFlowWithLinkMethodParams { + var () return &CompleteSelfServiceVerificationFlowWithLinkMethodParams{ + timeout: cr.DefaultTimeout, } } // NewCompleteSelfServiceVerificationFlowWithLinkMethodParamsWithTimeout creates a new CompleteSelfServiceVerificationFlowWithLinkMethodParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewCompleteSelfServiceVerificationFlowWithLinkMethodParamsWithTimeout(timeout time.Duration) *CompleteSelfServiceVerificationFlowWithLinkMethodParams { + var () return &CompleteSelfServiceVerificationFlowWithLinkMethodParams{ + timeout: timeout, } } // NewCompleteSelfServiceVerificationFlowWithLinkMethodParamsWithContext creates a new CompleteSelfServiceVerificationFlowWithLinkMethodParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewCompleteSelfServiceVerificationFlowWithLinkMethodParamsWithContext(ctx context.Context) *CompleteSelfServiceVerificationFlowWithLinkMethodParams { + var () return &CompleteSelfServiceVerificationFlowWithLinkMethodParams{ + Context: ctx, } } // NewCompleteSelfServiceVerificationFlowWithLinkMethodParamsWithHTTPClient creates a new CompleteSelfServiceVerificationFlowWithLinkMethodParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewCompleteSelfServiceVerificationFlowWithLinkMethodParamsWithHTTPClient(client *http.Client) *CompleteSelfServiceVerificationFlowWithLinkMethodParams { + var () return &CompleteSelfServiceVerificationFlowWithLinkMethodParams{ HTTPClient: client, } } -/* CompleteSelfServiceVerificationFlowWithLinkMethodParams contains all the parameters to send to the API endpoint - for the complete self service verification flow with link method operation. - - Typically these are written to a http.Request. +/*CompleteSelfServiceVerificationFlowWithLinkMethodParams contains all the parameters to send to the API endpoint +for the complete self service verification flow with link method operation typically these are written to a http.Request */ type CompleteSelfServiceVerificationFlowWithLinkMethodParams struct { - // Body. + /*Body*/ Body *models.CompleteSelfServiceVerificationFlowWithLinkMethod - - /* Flow. - - The Flow ID + /*Flow + The Flow ID format: uuid + */ Flow *string - - /* Token. - - Verification Token + /*Token + Verification Token The verification token which completes the verification request. If the token is invalid (e.g. expired) an error will be shown to the end-user. + */ Token *string @@ -86,21 +85,6 @@ type CompleteSelfServiceVerificationFlowWithLinkMethodParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the complete self service verification flow with link method params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CompleteSelfServiceVerificationFlowWithLinkMethodParams) WithDefaults() *CompleteSelfServiceVerificationFlowWithLinkMethodParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the complete self service verification flow with link method params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CompleteSelfServiceVerificationFlowWithLinkMethodParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the complete self service verification flow with link method params func (o *CompleteSelfServiceVerificationFlowWithLinkMethodParams) WithTimeout(timeout time.Duration) *CompleteSelfServiceVerificationFlowWithLinkMethodParams { o.SetTimeout(timeout) @@ -174,6 +158,7 @@ func (o *CompleteSelfServiceVerificationFlowWithLinkMethodParams) WriteToRequest return err } var res []error + if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err @@ -184,34 +169,32 @@ func (o *CompleteSelfServiceVerificationFlowWithLinkMethodParams) WriteToRequest // query param flow var qrFlow string - if o.Flow != nil { qrFlow = *o.Flow } qFlow := qrFlow if qFlow != "" { - if err := r.SetQueryParam("flow", qFlow); err != nil { return err } } + } if o.Token != nil { // query param token var qrToken string - if o.Token != nil { qrToken = *o.Token } qToken := qrToken if qToken != "" { - if err := r.SetQueryParam("token", qToken); err != nil { return err } } + } if len(res) > 0 { diff --git a/internal/httpclient/client/public/complete_self_service_verification_flow_with_link_method_responses.go b/internal/httpclient/client/public/complete_self_service_verification_flow_with_link_method_responses.go index 550e7329091..ebe7d229351 100644 --- a/internal/httpclient/client/public/complete_self_service_verification_flow_with_link_method_responses.go +++ b/internal/httpclient/client/public/complete_self_service_verification_flow_with_link_method_responses.go @@ -41,6 +41,7 @@ func (o *CompleteSelfServiceVerificationFlowWithLinkMethodReader) ReadResponse(r return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -51,9 +52,9 @@ func NewCompleteSelfServiceVerificationFlowWithLinkMethodFound() *CompleteSelfSe return &CompleteSelfServiceVerificationFlowWithLinkMethodFound{} } -/* CompleteSelfServiceVerificationFlowWithLinkMethodFound describes a response with status code 302, with default header values. +/*CompleteSelfServiceVerificationFlowWithLinkMethodFound handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type CompleteSelfServiceVerificationFlowWithLinkMethodFound struct { @@ -73,7 +74,7 @@ func NewCompleteSelfServiceVerificationFlowWithLinkMethodBadRequest() *CompleteS return &CompleteSelfServiceVerificationFlowWithLinkMethodBadRequest{} } -/* CompleteSelfServiceVerificationFlowWithLinkMethodBadRequest describes a response with status code 400, with default header values. +/*CompleteSelfServiceVerificationFlowWithLinkMethodBadRequest handles this case with default header values. verificationFlow */ @@ -84,6 +85,7 @@ type CompleteSelfServiceVerificationFlowWithLinkMethodBadRequest struct { func (o *CompleteSelfServiceVerificationFlowWithLinkMethodBadRequest) Error() string { return fmt.Sprintf("[POST /self-service/verification/methods/link][%d] completeSelfServiceVerificationFlowWithLinkMethodBadRequest %+v", 400, o.Payload) } + func (o *CompleteSelfServiceVerificationFlowWithLinkMethodBadRequest) GetPayload() *models.VerificationFlow { return o.Payload } @@ -105,7 +107,7 @@ func NewCompleteSelfServiceVerificationFlowWithLinkMethodInternalServerError() * return &CompleteSelfServiceVerificationFlowWithLinkMethodInternalServerError{} } -/* CompleteSelfServiceVerificationFlowWithLinkMethodInternalServerError describes a response with status code 500, with default header values. +/*CompleteSelfServiceVerificationFlowWithLinkMethodInternalServerError handles this case with default header values. genericError */ @@ -116,6 +118,7 @@ type CompleteSelfServiceVerificationFlowWithLinkMethodInternalServerError struct func (o *CompleteSelfServiceVerificationFlowWithLinkMethodInternalServerError) Error() string { return fmt.Sprintf("[POST /self-service/verification/methods/link][%d] completeSelfServiceVerificationFlowWithLinkMethodInternalServerError %+v", 500, o.Payload) } + func (o *CompleteSelfServiceVerificationFlowWithLinkMethodInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/public/get_schema_parameters.go b/internal/httpclient/client/public/get_schema_parameters.go index 16ba135d0f8..f7469415eb2 100644 --- a/internal/httpclient/client/public/get_schema_parameters.go +++ b/internal/httpclient/client/public/get_schema_parameters.go @@ -16,52 +16,53 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetSchemaParams creates a new GetSchemaParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewGetSchemaParams creates a new GetSchemaParams object +// with the default values initialized. func NewGetSchemaParams() *GetSchemaParams { + var () return &GetSchemaParams{ + timeout: cr.DefaultTimeout, } } // NewGetSchemaParamsWithTimeout creates a new GetSchemaParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewGetSchemaParamsWithTimeout(timeout time.Duration) *GetSchemaParams { + var () return &GetSchemaParams{ + timeout: timeout, } } // NewGetSchemaParamsWithContext creates a new GetSchemaParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewGetSchemaParamsWithContext(ctx context.Context) *GetSchemaParams { + var () return &GetSchemaParams{ + Context: ctx, } } // NewGetSchemaParamsWithHTTPClient creates a new GetSchemaParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewGetSchemaParamsWithHTTPClient(client *http.Client) *GetSchemaParams { + var () return &GetSchemaParams{ HTTPClient: client, } } -/* GetSchemaParams contains all the parameters to send to the API endpoint - for the get schema operation. - - Typically these are written to a http.Request. +/*GetSchemaParams contains all the parameters to send to the API endpoint +for the get schema operation typically these are written to a http.Request */ type GetSchemaParams struct { - /* ID. + /*ID + ID must be set to the ID of schema you want to get - ID must be set to the ID of schema you want to get */ ID string @@ -70,21 +71,6 @@ type GetSchemaParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the get schema params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetSchemaParams) WithDefaults() *GetSchemaParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get schema params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetSchemaParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the get schema params func (o *GetSchemaParams) WithTimeout(timeout time.Duration) *GetSchemaParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/public/get_schema_responses.go b/internal/httpclient/client/public/get_schema_responses.go index f603329eff9..c2db66aeb5b 100644 --- a/internal/httpclient/client/public/get_schema_responses.go +++ b/internal/httpclient/client/public/get_schema_responses.go @@ -41,6 +41,7 @@ func (o *GetSchemaReader) ReadResponse(response runtime.ClientResponse, consumer return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -51,7 +52,7 @@ func NewGetSchemaOK() *GetSchemaOK { return &GetSchemaOK{} } -/* GetSchemaOK describes a response with status code 200, with default header values. +/*GetSchemaOK handles this case with default header values. The raw identity traits schema */ @@ -62,6 +63,7 @@ type GetSchemaOK struct { func (o *GetSchemaOK) Error() string { return fmt.Sprintf("[GET /schemas/{id}][%d] getSchemaOK %+v", 200, o.Payload) } + func (o *GetSchemaOK) GetPayload() interface{} { return o.Payload } @@ -81,7 +83,7 @@ func NewGetSchemaNotFound() *GetSchemaNotFound { return &GetSchemaNotFound{} } -/* GetSchemaNotFound describes a response with status code 404, with default header values. +/*GetSchemaNotFound handles this case with default header values. genericError */ @@ -92,6 +94,7 @@ type GetSchemaNotFound struct { func (o *GetSchemaNotFound) Error() string { return fmt.Sprintf("[GET /schemas/{id}][%d] getSchemaNotFound %+v", 404, o.Payload) } + func (o *GetSchemaNotFound) GetPayload() *models.GenericError { return o.Payload } @@ -113,7 +116,7 @@ func NewGetSchemaInternalServerError() *GetSchemaInternalServerError { return &GetSchemaInternalServerError{} } -/* GetSchemaInternalServerError describes a response with status code 500, with default header values. +/*GetSchemaInternalServerError handles this case with default header values. genericError */ @@ -124,6 +127,7 @@ type GetSchemaInternalServerError struct { func (o *GetSchemaInternalServerError) Error() string { return fmt.Sprintf("[GET /schemas/{id}][%d] getSchemaInternalServerError %+v", 500, o.Payload) } + func (o *GetSchemaInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/public/get_self_service_error_parameters.go b/internal/httpclient/client/public/get_self_service_error_parameters.go index 3652586a5e4..f604c555984 100644 --- a/internal/httpclient/client/public/get_self_service_error_parameters.go +++ b/internal/httpclient/client/public/get_self_service_error_parameters.go @@ -16,52 +16,53 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetSelfServiceErrorParams creates a new GetSelfServiceErrorParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewGetSelfServiceErrorParams creates a new GetSelfServiceErrorParams object +// with the default values initialized. func NewGetSelfServiceErrorParams() *GetSelfServiceErrorParams { + var () return &GetSelfServiceErrorParams{ + timeout: cr.DefaultTimeout, } } // NewGetSelfServiceErrorParamsWithTimeout creates a new GetSelfServiceErrorParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewGetSelfServiceErrorParamsWithTimeout(timeout time.Duration) *GetSelfServiceErrorParams { + var () return &GetSelfServiceErrorParams{ + timeout: timeout, } } // NewGetSelfServiceErrorParamsWithContext creates a new GetSelfServiceErrorParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewGetSelfServiceErrorParamsWithContext(ctx context.Context) *GetSelfServiceErrorParams { + var () return &GetSelfServiceErrorParams{ + Context: ctx, } } // NewGetSelfServiceErrorParamsWithHTTPClient creates a new GetSelfServiceErrorParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewGetSelfServiceErrorParamsWithHTTPClient(client *http.Client) *GetSelfServiceErrorParams { + var () return &GetSelfServiceErrorParams{ HTTPClient: client, } } -/* GetSelfServiceErrorParams contains all the parameters to send to the API endpoint - for the get self service error operation. - - Typically these are written to a http.Request. +/*GetSelfServiceErrorParams contains all the parameters to send to the API endpoint +for the get self service error operation typically these are written to a http.Request */ type GetSelfServiceErrorParams struct { - /* Error. + /*Error + Error is the container's ID - Error is the container's ID */ Error string @@ -70,21 +71,6 @@ type GetSelfServiceErrorParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the get self service error params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetSelfServiceErrorParams) WithDefaults() *GetSelfServiceErrorParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get self service error params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetSelfServiceErrorParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the get self service error params func (o *GetSelfServiceErrorParams) WithTimeout(timeout time.Duration) *GetSelfServiceErrorParams { o.SetTimeout(timeout) @@ -141,7 +127,6 @@ func (o *GetSelfServiceErrorParams) WriteToRequest(r runtime.ClientRequest, reg qrError := o.Error qError := qrError if qError != "" { - if err := r.SetQueryParam("error", qError); err != nil { return err } diff --git a/internal/httpclient/client/public/get_self_service_error_responses.go b/internal/httpclient/client/public/get_self_service_error_responses.go index 7a5bdc66449..9964a2036ba 100644 --- a/internal/httpclient/client/public/get_self_service_error_responses.go +++ b/internal/httpclient/client/public/get_self_service_error_responses.go @@ -47,6 +47,7 @@ func (o *GetSelfServiceErrorReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -57,7 +58,7 @@ func NewGetSelfServiceErrorOK() *GetSelfServiceErrorOK { return &GetSelfServiceErrorOK{} } -/* GetSelfServiceErrorOK describes a response with status code 200, with default header values. +/*GetSelfServiceErrorOK handles this case with default header values. User-facing error response */ @@ -68,6 +69,7 @@ type GetSelfServiceErrorOK struct { func (o *GetSelfServiceErrorOK) Error() string { return fmt.Sprintf("[GET /self-service/errors][%d] getSelfServiceErrorOK %+v", 200, o.Payload) } + func (o *GetSelfServiceErrorOK) GetPayload() *models.ErrorContainer { return o.Payload } @@ -89,7 +91,7 @@ func NewGetSelfServiceErrorForbidden() *GetSelfServiceErrorForbidden { return &GetSelfServiceErrorForbidden{} } -/* GetSelfServiceErrorForbidden describes a response with status code 403, with default header values. +/*GetSelfServiceErrorForbidden handles this case with default header values. genericError */ @@ -100,6 +102,7 @@ type GetSelfServiceErrorForbidden struct { func (o *GetSelfServiceErrorForbidden) Error() string { return fmt.Sprintf("[GET /self-service/errors][%d] getSelfServiceErrorForbidden %+v", 403, o.Payload) } + func (o *GetSelfServiceErrorForbidden) GetPayload() *models.GenericError { return o.Payload } @@ -121,7 +124,7 @@ func NewGetSelfServiceErrorNotFound() *GetSelfServiceErrorNotFound { return &GetSelfServiceErrorNotFound{} } -/* GetSelfServiceErrorNotFound describes a response with status code 404, with default header values. +/*GetSelfServiceErrorNotFound handles this case with default header values. genericError */ @@ -132,6 +135,7 @@ type GetSelfServiceErrorNotFound struct { func (o *GetSelfServiceErrorNotFound) Error() string { return fmt.Sprintf("[GET /self-service/errors][%d] getSelfServiceErrorNotFound %+v", 404, o.Payload) } + func (o *GetSelfServiceErrorNotFound) GetPayload() *models.GenericError { return o.Payload } @@ -153,7 +157,7 @@ func NewGetSelfServiceErrorInternalServerError() *GetSelfServiceErrorInternalSer return &GetSelfServiceErrorInternalServerError{} } -/* GetSelfServiceErrorInternalServerError describes a response with status code 500, with default header values. +/*GetSelfServiceErrorInternalServerError handles this case with default header values. genericError */ @@ -164,6 +168,7 @@ type GetSelfServiceErrorInternalServerError struct { func (o *GetSelfServiceErrorInternalServerError) Error() string { return fmt.Sprintf("[GET /self-service/errors][%d] getSelfServiceErrorInternalServerError %+v", 500, o.Payload) } + func (o *GetSelfServiceErrorInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/public/get_self_service_login_flow_parameters.go b/internal/httpclient/client/public/get_self_service_login_flow_parameters.go index 3f0441b77af..cf86fe3f45d 100644 --- a/internal/httpclient/client/public/get_self_service_login_flow_parameters.go +++ b/internal/httpclient/client/public/get_self_service_login_flow_parameters.go @@ -16,55 +16,56 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetSelfServiceLoginFlowParams creates a new GetSelfServiceLoginFlowParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewGetSelfServiceLoginFlowParams creates a new GetSelfServiceLoginFlowParams object +// with the default values initialized. func NewGetSelfServiceLoginFlowParams() *GetSelfServiceLoginFlowParams { + var () return &GetSelfServiceLoginFlowParams{ + timeout: cr.DefaultTimeout, } } // NewGetSelfServiceLoginFlowParamsWithTimeout creates a new GetSelfServiceLoginFlowParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewGetSelfServiceLoginFlowParamsWithTimeout(timeout time.Duration) *GetSelfServiceLoginFlowParams { + var () return &GetSelfServiceLoginFlowParams{ + timeout: timeout, } } // NewGetSelfServiceLoginFlowParamsWithContext creates a new GetSelfServiceLoginFlowParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewGetSelfServiceLoginFlowParamsWithContext(ctx context.Context) *GetSelfServiceLoginFlowParams { + var () return &GetSelfServiceLoginFlowParams{ + Context: ctx, } } // NewGetSelfServiceLoginFlowParamsWithHTTPClient creates a new GetSelfServiceLoginFlowParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewGetSelfServiceLoginFlowParamsWithHTTPClient(client *http.Client) *GetSelfServiceLoginFlowParams { + var () return &GetSelfServiceLoginFlowParams{ HTTPClient: client, } } -/* GetSelfServiceLoginFlowParams contains all the parameters to send to the API endpoint - for the get self service login flow operation. - - Typically these are written to a http.Request. +/*GetSelfServiceLoginFlowParams contains all the parameters to send to the API endpoint +for the get self service login flow operation typically these are written to a http.Request */ type GetSelfServiceLoginFlowParams struct { - /* ID. - - The Login Flow ID + /*ID + The Login Flow ID The value for this parameter comes from `flow` URL Query parameter sent to your application (e.g. `/login?flow=abcde`). + */ ID string @@ -73,21 +74,6 @@ type GetSelfServiceLoginFlowParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the get self service login flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetSelfServiceLoginFlowParams) WithDefaults() *GetSelfServiceLoginFlowParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get self service login flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetSelfServiceLoginFlowParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the get self service login flow params func (o *GetSelfServiceLoginFlowParams) WithTimeout(timeout time.Duration) *GetSelfServiceLoginFlowParams { o.SetTimeout(timeout) @@ -144,7 +130,6 @@ func (o *GetSelfServiceLoginFlowParams) WriteToRequest(r runtime.ClientRequest, qrID := o.ID qID := qrID if qID != "" { - if err := r.SetQueryParam("id", qID); err != nil { return err } diff --git a/internal/httpclient/client/public/get_self_service_login_flow_responses.go b/internal/httpclient/client/public/get_self_service_login_flow_responses.go index 642bacc1923..3a6db9f53b2 100644 --- a/internal/httpclient/client/public/get_self_service_login_flow_responses.go +++ b/internal/httpclient/client/public/get_self_service_login_flow_responses.go @@ -53,6 +53,7 @@ func (o *GetSelfServiceLoginFlowReader) ReadResponse(response runtime.ClientResp return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -63,7 +64,7 @@ func NewGetSelfServiceLoginFlowOK() *GetSelfServiceLoginFlowOK { return &GetSelfServiceLoginFlowOK{} } -/* GetSelfServiceLoginFlowOK describes a response with status code 200, with default header values. +/*GetSelfServiceLoginFlowOK handles this case with default header values. loginFlow */ @@ -74,6 +75,7 @@ type GetSelfServiceLoginFlowOK struct { func (o *GetSelfServiceLoginFlowOK) Error() string { return fmt.Sprintf("[GET /self-service/login/flows][%d] getSelfServiceLoginFlowOK %+v", 200, o.Payload) } + func (o *GetSelfServiceLoginFlowOK) GetPayload() *models.LoginFlow { return o.Payload } @@ -95,7 +97,7 @@ func NewGetSelfServiceLoginFlowForbidden() *GetSelfServiceLoginFlowForbidden { return &GetSelfServiceLoginFlowForbidden{} } -/* GetSelfServiceLoginFlowForbidden describes a response with status code 403, with default header values. +/*GetSelfServiceLoginFlowForbidden handles this case with default header values. genericError */ @@ -106,6 +108,7 @@ type GetSelfServiceLoginFlowForbidden struct { func (o *GetSelfServiceLoginFlowForbidden) Error() string { return fmt.Sprintf("[GET /self-service/login/flows][%d] getSelfServiceLoginFlowForbidden %+v", 403, o.Payload) } + func (o *GetSelfServiceLoginFlowForbidden) GetPayload() *models.GenericError { return o.Payload } @@ -127,7 +130,7 @@ func NewGetSelfServiceLoginFlowNotFound() *GetSelfServiceLoginFlowNotFound { return &GetSelfServiceLoginFlowNotFound{} } -/* GetSelfServiceLoginFlowNotFound describes a response with status code 404, with default header values. +/*GetSelfServiceLoginFlowNotFound handles this case with default header values. genericError */ @@ -138,6 +141,7 @@ type GetSelfServiceLoginFlowNotFound struct { func (o *GetSelfServiceLoginFlowNotFound) Error() string { return fmt.Sprintf("[GET /self-service/login/flows][%d] getSelfServiceLoginFlowNotFound %+v", 404, o.Payload) } + func (o *GetSelfServiceLoginFlowNotFound) GetPayload() *models.GenericError { return o.Payload } @@ -159,7 +163,7 @@ func NewGetSelfServiceLoginFlowGone() *GetSelfServiceLoginFlowGone { return &GetSelfServiceLoginFlowGone{} } -/* GetSelfServiceLoginFlowGone describes a response with status code 410, with default header values. +/*GetSelfServiceLoginFlowGone handles this case with default header values. genericError */ @@ -170,6 +174,7 @@ type GetSelfServiceLoginFlowGone struct { func (o *GetSelfServiceLoginFlowGone) Error() string { return fmt.Sprintf("[GET /self-service/login/flows][%d] getSelfServiceLoginFlowGone %+v", 410, o.Payload) } + func (o *GetSelfServiceLoginFlowGone) GetPayload() *models.GenericError { return o.Payload } @@ -191,7 +196,7 @@ func NewGetSelfServiceLoginFlowInternalServerError() *GetSelfServiceLoginFlowInt return &GetSelfServiceLoginFlowInternalServerError{} } -/* GetSelfServiceLoginFlowInternalServerError describes a response with status code 500, with default header values. +/*GetSelfServiceLoginFlowInternalServerError handles this case with default header values. genericError */ @@ -202,6 +207,7 @@ type GetSelfServiceLoginFlowInternalServerError struct { func (o *GetSelfServiceLoginFlowInternalServerError) Error() string { return fmt.Sprintf("[GET /self-service/login/flows][%d] getSelfServiceLoginFlowInternalServerError %+v", 500, o.Payload) } + func (o *GetSelfServiceLoginFlowInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/public/get_self_service_recovery_flow_parameters.go b/internal/httpclient/client/public/get_self_service_recovery_flow_parameters.go index 9043f01d449..cccd2ad9b0e 100644 --- a/internal/httpclient/client/public/get_self_service_recovery_flow_parameters.go +++ b/internal/httpclient/client/public/get_self_service_recovery_flow_parameters.go @@ -16,55 +16,56 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetSelfServiceRecoveryFlowParams creates a new GetSelfServiceRecoveryFlowParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewGetSelfServiceRecoveryFlowParams creates a new GetSelfServiceRecoveryFlowParams object +// with the default values initialized. func NewGetSelfServiceRecoveryFlowParams() *GetSelfServiceRecoveryFlowParams { + var () return &GetSelfServiceRecoveryFlowParams{ + timeout: cr.DefaultTimeout, } } // NewGetSelfServiceRecoveryFlowParamsWithTimeout creates a new GetSelfServiceRecoveryFlowParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewGetSelfServiceRecoveryFlowParamsWithTimeout(timeout time.Duration) *GetSelfServiceRecoveryFlowParams { + var () return &GetSelfServiceRecoveryFlowParams{ + timeout: timeout, } } // NewGetSelfServiceRecoveryFlowParamsWithContext creates a new GetSelfServiceRecoveryFlowParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewGetSelfServiceRecoveryFlowParamsWithContext(ctx context.Context) *GetSelfServiceRecoveryFlowParams { + var () return &GetSelfServiceRecoveryFlowParams{ + Context: ctx, } } // NewGetSelfServiceRecoveryFlowParamsWithHTTPClient creates a new GetSelfServiceRecoveryFlowParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewGetSelfServiceRecoveryFlowParamsWithHTTPClient(client *http.Client) *GetSelfServiceRecoveryFlowParams { + var () return &GetSelfServiceRecoveryFlowParams{ HTTPClient: client, } } -/* GetSelfServiceRecoveryFlowParams contains all the parameters to send to the API endpoint - for the get self service recovery flow operation. - - Typically these are written to a http.Request. +/*GetSelfServiceRecoveryFlowParams contains all the parameters to send to the API endpoint +for the get self service recovery flow operation typically these are written to a http.Request */ type GetSelfServiceRecoveryFlowParams struct { - /* ID. - - The Flow ID + /*ID + The Flow ID The value for this parameter comes from `request` URL Query parameter sent to your application (e.g. `/recovery?flow=abcde`). + */ ID string @@ -73,21 +74,6 @@ type GetSelfServiceRecoveryFlowParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the get self service recovery flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetSelfServiceRecoveryFlowParams) WithDefaults() *GetSelfServiceRecoveryFlowParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get self service recovery flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetSelfServiceRecoveryFlowParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the get self service recovery flow params func (o *GetSelfServiceRecoveryFlowParams) WithTimeout(timeout time.Duration) *GetSelfServiceRecoveryFlowParams { o.SetTimeout(timeout) @@ -144,7 +130,6 @@ func (o *GetSelfServiceRecoveryFlowParams) WriteToRequest(r runtime.ClientReques qrID := o.ID qID := qrID if qID != "" { - if err := r.SetQueryParam("id", qID); err != nil { return err } diff --git a/internal/httpclient/client/public/get_self_service_recovery_flow_responses.go b/internal/httpclient/client/public/get_self_service_recovery_flow_responses.go index 35164ae84ec..334da409585 100644 --- a/internal/httpclient/client/public/get_self_service_recovery_flow_responses.go +++ b/internal/httpclient/client/public/get_self_service_recovery_flow_responses.go @@ -47,6 +47,7 @@ func (o *GetSelfServiceRecoveryFlowReader) ReadResponse(response runtime.ClientR return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -57,7 +58,7 @@ func NewGetSelfServiceRecoveryFlowOK() *GetSelfServiceRecoveryFlowOK { return &GetSelfServiceRecoveryFlowOK{} } -/* GetSelfServiceRecoveryFlowOK describes a response with status code 200, with default header values. +/*GetSelfServiceRecoveryFlowOK handles this case with default header values. recoveryFlow */ @@ -68,6 +69,7 @@ type GetSelfServiceRecoveryFlowOK struct { func (o *GetSelfServiceRecoveryFlowOK) Error() string { return fmt.Sprintf("[GET /self-service/recovery/flows][%d] getSelfServiceRecoveryFlowOK %+v", 200, o.Payload) } + func (o *GetSelfServiceRecoveryFlowOK) GetPayload() *models.RecoveryFlow { return o.Payload } @@ -89,7 +91,7 @@ func NewGetSelfServiceRecoveryFlowNotFound() *GetSelfServiceRecoveryFlowNotFound return &GetSelfServiceRecoveryFlowNotFound{} } -/* GetSelfServiceRecoveryFlowNotFound describes a response with status code 404, with default header values. +/*GetSelfServiceRecoveryFlowNotFound handles this case with default header values. genericError */ @@ -100,6 +102,7 @@ type GetSelfServiceRecoveryFlowNotFound struct { func (o *GetSelfServiceRecoveryFlowNotFound) Error() string { return fmt.Sprintf("[GET /self-service/recovery/flows][%d] getSelfServiceRecoveryFlowNotFound %+v", 404, o.Payload) } + func (o *GetSelfServiceRecoveryFlowNotFound) GetPayload() *models.GenericError { return o.Payload } @@ -121,7 +124,7 @@ func NewGetSelfServiceRecoveryFlowGone() *GetSelfServiceRecoveryFlowGone { return &GetSelfServiceRecoveryFlowGone{} } -/* GetSelfServiceRecoveryFlowGone describes a response with status code 410, with default header values. +/*GetSelfServiceRecoveryFlowGone handles this case with default header values. genericError */ @@ -132,6 +135,7 @@ type GetSelfServiceRecoveryFlowGone struct { func (o *GetSelfServiceRecoveryFlowGone) Error() string { return fmt.Sprintf("[GET /self-service/recovery/flows][%d] getSelfServiceRecoveryFlowGone %+v", 410, o.Payload) } + func (o *GetSelfServiceRecoveryFlowGone) GetPayload() *models.GenericError { return o.Payload } @@ -153,7 +157,7 @@ func NewGetSelfServiceRecoveryFlowInternalServerError() *GetSelfServiceRecoveryF return &GetSelfServiceRecoveryFlowInternalServerError{} } -/* GetSelfServiceRecoveryFlowInternalServerError describes a response with status code 500, with default header values. +/*GetSelfServiceRecoveryFlowInternalServerError handles this case with default header values. genericError */ @@ -164,6 +168,7 @@ type GetSelfServiceRecoveryFlowInternalServerError struct { func (o *GetSelfServiceRecoveryFlowInternalServerError) Error() string { return fmt.Sprintf("[GET /self-service/recovery/flows][%d] getSelfServiceRecoveryFlowInternalServerError %+v", 500, o.Payload) } + func (o *GetSelfServiceRecoveryFlowInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/public/get_self_service_registration_flow_parameters.go b/internal/httpclient/client/public/get_self_service_registration_flow_parameters.go index 9f9efb93104..f9383eae232 100644 --- a/internal/httpclient/client/public/get_self_service_registration_flow_parameters.go +++ b/internal/httpclient/client/public/get_self_service_registration_flow_parameters.go @@ -16,55 +16,56 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetSelfServiceRegistrationFlowParams creates a new GetSelfServiceRegistrationFlowParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewGetSelfServiceRegistrationFlowParams creates a new GetSelfServiceRegistrationFlowParams object +// with the default values initialized. func NewGetSelfServiceRegistrationFlowParams() *GetSelfServiceRegistrationFlowParams { + var () return &GetSelfServiceRegistrationFlowParams{ + timeout: cr.DefaultTimeout, } } // NewGetSelfServiceRegistrationFlowParamsWithTimeout creates a new GetSelfServiceRegistrationFlowParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewGetSelfServiceRegistrationFlowParamsWithTimeout(timeout time.Duration) *GetSelfServiceRegistrationFlowParams { + var () return &GetSelfServiceRegistrationFlowParams{ + timeout: timeout, } } // NewGetSelfServiceRegistrationFlowParamsWithContext creates a new GetSelfServiceRegistrationFlowParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewGetSelfServiceRegistrationFlowParamsWithContext(ctx context.Context) *GetSelfServiceRegistrationFlowParams { + var () return &GetSelfServiceRegistrationFlowParams{ + Context: ctx, } } // NewGetSelfServiceRegistrationFlowParamsWithHTTPClient creates a new GetSelfServiceRegistrationFlowParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewGetSelfServiceRegistrationFlowParamsWithHTTPClient(client *http.Client) *GetSelfServiceRegistrationFlowParams { + var () return &GetSelfServiceRegistrationFlowParams{ HTTPClient: client, } } -/* GetSelfServiceRegistrationFlowParams contains all the parameters to send to the API endpoint - for the get self service registration flow operation. - - Typically these are written to a http.Request. +/*GetSelfServiceRegistrationFlowParams contains all the parameters to send to the API endpoint +for the get self service registration flow operation typically these are written to a http.Request */ type GetSelfServiceRegistrationFlowParams struct { - /* ID. - - The Registration Flow ID + /*ID + The Registration Flow ID The value for this parameter comes from `flow` URL Query parameter sent to your application (e.g. `/registration?flow=abcde`). + */ ID string @@ -73,21 +74,6 @@ type GetSelfServiceRegistrationFlowParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the get self service registration flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetSelfServiceRegistrationFlowParams) WithDefaults() *GetSelfServiceRegistrationFlowParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get self service registration flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetSelfServiceRegistrationFlowParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the get self service registration flow params func (o *GetSelfServiceRegistrationFlowParams) WithTimeout(timeout time.Duration) *GetSelfServiceRegistrationFlowParams { o.SetTimeout(timeout) @@ -144,7 +130,6 @@ func (o *GetSelfServiceRegistrationFlowParams) WriteToRequest(r runtime.ClientRe qrID := o.ID qID := qrID if qID != "" { - if err := r.SetQueryParam("id", qID); err != nil { return err } diff --git a/internal/httpclient/client/public/get_self_service_registration_flow_responses.go b/internal/httpclient/client/public/get_self_service_registration_flow_responses.go index 1a56fda6cd7..80501824a68 100644 --- a/internal/httpclient/client/public/get_self_service_registration_flow_responses.go +++ b/internal/httpclient/client/public/get_self_service_registration_flow_responses.go @@ -53,6 +53,7 @@ func (o *GetSelfServiceRegistrationFlowReader) ReadResponse(response runtime.Cli return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -63,7 +64,7 @@ func NewGetSelfServiceRegistrationFlowOK() *GetSelfServiceRegistrationFlowOK { return &GetSelfServiceRegistrationFlowOK{} } -/* GetSelfServiceRegistrationFlowOK describes a response with status code 200, with default header values. +/*GetSelfServiceRegistrationFlowOK handles this case with default header values. registrationFlow */ @@ -74,6 +75,7 @@ type GetSelfServiceRegistrationFlowOK struct { func (o *GetSelfServiceRegistrationFlowOK) Error() string { return fmt.Sprintf("[GET /self-service/registration/flows][%d] getSelfServiceRegistrationFlowOK %+v", 200, o.Payload) } + func (o *GetSelfServiceRegistrationFlowOK) GetPayload() *models.RegistrationFlow { return o.Payload } @@ -95,7 +97,7 @@ func NewGetSelfServiceRegistrationFlowForbidden() *GetSelfServiceRegistrationFlo return &GetSelfServiceRegistrationFlowForbidden{} } -/* GetSelfServiceRegistrationFlowForbidden describes a response with status code 403, with default header values. +/*GetSelfServiceRegistrationFlowForbidden handles this case with default header values. genericError */ @@ -106,6 +108,7 @@ type GetSelfServiceRegistrationFlowForbidden struct { func (o *GetSelfServiceRegistrationFlowForbidden) Error() string { return fmt.Sprintf("[GET /self-service/registration/flows][%d] getSelfServiceRegistrationFlowForbidden %+v", 403, o.Payload) } + func (o *GetSelfServiceRegistrationFlowForbidden) GetPayload() *models.GenericError { return o.Payload } @@ -127,7 +130,7 @@ func NewGetSelfServiceRegistrationFlowNotFound() *GetSelfServiceRegistrationFlow return &GetSelfServiceRegistrationFlowNotFound{} } -/* GetSelfServiceRegistrationFlowNotFound describes a response with status code 404, with default header values. +/*GetSelfServiceRegistrationFlowNotFound handles this case with default header values. genericError */ @@ -138,6 +141,7 @@ type GetSelfServiceRegistrationFlowNotFound struct { func (o *GetSelfServiceRegistrationFlowNotFound) Error() string { return fmt.Sprintf("[GET /self-service/registration/flows][%d] getSelfServiceRegistrationFlowNotFound %+v", 404, o.Payload) } + func (o *GetSelfServiceRegistrationFlowNotFound) GetPayload() *models.GenericError { return o.Payload } @@ -159,7 +163,7 @@ func NewGetSelfServiceRegistrationFlowGone() *GetSelfServiceRegistrationFlowGone return &GetSelfServiceRegistrationFlowGone{} } -/* GetSelfServiceRegistrationFlowGone describes a response with status code 410, with default header values. +/*GetSelfServiceRegistrationFlowGone handles this case with default header values. genericError */ @@ -170,6 +174,7 @@ type GetSelfServiceRegistrationFlowGone struct { func (o *GetSelfServiceRegistrationFlowGone) Error() string { return fmt.Sprintf("[GET /self-service/registration/flows][%d] getSelfServiceRegistrationFlowGone %+v", 410, o.Payload) } + func (o *GetSelfServiceRegistrationFlowGone) GetPayload() *models.GenericError { return o.Payload } @@ -191,7 +196,7 @@ func NewGetSelfServiceRegistrationFlowInternalServerError() *GetSelfServiceRegis return &GetSelfServiceRegistrationFlowInternalServerError{} } -/* GetSelfServiceRegistrationFlowInternalServerError describes a response with status code 500, with default header values. +/*GetSelfServiceRegistrationFlowInternalServerError handles this case with default header values. genericError */ @@ -202,6 +207,7 @@ type GetSelfServiceRegistrationFlowInternalServerError struct { func (o *GetSelfServiceRegistrationFlowInternalServerError) Error() string { return fmt.Sprintf("[GET /self-service/registration/flows][%d] getSelfServiceRegistrationFlowInternalServerError %+v", 500, o.Payload) } + func (o *GetSelfServiceRegistrationFlowInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/public/get_self_service_settings_flow_parameters.go b/internal/httpclient/client/public/get_self_service_settings_flow_parameters.go index a458c93fc9b..425021bc807 100644 --- a/internal/httpclient/client/public/get_self_service_settings_flow_parameters.go +++ b/internal/httpclient/client/public/get_self_service_settings_flow_parameters.go @@ -16,55 +16,56 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetSelfServiceSettingsFlowParams creates a new GetSelfServiceSettingsFlowParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewGetSelfServiceSettingsFlowParams creates a new GetSelfServiceSettingsFlowParams object +// with the default values initialized. func NewGetSelfServiceSettingsFlowParams() *GetSelfServiceSettingsFlowParams { + var () return &GetSelfServiceSettingsFlowParams{ + timeout: cr.DefaultTimeout, } } // NewGetSelfServiceSettingsFlowParamsWithTimeout creates a new GetSelfServiceSettingsFlowParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewGetSelfServiceSettingsFlowParamsWithTimeout(timeout time.Duration) *GetSelfServiceSettingsFlowParams { + var () return &GetSelfServiceSettingsFlowParams{ + timeout: timeout, } } // NewGetSelfServiceSettingsFlowParamsWithContext creates a new GetSelfServiceSettingsFlowParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewGetSelfServiceSettingsFlowParamsWithContext(ctx context.Context) *GetSelfServiceSettingsFlowParams { + var () return &GetSelfServiceSettingsFlowParams{ + Context: ctx, } } // NewGetSelfServiceSettingsFlowParamsWithHTTPClient creates a new GetSelfServiceSettingsFlowParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewGetSelfServiceSettingsFlowParamsWithHTTPClient(client *http.Client) *GetSelfServiceSettingsFlowParams { + var () return &GetSelfServiceSettingsFlowParams{ HTTPClient: client, } } -/* GetSelfServiceSettingsFlowParams contains all the parameters to send to the API endpoint - for the get self service settings flow operation. - - Typically these are written to a http.Request. +/*GetSelfServiceSettingsFlowParams contains all the parameters to send to the API endpoint +for the get self service settings flow operation typically these are written to a http.Request */ type GetSelfServiceSettingsFlowParams struct { - /* ID. - - ID is the Settings Flow ID + /*ID + ID is the Settings Flow ID The value for this parameter comes from `flow` URL Query parameter sent to your application (e.g. `/settings?flow=abcde`). + */ ID string @@ -73,21 +74,6 @@ type GetSelfServiceSettingsFlowParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the get self service settings flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetSelfServiceSettingsFlowParams) WithDefaults() *GetSelfServiceSettingsFlowParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get self service settings flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetSelfServiceSettingsFlowParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the get self service settings flow params func (o *GetSelfServiceSettingsFlowParams) WithTimeout(timeout time.Duration) *GetSelfServiceSettingsFlowParams { o.SetTimeout(timeout) @@ -144,7 +130,6 @@ func (o *GetSelfServiceSettingsFlowParams) WriteToRequest(r runtime.ClientReques qrID := o.ID qID := qrID if qID != "" { - if err := r.SetQueryParam("id", qID); err != nil { return err } diff --git a/internal/httpclient/client/public/get_self_service_settings_flow_responses.go b/internal/httpclient/client/public/get_self_service_settings_flow_responses.go index 89531752877..c0bfa849c83 100644 --- a/internal/httpclient/client/public/get_self_service_settings_flow_responses.go +++ b/internal/httpclient/client/public/get_self_service_settings_flow_responses.go @@ -53,6 +53,7 @@ func (o *GetSelfServiceSettingsFlowReader) ReadResponse(response runtime.ClientR return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -63,7 +64,7 @@ func NewGetSelfServiceSettingsFlowOK() *GetSelfServiceSettingsFlowOK { return &GetSelfServiceSettingsFlowOK{} } -/* GetSelfServiceSettingsFlowOK describes a response with status code 200, with default header values. +/*GetSelfServiceSettingsFlowOK handles this case with default header values. settingsFlow */ @@ -74,6 +75,7 @@ type GetSelfServiceSettingsFlowOK struct { func (o *GetSelfServiceSettingsFlowOK) Error() string { return fmt.Sprintf("[GET /self-service/settings/flows][%d] getSelfServiceSettingsFlowOK %+v", 200, o.Payload) } + func (o *GetSelfServiceSettingsFlowOK) GetPayload() *models.SettingsFlow { return o.Payload } @@ -95,7 +97,7 @@ func NewGetSelfServiceSettingsFlowForbidden() *GetSelfServiceSettingsFlowForbidd return &GetSelfServiceSettingsFlowForbidden{} } -/* GetSelfServiceSettingsFlowForbidden describes a response with status code 403, with default header values. +/*GetSelfServiceSettingsFlowForbidden handles this case with default header values. genericError */ @@ -106,6 +108,7 @@ type GetSelfServiceSettingsFlowForbidden struct { func (o *GetSelfServiceSettingsFlowForbidden) Error() string { return fmt.Sprintf("[GET /self-service/settings/flows][%d] getSelfServiceSettingsFlowForbidden %+v", 403, o.Payload) } + func (o *GetSelfServiceSettingsFlowForbidden) GetPayload() *models.GenericError { return o.Payload } @@ -127,7 +130,7 @@ func NewGetSelfServiceSettingsFlowNotFound() *GetSelfServiceSettingsFlowNotFound return &GetSelfServiceSettingsFlowNotFound{} } -/* GetSelfServiceSettingsFlowNotFound describes a response with status code 404, with default header values. +/*GetSelfServiceSettingsFlowNotFound handles this case with default header values. genericError */ @@ -138,6 +141,7 @@ type GetSelfServiceSettingsFlowNotFound struct { func (o *GetSelfServiceSettingsFlowNotFound) Error() string { return fmt.Sprintf("[GET /self-service/settings/flows][%d] getSelfServiceSettingsFlowNotFound %+v", 404, o.Payload) } + func (o *GetSelfServiceSettingsFlowNotFound) GetPayload() *models.GenericError { return o.Payload } @@ -159,7 +163,7 @@ func NewGetSelfServiceSettingsFlowGone() *GetSelfServiceSettingsFlowGone { return &GetSelfServiceSettingsFlowGone{} } -/* GetSelfServiceSettingsFlowGone describes a response with status code 410, with default header values. +/*GetSelfServiceSettingsFlowGone handles this case with default header values. genericError */ @@ -170,6 +174,7 @@ type GetSelfServiceSettingsFlowGone struct { func (o *GetSelfServiceSettingsFlowGone) Error() string { return fmt.Sprintf("[GET /self-service/settings/flows][%d] getSelfServiceSettingsFlowGone %+v", 410, o.Payload) } + func (o *GetSelfServiceSettingsFlowGone) GetPayload() *models.GenericError { return o.Payload } @@ -191,7 +196,7 @@ func NewGetSelfServiceSettingsFlowInternalServerError() *GetSelfServiceSettingsF return &GetSelfServiceSettingsFlowInternalServerError{} } -/* GetSelfServiceSettingsFlowInternalServerError describes a response with status code 500, with default header values. +/*GetSelfServiceSettingsFlowInternalServerError handles this case with default header values. genericError */ @@ -202,6 +207,7 @@ type GetSelfServiceSettingsFlowInternalServerError struct { func (o *GetSelfServiceSettingsFlowInternalServerError) Error() string { return fmt.Sprintf("[GET /self-service/settings/flows][%d] getSelfServiceSettingsFlowInternalServerError %+v", 500, o.Payload) } + func (o *GetSelfServiceSettingsFlowInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/public/get_self_service_verification_flow_parameters.go b/internal/httpclient/client/public/get_self_service_verification_flow_parameters.go index 55c5fda3d92..7f92cdbdb60 100644 --- a/internal/httpclient/client/public/get_self_service_verification_flow_parameters.go +++ b/internal/httpclient/client/public/get_self_service_verification_flow_parameters.go @@ -16,55 +16,56 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetSelfServiceVerificationFlowParams creates a new GetSelfServiceVerificationFlowParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewGetSelfServiceVerificationFlowParams creates a new GetSelfServiceVerificationFlowParams object +// with the default values initialized. func NewGetSelfServiceVerificationFlowParams() *GetSelfServiceVerificationFlowParams { + var () return &GetSelfServiceVerificationFlowParams{ + timeout: cr.DefaultTimeout, } } // NewGetSelfServiceVerificationFlowParamsWithTimeout creates a new GetSelfServiceVerificationFlowParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewGetSelfServiceVerificationFlowParamsWithTimeout(timeout time.Duration) *GetSelfServiceVerificationFlowParams { + var () return &GetSelfServiceVerificationFlowParams{ + timeout: timeout, } } // NewGetSelfServiceVerificationFlowParamsWithContext creates a new GetSelfServiceVerificationFlowParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewGetSelfServiceVerificationFlowParamsWithContext(ctx context.Context) *GetSelfServiceVerificationFlowParams { + var () return &GetSelfServiceVerificationFlowParams{ + Context: ctx, } } // NewGetSelfServiceVerificationFlowParamsWithHTTPClient creates a new GetSelfServiceVerificationFlowParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewGetSelfServiceVerificationFlowParamsWithHTTPClient(client *http.Client) *GetSelfServiceVerificationFlowParams { + var () return &GetSelfServiceVerificationFlowParams{ HTTPClient: client, } } -/* GetSelfServiceVerificationFlowParams contains all the parameters to send to the API endpoint - for the get self service verification flow operation. - - Typically these are written to a http.Request. +/*GetSelfServiceVerificationFlowParams contains all the parameters to send to the API endpoint +for the get self service verification flow operation typically these are written to a http.Request */ type GetSelfServiceVerificationFlowParams struct { - /* ID. - - The Flow ID + /*ID + The Flow ID The value for this parameter comes from `request` URL Query parameter sent to your application (e.g. `/verification?flow=abcde`). + */ ID string @@ -73,21 +74,6 @@ type GetSelfServiceVerificationFlowParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the get self service verification flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetSelfServiceVerificationFlowParams) WithDefaults() *GetSelfServiceVerificationFlowParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get self service verification flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetSelfServiceVerificationFlowParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the get self service verification flow params func (o *GetSelfServiceVerificationFlowParams) WithTimeout(timeout time.Duration) *GetSelfServiceVerificationFlowParams { o.SetTimeout(timeout) @@ -144,7 +130,6 @@ func (o *GetSelfServiceVerificationFlowParams) WriteToRequest(r runtime.ClientRe qrID := o.ID qID := qrID if qID != "" { - if err := r.SetQueryParam("id", qID); err != nil { return err } diff --git a/internal/httpclient/client/public/get_self_service_verification_flow_responses.go b/internal/httpclient/client/public/get_self_service_verification_flow_responses.go index 6455369e547..f3ffd237a91 100644 --- a/internal/httpclient/client/public/get_self_service_verification_flow_responses.go +++ b/internal/httpclient/client/public/get_self_service_verification_flow_responses.go @@ -47,6 +47,7 @@ func (o *GetSelfServiceVerificationFlowReader) ReadResponse(response runtime.Cli return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -57,7 +58,7 @@ func NewGetSelfServiceVerificationFlowOK() *GetSelfServiceVerificationFlowOK { return &GetSelfServiceVerificationFlowOK{} } -/* GetSelfServiceVerificationFlowOK describes a response with status code 200, with default header values. +/*GetSelfServiceVerificationFlowOK handles this case with default header values. verificationFlow */ @@ -68,6 +69,7 @@ type GetSelfServiceVerificationFlowOK struct { func (o *GetSelfServiceVerificationFlowOK) Error() string { return fmt.Sprintf("[GET /self-service/verification/flows][%d] getSelfServiceVerificationFlowOK %+v", 200, o.Payload) } + func (o *GetSelfServiceVerificationFlowOK) GetPayload() *models.VerificationFlow { return o.Payload } @@ -89,7 +91,7 @@ func NewGetSelfServiceVerificationFlowForbidden() *GetSelfServiceVerificationFlo return &GetSelfServiceVerificationFlowForbidden{} } -/* GetSelfServiceVerificationFlowForbidden describes a response with status code 403, with default header values. +/*GetSelfServiceVerificationFlowForbidden handles this case with default header values. genericError */ @@ -100,6 +102,7 @@ type GetSelfServiceVerificationFlowForbidden struct { func (o *GetSelfServiceVerificationFlowForbidden) Error() string { return fmt.Sprintf("[GET /self-service/verification/flows][%d] getSelfServiceVerificationFlowForbidden %+v", 403, o.Payload) } + func (o *GetSelfServiceVerificationFlowForbidden) GetPayload() *models.GenericError { return o.Payload } @@ -121,7 +124,7 @@ func NewGetSelfServiceVerificationFlowNotFound() *GetSelfServiceVerificationFlow return &GetSelfServiceVerificationFlowNotFound{} } -/* GetSelfServiceVerificationFlowNotFound describes a response with status code 404, with default header values. +/*GetSelfServiceVerificationFlowNotFound handles this case with default header values. genericError */ @@ -132,6 +135,7 @@ type GetSelfServiceVerificationFlowNotFound struct { func (o *GetSelfServiceVerificationFlowNotFound) Error() string { return fmt.Sprintf("[GET /self-service/verification/flows][%d] getSelfServiceVerificationFlowNotFound %+v", 404, o.Payload) } + func (o *GetSelfServiceVerificationFlowNotFound) GetPayload() *models.GenericError { return o.Payload } @@ -153,7 +157,7 @@ func NewGetSelfServiceVerificationFlowInternalServerError() *GetSelfServiceVerif return &GetSelfServiceVerificationFlowInternalServerError{} } -/* GetSelfServiceVerificationFlowInternalServerError describes a response with status code 500, with default header values. +/*GetSelfServiceVerificationFlowInternalServerError handles this case with default header values. genericError */ @@ -164,6 +168,7 @@ type GetSelfServiceVerificationFlowInternalServerError struct { func (o *GetSelfServiceVerificationFlowInternalServerError) Error() string { return fmt.Sprintf("[GET /self-service/verification/flows][%d] getSelfServiceVerificationFlowInternalServerError %+v", 500, o.Payload) } + func (o *GetSelfServiceVerificationFlowInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/public/initialize_self_service_browser_logout_flow_parameters.go b/internal/httpclient/client/public/initialize_self_service_browser_logout_flow_parameters.go index 7572cb6c202..fb53aaafaea 100644 --- a/internal/httpclient/client/public/initialize_self_service_browser_logout_flow_parameters.go +++ b/internal/httpclient/client/public/initialize_self_service_browser_logout_flow_parameters.go @@ -16,46 +16,47 @@ import ( "github.com/go-openapi/strfmt" ) -// NewInitializeSelfServiceBrowserLogoutFlowParams creates a new InitializeSelfServiceBrowserLogoutFlowParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewInitializeSelfServiceBrowserLogoutFlowParams creates a new InitializeSelfServiceBrowserLogoutFlowParams object +// with the default values initialized. func NewInitializeSelfServiceBrowserLogoutFlowParams() *InitializeSelfServiceBrowserLogoutFlowParams { + return &InitializeSelfServiceBrowserLogoutFlowParams{ + timeout: cr.DefaultTimeout, } } // NewInitializeSelfServiceBrowserLogoutFlowParamsWithTimeout creates a new InitializeSelfServiceBrowserLogoutFlowParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewInitializeSelfServiceBrowserLogoutFlowParamsWithTimeout(timeout time.Duration) *InitializeSelfServiceBrowserLogoutFlowParams { + return &InitializeSelfServiceBrowserLogoutFlowParams{ + timeout: timeout, } } // NewInitializeSelfServiceBrowserLogoutFlowParamsWithContext creates a new InitializeSelfServiceBrowserLogoutFlowParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewInitializeSelfServiceBrowserLogoutFlowParamsWithContext(ctx context.Context) *InitializeSelfServiceBrowserLogoutFlowParams { + return &InitializeSelfServiceBrowserLogoutFlowParams{ + Context: ctx, } } // NewInitializeSelfServiceBrowserLogoutFlowParamsWithHTTPClient creates a new InitializeSelfServiceBrowserLogoutFlowParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewInitializeSelfServiceBrowserLogoutFlowParamsWithHTTPClient(client *http.Client) *InitializeSelfServiceBrowserLogoutFlowParams { + return &InitializeSelfServiceBrowserLogoutFlowParams{ HTTPClient: client, } } -/* InitializeSelfServiceBrowserLogoutFlowParams contains all the parameters to send to the API endpoint - for the initialize self service browser logout flow operation. - - Typically these are written to a http.Request. +/*InitializeSelfServiceBrowserLogoutFlowParams contains all the parameters to send to the API endpoint +for the initialize self service browser logout flow operation typically these are written to a http.Request */ type InitializeSelfServiceBrowserLogoutFlowParams struct { timeout time.Duration @@ -63,21 +64,6 @@ type InitializeSelfServiceBrowserLogoutFlowParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the initialize self service browser logout flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InitializeSelfServiceBrowserLogoutFlowParams) WithDefaults() *InitializeSelfServiceBrowserLogoutFlowParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the initialize self service browser logout flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InitializeSelfServiceBrowserLogoutFlowParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the initialize self service browser logout flow params func (o *InitializeSelfServiceBrowserLogoutFlowParams) WithTimeout(timeout time.Duration) *InitializeSelfServiceBrowserLogoutFlowParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/public/initialize_self_service_browser_logout_flow_responses.go b/internal/httpclient/client/public/initialize_self_service_browser_logout_flow_responses.go index 989ea4aaeba..ab3a5a9f475 100644 --- a/internal/httpclient/client/public/initialize_self_service_browser_logout_flow_responses.go +++ b/internal/httpclient/client/public/initialize_self_service_browser_logout_flow_responses.go @@ -35,6 +35,7 @@ func (o *InitializeSelfServiceBrowserLogoutFlowReader) ReadResponse(response run return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -45,9 +46,9 @@ func NewInitializeSelfServiceBrowserLogoutFlowFound() *InitializeSelfServiceBrow return &InitializeSelfServiceBrowserLogoutFlowFound{} } -/* InitializeSelfServiceBrowserLogoutFlowFound describes a response with status code 302, with default header values. +/*InitializeSelfServiceBrowserLogoutFlowFound handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type InitializeSelfServiceBrowserLogoutFlowFound struct { @@ -67,7 +68,7 @@ func NewInitializeSelfServiceBrowserLogoutFlowInternalServerError() *InitializeS return &InitializeSelfServiceBrowserLogoutFlowInternalServerError{} } -/* InitializeSelfServiceBrowserLogoutFlowInternalServerError describes a response with status code 500, with default header values. +/*InitializeSelfServiceBrowserLogoutFlowInternalServerError handles this case with default header values. genericError */ @@ -78,6 +79,7 @@ type InitializeSelfServiceBrowserLogoutFlowInternalServerError struct { func (o *InitializeSelfServiceBrowserLogoutFlowInternalServerError) Error() string { return fmt.Sprintf("[GET /self-service/browser/flows/logout][%d] initializeSelfServiceBrowserLogoutFlowInternalServerError %+v", 500, o.Payload) } + func (o *InitializeSelfServiceBrowserLogoutFlowInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/public/initialize_self_service_login_via_api_flow_parameters.go b/internal/httpclient/client/public/initialize_self_service_login_via_api_flow_parameters.go index 1b58aa00da2..6711d844c88 100644 --- a/internal/httpclient/client/public/initialize_self_service_login_via_api_flow_parameters.go +++ b/internal/httpclient/client/public/initialize_self_service_login_via_api_flow_parameters.go @@ -17,56 +17,57 @@ import ( "github.com/go-openapi/swag" ) -// NewInitializeSelfServiceLoginViaAPIFlowParams creates a new InitializeSelfServiceLoginViaAPIFlowParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewInitializeSelfServiceLoginViaAPIFlowParams creates a new InitializeSelfServiceLoginViaAPIFlowParams object +// with the default values initialized. func NewInitializeSelfServiceLoginViaAPIFlowParams() *InitializeSelfServiceLoginViaAPIFlowParams { + var () return &InitializeSelfServiceLoginViaAPIFlowParams{ + timeout: cr.DefaultTimeout, } } // NewInitializeSelfServiceLoginViaAPIFlowParamsWithTimeout creates a new InitializeSelfServiceLoginViaAPIFlowParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewInitializeSelfServiceLoginViaAPIFlowParamsWithTimeout(timeout time.Duration) *InitializeSelfServiceLoginViaAPIFlowParams { + var () return &InitializeSelfServiceLoginViaAPIFlowParams{ + timeout: timeout, } } // NewInitializeSelfServiceLoginViaAPIFlowParamsWithContext creates a new InitializeSelfServiceLoginViaAPIFlowParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewInitializeSelfServiceLoginViaAPIFlowParamsWithContext(ctx context.Context) *InitializeSelfServiceLoginViaAPIFlowParams { + var () return &InitializeSelfServiceLoginViaAPIFlowParams{ + Context: ctx, } } // NewInitializeSelfServiceLoginViaAPIFlowParamsWithHTTPClient creates a new InitializeSelfServiceLoginViaAPIFlowParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewInitializeSelfServiceLoginViaAPIFlowParamsWithHTTPClient(client *http.Client) *InitializeSelfServiceLoginViaAPIFlowParams { + var () return &InitializeSelfServiceLoginViaAPIFlowParams{ HTTPClient: client, } } -/* InitializeSelfServiceLoginViaAPIFlowParams contains all the parameters to send to the API endpoint - for the initialize self service login via API flow operation. - - Typically these are written to a http.Request. +/*InitializeSelfServiceLoginViaAPIFlowParams contains all the parameters to send to the API endpoint +for the initialize self service login via API flow operation typically these are written to a http.Request */ type InitializeSelfServiceLoginViaAPIFlowParams struct { - /* Refresh. - - Refresh a login session + /*Refresh + Refresh a login session If set to true, this will refresh an existing login session by asking the user to sign in again. This will reset the authenticated_at time of the session. + */ Refresh *bool @@ -75,21 +76,6 @@ type InitializeSelfServiceLoginViaAPIFlowParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the initialize self service login via API flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InitializeSelfServiceLoginViaAPIFlowParams) WithDefaults() *InitializeSelfServiceLoginViaAPIFlowParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the initialize self service login via API flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InitializeSelfServiceLoginViaAPIFlowParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the initialize self service login via API flow params func (o *InitializeSelfServiceLoginViaAPIFlowParams) WithTimeout(timeout time.Duration) *InitializeSelfServiceLoginViaAPIFlowParams { o.SetTimeout(timeout) @@ -146,17 +132,16 @@ func (o *InitializeSelfServiceLoginViaAPIFlowParams) WriteToRequest(r runtime.Cl // query param refresh var qrRefresh bool - if o.Refresh != nil { qrRefresh = *o.Refresh } qRefresh := swag.FormatBool(qrRefresh) if qRefresh != "" { - if err := r.SetQueryParam("refresh", qRefresh); err != nil { return err } } + } if len(res) > 0 { diff --git a/internal/httpclient/client/public/initialize_self_service_login_via_api_flow_responses.go b/internal/httpclient/client/public/initialize_self_service_login_via_api_flow_responses.go index df810b59060..58ec1b2e9d1 100644 --- a/internal/httpclient/client/public/initialize_self_service_login_via_api_flow_responses.go +++ b/internal/httpclient/client/public/initialize_self_service_login_via_api_flow_responses.go @@ -41,6 +41,7 @@ func (o *InitializeSelfServiceLoginViaAPIFlowReader) ReadResponse(response runti return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -51,7 +52,7 @@ func NewInitializeSelfServiceLoginViaAPIFlowOK() *InitializeSelfServiceLoginViaA return &InitializeSelfServiceLoginViaAPIFlowOK{} } -/* InitializeSelfServiceLoginViaAPIFlowOK describes a response with status code 200, with default header values. +/*InitializeSelfServiceLoginViaAPIFlowOK handles this case with default header values. loginFlow */ @@ -62,6 +63,7 @@ type InitializeSelfServiceLoginViaAPIFlowOK struct { func (o *InitializeSelfServiceLoginViaAPIFlowOK) Error() string { return fmt.Sprintf("[GET /self-service/login/api][%d] initializeSelfServiceLoginViaApiFlowOK %+v", 200, o.Payload) } + func (o *InitializeSelfServiceLoginViaAPIFlowOK) GetPayload() *models.LoginFlow { return o.Payload } @@ -83,7 +85,7 @@ func NewInitializeSelfServiceLoginViaAPIFlowBadRequest() *InitializeSelfServiceL return &InitializeSelfServiceLoginViaAPIFlowBadRequest{} } -/* InitializeSelfServiceLoginViaAPIFlowBadRequest describes a response with status code 400, with default header values. +/*InitializeSelfServiceLoginViaAPIFlowBadRequest handles this case with default header values. genericError */ @@ -94,6 +96,7 @@ type InitializeSelfServiceLoginViaAPIFlowBadRequest struct { func (o *InitializeSelfServiceLoginViaAPIFlowBadRequest) Error() string { return fmt.Sprintf("[GET /self-service/login/api][%d] initializeSelfServiceLoginViaApiFlowBadRequest %+v", 400, o.Payload) } + func (o *InitializeSelfServiceLoginViaAPIFlowBadRequest) GetPayload() *models.GenericError { return o.Payload } @@ -115,7 +118,7 @@ func NewInitializeSelfServiceLoginViaAPIFlowInternalServerError() *InitializeSel return &InitializeSelfServiceLoginViaAPIFlowInternalServerError{} } -/* InitializeSelfServiceLoginViaAPIFlowInternalServerError describes a response with status code 500, with default header values. +/*InitializeSelfServiceLoginViaAPIFlowInternalServerError handles this case with default header values. genericError */ @@ -126,6 +129,7 @@ type InitializeSelfServiceLoginViaAPIFlowInternalServerError struct { func (o *InitializeSelfServiceLoginViaAPIFlowInternalServerError) Error() string { return fmt.Sprintf("[GET /self-service/login/api][%d] initializeSelfServiceLoginViaApiFlowInternalServerError %+v", 500, o.Payload) } + func (o *InitializeSelfServiceLoginViaAPIFlowInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/public/initialize_self_service_login_via_browser_flow_parameters.go b/internal/httpclient/client/public/initialize_self_service_login_via_browser_flow_parameters.go index d719a92b3d4..ccfd8de89da 100644 --- a/internal/httpclient/client/public/initialize_self_service_login_via_browser_flow_parameters.go +++ b/internal/httpclient/client/public/initialize_self_service_login_via_browser_flow_parameters.go @@ -16,46 +16,47 @@ import ( "github.com/go-openapi/strfmt" ) -// NewInitializeSelfServiceLoginViaBrowserFlowParams creates a new InitializeSelfServiceLoginViaBrowserFlowParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewInitializeSelfServiceLoginViaBrowserFlowParams creates a new InitializeSelfServiceLoginViaBrowserFlowParams object +// with the default values initialized. func NewInitializeSelfServiceLoginViaBrowserFlowParams() *InitializeSelfServiceLoginViaBrowserFlowParams { + return &InitializeSelfServiceLoginViaBrowserFlowParams{ + timeout: cr.DefaultTimeout, } } // NewInitializeSelfServiceLoginViaBrowserFlowParamsWithTimeout creates a new InitializeSelfServiceLoginViaBrowserFlowParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewInitializeSelfServiceLoginViaBrowserFlowParamsWithTimeout(timeout time.Duration) *InitializeSelfServiceLoginViaBrowserFlowParams { + return &InitializeSelfServiceLoginViaBrowserFlowParams{ + timeout: timeout, } } // NewInitializeSelfServiceLoginViaBrowserFlowParamsWithContext creates a new InitializeSelfServiceLoginViaBrowserFlowParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewInitializeSelfServiceLoginViaBrowserFlowParamsWithContext(ctx context.Context) *InitializeSelfServiceLoginViaBrowserFlowParams { + return &InitializeSelfServiceLoginViaBrowserFlowParams{ + Context: ctx, } } // NewInitializeSelfServiceLoginViaBrowserFlowParamsWithHTTPClient creates a new InitializeSelfServiceLoginViaBrowserFlowParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewInitializeSelfServiceLoginViaBrowserFlowParamsWithHTTPClient(client *http.Client) *InitializeSelfServiceLoginViaBrowserFlowParams { + return &InitializeSelfServiceLoginViaBrowserFlowParams{ HTTPClient: client, } } -/* InitializeSelfServiceLoginViaBrowserFlowParams contains all the parameters to send to the API endpoint - for the initialize self service login via browser flow operation. - - Typically these are written to a http.Request. +/*InitializeSelfServiceLoginViaBrowserFlowParams contains all the parameters to send to the API endpoint +for the initialize self service login via browser flow operation typically these are written to a http.Request */ type InitializeSelfServiceLoginViaBrowserFlowParams struct { timeout time.Duration @@ -63,21 +64,6 @@ type InitializeSelfServiceLoginViaBrowserFlowParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the initialize self service login via browser flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InitializeSelfServiceLoginViaBrowserFlowParams) WithDefaults() *InitializeSelfServiceLoginViaBrowserFlowParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the initialize self service login via browser flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InitializeSelfServiceLoginViaBrowserFlowParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the initialize self service login via browser flow params func (o *InitializeSelfServiceLoginViaBrowserFlowParams) WithTimeout(timeout time.Duration) *InitializeSelfServiceLoginViaBrowserFlowParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/public/initialize_self_service_login_via_browser_flow_responses.go b/internal/httpclient/client/public/initialize_self_service_login_via_browser_flow_responses.go index 183385a74c1..aa29347129d 100644 --- a/internal/httpclient/client/public/initialize_self_service_login_via_browser_flow_responses.go +++ b/internal/httpclient/client/public/initialize_self_service_login_via_browser_flow_responses.go @@ -35,6 +35,7 @@ func (o *InitializeSelfServiceLoginViaBrowserFlowReader) ReadResponse(response r return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -45,9 +46,9 @@ func NewInitializeSelfServiceLoginViaBrowserFlowFound() *InitializeSelfServiceLo return &InitializeSelfServiceLoginViaBrowserFlowFound{} } -/* InitializeSelfServiceLoginViaBrowserFlowFound describes a response with status code 302, with default header values. +/*InitializeSelfServiceLoginViaBrowserFlowFound handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type InitializeSelfServiceLoginViaBrowserFlowFound struct { @@ -67,7 +68,7 @@ func NewInitializeSelfServiceLoginViaBrowserFlowInternalServerError() *Initializ return &InitializeSelfServiceLoginViaBrowserFlowInternalServerError{} } -/* InitializeSelfServiceLoginViaBrowserFlowInternalServerError describes a response with status code 500, with default header values. +/*InitializeSelfServiceLoginViaBrowserFlowInternalServerError handles this case with default header values. genericError */ @@ -78,6 +79,7 @@ type InitializeSelfServiceLoginViaBrowserFlowInternalServerError struct { func (o *InitializeSelfServiceLoginViaBrowserFlowInternalServerError) Error() string { return fmt.Sprintf("[GET /self-service/login/browser][%d] initializeSelfServiceLoginViaBrowserFlowInternalServerError %+v", 500, o.Payload) } + func (o *InitializeSelfServiceLoginViaBrowserFlowInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/public/initialize_self_service_recovery_via_api_flow_parameters.go b/internal/httpclient/client/public/initialize_self_service_recovery_via_api_flow_parameters.go index 729611711f1..3a44eb772fe 100644 --- a/internal/httpclient/client/public/initialize_self_service_recovery_via_api_flow_parameters.go +++ b/internal/httpclient/client/public/initialize_self_service_recovery_via_api_flow_parameters.go @@ -16,46 +16,47 @@ import ( "github.com/go-openapi/strfmt" ) -// NewInitializeSelfServiceRecoveryViaAPIFlowParams creates a new InitializeSelfServiceRecoveryViaAPIFlowParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewInitializeSelfServiceRecoveryViaAPIFlowParams creates a new InitializeSelfServiceRecoveryViaAPIFlowParams object +// with the default values initialized. func NewInitializeSelfServiceRecoveryViaAPIFlowParams() *InitializeSelfServiceRecoveryViaAPIFlowParams { + return &InitializeSelfServiceRecoveryViaAPIFlowParams{ + timeout: cr.DefaultTimeout, } } // NewInitializeSelfServiceRecoveryViaAPIFlowParamsWithTimeout creates a new InitializeSelfServiceRecoveryViaAPIFlowParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewInitializeSelfServiceRecoveryViaAPIFlowParamsWithTimeout(timeout time.Duration) *InitializeSelfServiceRecoveryViaAPIFlowParams { + return &InitializeSelfServiceRecoveryViaAPIFlowParams{ + timeout: timeout, } } // NewInitializeSelfServiceRecoveryViaAPIFlowParamsWithContext creates a new InitializeSelfServiceRecoveryViaAPIFlowParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewInitializeSelfServiceRecoveryViaAPIFlowParamsWithContext(ctx context.Context) *InitializeSelfServiceRecoveryViaAPIFlowParams { + return &InitializeSelfServiceRecoveryViaAPIFlowParams{ + Context: ctx, } } // NewInitializeSelfServiceRecoveryViaAPIFlowParamsWithHTTPClient creates a new InitializeSelfServiceRecoveryViaAPIFlowParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewInitializeSelfServiceRecoveryViaAPIFlowParamsWithHTTPClient(client *http.Client) *InitializeSelfServiceRecoveryViaAPIFlowParams { + return &InitializeSelfServiceRecoveryViaAPIFlowParams{ HTTPClient: client, } } -/* InitializeSelfServiceRecoveryViaAPIFlowParams contains all the parameters to send to the API endpoint - for the initialize self service recovery via API flow operation. - - Typically these are written to a http.Request. +/*InitializeSelfServiceRecoveryViaAPIFlowParams contains all the parameters to send to the API endpoint +for the initialize self service recovery via API flow operation typically these are written to a http.Request */ type InitializeSelfServiceRecoveryViaAPIFlowParams struct { timeout time.Duration @@ -63,21 +64,6 @@ type InitializeSelfServiceRecoveryViaAPIFlowParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the initialize self service recovery via API flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InitializeSelfServiceRecoveryViaAPIFlowParams) WithDefaults() *InitializeSelfServiceRecoveryViaAPIFlowParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the initialize self service recovery via API flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InitializeSelfServiceRecoveryViaAPIFlowParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the initialize self service recovery via API flow params func (o *InitializeSelfServiceRecoveryViaAPIFlowParams) WithTimeout(timeout time.Duration) *InitializeSelfServiceRecoveryViaAPIFlowParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/public/initialize_self_service_recovery_via_api_flow_responses.go b/internal/httpclient/client/public/initialize_self_service_recovery_via_api_flow_responses.go index 741b1147d8b..44b062ade68 100644 --- a/internal/httpclient/client/public/initialize_self_service_recovery_via_api_flow_responses.go +++ b/internal/httpclient/client/public/initialize_self_service_recovery_via_api_flow_responses.go @@ -41,6 +41,7 @@ func (o *InitializeSelfServiceRecoveryViaAPIFlowReader) ReadResponse(response ru return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -51,7 +52,7 @@ func NewInitializeSelfServiceRecoveryViaAPIFlowOK() *InitializeSelfServiceRecove return &InitializeSelfServiceRecoveryViaAPIFlowOK{} } -/* InitializeSelfServiceRecoveryViaAPIFlowOK describes a response with status code 200, with default header values. +/*InitializeSelfServiceRecoveryViaAPIFlowOK handles this case with default header values. recoveryFlow */ @@ -62,6 +63,7 @@ type InitializeSelfServiceRecoveryViaAPIFlowOK struct { func (o *InitializeSelfServiceRecoveryViaAPIFlowOK) Error() string { return fmt.Sprintf("[GET /self-service/recovery/api][%d] initializeSelfServiceRecoveryViaApiFlowOK %+v", 200, o.Payload) } + func (o *InitializeSelfServiceRecoveryViaAPIFlowOK) GetPayload() *models.RecoveryFlow { return o.Payload } @@ -83,7 +85,7 @@ func NewInitializeSelfServiceRecoveryViaAPIFlowBadRequest() *InitializeSelfServi return &InitializeSelfServiceRecoveryViaAPIFlowBadRequest{} } -/* InitializeSelfServiceRecoveryViaAPIFlowBadRequest describes a response with status code 400, with default header values. +/*InitializeSelfServiceRecoveryViaAPIFlowBadRequest handles this case with default header values. genericError */ @@ -94,6 +96,7 @@ type InitializeSelfServiceRecoveryViaAPIFlowBadRequest struct { func (o *InitializeSelfServiceRecoveryViaAPIFlowBadRequest) Error() string { return fmt.Sprintf("[GET /self-service/recovery/api][%d] initializeSelfServiceRecoveryViaApiFlowBadRequest %+v", 400, o.Payload) } + func (o *InitializeSelfServiceRecoveryViaAPIFlowBadRequest) GetPayload() *models.GenericError { return o.Payload } @@ -115,7 +118,7 @@ func NewInitializeSelfServiceRecoveryViaAPIFlowInternalServerError() *Initialize return &InitializeSelfServiceRecoveryViaAPIFlowInternalServerError{} } -/* InitializeSelfServiceRecoveryViaAPIFlowInternalServerError describes a response with status code 500, with default header values. +/*InitializeSelfServiceRecoveryViaAPIFlowInternalServerError handles this case with default header values. genericError */ @@ -126,6 +129,7 @@ type InitializeSelfServiceRecoveryViaAPIFlowInternalServerError struct { func (o *InitializeSelfServiceRecoveryViaAPIFlowInternalServerError) Error() string { return fmt.Sprintf("[GET /self-service/recovery/api][%d] initializeSelfServiceRecoveryViaApiFlowInternalServerError %+v", 500, o.Payload) } + func (o *InitializeSelfServiceRecoveryViaAPIFlowInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/public/initialize_self_service_recovery_via_browser_flow_parameters.go b/internal/httpclient/client/public/initialize_self_service_recovery_via_browser_flow_parameters.go index 1dc89842aa3..68c6b72f842 100644 --- a/internal/httpclient/client/public/initialize_self_service_recovery_via_browser_flow_parameters.go +++ b/internal/httpclient/client/public/initialize_self_service_recovery_via_browser_flow_parameters.go @@ -16,46 +16,47 @@ import ( "github.com/go-openapi/strfmt" ) -// NewInitializeSelfServiceRecoveryViaBrowserFlowParams creates a new InitializeSelfServiceRecoveryViaBrowserFlowParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewInitializeSelfServiceRecoveryViaBrowserFlowParams creates a new InitializeSelfServiceRecoveryViaBrowserFlowParams object +// with the default values initialized. func NewInitializeSelfServiceRecoveryViaBrowserFlowParams() *InitializeSelfServiceRecoveryViaBrowserFlowParams { + return &InitializeSelfServiceRecoveryViaBrowserFlowParams{ + timeout: cr.DefaultTimeout, } } // NewInitializeSelfServiceRecoveryViaBrowserFlowParamsWithTimeout creates a new InitializeSelfServiceRecoveryViaBrowserFlowParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewInitializeSelfServiceRecoveryViaBrowserFlowParamsWithTimeout(timeout time.Duration) *InitializeSelfServiceRecoveryViaBrowserFlowParams { + return &InitializeSelfServiceRecoveryViaBrowserFlowParams{ + timeout: timeout, } } // NewInitializeSelfServiceRecoveryViaBrowserFlowParamsWithContext creates a new InitializeSelfServiceRecoveryViaBrowserFlowParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewInitializeSelfServiceRecoveryViaBrowserFlowParamsWithContext(ctx context.Context) *InitializeSelfServiceRecoveryViaBrowserFlowParams { + return &InitializeSelfServiceRecoveryViaBrowserFlowParams{ + Context: ctx, } } // NewInitializeSelfServiceRecoveryViaBrowserFlowParamsWithHTTPClient creates a new InitializeSelfServiceRecoveryViaBrowserFlowParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewInitializeSelfServiceRecoveryViaBrowserFlowParamsWithHTTPClient(client *http.Client) *InitializeSelfServiceRecoveryViaBrowserFlowParams { + return &InitializeSelfServiceRecoveryViaBrowserFlowParams{ HTTPClient: client, } } -/* InitializeSelfServiceRecoveryViaBrowserFlowParams contains all the parameters to send to the API endpoint - for the initialize self service recovery via browser flow operation. - - Typically these are written to a http.Request. +/*InitializeSelfServiceRecoveryViaBrowserFlowParams contains all the parameters to send to the API endpoint +for the initialize self service recovery via browser flow operation typically these are written to a http.Request */ type InitializeSelfServiceRecoveryViaBrowserFlowParams struct { timeout time.Duration @@ -63,21 +64,6 @@ type InitializeSelfServiceRecoveryViaBrowserFlowParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the initialize self service recovery via browser flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InitializeSelfServiceRecoveryViaBrowserFlowParams) WithDefaults() *InitializeSelfServiceRecoveryViaBrowserFlowParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the initialize self service recovery via browser flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InitializeSelfServiceRecoveryViaBrowserFlowParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the initialize self service recovery via browser flow params func (o *InitializeSelfServiceRecoveryViaBrowserFlowParams) WithTimeout(timeout time.Duration) *InitializeSelfServiceRecoveryViaBrowserFlowParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/public/initialize_self_service_recovery_via_browser_flow_responses.go b/internal/httpclient/client/public/initialize_self_service_recovery_via_browser_flow_responses.go index 62397fb4270..48c9e9714ba 100644 --- a/internal/httpclient/client/public/initialize_self_service_recovery_via_browser_flow_responses.go +++ b/internal/httpclient/client/public/initialize_self_service_recovery_via_browser_flow_responses.go @@ -35,6 +35,7 @@ func (o *InitializeSelfServiceRecoveryViaBrowserFlowReader) ReadResponse(respons return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -45,9 +46,9 @@ func NewInitializeSelfServiceRecoveryViaBrowserFlowFound() *InitializeSelfServic return &InitializeSelfServiceRecoveryViaBrowserFlowFound{} } -/* InitializeSelfServiceRecoveryViaBrowserFlowFound describes a response with status code 302, with default header values. +/*InitializeSelfServiceRecoveryViaBrowserFlowFound handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type InitializeSelfServiceRecoveryViaBrowserFlowFound struct { @@ -67,7 +68,7 @@ func NewInitializeSelfServiceRecoveryViaBrowserFlowInternalServerError() *Initia return &InitializeSelfServiceRecoveryViaBrowserFlowInternalServerError{} } -/* InitializeSelfServiceRecoveryViaBrowserFlowInternalServerError describes a response with status code 500, with default header values. +/*InitializeSelfServiceRecoveryViaBrowserFlowInternalServerError handles this case with default header values. genericError */ @@ -78,6 +79,7 @@ type InitializeSelfServiceRecoveryViaBrowserFlowInternalServerError struct { func (o *InitializeSelfServiceRecoveryViaBrowserFlowInternalServerError) Error() string { return fmt.Sprintf("[GET /self-service/recovery/browser][%d] initializeSelfServiceRecoveryViaBrowserFlowInternalServerError %+v", 500, o.Payload) } + func (o *InitializeSelfServiceRecoveryViaBrowserFlowInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/public/initialize_self_service_registration_via_api_flow_parameters.go b/internal/httpclient/client/public/initialize_self_service_registration_via_api_flow_parameters.go index 74cb9f4ed7c..0c0d924ed17 100644 --- a/internal/httpclient/client/public/initialize_self_service_registration_via_api_flow_parameters.go +++ b/internal/httpclient/client/public/initialize_self_service_registration_via_api_flow_parameters.go @@ -16,46 +16,47 @@ import ( "github.com/go-openapi/strfmt" ) -// NewInitializeSelfServiceRegistrationViaAPIFlowParams creates a new InitializeSelfServiceRegistrationViaAPIFlowParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewInitializeSelfServiceRegistrationViaAPIFlowParams creates a new InitializeSelfServiceRegistrationViaAPIFlowParams object +// with the default values initialized. func NewInitializeSelfServiceRegistrationViaAPIFlowParams() *InitializeSelfServiceRegistrationViaAPIFlowParams { + return &InitializeSelfServiceRegistrationViaAPIFlowParams{ + timeout: cr.DefaultTimeout, } } // NewInitializeSelfServiceRegistrationViaAPIFlowParamsWithTimeout creates a new InitializeSelfServiceRegistrationViaAPIFlowParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewInitializeSelfServiceRegistrationViaAPIFlowParamsWithTimeout(timeout time.Duration) *InitializeSelfServiceRegistrationViaAPIFlowParams { + return &InitializeSelfServiceRegistrationViaAPIFlowParams{ + timeout: timeout, } } // NewInitializeSelfServiceRegistrationViaAPIFlowParamsWithContext creates a new InitializeSelfServiceRegistrationViaAPIFlowParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewInitializeSelfServiceRegistrationViaAPIFlowParamsWithContext(ctx context.Context) *InitializeSelfServiceRegistrationViaAPIFlowParams { + return &InitializeSelfServiceRegistrationViaAPIFlowParams{ + Context: ctx, } } // NewInitializeSelfServiceRegistrationViaAPIFlowParamsWithHTTPClient creates a new InitializeSelfServiceRegistrationViaAPIFlowParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewInitializeSelfServiceRegistrationViaAPIFlowParamsWithHTTPClient(client *http.Client) *InitializeSelfServiceRegistrationViaAPIFlowParams { + return &InitializeSelfServiceRegistrationViaAPIFlowParams{ HTTPClient: client, } } -/* InitializeSelfServiceRegistrationViaAPIFlowParams contains all the parameters to send to the API endpoint - for the initialize self service registration via API flow operation. - - Typically these are written to a http.Request. +/*InitializeSelfServiceRegistrationViaAPIFlowParams contains all the parameters to send to the API endpoint +for the initialize self service registration via API flow operation typically these are written to a http.Request */ type InitializeSelfServiceRegistrationViaAPIFlowParams struct { timeout time.Duration @@ -63,21 +64,6 @@ type InitializeSelfServiceRegistrationViaAPIFlowParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the initialize self service registration via API flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InitializeSelfServiceRegistrationViaAPIFlowParams) WithDefaults() *InitializeSelfServiceRegistrationViaAPIFlowParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the initialize self service registration via API flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InitializeSelfServiceRegistrationViaAPIFlowParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the initialize self service registration via API flow params func (o *InitializeSelfServiceRegistrationViaAPIFlowParams) WithTimeout(timeout time.Duration) *InitializeSelfServiceRegistrationViaAPIFlowParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/public/initialize_self_service_registration_via_api_flow_responses.go b/internal/httpclient/client/public/initialize_self_service_registration_via_api_flow_responses.go index f313568ca3b..2e12cf17391 100644 --- a/internal/httpclient/client/public/initialize_self_service_registration_via_api_flow_responses.go +++ b/internal/httpclient/client/public/initialize_self_service_registration_via_api_flow_responses.go @@ -41,6 +41,7 @@ func (o *InitializeSelfServiceRegistrationViaAPIFlowReader) ReadResponse(respons return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -51,7 +52,7 @@ func NewInitializeSelfServiceRegistrationViaAPIFlowOK() *InitializeSelfServiceRe return &InitializeSelfServiceRegistrationViaAPIFlowOK{} } -/* InitializeSelfServiceRegistrationViaAPIFlowOK describes a response with status code 200, with default header values. +/*InitializeSelfServiceRegistrationViaAPIFlowOK handles this case with default header values. registrationFlow */ @@ -62,6 +63,7 @@ type InitializeSelfServiceRegistrationViaAPIFlowOK struct { func (o *InitializeSelfServiceRegistrationViaAPIFlowOK) Error() string { return fmt.Sprintf("[GET /self-service/registration/api][%d] initializeSelfServiceRegistrationViaApiFlowOK %+v", 200, o.Payload) } + func (o *InitializeSelfServiceRegistrationViaAPIFlowOK) GetPayload() *models.RegistrationFlow { return o.Payload } @@ -83,7 +85,7 @@ func NewInitializeSelfServiceRegistrationViaAPIFlowBadRequest() *InitializeSelfS return &InitializeSelfServiceRegistrationViaAPIFlowBadRequest{} } -/* InitializeSelfServiceRegistrationViaAPIFlowBadRequest describes a response with status code 400, with default header values. +/*InitializeSelfServiceRegistrationViaAPIFlowBadRequest handles this case with default header values. genericError */ @@ -94,6 +96,7 @@ type InitializeSelfServiceRegistrationViaAPIFlowBadRequest struct { func (o *InitializeSelfServiceRegistrationViaAPIFlowBadRequest) Error() string { return fmt.Sprintf("[GET /self-service/registration/api][%d] initializeSelfServiceRegistrationViaApiFlowBadRequest %+v", 400, o.Payload) } + func (o *InitializeSelfServiceRegistrationViaAPIFlowBadRequest) GetPayload() *models.GenericError { return o.Payload } @@ -115,7 +118,7 @@ func NewInitializeSelfServiceRegistrationViaAPIFlowInternalServerError() *Initia return &InitializeSelfServiceRegistrationViaAPIFlowInternalServerError{} } -/* InitializeSelfServiceRegistrationViaAPIFlowInternalServerError describes a response with status code 500, with default header values. +/*InitializeSelfServiceRegistrationViaAPIFlowInternalServerError handles this case with default header values. genericError */ @@ -126,6 +129,7 @@ type InitializeSelfServiceRegistrationViaAPIFlowInternalServerError struct { func (o *InitializeSelfServiceRegistrationViaAPIFlowInternalServerError) Error() string { return fmt.Sprintf("[GET /self-service/registration/api][%d] initializeSelfServiceRegistrationViaApiFlowInternalServerError %+v", 500, o.Payload) } + func (o *InitializeSelfServiceRegistrationViaAPIFlowInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/public/initialize_self_service_registration_via_browser_flow_parameters.go b/internal/httpclient/client/public/initialize_self_service_registration_via_browser_flow_parameters.go index f1ce91378ea..067667fd4c7 100644 --- a/internal/httpclient/client/public/initialize_self_service_registration_via_browser_flow_parameters.go +++ b/internal/httpclient/client/public/initialize_self_service_registration_via_browser_flow_parameters.go @@ -16,46 +16,47 @@ import ( "github.com/go-openapi/strfmt" ) -// NewInitializeSelfServiceRegistrationViaBrowserFlowParams creates a new InitializeSelfServiceRegistrationViaBrowserFlowParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewInitializeSelfServiceRegistrationViaBrowserFlowParams creates a new InitializeSelfServiceRegistrationViaBrowserFlowParams object +// with the default values initialized. func NewInitializeSelfServiceRegistrationViaBrowserFlowParams() *InitializeSelfServiceRegistrationViaBrowserFlowParams { + return &InitializeSelfServiceRegistrationViaBrowserFlowParams{ + timeout: cr.DefaultTimeout, } } // NewInitializeSelfServiceRegistrationViaBrowserFlowParamsWithTimeout creates a new InitializeSelfServiceRegistrationViaBrowserFlowParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewInitializeSelfServiceRegistrationViaBrowserFlowParamsWithTimeout(timeout time.Duration) *InitializeSelfServiceRegistrationViaBrowserFlowParams { + return &InitializeSelfServiceRegistrationViaBrowserFlowParams{ + timeout: timeout, } } // NewInitializeSelfServiceRegistrationViaBrowserFlowParamsWithContext creates a new InitializeSelfServiceRegistrationViaBrowserFlowParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewInitializeSelfServiceRegistrationViaBrowserFlowParamsWithContext(ctx context.Context) *InitializeSelfServiceRegistrationViaBrowserFlowParams { + return &InitializeSelfServiceRegistrationViaBrowserFlowParams{ + Context: ctx, } } // NewInitializeSelfServiceRegistrationViaBrowserFlowParamsWithHTTPClient creates a new InitializeSelfServiceRegistrationViaBrowserFlowParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewInitializeSelfServiceRegistrationViaBrowserFlowParamsWithHTTPClient(client *http.Client) *InitializeSelfServiceRegistrationViaBrowserFlowParams { + return &InitializeSelfServiceRegistrationViaBrowserFlowParams{ HTTPClient: client, } } -/* InitializeSelfServiceRegistrationViaBrowserFlowParams contains all the parameters to send to the API endpoint - for the initialize self service registration via browser flow operation. - - Typically these are written to a http.Request. +/*InitializeSelfServiceRegistrationViaBrowserFlowParams contains all the parameters to send to the API endpoint +for the initialize self service registration via browser flow operation typically these are written to a http.Request */ type InitializeSelfServiceRegistrationViaBrowserFlowParams struct { timeout time.Duration @@ -63,21 +64,6 @@ type InitializeSelfServiceRegistrationViaBrowserFlowParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the initialize self service registration via browser flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InitializeSelfServiceRegistrationViaBrowserFlowParams) WithDefaults() *InitializeSelfServiceRegistrationViaBrowserFlowParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the initialize self service registration via browser flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InitializeSelfServiceRegistrationViaBrowserFlowParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the initialize self service registration via browser flow params func (o *InitializeSelfServiceRegistrationViaBrowserFlowParams) WithTimeout(timeout time.Duration) *InitializeSelfServiceRegistrationViaBrowserFlowParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/public/initialize_self_service_registration_via_browser_flow_responses.go b/internal/httpclient/client/public/initialize_self_service_registration_via_browser_flow_responses.go index 6c6aaf30a8f..a9bc4f6dbd5 100644 --- a/internal/httpclient/client/public/initialize_self_service_registration_via_browser_flow_responses.go +++ b/internal/httpclient/client/public/initialize_self_service_registration_via_browser_flow_responses.go @@ -35,6 +35,7 @@ func (o *InitializeSelfServiceRegistrationViaBrowserFlowReader) ReadResponse(res return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -45,9 +46,9 @@ func NewInitializeSelfServiceRegistrationViaBrowserFlowFound() *InitializeSelfSe return &InitializeSelfServiceRegistrationViaBrowserFlowFound{} } -/* InitializeSelfServiceRegistrationViaBrowserFlowFound describes a response with status code 302, with default header values. +/*InitializeSelfServiceRegistrationViaBrowserFlowFound handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type InitializeSelfServiceRegistrationViaBrowserFlowFound struct { @@ -67,7 +68,7 @@ func NewInitializeSelfServiceRegistrationViaBrowserFlowInternalServerError() *In return &InitializeSelfServiceRegistrationViaBrowserFlowInternalServerError{} } -/* InitializeSelfServiceRegistrationViaBrowserFlowInternalServerError describes a response with status code 500, with default header values. +/*InitializeSelfServiceRegistrationViaBrowserFlowInternalServerError handles this case with default header values. genericError */ @@ -78,6 +79,7 @@ type InitializeSelfServiceRegistrationViaBrowserFlowInternalServerError struct { func (o *InitializeSelfServiceRegistrationViaBrowserFlowInternalServerError) Error() string { return fmt.Sprintf("[GET /self-service/registration/browser][%d] initializeSelfServiceRegistrationViaBrowserFlowInternalServerError %+v", 500, o.Payload) } + func (o *InitializeSelfServiceRegistrationViaBrowserFlowInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/public/initialize_self_service_settings_via_api_flow_parameters.go b/internal/httpclient/client/public/initialize_self_service_settings_via_api_flow_parameters.go index e16d606d230..c38acd5f7e5 100644 --- a/internal/httpclient/client/public/initialize_self_service_settings_via_api_flow_parameters.go +++ b/internal/httpclient/client/public/initialize_self_service_settings_via_api_flow_parameters.go @@ -16,46 +16,47 @@ import ( "github.com/go-openapi/strfmt" ) -// NewInitializeSelfServiceSettingsViaAPIFlowParams creates a new InitializeSelfServiceSettingsViaAPIFlowParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewInitializeSelfServiceSettingsViaAPIFlowParams creates a new InitializeSelfServiceSettingsViaAPIFlowParams object +// with the default values initialized. func NewInitializeSelfServiceSettingsViaAPIFlowParams() *InitializeSelfServiceSettingsViaAPIFlowParams { + return &InitializeSelfServiceSettingsViaAPIFlowParams{ + timeout: cr.DefaultTimeout, } } // NewInitializeSelfServiceSettingsViaAPIFlowParamsWithTimeout creates a new InitializeSelfServiceSettingsViaAPIFlowParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewInitializeSelfServiceSettingsViaAPIFlowParamsWithTimeout(timeout time.Duration) *InitializeSelfServiceSettingsViaAPIFlowParams { + return &InitializeSelfServiceSettingsViaAPIFlowParams{ + timeout: timeout, } } // NewInitializeSelfServiceSettingsViaAPIFlowParamsWithContext creates a new InitializeSelfServiceSettingsViaAPIFlowParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewInitializeSelfServiceSettingsViaAPIFlowParamsWithContext(ctx context.Context) *InitializeSelfServiceSettingsViaAPIFlowParams { + return &InitializeSelfServiceSettingsViaAPIFlowParams{ + Context: ctx, } } // NewInitializeSelfServiceSettingsViaAPIFlowParamsWithHTTPClient creates a new InitializeSelfServiceSettingsViaAPIFlowParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewInitializeSelfServiceSettingsViaAPIFlowParamsWithHTTPClient(client *http.Client) *InitializeSelfServiceSettingsViaAPIFlowParams { + return &InitializeSelfServiceSettingsViaAPIFlowParams{ HTTPClient: client, } } -/* InitializeSelfServiceSettingsViaAPIFlowParams contains all the parameters to send to the API endpoint - for the initialize self service settings via API flow operation. - - Typically these are written to a http.Request. +/*InitializeSelfServiceSettingsViaAPIFlowParams contains all the parameters to send to the API endpoint +for the initialize self service settings via API flow operation typically these are written to a http.Request */ type InitializeSelfServiceSettingsViaAPIFlowParams struct { timeout time.Duration @@ -63,21 +64,6 @@ type InitializeSelfServiceSettingsViaAPIFlowParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the initialize self service settings via API flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InitializeSelfServiceSettingsViaAPIFlowParams) WithDefaults() *InitializeSelfServiceSettingsViaAPIFlowParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the initialize self service settings via API flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InitializeSelfServiceSettingsViaAPIFlowParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the initialize self service settings via API flow params func (o *InitializeSelfServiceSettingsViaAPIFlowParams) WithTimeout(timeout time.Duration) *InitializeSelfServiceSettingsViaAPIFlowParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/public/initialize_self_service_settings_via_api_flow_responses.go b/internal/httpclient/client/public/initialize_self_service_settings_via_api_flow_responses.go index a93d37637ee..c2a26fefa6c 100644 --- a/internal/httpclient/client/public/initialize_self_service_settings_via_api_flow_responses.go +++ b/internal/httpclient/client/public/initialize_self_service_settings_via_api_flow_responses.go @@ -41,6 +41,7 @@ func (o *InitializeSelfServiceSettingsViaAPIFlowReader) ReadResponse(response ru return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -51,7 +52,7 @@ func NewInitializeSelfServiceSettingsViaAPIFlowOK() *InitializeSelfServiceSettin return &InitializeSelfServiceSettingsViaAPIFlowOK{} } -/* InitializeSelfServiceSettingsViaAPIFlowOK describes a response with status code 200, with default header values. +/*InitializeSelfServiceSettingsViaAPIFlowOK handles this case with default header values. settingsFlow */ @@ -62,6 +63,7 @@ type InitializeSelfServiceSettingsViaAPIFlowOK struct { func (o *InitializeSelfServiceSettingsViaAPIFlowOK) Error() string { return fmt.Sprintf("[GET /self-service/settings/api][%d] initializeSelfServiceSettingsViaApiFlowOK %+v", 200, o.Payload) } + func (o *InitializeSelfServiceSettingsViaAPIFlowOK) GetPayload() *models.SettingsFlow { return o.Payload } @@ -83,7 +85,7 @@ func NewInitializeSelfServiceSettingsViaAPIFlowBadRequest() *InitializeSelfServi return &InitializeSelfServiceSettingsViaAPIFlowBadRequest{} } -/* InitializeSelfServiceSettingsViaAPIFlowBadRequest describes a response with status code 400, with default header values. +/*InitializeSelfServiceSettingsViaAPIFlowBadRequest handles this case with default header values. genericError */ @@ -94,6 +96,7 @@ type InitializeSelfServiceSettingsViaAPIFlowBadRequest struct { func (o *InitializeSelfServiceSettingsViaAPIFlowBadRequest) Error() string { return fmt.Sprintf("[GET /self-service/settings/api][%d] initializeSelfServiceSettingsViaApiFlowBadRequest %+v", 400, o.Payload) } + func (o *InitializeSelfServiceSettingsViaAPIFlowBadRequest) GetPayload() *models.GenericError { return o.Payload } @@ -115,7 +118,7 @@ func NewInitializeSelfServiceSettingsViaAPIFlowInternalServerError() *Initialize return &InitializeSelfServiceSettingsViaAPIFlowInternalServerError{} } -/* InitializeSelfServiceSettingsViaAPIFlowInternalServerError describes a response with status code 500, with default header values. +/*InitializeSelfServiceSettingsViaAPIFlowInternalServerError handles this case with default header values. genericError */ @@ -126,6 +129,7 @@ type InitializeSelfServiceSettingsViaAPIFlowInternalServerError struct { func (o *InitializeSelfServiceSettingsViaAPIFlowInternalServerError) Error() string { return fmt.Sprintf("[GET /self-service/settings/api][%d] initializeSelfServiceSettingsViaApiFlowInternalServerError %+v", 500, o.Payload) } + func (o *InitializeSelfServiceSettingsViaAPIFlowInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/public/initialize_self_service_settings_via_browser_flow_parameters.go b/internal/httpclient/client/public/initialize_self_service_settings_via_browser_flow_parameters.go index 4f94ee11570..ef07bb08834 100644 --- a/internal/httpclient/client/public/initialize_self_service_settings_via_browser_flow_parameters.go +++ b/internal/httpclient/client/public/initialize_self_service_settings_via_browser_flow_parameters.go @@ -16,46 +16,47 @@ import ( "github.com/go-openapi/strfmt" ) -// NewInitializeSelfServiceSettingsViaBrowserFlowParams creates a new InitializeSelfServiceSettingsViaBrowserFlowParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewInitializeSelfServiceSettingsViaBrowserFlowParams creates a new InitializeSelfServiceSettingsViaBrowserFlowParams object +// with the default values initialized. func NewInitializeSelfServiceSettingsViaBrowserFlowParams() *InitializeSelfServiceSettingsViaBrowserFlowParams { + return &InitializeSelfServiceSettingsViaBrowserFlowParams{ + timeout: cr.DefaultTimeout, } } // NewInitializeSelfServiceSettingsViaBrowserFlowParamsWithTimeout creates a new InitializeSelfServiceSettingsViaBrowserFlowParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewInitializeSelfServiceSettingsViaBrowserFlowParamsWithTimeout(timeout time.Duration) *InitializeSelfServiceSettingsViaBrowserFlowParams { + return &InitializeSelfServiceSettingsViaBrowserFlowParams{ + timeout: timeout, } } // NewInitializeSelfServiceSettingsViaBrowserFlowParamsWithContext creates a new InitializeSelfServiceSettingsViaBrowserFlowParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewInitializeSelfServiceSettingsViaBrowserFlowParamsWithContext(ctx context.Context) *InitializeSelfServiceSettingsViaBrowserFlowParams { + return &InitializeSelfServiceSettingsViaBrowserFlowParams{ + Context: ctx, } } // NewInitializeSelfServiceSettingsViaBrowserFlowParamsWithHTTPClient creates a new InitializeSelfServiceSettingsViaBrowserFlowParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewInitializeSelfServiceSettingsViaBrowserFlowParamsWithHTTPClient(client *http.Client) *InitializeSelfServiceSettingsViaBrowserFlowParams { + return &InitializeSelfServiceSettingsViaBrowserFlowParams{ HTTPClient: client, } } -/* InitializeSelfServiceSettingsViaBrowserFlowParams contains all the parameters to send to the API endpoint - for the initialize self service settings via browser flow operation. - - Typically these are written to a http.Request. +/*InitializeSelfServiceSettingsViaBrowserFlowParams contains all the parameters to send to the API endpoint +for the initialize self service settings via browser flow operation typically these are written to a http.Request */ type InitializeSelfServiceSettingsViaBrowserFlowParams struct { timeout time.Duration @@ -63,21 +64,6 @@ type InitializeSelfServiceSettingsViaBrowserFlowParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the initialize self service settings via browser flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InitializeSelfServiceSettingsViaBrowserFlowParams) WithDefaults() *InitializeSelfServiceSettingsViaBrowserFlowParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the initialize self service settings via browser flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InitializeSelfServiceSettingsViaBrowserFlowParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the initialize self service settings via browser flow params func (o *InitializeSelfServiceSettingsViaBrowserFlowParams) WithTimeout(timeout time.Duration) *InitializeSelfServiceSettingsViaBrowserFlowParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/public/initialize_self_service_settings_via_browser_flow_responses.go b/internal/httpclient/client/public/initialize_self_service_settings_via_browser_flow_responses.go index 2131278592e..0fce7fb3070 100644 --- a/internal/httpclient/client/public/initialize_self_service_settings_via_browser_flow_responses.go +++ b/internal/httpclient/client/public/initialize_self_service_settings_via_browser_flow_responses.go @@ -35,6 +35,7 @@ func (o *InitializeSelfServiceSettingsViaBrowserFlowReader) ReadResponse(respons return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -45,9 +46,9 @@ func NewInitializeSelfServiceSettingsViaBrowserFlowFound() *InitializeSelfServic return &InitializeSelfServiceSettingsViaBrowserFlowFound{} } -/* InitializeSelfServiceSettingsViaBrowserFlowFound describes a response with status code 302, with default header values. +/*InitializeSelfServiceSettingsViaBrowserFlowFound handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type InitializeSelfServiceSettingsViaBrowserFlowFound struct { @@ -67,7 +68,7 @@ func NewInitializeSelfServiceSettingsViaBrowserFlowInternalServerError() *Initia return &InitializeSelfServiceSettingsViaBrowserFlowInternalServerError{} } -/* InitializeSelfServiceSettingsViaBrowserFlowInternalServerError describes a response with status code 500, with default header values. +/*InitializeSelfServiceSettingsViaBrowserFlowInternalServerError handles this case with default header values. genericError */ @@ -78,6 +79,7 @@ type InitializeSelfServiceSettingsViaBrowserFlowInternalServerError struct { func (o *InitializeSelfServiceSettingsViaBrowserFlowInternalServerError) Error() string { return fmt.Sprintf("[GET /self-service/settings/browser][%d] initializeSelfServiceSettingsViaBrowserFlowInternalServerError %+v", 500, o.Payload) } + func (o *InitializeSelfServiceSettingsViaBrowserFlowInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/public/initialize_self_service_verification_via_api_flow_parameters.go b/internal/httpclient/client/public/initialize_self_service_verification_via_api_flow_parameters.go index 09db6368a3e..cd3b19bab09 100644 --- a/internal/httpclient/client/public/initialize_self_service_verification_via_api_flow_parameters.go +++ b/internal/httpclient/client/public/initialize_self_service_verification_via_api_flow_parameters.go @@ -16,46 +16,47 @@ import ( "github.com/go-openapi/strfmt" ) -// NewInitializeSelfServiceVerificationViaAPIFlowParams creates a new InitializeSelfServiceVerificationViaAPIFlowParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewInitializeSelfServiceVerificationViaAPIFlowParams creates a new InitializeSelfServiceVerificationViaAPIFlowParams object +// with the default values initialized. func NewInitializeSelfServiceVerificationViaAPIFlowParams() *InitializeSelfServiceVerificationViaAPIFlowParams { + return &InitializeSelfServiceVerificationViaAPIFlowParams{ + timeout: cr.DefaultTimeout, } } // NewInitializeSelfServiceVerificationViaAPIFlowParamsWithTimeout creates a new InitializeSelfServiceVerificationViaAPIFlowParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewInitializeSelfServiceVerificationViaAPIFlowParamsWithTimeout(timeout time.Duration) *InitializeSelfServiceVerificationViaAPIFlowParams { + return &InitializeSelfServiceVerificationViaAPIFlowParams{ + timeout: timeout, } } // NewInitializeSelfServiceVerificationViaAPIFlowParamsWithContext creates a new InitializeSelfServiceVerificationViaAPIFlowParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewInitializeSelfServiceVerificationViaAPIFlowParamsWithContext(ctx context.Context) *InitializeSelfServiceVerificationViaAPIFlowParams { + return &InitializeSelfServiceVerificationViaAPIFlowParams{ + Context: ctx, } } // NewInitializeSelfServiceVerificationViaAPIFlowParamsWithHTTPClient creates a new InitializeSelfServiceVerificationViaAPIFlowParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewInitializeSelfServiceVerificationViaAPIFlowParamsWithHTTPClient(client *http.Client) *InitializeSelfServiceVerificationViaAPIFlowParams { + return &InitializeSelfServiceVerificationViaAPIFlowParams{ HTTPClient: client, } } -/* InitializeSelfServiceVerificationViaAPIFlowParams contains all the parameters to send to the API endpoint - for the initialize self service verification via API flow operation. - - Typically these are written to a http.Request. +/*InitializeSelfServiceVerificationViaAPIFlowParams contains all the parameters to send to the API endpoint +for the initialize self service verification via API flow operation typically these are written to a http.Request */ type InitializeSelfServiceVerificationViaAPIFlowParams struct { timeout time.Duration @@ -63,21 +64,6 @@ type InitializeSelfServiceVerificationViaAPIFlowParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the initialize self service verification via API flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InitializeSelfServiceVerificationViaAPIFlowParams) WithDefaults() *InitializeSelfServiceVerificationViaAPIFlowParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the initialize self service verification via API flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InitializeSelfServiceVerificationViaAPIFlowParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the initialize self service verification via API flow params func (o *InitializeSelfServiceVerificationViaAPIFlowParams) WithTimeout(timeout time.Duration) *InitializeSelfServiceVerificationViaAPIFlowParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/public/initialize_self_service_verification_via_api_flow_responses.go b/internal/httpclient/client/public/initialize_self_service_verification_via_api_flow_responses.go index c7bf9e7e039..871bc337b7b 100644 --- a/internal/httpclient/client/public/initialize_self_service_verification_via_api_flow_responses.go +++ b/internal/httpclient/client/public/initialize_self_service_verification_via_api_flow_responses.go @@ -41,6 +41,7 @@ func (o *InitializeSelfServiceVerificationViaAPIFlowReader) ReadResponse(respons return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -51,7 +52,7 @@ func NewInitializeSelfServiceVerificationViaAPIFlowOK() *InitializeSelfServiceVe return &InitializeSelfServiceVerificationViaAPIFlowOK{} } -/* InitializeSelfServiceVerificationViaAPIFlowOK describes a response with status code 200, with default header values. +/*InitializeSelfServiceVerificationViaAPIFlowOK handles this case with default header values. verificationFlow */ @@ -62,6 +63,7 @@ type InitializeSelfServiceVerificationViaAPIFlowOK struct { func (o *InitializeSelfServiceVerificationViaAPIFlowOK) Error() string { return fmt.Sprintf("[GET /self-service/verification/api][%d] initializeSelfServiceVerificationViaApiFlowOK %+v", 200, o.Payload) } + func (o *InitializeSelfServiceVerificationViaAPIFlowOK) GetPayload() *models.VerificationFlow { return o.Payload } @@ -83,7 +85,7 @@ func NewInitializeSelfServiceVerificationViaAPIFlowBadRequest() *InitializeSelfS return &InitializeSelfServiceVerificationViaAPIFlowBadRequest{} } -/* InitializeSelfServiceVerificationViaAPIFlowBadRequest describes a response with status code 400, with default header values. +/*InitializeSelfServiceVerificationViaAPIFlowBadRequest handles this case with default header values. genericError */ @@ -94,6 +96,7 @@ type InitializeSelfServiceVerificationViaAPIFlowBadRequest struct { func (o *InitializeSelfServiceVerificationViaAPIFlowBadRequest) Error() string { return fmt.Sprintf("[GET /self-service/verification/api][%d] initializeSelfServiceVerificationViaApiFlowBadRequest %+v", 400, o.Payload) } + func (o *InitializeSelfServiceVerificationViaAPIFlowBadRequest) GetPayload() *models.GenericError { return o.Payload } @@ -115,7 +118,7 @@ func NewInitializeSelfServiceVerificationViaAPIFlowInternalServerError() *Initia return &InitializeSelfServiceVerificationViaAPIFlowInternalServerError{} } -/* InitializeSelfServiceVerificationViaAPIFlowInternalServerError describes a response with status code 500, with default header values. +/*InitializeSelfServiceVerificationViaAPIFlowInternalServerError handles this case with default header values. genericError */ @@ -126,6 +129,7 @@ type InitializeSelfServiceVerificationViaAPIFlowInternalServerError struct { func (o *InitializeSelfServiceVerificationViaAPIFlowInternalServerError) Error() string { return fmt.Sprintf("[GET /self-service/verification/api][%d] initializeSelfServiceVerificationViaApiFlowInternalServerError %+v", 500, o.Payload) } + func (o *InitializeSelfServiceVerificationViaAPIFlowInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/public/initialize_self_service_verification_via_browser_flow_parameters.go b/internal/httpclient/client/public/initialize_self_service_verification_via_browser_flow_parameters.go index 3a6dfce60a6..9932f43ad67 100644 --- a/internal/httpclient/client/public/initialize_self_service_verification_via_browser_flow_parameters.go +++ b/internal/httpclient/client/public/initialize_self_service_verification_via_browser_flow_parameters.go @@ -16,46 +16,47 @@ import ( "github.com/go-openapi/strfmt" ) -// NewInitializeSelfServiceVerificationViaBrowserFlowParams creates a new InitializeSelfServiceVerificationViaBrowserFlowParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewInitializeSelfServiceVerificationViaBrowserFlowParams creates a new InitializeSelfServiceVerificationViaBrowserFlowParams object +// with the default values initialized. func NewInitializeSelfServiceVerificationViaBrowserFlowParams() *InitializeSelfServiceVerificationViaBrowserFlowParams { + return &InitializeSelfServiceVerificationViaBrowserFlowParams{ + timeout: cr.DefaultTimeout, } } // NewInitializeSelfServiceVerificationViaBrowserFlowParamsWithTimeout creates a new InitializeSelfServiceVerificationViaBrowserFlowParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewInitializeSelfServiceVerificationViaBrowserFlowParamsWithTimeout(timeout time.Duration) *InitializeSelfServiceVerificationViaBrowserFlowParams { + return &InitializeSelfServiceVerificationViaBrowserFlowParams{ + timeout: timeout, } } // NewInitializeSelfServiceVerificationViaBrowserFlowParamsWithContext creates a new InitializeSelfServiceVerificationViaBrowserFlowParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewInitializeSelfServiceVerificationViaBrowserFlowParamsWithContext(ctx context.Context) *InitializeSelfServiceVerificationViaBrowserFlowParams { + return &InitializeSelfServiceVerificationViaBrowserFlowParams{ + Context: ctx, } } // NewInitializeSelfServiceVerificationViaBrowserFlowParamsWithHTTPClient creates a new InitializeSelfServiceVerificationViaBrowserFlowParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewInitializeSelfServiceVerificationViaBrowserFlowParamsWithHTTPClient(client *http.Client) *InitializeSelfServiceVerificationViaBrowserFlowParams { + return &InitializeSelfServiceVerificationViaBrowserFlowParams{ HTTPClient: client, } } -/* InitializeSelfServiceVerificationViaBrowserFlowParams contains all the parameters to send to the API endpoint - for the initialize self service verification via browser flow operation. - - Typically these are written to a http.Request. +/*InitializeSelfServiceVerificationViaBrowserFlowParams contains all the parameters to send to the API endpoint +for the initialize self service verification via browser flow operation typically these are written to a http.Request */ type InitializeSelfServiceVerificationViaBrowserFlowParams struct { timeout time.Duration @@ -63,21 +64,6 @@ type InitializeSelfServiceVerificationViaBrowserFlowParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the initialize self service verification via browser flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InitializeSelfServiceVerificationViaBrowserFlowParams) WithDefaults() *InitializeSelfServiceVerificationViaBrowserFlowParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the initialize self service verification via browser flow params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *InitializeSelfServiceVerificationViaBrowserFlowParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the initialize self service verification via browser flow params func (o *InitializeSelfServiceVerificationViaBrowserFlowParams) WithTimeout(timeout time.Duration) *InitializeSelfServiceVerificationViaBrowserFlowParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/public/initialize_self_service_verification_via_browser_flow_responses.go b/internal/httpclient/client/public/initialize_self_service_verification_via_browser_flow_responses.go index 3b86fa8e927..549b8d792ca 100644 --- a/internal/httpclient/client/public/initialize_self_service_verification_via_browser_flow_responses.go +++ b/internal/httpclient/client/public/initialize_self_service_verification_via_browser_flow_responses.go @@ -35,6 +35,7 @@ func (o *InitializeSelfServiceVerificationViaBrowserFlowReader) ReadResponse(res return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -45,9 +46,9 @@ func NewInitializeSelfServiceVerificationViaBrowserFlowFound() *InitializeSelfSe return &InitializeSelfServiceVerificationViaBrowserFlowFound{} } -/* InitializeSelfServiceVerificationViaBrowserFlowFound describes a response with status code 302, with default header values. +/*InitializeSelfServiceVerificationViaBrowserFlowFound handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type InitializeSelfServiceVerificationViaBrowserFlowFound struct { @@ -67,7 +68,7 @@ func NewInitializeSelfServiceVerificationViaBrowserFlowInternalServerError() *In return &InitializeSelfServiceVerificationViaBrowserFlowInternalServerError{} } -/* InitializeSelfServiceVerificationViaBrowserFlowInternalServerError describes a response with status code 500, with default header values. +/*InitializeSelfServiceVerificationViaBrowserFlowInternalServerError handles this case with default header values. genericError */ @@ -78,6 +79,7 @@ type InitializeSelfServiceVerificationViaBrowserFlowInternalServerError struct { func (o *InitializeSelfServiceVerificationViaBrowserFlowInternalServerError) Error() string { return fmt.Sprintf("[GET /self-service/verification/browser][%d] initializeSelfServiceVerificationViaBrowserFlowInternalServerError %+v", 500, o.Payload) } + func (o *InitializeSelfServiceVerificationViaBrowserFlowInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/public/revoke_session_parameters.go b/internal/httpclient/client/public/revoke_session_parameters.go index 45729bd1854..4ca2a87ea52 100644 --- a/internal/httpclient/client/public/revoke_session_parameters.go +++ b/internal/httpclient/client/public/revoke_session_parameters.go @@ -18,50 +18,51 @@ import ( "github.com/ory/kratos-client-go/models" ) -// NewRevokeSessionParams creates a new RevokeSessionParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewRevokeSessionParams creates a new RevokeSessionParams object +// with the default values initialized. func NewRevokeSessionParams() *RevokeSessionParams { + var () return &RevokeSessionParams{ + timeout: cr.DefaultTimeout, } } // NewRevokeSessionParamsWithTimeout creates a new RevokeSessionParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewRevokeSessionParamsWithTimeout(timeout time.Duration) *RevokeSessionParams { + var () return &RevokeSessionParams{ + timeout: timeout, } } // NewRevokeSessionParamsWithContext creates a new RevokeSessionParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewRevokeSessionParamsWithContext(ctx context.Context) *RevokeSessionParams { + var () return &RevokeSessionParams{ + Context: ctx, } } // NewRevokeSessionParamsWithHTTPClient creates a new RevokeSessionParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewRevokeSessionParamsWithHTTPClient(client *http.Client) *RevokeSessionParams { + var () return &RevokeSessionParams{ HTTPClient: client, } } -/* RevokeSessionParams contains all the parameters to send to the API endpoint - for the revoke session operation. - - Typically these are written to a http.Request. +/*RevokeSessionParams contains all the parameters to send to the API endpoint +for the revoke session operation typically these are written to a http.Request */ type RevokeSessionParams struct { - // Body. + /*Body*/ Body *models.RevokeSession timeout time.Duration @@ -69,21 +70,6 @@ type RevokeSessionParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the revoke session params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RevokeSessionParams) WithDefaults() *RevokeSessionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the revoke session params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RevokeSessionParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the revoke session params func (o *RevokeSessionParams) WithTimeout(timeout time.Duration) *RevokeSessionParams { o.SetTimeout(timeout) @@ -135,6 +121,7 @@ func (o *RevokeSessionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt return err } var res []error + if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/internal/httpclient/client/public/revoke_session_responses.go b/internal/httpclient/client/public/revoke_session_responses.go index c6a5269263a..e6b5ed4cf1f 100644 --- a/internal/httpclient/client/public/revoke_session_responses.go +++ b/internal/httpclient/client/public/revoke_session_responses.go @@ -41,6 +41,7 @@ func (o *RevokeSessionReader) ReadResponse(response runtime.ClientResponse, cons return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -51,9 +52,9 @@ func NewRevokeSessionNoContent() *RevokeSessionNoContent { return &RevokeSessionNoContent{} } -/* RevokeSessionNoContent describes a response with status code 204, with default header values. +/*RevokeSessionNoContent handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type RevokeSessionNoContent struct { @@ -73,7 +74,7 @@ func NewRevokeSessionBadRequest() *RevokeSessionBadRequest { return &RevokeSessionBadRequest{} } -/* RevokeSessionBadRequest describes a response with status code 400, with default header values. +/*RevokeSessionBadRequest handles this case with default header values. genericError */ @@ -84,6 +85,7 @@ type RevokeSessionBadRequest struct { func (o *RevokeSessionBadRequest) Error() string { return fmt.Sprintf("[DELETE /sessions][%d] revokeSessionBadRequest %+v", 400, o.Payload) } + func (o *RevokeSessionBadRequest) GetPayload() *models.GenericError { return o.Payload } @@ -105,7 +107,7 @@ func NewRevokeSessionInternalServerError() *RevokeSessionInternalServerError { return &RevokeSessionInternalServerError{} } -/* RevokeSessionInternalServerError describes a response with status code 500, with default header values. +/*RevokeSessionInternalServerError handles this case with default header values. genericError */ @@ -116,6 +118,7 @@ type RevokeSessionInternalServerError struct { func (o *RevokeSessionInternalServerError) Error() string { return fmt.Sprintf("[DELETE /sessions][%d] revokeSessionInternalServerError %+v", 500, o.Payload) } + func (o *RevokeSessionInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/public/whoami_parameters.go b/internal/httpclient/client/public/whoami_parameters.go index 2d007337868..2d011c9a6ac 100644 --- a/internal/httpclient/client/public/whoami_parameters.go +++ b/internal/httpclient/client/public/whoami_parameters.go @@ -16,56 +16,56 @@ import ( "github.com/go-openapi/strfmt" ) -// NewWhoamiParams creates a new WhoamiParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewWhoamiParams creates a new WhoamiParams object +// with the default values initialized. func NewWhoamiParams() *WhoamiParams { + var () return &WhoamiParams{ + timeout: cr.DefaultTimeout, } } // NewWhoamiParamsWithTimeout creates a new WhoamiParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewWhoamiParamsWithTimeout(timeout time.Duration) *WhoamiParams { + var () return &WhoamiParams{ + timeout: timeout, } } // NewWhoamiParamsWithContext creates a new WhoamiParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewWhoamiParamsWithContext(ctx context.Context) *WhoamiParams { + var () return &WhoamiParams{ + Context: ctx, } } // NewWhoamiParamsWithHTTPClient creates a new WhoamiParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewWhoamiParamsWithHTTPClient(client *http.Client) *WhoamiParams { + var () return &WhoamiParams{ HTTPClient: client, } } -/* WhoamiParams contains all the parameters to send to the API endpoint - for the whoami operation. - - Typically these are written to a http.Request. +/*WhoamiParams contains all the parameters to send to the API endpoint +for the whoami operation typically these are written to a http.Request */ type WhoamiParams struct { - /* Authorization. + /*Authorization + in: authorization - in: authorization */ Authorization *string - - // Cookie. + /*Cookie*/ Cookie *string timeout time.Duration @@ -73,21 +73,6 @@ type WhoamiParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the whoami params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *WhoamiParams) WithDefaults() *WhoamiParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the whoami params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *WhoamiParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the whoami params func (o *WhoamiParams) WithTimeout(timeout time.Duration) *WhoamiParams { o.SetTimeout(timeout) @@ -155,17 +140,16 @@ func (o *WhoamiParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regist // query param Authorization var qrAuthorization string - if o.Authorization != nil { qrAuthorization = *o.Authorization } qAuthorization := qrAuthorization if qAuthorization != "" { - if err := r.SetQueryParam("Authorization", qAuthorization); err != nil { return err } } + } if o.Cookie != nil { @@ -174,6 +158,7 @@ func (o *WhoamiParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regist if err := r.SetHeaderParam("Cookie", *o.Cookie); err != nil { return err } + } if len(res) > 0 { diff --git a/internal/httpclient/client/public/whoami_responses.go b/internal/httpclient/client/public/whoami_responses.go index b758cbf00aa..b367c4289ed 100644 --- a/internal/httpclient/client/public/whoami_responses.go +++ b/internal/httpclient/client/public/whoami_responses.go @@ -41,6 +41,7 @@ func (o *WhoamiReader) ReadResponse(response runtime.ClientResponse, consumer ru return nil, err } return nil, result + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -51,7 +52,7 @@ func NewWhoamiOK() *WhoamiOK { return &WhoamiOK{} } -/* WhoamiOK describes a response with status code 200, with default header values. +/*WhoamiOK handles this case with default header values. session */ @@ -62,6 +63,7 @@ type WhoamiOK struct { func (o *WhoamiOK) Error() string { return fmt.Sprintf("[GET /sessions/whoami][%d] whoamiOK %+v", 200, o.Payload) } + func (o *WhoamiOK) GetPayload() *models.Session { return o.Payload } @@ -83,7 +85,7 @@ func NewWhoamiUnauthorized() *WhoamiUnauthorized { return &WhoamiUnauthorized{} } -/* WhoamiUnauthorized describes a response with status code 401, with default header values. +/*WhoamiUnauthorized handles this case with default header values. genericError */ @@ -94,6 +96,7 @@ type WhoamiUnauthorized struct { func (o *WhoamiUnauthorized) Error() string { return fmt.Sprintf("[GET /sessions/whoami][%d] whoamiUnauthorized %+v", 401, o.Payload) } + func (o *WhoamiUnauthorized) GetPayload() *models.GenericError { return o.Payload } @@ -115,7 +118,7 @@ func NewWhoamiInternalServerError() *WhoamiInternalServerError { return &WhoamiInternalServerError{} } -/* WhoamiInternalServerError describes a response with status code 500, with default header values. +/*WhoamiInternalServerError handles this case with default header values. genericError */ @@ -126,6 +129,7 @@ type WhoamiInternalServerError struct { func (o *WhoamiInternalServerError) Error() string { return fmt.Sprintf("[GET /sessions/whoami][%d] whoamiInternalServerError %+v", 500, o.Payload) } + func (o *WhoamiInternalServerError) GetPayload() *models.GenericError { return o.Payload } diff --git a/internal/httpclient/client/version/get_version_parameters.go b/internal/httpclient/client/version/get_version_parameters.go index 06e87f79411..29bf00d13b8 100644 --- a/internal/httpclient/client/version/get_version_parameters.go +++ b/internal/httpclient/client/version/get_version_parameters.go @@ -16,46 +16,47 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetVersionParams creates a new GetVersionParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewGetVersionParams creates a new GetVersionParams object +// with the default values initialized. func NewGetVersionParams() *GetVersionParams { + return &GetVersionParams{ + timeout: cr.DefaultTimeout, } } // NewGetVersionParamsWithTimeout creates a new GetVersionParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewGetVersionParamsWithTimeout(timeout time.Duration) *GetVersionParams { + return &GetVersionParams{ + timeout: timeout, } } // NewGetVersionParamsWithContext creates a new GetVersionParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewGetVersionParamsWithContext(ctx context.Context) *GetVersionParams { + return &GetVersionParams{ + Context: ctx, } } // NewGetVersionParamsWithHTTPClient creates a new GetVersionParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewGetVersionParamsWithHTTPClient(client *http.Client) *GetVersionParams { + return &GetVersionParams{ HTTPClient: client, } } -/* GetVersionParams contains all the parameters to send to the API endpoint - for the get version operation. - - Typically these are written to a http.Request. +/*GetVersionParams contains all the parameters to send to the API endpoint +for the get version operation typically these are written to a http.Request */ type GetVersionParams struct { timeout time.Duration @@ -63,21 +64,6 @@ type GetVersionParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the get version params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetVersionParams) WithDefaults() *GetVersionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get version params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetVersionParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the get version params func (o *GetVersionParams) WithTimeout(timeout time.Duration) *GetVersionParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/version/get_version_responses.go b/internal/httpclient/client/version/get_version_responses.go index 4ef9679b5d8..6d22a417db1 100644 --- a/internal/httpclient/client/version/get_version_responses.go +++ b/internal/httpclient/client/version/get_version_responses.go @@ -29,6 +29,7 @@ func (o *GetVersionReader) ReadResponse(response runtime.ClientResponse, consume return nil, err } return result, nil + default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } @@ -39,7 +40,7 @@ func NewGetVersionOK() *GetVersionOK { return &GetVersionOK{} } -/* GetVersionOK describes a response with status code 200, with default header values. +/*GetVersionOK handles this case with default header values. version */ @@ -50,6 +51,7 @@ type GetVersionOK struct { func (o *GetVersionOK) Error() string { return fmt.Sprintf("[GET /version][%d] getVersionOK %+v", 200, o.Payload) } + func (o *GetVersionOK) GetPayload() *models.Version { return o.Payload } diff --git a/internal/httpclient/models/complete_self_service_login_flow_with_password_method.go b/internal/httpclient/models/complete_self_service_login_flow_with_password_method.go index f792d9619b2..302179bce04 100644 --- a/internal/httpclient/models/complete_self_service_login_flow_with_password_method.go +++ b/internal/httpclient/models/complete_self_service_login_flow_with_password_method.go @@ -6,13 +6,11 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) -// CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod complete self service login flow with password method +// CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod CompleteSelfServiceLoginFlowWithPasswordMethod complete self service login flow with password method // // swagger:model CompleteSelfServiceLoginFlowWithPasswordMethod type CompleteSelfServiceLoginFlowWithPasswordMethod struct { @@ -32,11 +30,6 @@ func (m *CompleteSelfServiceLoginFlowWithPasswordMethod) Validate(formats strfmt return nil } -// ContextValidate validates this complete self service login flow with password method based on context it is used -func (m *CompleteSelfServiceLoginFlowWithPasswordMethod) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *CompleteSelfServiceLoginFlowWithPasswordMethod) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/complete_self_service_recovery_flow_with_link_method.go b/internal/httpclient/models/complete_self_service_recovery_flow_with_link_method.go index e8b64af36d8..0346ff0dbd0 100644 --- a/internal/httpclient/models/complete_self_service_recovery_flow_with_link_method.go +++ b/internal/httpclient/models/complete_self_service_recovery_flow_with_link_method.go @@ -6,13 +6,11 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) -// CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod complete self service recovery flow with link method +// CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod CompleteSelfServiceRecoveryFlowWithLinkMethod complete self service recovery flow with link method // // swagger:model completeSelfServiceRecoveryFlowWithLinkMethod type CompleteSelfServiceRecoveryFlowWithLinkMethod struct { @@ -36,11 +34,6 @@ func (m *CompleteSelfServiceRecoveryFlowWithLinkMethod) Validate(formats strfmt. return nil } -// ContextValidate validates this complete self service recovery flow with link method based on context it is used -func (m *CompleteSelfServiceRecoveryFlowWithLinkMethod) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *CompleteSelfServiceRecoveryFlowWithLinkMethod) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/complete_self_service_settings_flow_with_password_method.go b/internal/httpclient/models/complete_self_service_settings_flow_with_password_method.go index aac5c8c3424..cf381b4c3bb 100644 --- a/internal/httpclient/models/complete_self_service_settings_flow_with_password_method.go +++ b/internal/httpclient/models/complete_self_service_settings_flow_with_password_method.go @@ -6,15 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) -// CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod complete self service settings flow with password method +// CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod CompleteSelfServiceSettingsFlowWithPasswordMethod complete self service settings flow with password method // // swagger:model CompleteSelfServiceSettingsFlowWithPasswordMethod type CompleteSelfServiceSettingsFlowWithPasswordMethod struct { @@ -54,11 +52,6 @@ func (m *CompleteSelfServiceSettingsFlowWithPasswordMethod) validatePassword(for return nil } -// ContextValidate validates this complete self service settings flow with password method based on context it is used -func (m *CompleteSelfServiceSettingsFlowWithPasswordMethod) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *CompleteSelfServiceSettingsFlowWithPasswordMethod) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/complete_self_service_verification_flow_with_link_method.go b/internal/httpclient/models/complete_self_service_verification_flow_with_link_method.go index c67e1fa5dfb..ad948dc28cf 100644 --- a/internal/httpclient/models/complete_self_service_verification_flow_with_link_method.go +++ b/internal/httpclient/models/complete_self_service_verification_flow_with_link_method.go @@ -6,13 +6,11 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) -// CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod complete self service verification flow with link method +// CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod CompleteSelfServiceVerificationFlowWithLinkMethod complete self service verification flow with link method // // swagger:model completeSelfServiceVerificationFlowWithLinkMethod type CompleteSelfServiceVerificationFlowWithLinkMethod struct { @@ -36,11 +34,6 @@ func (m *CompleteSelfServiceVerificationFlowWithLinkMethod) Validate(formats str return nil } -// ContextValidate validates this complete self service verification flow with link method based on context it is used -func (m *CompleteSelfServiceVerificationFlowWithLinkMethod) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *CompleteSelfServiceVerificationFlowWithLinkMethod) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/create_identity.go b/internal/httpclient/models/create_identity.go index d0fd245239f..bd95eaaa76d 100644 --- a/internal/httpclient/models/create_identity.go +++ b/internal/httpclient/models/create_identity.go @@ -6,15 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) -// CreateIdentity CreateIdentity CreateIdentity CreateIdentity CreateIdentity CreateIdentity CreateIdentity CreateIdentity CreateIdentity CreateIdentity CreateIdentity create identity +// CreateIdentity CreateIdentity CreateIdentity CreateIdentity CreateIdentity CreateIdentity CreateIdentity CreateIdentity CreateIdentity CreateIdentity CreateIdentity CreateIdentity CreateIdentity create identity // // swagger:model CreateIdentity type CreateIdentity struct { @@ -59,18 +57,13 @@ func (m *CreateIdentity) validateSchemaID(formats strfmt.Registry) error { func (m *CreateIdentity) validateTraits(formats strfmt.Registry) error { - if m.Traits == nil { - return errors.Required("traits", "body", nil) + if err := validate.Required("traits", "body", m.Traits); err != nil { + return err } return nil } -// ContextValidate validates this create identity based on context it is used -func (m *CreateIdentity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *CreateIdentity) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/create_recovery_link.go b/internal/httpclient/models/create_recovery_link.go index c7f1ea6ed05..ff570acfbc3 100644 --- a/internal/httpclient/models/create_recovery_link.go +++ b/internal/httpclient/models/create_recovery_link.go @@ -6,15 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) -// CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink create recovery link +// CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink CreateRecoveryLink create recovery link // // swagger:model CreateRecoveryLink type CreateRecoveryLink struct { @@ -29,7 +27,7 @@ type CreateRecoveryLink struct { // identity id // Required: true // Format: uuid4 - IdentityID *UUID `json:"identity_id"` + IdentityID UUID `json:"identity_id"` } // Validate validates this create recovery link @@ -51,11 +49,12 @@ func (m *CreateRecoveryLink) Validate(formats strfmt.Registry) error { } func (m *CreateRecoveryLink) validateExpiresIn(formats strfmt.Registry) error { + if swag.IsZero(m.ExpiresIn) { // not required return nil } - if err := validate.Pattern("expires_in", "body", m.ExpiresIn, `^[0-9]+(ns|us|ms|s|m|h)$`); err != nil { + if err := validate.Pattern("expires_in", "body", string(m.ExpiresIn), `^[0-9]+(ns|us|ms|s|m|h)$`); err != nil { return err } @@ -64,49 +63,11 @@ func (m *CreateRecoveryLink) validateExpiresIn(formats strfmt.Registry) error { func (m *CreateRecoveryLink) validateIdentityID(formats strfmt.Registry) error { - if err := validate.Required("identity_id", "body", m.IdentityID); err != nil { - return err - } - - if err := validate.Required("identity_id", "body", m.IdentityID); err != nil { - return err - } - - if m.IdentityID != nil { - if err := m.IdentityID.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identity_id") - } - return err - } - } - - return nil -} - -// ContextValidate validate this create recovery link based on the context it is used -func (m *CreateRecoveryLink) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateIdentityID(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateRecoveryLink) contextValidateIdentityID(ctx context.Context, formats strfmt.Registry) error { - - if m.IdentityID != nil { - if err := m.IdentityID.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identity_id") - } - return err + if err := m.IdentityID.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("identity_id") } + return err } return nil diff --git a/internal/httpclient/models/credentials_type.go b/internal/httpclient/models/credentials_type.go index a08e2afe574..81188627891 100644 --- a/internal/httpclient/models/credentials_type.go +++ b/internal/httpclient/models/credentials_type.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" ) @@ -22,8 +20,3 @@ type CredentialsType string func (m CredentialsType) Validate(formats strfmt.Registry) error { return nil } - -// ContextValidate validates this credentials type based on context it is used -func (m CredentialsType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/internal/httpclient/models/error_container.go b/internal/httpclient/models/error_container.go index 7c14220426c..87aef47f881 100644 --- a/internal/httpclient/models/error_container.go +++ b/internal/httpclient/models/error_container.go @@ -6,15 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) -// ErrorContainer ErrorContainer ErrorContainer ErrorContainer error container +// ErrorContainer error container // // swagger:model errorContainer type ErrorContainer struct { @@ -26,7 +24,7 @@ type ErrorContainer struct { // id // Required: true // Format: uuid4 - ID *UUID `json:"id"` + ID UUID `json:"id"` } // Validate validates this error container @@ -49,58 +47,20 @@ func (m *ErrorContainer) Validate(formats strfmt.Registry) error { func (m *ErrorContainer) validateErrors(formats strfmt.Registry) error { - if m.Errors == nil { - return errors.Required("errors", "body", nil) - } - - return nil -} - -func (m *ErrorContainer) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.Required("id", "body", m.ID); err != nil { + if err := validate.Required("errors", "body", m.Errors); err != nil { return err } - if m.ID != nil { - if err := m.ID.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("id") - } - return err - } - } - return nil } -// ContextValidate validate this error container based on the context it is used -func (m *ErrorContainer) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ErrorContainer) contextValidateID(ctx context.Context, formats strfmt.Registry) error { +func (m *ErrorContainer) validateID(formats strfmt.Registry) error { - if m.ID != nil { - if err := m.ID.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("id") - } - return err + if err := m.ID.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("id") } + return err } return nil diff --git a/internal/httpclient/models/form_field.go b/internal/httpclient/models/form_field.go index fe2c651f13a..a51875d7fa6 100644 --- a/internal/httpclient/models/form_field.go +++ b/internal/httpclient/models/form_field.go @@ -6,15 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) -// FormField FormField FormField FormField Field represents a HTML Form Field +// FormField Field represents a HTML Form Field // // swagger:model formField type FormField struct { @@ -66,6 +64,7 @@ func (m *FormField) Validate(formats strfmt.Registry) error { } func (m *FormField) validateMessages(formats strfmt.Registry) error { + if swag.IsZero(m.Messages) { // not required return nil } @@ -98,32 +97,6 @@ func (m *FormField) validateType(formats strfmt.Registry) error { return nil } -// ContextValidate validate this form field based on the context it is used -func (m *FormField) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateMessages(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *FormField) contextValidateMessages(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Messages.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("messages") - } - return err - } - - return nil -} - // MarshalBinary interface implementation func (m *FormField) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/form_fields.go b/internal/httpclient/models/form_fields.go index aba9f2d5542..9a28d1c13ef 100644 --- a/internal/httpclient/models/form_fields.go +++ b/internal/httpclient/models/form_fields.go @@ -6,7 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" "strconv" "github.com/go-openapi/errors" @@ -44,26 +43,3 @@ func (m FormFields) Validate(formats strfmt.Registry) error { } return nil } - -// ContextValidate validate this form fields based on the context it is used -func (m FormFields) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/internal/httpclient/models/generic_error.go b/internal/httpclient/models/generic_error.go index ca8fbb6f918..e4a3a85c6bd 100644 --- a/internal/httpclient/models/generic_error.go +++ b/internal/httpclient/models/generic_error.go @@ -6,14 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) -// GenericError Error response +// GenericError GenericError Error response // // Error responses are sent when an error (e.g. unauthorized, bad request, ...) occurred. // @@ -39,6 +37,7 @@ func (m *GenericError) Validate(formats strfmt.Registry) error { } func (m *GenericError) validateError(formats strfmt.Registry) error { + if swag.IsZero(m.Error) { // not required return nil } @@ -55,34 +54,6 @@ func (m *GenericError) validateError(formats strfmt.Registry) error { return nil } -// ContextValidate validate this generic error based on the context it is used -func (m *GenericError) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateError(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GenericError) contextValidateError(ctx context.Context, formats strfmt.Registry) error { - - if m.Error != nil { - if err := m.Error.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("error") - } - return err - } - } - - return nil -} - // MarshalBinary interface implementation func (m *GenericError) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/generic_error_payload.go b/internal/httpclient/models/generic_error_payload.go index 84a5169213a..eedcd468295 100644 --- a/internal/httpclient/models/generic_error_payload.go +++ b/internal/httpclient/models/generic_error_payload.go @@ -6,23 +6,19 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) -// GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload generic error payload +// GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload GenericErrorPayload generic error payload // // swagger:model genericErrorPayload type GenericErrorPayload struct { // Code represents the error status code (404, 403, 401, ...). - // Example: 404 Code int64 `json:"code,omitempty"` // Debug contains debug information. This is usually not available and has to be enabled. - // Example: The database adapter was unable to find the element Debug string `json:"debug,omitempty"` // details @@ -46,11 +42,6 @@ func (m *GenericErrorPayload) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validates this generic error payload based on context it is used -func (m *GenericErrorPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *GenericErrorPayload) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/health_not_ready_status.go b/internal/httpclient/models/health_not_ready_status.go index bab6d3873e8..64626783ed4 100644 --- a/internal/httpclient/models/health_not_ready_status.go +++ b/internal/httpclient/models/health_not_ready_status.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -26,11 +24,6 @@ func (m *HealthNotReadyStatus) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validates this health not ready status based on context it is used -func (m *HealthNotReadyStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *HealthNotReadyStatus) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/health_status.go b/internal/httpclient/models/health_status.go index a2057e10151..60ba32416b0 100644 --- a/internal/httpclient/models/health_status.go +++ b/internal/httpclient/models/health_status.go @@ -6,13 +6,11 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) -// HealthStatus HealthStatus health status +// HealthStatus health status // // swagger:model healthStatus type HealthStatus struct { @@ -26,11 +24,6 @@ func (m *HealthStatus) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validates this health status based on context it is used -func (m *HealthStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *HealthStatus) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/id.go b/internal/httpclient/models/id.go index a275a2dc5a2..e840a135500 100644 --- a/internal/httpclient/models/id.go +++ b/internal/httpclient/models/id.go @@ -6,12 +6,10 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" ) -// ID ID ID ID ID ID ID ID ID ID ID ID +// ID ID ID ID ID ID ID ID ID ID ID ID ID ID // // swagger:model ID type ID int64 @@ -20,8 +18,3 @@ type ID int64 func (m ID) Validate(formats strfmt.Registry) error { return nil } - -// ContextValidate validates this ID based on context it is used -func (m ID) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/internal/httpclient/models/identity.go b/internal/httpclient/models/identity.go index 4b9113e5243..8d4d4efca97 100644 --- a/internal/httpclient/models/identity.go +++ b/internal/httpclient/models/identity.go @@ -6,7 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" "strconv" "github.com/go-openapi/errors" @@ -15,7 +14,7 @@ import ( "github.com/go-openapi/validate" ) -// Identity Identity Identity Identity Identity Identity Identity Identity Identity Identity Identity identity +// Identity Identity Identity Identity Identity Identity Identity Identity Identity Identity Identity Identity Identity identity // // swagger:model Identity type Identity struct { @@ -23,7 +22,7 @@ type Identity struct { // id // Required: true // Format: uuid4 - ID *UUID `json:"id"` + ID UUID `json:"id"` // RecoveryAddresses contains all the addresses that can be used to recover an identity. RecoveryAddresses []*RecoveryAddress `json:"recovery_addresses,omitempty"` @@ -82,27 +81,18 @@ func (m *Identity) Validate(formats strfmt.Registry) error { func (m *Identity) validateID(formats strfmt.Registry) error { - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if m.ID != nil { - if err := m.ID.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("id") - } - return err + if err := m.ID.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("id") } + return err } return nil } func (m *Identity) validateRecoveryAddresses(formats strfmt.Registry) error { + if swag.IsZero(m.RecoveryAddresses) { // not required return nil } @@ -146,14 +136,15 @@ func (m *Identity) validateSchemaURL(formats strfmt.Registry) error { func (m *Identity) validateTraits(formats strfmt.Registry) error { - if m.Traits == nil { - return errors.Required("traits", "body", nil) + if err := validate.Required("traits", "body", m.Traits); err != nil { + return err } return nil } func (m *Identity) validateVerifiableAddresses(formats strfmt.Registry) error { + if swag.IsZero(m.VerifiableAddresses) { // not required return nil } @@ -177,78 +168,6 @@ func (m *Identity) validateVerifiableAddresses(formats strfmt.Registry) error { return nil } -// ContextValidate validate this identity based on the context it is used -func (m *Identity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRecoveryAddresses(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVerifiableAddresses(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Identity) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if m.ID != nil { - if err := m.ID.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("id") - } - return err - } - } - - return nil -} - -func (m *Identity) contextValidateRecoveryAddresses(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.RecoveryAddresses); i++ { - - if m.RecoveryAddresses[i] != nil { - if err := m.RecoveryAddresses[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("recovery_addresses" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *Identity) contextValidateVerifiableAddresses(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.VerifiableAddresses); i++ { - - if m.VerifiableAddresses[i] != nil { - if err := m.VerifiableAddresses[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("verifiable_addresses" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - // MarshalBinary interface implementation func (m *Identity) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/login_flow.go b/internal/httpclient/models/login_flow.go index 1565d60ece5..fca3208d5b4 100644 --- a/internal/httpclient/models/login_flow.go +++ b/internal/httpclient/models/login_flow.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -39,7 +37,7 @@ type LoginFlow struct { // id // Required: true // Format: uuid4 - ID *UUID `json:"id"` + ID UUID `json:"id"` // IssuedAt is the time (UTC) when the flow started. // Required: true @@ -108,6 +106,7 @@ func (m *LoginFlow) Validate(formats strfmt.Registry) error { } func (m *LoginFlow) validateActive(formats strfmt.Registry) error { + if swag.IsZero(m.Active) { // not required return nil } @@ -137,21 +136,11 @@ func (m *LoginFlow) validateExpiresAt(formats strfmt.Registry) error { func (m *LoginFlow) validateID(formats strfmt.Registry) error { - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if m.ID != nil { - if err := m.ID.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("id") - } - return err + if err := m.ID.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("id") } + return err } return nil @@ -171,6 +160,7 @@ func (m *LoginFlow) validateIssuedAt(formats strfmt.Registry) error { } func (m *LoginFlow) validateMessages(formats strfmt.Registry) error { + if swag.IsZero(m.Messages) { // not required return nil } @@ -187,10 +177,6 @@ func (m *LoginFlow) validateMessages(formats strfmt.Registry) error { func (m *LoginFlow) validateMethods(formats strfmt.Registry) error { - if err := validate.Required("methods", "body", m.Methods); err != nil { - return err - } - for k := range m.Methods { if err := validate.Required("methods"+"."+k, "body", m.Methods[k]); err != nil { @@ -217,6 +203,7 @@ func (m *LoginFlow) validateRequestURL(formats strfmt.Registry) error { } func (m *LoginFlow) validateType(formats strfmt.Registry) error { + if swag.IsZero(m.Type) { // not required return nil } @@ -231,105 +218,6 @@ func (m *LoginFlow) validateType(formats strfmt.Registry) error { return nil } -// ContextValidate validate this login flow based on the context it is used -func (m *LoginFlow) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateActive(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMessages(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMethods(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *LoginFlow) contextValidateActive(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Active.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("active") - } - return err - } - - return nil -} - -func (m *LoginFlow) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if m.ID != nil { - if err := m.ID.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("id") - } - return err - } - } - - return nil -} - -func (m *LoginFlow) contextValidateMessages(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Messages.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("messages") - } - return err - } - - return nil -} - -func (m *LoginFlow) contextValidateMethods(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.Required("methods", "body", m.Methods); err != nil { - return err - } - - for k := range m.Methods { - - if val, ok := m.Methods[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - return nil -} - -func (m *LoginFlow) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - - return nil -} - // MarshalBinary interface implementation func (m *LoginFlow) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/login_flow_method.go b/internal/httpclient/models/login_flow_method.go index 6e38e1a216d..12ba70f33d6 100644 --- a/internal/httpclient/models/login_flow_method.go +++ b/internal/httpclient/models/login_flow_method.go @@ -6,15 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) -// LoginFlowMethod login flow method +// LoginFlowMethod LoginFlowMethod login flow method // // swagger:model loginFlowMethod type LoginFlowMethod struct { @@ -25,7 +23,7 @@ type LoginFlowMethod struct { // method // Required: true - Method *CredentialsType `json:"method"` + Method CredentialsType `json:"method"` } // Validate validates this login flow method @@ -66,67 +64,11 @@ func (m *LoginFlowMethod) validateConfig(formats strfmt.Registry) error { func (m *LoginFlowMethod) validateMethod(formats strfmt.Registry) error { - if err := validate.Required("method", "body", m.Method); err != nil { - return err - } - - if err := validate.Required("method", "body", m.Method); err != nil { - return err - } - - if m.Method != nil { - if err := m.Method.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("method") - } - return err - } - } - - return nil -} - -// ContextValidate validate this login flow method based on the context it is used -func (m *LoginFlowMethod) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMethod(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *LoginFlowMethod) contextValidateConfig(ctx context.Context, formats strfmt.Registry) error { - - if m.Config != nil { - if err := m.Config.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("config") - } - return err - } - } - - return nil -} - -func (m *LoginFlowMethod) contextValidateMethod(ctx context.Context, formats strfmt.Registry) error { - - if m.Method != nil { - if err := m.Method.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("method") - } - return err + if err := m.Method.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("method") } + return err } return nil diff --git a/internal/httpclient/models/login_flow_method_config.go b/internal/httpclient/models/login_flow_method_config.go index 2f1378f5399..0968f14b8ba 100644 --- a/internal/httpclient/models/login_flow_method_config.go +++ b/internal/httpclient/models/login_flow_method_config.go @@ -6,7 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" "strconv" "github.com/go-openapi/errors" @@ -15,7 +14,7 @@ import ( "github.com/go-openapi/validate" ) -// LoginFlowMethodConfig LoginFlowMethodConfig LoginFlowMethodConfig login flow method config +// LoginFlowMethodConfig login flow method config // // swagger:model loginFlowMethodConfig type LoginFlowMethodConfig struct { @@ -95,6 +94,7 @@ func (m *LoginFlowMethodConfig) validateFields(formats strfmt.Registry) error { } func (m *LoginFlowMethodConfig) validateMessages(formats strfmt.Registry) error { + if swag.IsZero(m.Messages) { // not required return nil } @@ -119,6 +119,7 @@ func (m *LoginFlowMethodConfig) validateMethod(formats strfmt.Registry) error { } func (m *LoginFlowMethodConfig) validateProviders(formats strfmt.Registry) error { + if swag.IsZero(m.Providers) { // not required return nil } @@ -142,70 +143,6 @@ func (m *LoginFlowMethodConfig) validateProviders(formats strfmt.Registry) error return nil } -// ContextValidate validate this login flow method config based on the context it is used -func (m *LoginFlowMethodConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateFields(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMessages(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateProviders(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *LoginFlowMethodConfig) contextValidateFields(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Fields.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("fields") - } - return err - } - - return nil -} - -func (m *LoginFlowMethodConfig) contextValidateMessages(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Messages.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("messages") - } - return err - } - - return nil -} - -func (m *LoginFlowMethodConfig) contextValidateProviders(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Providers); i++ { - - if m.Providers[i] != nil { - if err := m.Providers[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("providers" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - // MarshalBinary interface implementation func (m *LoginFlowMethodConfig) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/login_via_api_response.go b/internal/httpclient/models/login_via_api_response.go index 47fee711829..b199f814057 100644 --- a/internal/httpclient/models/login_via_api_response.go +++ b/internal/httpclient/models/login_via_api_response.go @@ -6,15 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) -// LoginViaAPIResponse The Response for Login Flows via API +// LoginViaAPIResponse LoginViaAPIResponse LoginViaAPIResponse The Response for Login Flows via API // // swagger:model loginViaApiResponse type LoginViaAPIResponse struct { @@ -80,34 +78,6 @@ func (m *LoginViaAPIResponse) validateSessionToken(formats strfmt.Registry) erro return nil } -// ContextValidate validate this login via Api response based on the context it is used -func (m *LoginViaAPIResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateSession(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *LoginViaAPIResponse) contextValidateSession(ctx context.Context, formats strfmt.Registry) error { - - if m.Session != nil { - if err := m.Session.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("session") - } - return err - } - } - - return nil -} - // MarshalBinary interface implementation func (m *LoginViaAPIResponse) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/message.go b/internal/httpclient/models/message.go index 9b1595de35b..b6eed8bd3fd 100644 --- a/internal/httpclient/models/message.go +++ b/internal/httpclient/models/message.go @@ -6,14 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) -// Message Message Message Message Message Message Message Message Message Message Message message +// Message Message Message Message Message Message Message Message Message Message Message Message Message message // // swagger:model Message type Message struct { @@ -50,6 +48,7 @@ func (m *Message) Validate(formats strfmt.Registry) error { } func (m *Message) validateID(formats strfmt.Registry) error { + if swag.IsZero(m.ID) { // not required return nil } @@ -65,6 +64,7 @@ func (m *Message) validateID(formats strfmt.Registry) error { } func (m *Message) validateType(formats strfmt.Registry) error { + if swag.IsZero(m.Type) { // not required return nil } @@ -79,48 +79,6 @@ func (m *Message) validateType(formats strfmt.Registry) error { return nil } -// ContextValidate validate this message based on the context it is used -func (m *Message) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Message) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ID.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("id") - } - return err - } - - return nil -} - -func (m *Message) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - - return nil -} - // MarshalBinary interface implementation func (m *Message) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/messages.go b/internal/httpclient/models/messages.go index 9896642f8e4..80f03b369d2 100644 --- a/internal/httpclient/models/messages.go +++ b/internal/httpclient/models/messages.go @@ -6,7 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" "strconv" "github.com/go-openapi/errors" @@ -14,7 +13,7 @@ import ( "github.com/go-openapi/swag" ) -// Messages Messages Messages Messages Messages Messages Messages Messages Messages Messages Messages messages +// Messages Messages Messages Messages Messages Messages Messages Messages Messages Messages Messages Messages Messages messages // // swagger:model Messages type Messages []*Message @@ -44,26 +43,3 @@ func (m Messages) Validate(formats strfmt.Registry) error { } return nil } - -// ContextValidate validate this messages based on the context it is used -func (m Messages) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/internal/httpclient/models/null_time.go b/internal/httpclient/models/null_time.go index 1e146a0e9ac..8997a9ec6b8 100644 --- a/internal/httpclient/models/null_time.go +++ b/internal/httpclient/models/null_time.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -43,11 +41,6 @@ func (m NullTime) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validates this null time based on context it is used -func (m NullTime) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *NullTime) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/recovery_address.go b/internal/httpclient/models/recovery_address.go index da1b879e581..70e347add5b 100644 --- a/internal/httpclient/models/recovery_address.go +++ b/internal/httpclient/models/recovery_address.go @@ -6,15 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) -// RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress recovery address +// RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress RecoveryAddress recovery address // // swagger:model RecoveryAddress type RecoveryAddress struct { @@ -22,7 +20,7 @@ type RecoveryAddress struct { // id // Required: true // Format: uuid4 - ID *UUID `json:"id"` + ID UUID `json:"id"` // value // Required: true @@ -30,7 +28,7 @@ type RecoveryAddress struct { // via // Required: true - Via *RecoveryAddressType `json:"via"` + Via RecoveryAddressType `json:"via"` } // Validate validates this recovery address @@ -57,21 +55,11 @@ func (m *RecoveryAddress) Validate(formats strfmt.Registry) error { func (m *RecoveryAddress) validateID(formats strfmt.Registry) error { - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if m.ID != nil { - if err := m.ID.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("id") - } - return err + if err := m.ID.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("id") } + return err } return nil @@ -88,67 +76,11 @@ func (m *RecoveryAddress) validateValue(formats strfmt.Registry) error { func (m *RecoveryAddress) validateVia(formats strfmt.Registry) error { - if err := validate.Required("via", "body", m.Via); err != nil { - return err - } - - if err := validate.Required("via", "body", m.Via); err != nil { - return err - } - - if m.Via != nil { - if err := m.Via.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("via") - } - return err - } - } - - return nil -} - -// ContextValidate validate this recovery address based on the context it is used -func (m *RecoveryAddress) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVia(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RecoveryAddress) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if m.ID != nil { - if err := m.ID.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("id") - } - return err - } - } - - return nil -} - -func (m *RecoveryAddress) contextValidateVia(ctx context.Context, formats strfmt.Registry) error { - - if m.Via != nil { - if err := m.Via.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("via") - } - return err + if err := m.Via.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("via") } + return err } return nil diff --git a/internal/httpclient/models/recovery_address_type.go b/internal/httpclient/models/recovery_address_type.go index 737ad382da6..3146c419274 100644 --- a/internal/httpclient/models/recovery_address_type.go +++ b/internal/httpclient/models/recovery_address_type.go @@ -6,12 +6,10 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" ) -// RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType recovery address type +// RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType RecoveryAddressType recovery address type // // swagger:model RecoveryAddressType type RecoveryAddressType string @@ -20,8 +18,3 @@ type RecoveryAddressType string func (m RecoveryAddressType) Validate(formats strfmt.Registry) error { return nil } - -// ContextValidate validates this recovery address type based on context it is used -func (m RecoveryAddressType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/internal/httpclient/models/recovery_flow.go b/internal/httpclient/models/recovery_flow.go index 6cee1d0409d..7322e8abe4f 100644 --- a/internal/httpclient/models/recovery_flow.go +++ b/internal/httpclient/models/recovery_flow.go @@ -6,15 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) -// RecoveryFlow A Recovery Flow +// RecoveryFlow RecoveryFlow A Recovery Flow // // This request is used when an identity wants to recover their account. // @@ -36,7 +34,7 @@ type RecoveryFlow struct { // id // Required: true // Format: uuid4 - ID *UUID `json:"id"` + ID UUID `json:"id"` // IssuedAt is the time (UTC) when the request occurred. // Required: true @@ -58,7 +56,7 @@ type RecoveryFlow struct { // state // Required: true - State *State `json:"state"` + State State `json:"state"` // type Type Type `json:"type,omitempty"` @@ -121,21 +119,11 @@ func (m *RecoveryFlow) validateExpiresAt(formats strfmt.Registry) error { func (m *RecoveryFlow) validateID(formats strfmt.Registry) error { - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if m.ID != nil { - if err := m.ID.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("id") - } - return err + if err := m.ID.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("id") } + return err } return nil @@ -155,6 +143,7 @@ func (m *RecoveryFlow) validateIssuedAt(formats strfmt.Registry) error { } func (m *RecoveryFlow) validateMessages(formats strfmt.Registry) error { + if swag.IsZero(m.Messages) { // not required return nil } @@ -171,10 +160,6 @@ func (m *RecoveryFlow) validateMessages(formats strfmt.Registry) error { func (m *RecoveryFlow) validateMethods(formats strfmt.Registry) error { - if err := validate.Required("methods", "body", m.Methods); err != nil { - return err - } - for k := range m.Methods { if err := validate.Required("methods"+"."+k, "body", m.Methods[k]); err != nil { @@ -202,27 +187,18 @@ func (m *RecoveryFlow) validateRequestURL(formats strfmt.Registry) error { func (m *RecoveryFlow) validateState(formats strfmt.Registry) error { - if err := validate.Required("state", "body", m.State); err != nil { - return err - } - - if err := validate.Required("state", "body", m.State); err != nil { - return err - } - - if m.State != nil { - if err := m.State.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("state") - } - return err + if err := m.State.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("state") } + return err } return nil } func (m *RecoveryFlow) validateType(formats strfmt.Registry) error { + if swag.IsZero(m.Type) { // not required return nil } @@ -237,107 +213,6 @@ func (m *RecoveryFlow) validateType(formats strfmt.Registry) error { return nil } -// ContextValidate validate this recovery flow based on the context it is used -func (m *RecoveryFlow) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMessages(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMethods(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateState(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RecoveryFlow) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if m.ID != nil { - if err := m.ID.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("id") - } - return err - } - } - - return nil -} - -func (m *RecoveryFlow) contextValidateMessages(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Messages.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("messages") - } - return err - } - - return nil -} - -func (m *RecoveryFlow) contextValidateMethods(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.Required("methods", "body", m.Methods); err != nil { - return err - } - - for k := range m.Methods { - - if val, ok := m.Methods[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - return nil -} - -func (m *RecoveryFlow) contextValidateState(ctx context.Context, formats strfmt.Registry) error { - - if m.State != nil { - if err := m.State.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("state") - } - return err - } - } - - return nil -} - -func (m *RecoveryFlow) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - - return nil -} - // MarshalBinary interface implementation func (m *RecoveryFlow) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/recovery_flow_method.go b/internal/httpclient/models/recovery_flow_method.go index 15fa7184def..e93df2082b0 100644 --- a/internal/httpclient/models/recovery_flow_method.go +++ b/internal/httpclient/models/recovery_flow_method.go @@ -6,15 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) -// RecoveryFlowMethod RecoveryFlowMethod recovery flow method +// RecoveryFlowMethod recovery flow method // // swagger:model recoveryFlowMethod type RecoveryFlowMethod struct { @@ -73,34 +71,6 @@ func (m *RecoveryFlowMethod) validateMethod(formats strfmt.Registry) error { return nil } -// ContextValidate validate this recovery flow method based on the context it is used -func (m *RecoveryFlowMethod) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RecoveryFlowMethod) contextValidateConfig(ctx context.Context, formats strfmt.Registry) error { - - if m.Config != nil { - if err := m.Config.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("config") - } - return err - } - } - - return nil -} - // MarshalBinary interface implementation func (m *RecoveryFlowMethod) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/recovery_flow_method_config.go b/internal/httpclient/models/recovery_flow_method_config.go index a12f2cd7f98..516e4f8d7f3 100644 --- a/internal/httpclient/models/recovery_flow_method_config.go +++ b/internal/httpclient/models/recovery_flow_method_config.go @@ -6,15 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) -// RecoveryFlowMethodConfig recovery flow method config +// RecoveryFlowMethodConfig RecoveryFlowMethodConfig RecoveryFlowMethodConfig recovery flow method config // // swagger:model recoveryFlowMethodConfig type RecoveryFlowMethodConfig struct { @@ -87,6 +85,7 @@ func (m *RecoveryFlowMethodConfig) validateFields(formats strfmt.Registry) error } func (m *RecoveryFlowMethodConfig) validateMessages(formats strfmt.Registry) error { + if swag.IsZero(m.Messages) { // not required return nil } @@ -110,48 +109,6 @@ func (m *RecoveryFlowMethodConfig) validateMethod(formats strfmt.Registry) error return nil } -// ContextValidate validate this recovery flow method config based on the context it is used -func (m *RecoveryFlowMethodConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateFields(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMessages(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RecoveryFlowMethodConfig) contextValidateFields(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Fields.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("fields") - } - return err - } - - return nil -} - -func (m *RecoveryFlowMethodConfig) contextValidateMessages(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Messages.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("messages") - } - return err - } - - return nil -} - // MarshalBinary interface implementation func (m *RecoveryFlowMethodConfig) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/recovery_link.go b/internal/httpclient/models/recovery_link.go index f8e20f95134..0a3bcaf536b 100644 --- a/internal/httpclient/models/recovery_link.go +++ b/internal/httpclient/models/recovery_link.go @@ -6,15 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) -// RecoveryLink RecoveryLink recovery link +// RecoveryLink RecoveryLink RecoveryLink RecoveryLink recovery link // // swagger:model recoveryLink type RecoveryLink struct { @@ -24,6 +22,8 @@ type RecoveryLink struct { // The timestamp when the recovery link expires. // Format: date-time // Format: date-time + // Format: date-time + // Format: date-time ExpiresAt strfmt.DateTime `json:"expires_at,omitempty"` // Recovery Link @@ -52,6 +52,7 @@ func (m *RecoveryLink) Validate(formats strfmt.Registry) error { } func (m *RecoveryLink) validateExpiresAt(formats strfmt.Registry) error { + if swag.IsZero(m.ExpiresAt) { // not required return nil } @@ -72,11 +73,6 @@ func (m *RecoveryLink) validateRecoveryLink(formats strfmt.Registry) error { return nil } -// ContextValidate validates this recovery link based on context it is used -func (m *RecoveryLink) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *RecoveryLink) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/registration_flow.go b/internal/httpclient/models/registration_flow.go index 4fcc935af4d..a88dc613a3b 100644 --- a/internal/httpclient/models/registration_flow.go +++ b/internal/httpclient/models/registration_flow.go @@ -6,15 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) -// RegistrationFlow RegistrationFlow RegistrationFlow RegistrationFlow registration flow +// RegistrationFlow RegistrationFlow registration flow // // swagger:model registrationFlow type RegistrationFlow struct { @@ -31,7 +29,7 @@ type RegistrationFlow struct { // id // Required: true // Format: uuid4 - ID *UUID `json:"id"` + ID UUID `json:"id"` // IssuedAt is the time (UTC) when the flow occurred. // Required: true @@ -98,6 +96,7 @@ func (m *RegistrationFlow) Validate(formats strfmt.Registry) error { } func (m *RegistrationFlow) validateActive(formats strfmt.Registry) error { + if swag.IsZero(m.Active) { // not required return nil } @@ -127,21 +126,11 @@ func (m *RegistrationFlow) validateExpiresAt(formats strfmt.Registry) error { func (m *RegistrationFlow) validateID(formats strfmt.Registry) error { - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if m.ID != nil { - if err := m.ID.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("id") - } - return err + if err := m.ID.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("id") } + return err } return nil @@ -161,6 +150,7 @@ func (m *RegistrationFlow) validateIssuedAt(formats strfmt.Registry) error { } func (m *RegistrationFlow) validateMessages(formats strfmt.Registry) error { + if swag.IsZero(m.Messages) { // not required return nil } @@ -177,10 +167,6 @@ func (m *RegistrationFlow) validateMessages(formats strfmt.Registry) error { func (m *RegistrationFlow) validateMethods(formats strfmt.Registry) error { - if err := validate.Required("methods", "body", m.Methods); err != nil { - return err - } - for k := range m.Methods { if err := validate.Required("methods"+"."+k, "body", m.Methods[k]); err != nil { @@ -207,6 +193,7 @@ func (m *RegistrationFlow) validateRequestURL(formats strfmt.Registry) error { } func (m *RegistrationFlow) validateType(formats strfmt.Registry) error { + if swag.IsZero(m.Type) { // not required return nil } @@ -221,105 +208,6 @@ func (m *RegistrationFlow) validateType(formats strfmt.Registry) error { return nil } -// ContextValidate validate this registration flow based on the context it is used -func (m *RegistrationFlow) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateActive(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMessages(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMethods(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RegistrationFlow) contextValidateActive(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Active.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("active") - } - return err - } - - return nil -} - -func (m *RegistrationFlow) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if m.ID != nil { - if err := m.ID.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("id") - } - return err - } - } - - return nil -} - -func (m *RegistrationFlow) contextValidateMessages(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Messages.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("messages") - } - return err - } - - return nil -} - -func (m *RegistrationFlow) contextValidateMethods(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.Required("methods", "body", m.Methods); err != nil { - return err - } - - for k := range m.Methods { - - if val, ok := m.Methods[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - return nil -} - -func (m *RegistrationFlow) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - - return nil -} - // MarshalBinary interface implementation func (m *RegistrationFlow) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/registration_flow_method.go b/internal/httpclient/models/registration_flow_method.go index 79164c87fd9..99f50031de5 100644 --- a/internal/httpclient/models/registration_flow_method.go +++ b/internal/httpclient/models/registration_flow_method.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -25,7 +23,7 @@ type RegistrationFlowMethod struct { // method // Required: true - Method *CredentialsType `json:"method"` + Method CredentialsType `json:"method"` } // Validate validates this registration flow method @@ -66,67 +64,11 @@ func (m *RegistrationFlowMethod) validateConfig(formats strfmt.Registry) error { func (m *RegistrationFlowMethod) validateMethod(formats strfmt.Registry) error { - if err := validate.Required("method", "body", m.Method); err != nil { - return err - } - - if err := validate.Required("method", "body", m.Method); err != nil { - return err - } - - if m.Method != nil { - if err := m.Method.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("method") - } - return err - } - } - - return nil -} - -// ContextValidate validate this registration flow method based on the context it is used -func (m *RegistrationFlowMethod) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMethod(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RegistrationFlowMethod) contextValidateConfig(ctx context.Context, formats strfmt.Registry) error { - - if m.Config != nil { - if err := m.Config.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("config") - } - return err - } - } - - return nil -} - -func (m *RegistrationFlowMethod) contextValidateMethod(ctx context.Context, formats strfmt.Registry) error { - - if m.Method != nil { - if err := m.Method.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("method") - } - return err + if err := m.Method.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("method") } + return err } return nil diff --git a/internal/httpclient/models/registration_flow_method_config.go b/internal/httpclient/models/registration_flow_method_config.go index 2f40bd065b4..ad59c703f1d 100644 --- a/internal/httpclient/models/registration_flow_method_config.go +++ b/internal/httpclient/models/registration_flow_method_config.go @@ -6,7 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" "strconv" "github.com/go-openapi/errors" @@ -15,7 +14,7 @@ import ( "github.com/go-openapi/validate" ) -// RegistrationFlowMethodConfig RegistrationFlowMethodConfig registration flow method config +// RegistrationFlowMethodConfig registration flow method config // // swagger:model registrationFlowMethodConfig type RegistrationFlowMethodConfig struct { @@ -95,6 +94,7 @@ func (m *RegistrationFlowMethodConfig) validateFields(formats strfmt.Registry) e } func (m *RegistrationFlowMethodConfig) validateMessages(formats strfmt.Registry) error { + if swag.IsZero(m.Messages) { // not required return nil } @@ -119,6 +119,7 @@ func (m *RegistrationFlowMethodConfig) validateMethod(formats strfmt.Registry) e } func (m *RegistrationFlowMethodConfig) validateProviders(formats strfmt.Registry) error { + if swag.IsZero(m.Providers) { // not required return nil } @@ -142,70 +143,6 @@ func (m *RegistrationFlowMethodConfig) validateProviders(formats strfmt.Registry return nil } -// ContextValidate validate this registration flow method config based on the context it is used -func (m *RegistrationFlowMethodConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateFields(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMessages(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateProviders(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RegistrationFlowMethodConfig) contextValidateFields(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Fields.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("fields") - } - return err - } - - return nil -} - -func (m *RegistrationFlowMethodConfig) contextValidateMessages(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Messages.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("messages") - } - return err - } - - return nil -} - -func (m *RegistrationFlowMethodConfig) contextValidateProviders(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Providers); i++ { - - if m.Providers[i] != nil { - if err := m.Providers[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("providers" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - // MarshalBinary interface implementation func (m *RegistrationFlowMethodConfig) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/registration_via_api_response.go b/internal/httpclient/models/registration_via_api_response.go index 85415d09a72..5fcaed85f7a 100644 --- a/internal/httpclient/models/registration_via_api_response.go +++ b/internal/httpclient/models/registration_via_api_response.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -81,6 +79,7 @@ func (m *RegistrationViaAPIResponse) validateIdentity(formats strfmt.Registry) e } func (m *RegistrationViaAPIResponse) validateSession(formats strfmt.Registry) error { + if swag.IsZero(m.Session) { // not required return nil } @@ -106,52 +105,6 @@ func (m *RegistrationViaAPIResponse) validateSessionToken(formats strfmt.Registr return nil } -// ContextValidate validate this registration via Api response based on the context it is used -func (m *RegistrationViaAPIResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateIdentity(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSession(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RegistrationViaAPIResponse) contextValidateIdentity(ctx context.Context, formats strfmt.Registry) error { - - if m.Identity != nil { - if err := m.Identity.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identity") - } - return err - } - } - - return nil -} - -func (m *RegistrationViaAPIResponse) contextValidateSession(ctx context.Context, formats strfmt.Registry) error { - - if m.Session != nil { - if err := m.Session.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("session") - } - return err - } - } - - return nil -} - // MarshalBinary interface implementation func (m *RegistrationViaAPIResponse) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/revoke_session.go b/internal/httpclient/models/revoke_session.go index c88f1f91244..eb7b059af8c 100644 --- a/internal/httpclient/models/revoke_session.go +++ b/internal/httpclient/models/revoke_session.go @@ -6,15 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) -// RevokeSession RevokeSession RevokeSession RevokeSession RevokeSession RevokeSession RevokeSession RevokeSession RevokeSession RevokeSession RevokeSession revoke session +// RevokeSession RevokeSession RevokeSession RevokeSession RevokeSession RevokeSession RevokeSession RevokeSession RevokeSession RevokeSession RevokeSession RevokeSession RevokeSession revoke session // // swagger:model revokeSession type RevokeSession struct { @@ -49,11 +47,6 @@ func (m *RevokeSession) validateSessionToken(formats strfmt.Registry) error { return nil } -// ContextValidate validates this revoke session based on context it is used -func (m *RevokeSession) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *RevokeSession) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/session.go b/internal/httpclient/models/session.go index 2054749b9b1..bd2ad4c502e 100644 --- a/internal/httpclient/models/session.go +++ b/internal/httpclient/models/session.go @@ -6,15 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) -// Session session +// Session Session session // // swagger:model session type Session struct { @@ -35,7 +33,7 @@ type Session struct { // id // Required: true // Format: uuid4 - ID *UUID `json:"id"` + ID UUID `json:"id"` // identity // Required: true @@ -105,21 +103,11 @@ func (m *Session) validateExpiresAt(formats strfmt.Registry) error { func (m *Session) validateID(formats strfmt.Registry) error { - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if m.ID != nil { - if err := m.ID.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("id") - } - return err + if err := m.ID.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("id") } + return err } return nil @@ -156,52 +144,6 @@ func (m *Session) validateIssuedAt(formats strfmt.Registry) error { return nil } -// ContextValidate validate this session based on the context it is used -func (m *Session) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateIdentity(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Session) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if m.ID != nil { - if err := m.ID.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("id") - } - return err - } - } - - return nil -} - -func (m *Session) contextValidateIdentity(ctx context.Context, formats strfmt.Registry) error { - - if m.Identity != nil { - if err := m.Identity.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identity") - } - return err - } - } - - return nil -} - // MarshalBinary interface implementation func (m *Session) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/settings_flow.go b/internal/httpclient/models/settings_flow.go index 814a66d99fd..521dfb9bffe 100644 --- a/internal/httpclient/models/settings_flow.go +++ b/internal/httpclient/models/settings_flow.go @@ -6,15 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) -// SettingsFlow SettingsFlow Flow represents a Settings Flow +// SettingsFlow Flow represents a Settings Flow // // This flow is used when an identity wants to update settings // (e.g. profile data, passwords, ...) in a selfservice manner. @@ -37,7 +35,7 @@ type SettingsFlow struct { // id // Required: true // Format: uuid4 - ID *UUID `json:"id"` + ID UUID `json:"id"` // identity // Required: true @@ -63,7 +61,7 @@ type SettingsFlow struct { // state // Required: true - State *State `json:"state"` + State State `json:"state"` // type Type Type `json:"type,omitempty"` @@ -130,21 +128,11 @@ func (m *SettingsFlow) validateExpiresAt(formats strfmt.Registry) error { func (m *SettingsFlow) validateID(formats strfmt.Registry) error { - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if m.ID != nil { - if err := m.ID.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("id") - } - return err + if err := m.ID.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("id") } + return err } return nil @@ -182,6 +170,7 @@ func (m *SettingsFlow) validateIssuedAt(formats strfmt.Registry) error { } func (m *SettingsFlow) validateMessages(formats strfmt.Registry) error { + if swag.IsZero(m.Messages) { // not required return nil } @@ -198,10 +187,6 @@ func (m *SettingsFlow) validateMessages(formats strfmt.Registry) error { func (m *SettingsFlow) validateMethods(formats strfmt.Registry) error { - if err := validate.Required("methods", "body", m.Methods); err != nil { - return err - } - for k := range m.Methods { if err := validate.Required("methods"+"."+k, "body", m.Methods[k]); err != nil { @@ -229,27 +214,18 @@ func (m *SettingsFlow) validateRequestURL(formats strfmt.Registry) error { func (m *SettingsFlow) validateState(formats strfmt.Registry) error { - if err := validate.Required("state", "body", m.State); err != nil { - return err - } - - if err := validate.Required("state", "body", m.State); err != nil { - return err - } - - if m.State != nil { - if err := m.State.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("state") - } - return err + if err := m.State.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("state") } + return err } return nil } func (m *SettingsFlow) validateType(formats strfmt.Registry) error { + if swag.IsZero(m.Type) { // not required return nil } @@ -264,125 +240,6 @@ func (m *SettingsFlow) validateType(formats strfmt.Registry) error { return nil } -// ContextValidate validate this settings flow based on the context it is used -func (m *SettingsFlow) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateIdentity(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMessages(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMethods(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateState(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SettingsFlow) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if m.ID != nil { - if err := m.ID.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("id") - } - return err - } - } - - return nil -} - -func (m *SettingsFlow) contextValidateIdentity(ctx context.Context, formats strfmt.Registry) error { - - if m.Identity != nil { - if err := m.Identity.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identity") - } - return err - } - } - - return nil -} - -func (m *SettingsFlow) contextValidateMessages(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Messages.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("messages") - } - return err - } - - return nil -} - -func (m *SettingsFlow) contextValidateMethods(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.Required("methods", "body", m.Methods); err != nil { - return err - } - - for k := range m.Methods { - - if val, ok := m.Methods[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - return nil -} - -func (m *SettingsFlow) contextValidateState(ctx context.Context, formats strfmt.Registry) error { - - if m.State != nil { - if err := m.State.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("state") - } - return err - } - } - - return nil -} - -func (m *SettingsFlow) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - - return nil -} - // MarshalBinary interface implementation func (m *SettingsFlow) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/settings_flow_method.go b/internal/httpclient/models/settings_flow_method.go index 84292bd103a..7dd55a29dde 100644 --- a/internal/httpclient/models/settings_flow_method.go +++ b/internal/httpclient/models/settings_flow_method.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -73,34 +71,6 @@ func (m *SettingsFlowMethod) validateMethod(formats strfmt.Registry) error { return nil } -// ContextValidate validate this settings flow method based on the context it is used -func (m *SettingsFlowMethod) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SettingsFlowMethod) contextValidateConfig(ctx context.Context, formats strfmt.Registry) error { - - if m.Config != nil { - if err := m.Config.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("config") - } - return err - } - } - - return nil -} - // MarshalBinary interface implementation func (m *SettingsFlowMethod) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/settings_flow_method_config.go b/internal/httpclient/models/settings_flow_method_config.go index 56300083081..c9b45f818b7 100644 --- a/internal/httpclient/models/settings_flow_method_config.go +++ b/internal/httpclient/models/settings_flow_method_config.go @@ -6,15 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) -// SettingsFlowMethodConfig SettingsFlowMethodConfig settings flow method config +// SettingsFlowMethodConfig settings flow method config // // swagger:model settingsFlowMethodConfig type SettingsFlowMethodConfig struct { @@ -87,6 +85,7 @@ func (m *SettingsFlowMethodConfig) validateFields(formats strfmt.Registry) error } func (m *SettingsFlowMethodConfig) validateMessages(formats strfmt.Registry) error { + if swag.IsZero(m.Messages) { // not required return nil } @@ -110,48 +109,6 @@ func (m *SettingsFlowMethodConfig) validateMethod(formats strfmt.Registry) error return nil } -// ContextValidate validate this settings flow method config based on the context it is used -func (m *SettingsFlowMethodConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateFields(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMessages(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SettingsFlowMethodConfig) contextValidateFields(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Fields.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("fields") - } - return err - } - - return nil -} - -func (m *SettingsFlowMethodConfig) contextValidateMessages(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Messages.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("messages") - } - return err - } - - return nil -} - // MarshalBinary interface implementation func (m *SettingsFlowMethodConfig) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/settings_via_api_response.go b/internal/httpclient/models/settings_via_api_response.go index 4bd2ecb0ce4..67f3f9517aa 100644 --- a/internal/httpclient/models/settings_via_api_response.go +++ b/internal/httpclient/models/settings_via_api_response.go @@ -6,15 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) -// SettingsViaAPIResponse SettingsViaAPIResponse SettingsViaAPIResponse The Response for Settings Flows via API +// SettingsViaAPIResponse The Response for Settings Flows via API // // swagger:model settingsViaApiResponse type SettingsViaAPIResponse struct { @@ -82,52 +80,6 @@ func (m *SettingsViaAPIResponse) validateIdentity(formats strfmt.Registry) error return nil } -// ContextValidate validate this settings via Api response based on the context it is used -func (m *SettingsViaAPIResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateFlow(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateIdentity(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SettingsViaAPIResponse) contextValidateFlow(ctx context.Context, formats strfmt.Registry) error { - - if m.Flow != nil { - if err := m.Flow.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("flow") - } - return err - } - } - - return nil -} - -func (m *SettingsViaAPIResponse) contextValidateIdentity(ctx context.Context, formats strfmt.Registry) error { - - if m.Identity != nil { - if err := m.Identity.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identity") - } - return err - } - } - - return nil -} - // MarshalBinary interface implementation func (m *SettingsViaAPIResponse) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/state.go b/internal/httpclient/models/state.go index b12eafe6945..fd26dbb3866 100644 --- a/internal/httpclient/models/state.go +++ b/internal/httpclient/models/state.go @@ -6,12 +6,10 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" ) -// State State State State State State State State State State State state +// State State State State State State State State State State State State State state // // swagger:model State type State string @@ -20,8 +18,3 @@ type State string func (m State) Validate(formats strfmt.Registry) error { return nil } - -// ContextValidate validates this state based on context it is used -func (m State) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/internal/httpclient/models/traits.go b/internal/httpclient/models/traits.go index a251ecda5b8..ba0a14ca743 100644 --- a/internal/httpclient/models/traits.go +++ b/internal/httpclient/models/traits.go @@ -5,7 +5,7 @@ package models // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command -// Traits Traits Traits Traits Traits Traits Traits Traits Traits Traits Traits traits +// Traits Traits Traits Traits Traits Traits Traits Traits Traits Traits Traits Traits Traits traits // // swagger:model Traits type Traits interface{} diff --git a/internal/httpclient/models/type.go b/internal/httpclient/models/type.go index a3bac8c8753..96f4c91de83 100644 --- a/internal/httpclient/models/type.go +++ b/internal/httpclient/models/type.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" ) @@ -22,8 +20,3 @@ type Type string func (m Type) Validate(formats strfmt.Registry) error { return nil } - -// ContextValidate validates this type based on context it is used -func (m Type) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/internal/httpclient/models/update_identity.go b/internal/httpclient/models/update_identity.go index 759efa4dae2..79963e2bbb4 100644 --- a/internal/httpclient/models/update_identity.go +++ b/internal/httpclient/models/update_identity.go @@ -6,14 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) -// UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity update identity +// UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity UpdateIdentity update identity // // swagger:model UpdateIdentity type UpdateIdentity struct { @@ -45,18 +44,13 @@ func (m *UpdateIdentity) Validate(formats strfmt.Registry) error { func (m *UpdateIdentity) validateTraits(formats strfmt.Registry) error { - if m.Traits == nil { - return errors.Required("traits", "body", nil) + if err := validate.Required("traits", "body", m.Traits); err != nil { + return err } return nil } -// ContextValidate validates this update identity based on context it is used -func (m *UpdateIdentity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *UpdateIdentity) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/uuid.go b/internal/httpclient/models/uuid.go index 5ce11709b43..f28209a7a40 100644 --- a/internal/httpclient/models/uuid.go +++ b/internal/httpclient/models/uuid.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/validate" @@ -31,8 +29,3 @@ func (m UUID) Validate(formats strfmt.Registry) error { } return nil } - -// ContextValidate validates this UUID based on context it is used -func (m UUID) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/internal/httpclient/models/verifiable_address.go b/internal/httpclient/models/verifiable_address.go index fc908fec500..56eade9955b 100644 --- a/internal/httpclient/models/verifiable_address.go +++ b/internal/httpclient/models/verifiable_address.go @@ -6,15 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) -// VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress verifiable address +// VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress VerifiableAddress verifiable address // // swagger:model VerifiableAddress type VerifiableAddress struct { @@ -22,11 +20,11 @@ type VerifiableAddress struct { // id // Required: true // Format: uuid4 - ID *UUID `json:"id"` + ID UUID `json:"id"` // status // Required: true - Status *VerifiableAddressStatus `json:"status"` + Status VerifiableAddressStatus `json:"status"` // value // Required: true @@ -42,7 +40,7 @@ type VerifiableAddress struct { // via // Required: true - Via *VerifiableAddressType `json:"via"` + Via VerifiableAddressType `json:"via"` } // Validate validates this verifiable address @@ -81,21 +79,11 @@ func (m *VerifiableAddress) Validate(formats strfmt.Registry) error { func (m *VerifiableAddress) validateID(formats strfmt.Registry) error { - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if m.ID != nil { - if err := m.ID.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("id") - } - return err + if err := m.ID.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("id") } + return err } return nil @@ -103,21 +91,11 @@ func (m *VerifiableAddress) validateID(formats strfmt.Registry) error { func (m *VerifiableAddress) validateStatus(formats strfmt.Registry) error { - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - if m.Status != nil { - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } - return err + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") } + return err } return nil @@ -142,6 +120,7 @@ func (m *VerifiableAddress) validateVerified(formats strfmt.Registry) error { } func (m *VerifiableAddress) validateVerifiedAt(formats strfmt.Registry) error { + if swag.IsZero(m.VerifiedAt) { // not required return nil } @@ -158,85 +137,9 @@ func (m *VerifiableAddress) validateVerifiedAt(formats strfmt.Registry) error { func (m *VerifiableAddress) validateVia(formats strfmt.Registry) error { - if err := validate.Required("via", "body", m.Via); err != nil { - return err - } - - if err := validate.Required("via", "body", m.Via); err != nil { - return err - } - - if m.Via != nil { - if err := m.Via.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("via") - } - return err - } - } - - return nil -} - -// ContextValidate validate this verifiable address based on the context it is used -func (m *VerifiableAddress) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVerifiedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVia(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VerifiableAddress) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if m.ID != nil { - if err := m.ID.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("id") - } - return err - } - } - - return nil -} - -func (m *VerifiableAddress) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if m.Status != nil { - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } - return err - } - } - - return nil -} - -func (m *VerifiableAddress) contextValidateVerifiedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := m.VerifiedAt.ContextValidate(ctx, formats); err != nil { + if err := m.Via.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("verified_at") + return ve.ValidateName("via") } return err } @@ -244,20 +147,6 @@ func (m *VerifiableAddress) contextValidateVerifiedAt(ctx context.Context, forma return nil } -func (m *VerifiableAddress) contextValidateVia(ctx context.Context, formats strfmt.Registry) error { - - if m.Via != nil { - if err := m.Via.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("via") - } - return err - } - } - - return nil -} - // MarshalBinary interface implementation func (m *VerifiableAddress) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/verifiable_address_status.go b/internal/httpclient/models/verifiable_address_status.go index c8449548138..6e635aa52bc 100644 --- a/internal/httpclient/models/verifiable_address_status.go +++ b/internal/httpclient/models/verifiable_address_status.go @@ -6,12 +6,10 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" ) -// VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus verifiable address status +// VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus VerifiableAddressStatus verifiable address status // // swagger:model VerifiableAddressStatus type VerifiableAddressStatus string @@ -20,8 +18,3 @@ type VerifiableAddressStatus string func (m VerifiableAddressStatus) Validate(formats strfmt.Registry) error { return nil } - -// ContextValidate validates this verifiable address status based on context it is used -func (m VerifiableAddressStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/internal/httpclient/models/verifiable_address_type.go b/internal/httpclient/models/verifiable_address_type.go index 518abb78243..c50f11afdea 100644 --- a/internal/httpclient/models/verifiable_address_type.go +++ b/internal/httpclient/models/verifiable_address_type.go @@ -6,12 +6,10 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" ) -// VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType verifiable address type +// VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType VerifiableAddressType verifiable address type // // swagger:model VerifiableAddressType type VerifiableAddressType string @@ -20,8 +18,3 @@ type VerifiableAddressType string func (m VerifiableAddressType) Validate(formats strfmt.Registry) error { return nil } - -// ContextValidate validates this verifiable address type based on context it is used -func (m VerifiableAddressType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/internal/httpclient/models/verification_flow.go b/internal/httpclient/models/verification_flow.go index f04976eb4a3..d98b503fe5d 100644 --- a/internal/httpclient/models/verification_flow.go +++ b/internal/httpclient/models/verification_flow.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -57,7 +55,7 @@ type VerificationFlow struct { // state // Required: true - State *State `json:"state"` + State State `json:"state"` // type Type Type `json:"type,omitempty"` @@ -102,6 +100,7 @@ func (m *VerificationFlow) Validate(formats strfmt.Registry) error { } func (m *VerificationFlow) validateExpiresAt(formats strfmt.Registry) error { + if swag.IsZero(m.ExpiresAt) { // not required return nil } @@ -114,6 +113,7 @@ func (m *VerificationFlow) validateExpiresAt(formats strfmt.Registry) error { } func (m *VerificationFlow) validateID(formats strfmt.Registry) error { + if swag.IsZero(m.ID) { // not required return nil } @@ -129,6 +129,7 @@ func (m *VerificationFlow) validateID(formats strfmt.Registry) error { } func (m *VerificationFlow) validateIssuedAt(formats strfmt.Registry) error { + if swag.IsZero(m.IssuedAt) { // not required return nil } @@ -141,6 +142,7 @@ func (m *VerificationFlow) validateIssuedAt(formats strfmt.Registry) error { } func (m *VerificationFlow) validateMessages(formats strfmt.Registry) error { + if swag.IsZero(m.Messages) { // not required return nil } @@ -157,10 +159,6 @@ func (m *VerificationFlow) validateMessages(formats strfmt.Registry) error { func (m *VerificationFlow) validateMethods(formats strfmt.Registry) error { - if err := validate.Required("methods", "body", m.Methods); err != nil { - return err - } - for k := range m.Methods { if err := validate.Required("methods"+"."+k, "body", m.Methods[k]); err != nil { @@ -179,27 +177,18 @@ func (m *VerificationFlow) validateMethods(formats strfmt.Registry) error { func (m *VerificationFlow) validateState(formats strfmt.Registry) error { - if err := validate.Required("state", "body", m.State); err != nil { - return err - } - - if err := validate.Required("state", "body", m.State); err != nil { - return err - } - - if m.State != nil { - if err := m.State.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("state") - } - return err + if err := m.State.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("state") } + return err } return nil } func (m *VerificationFlow) validateType(formats strfmt.Registry) error { + if swag.IsZero(m.Type) { // not required return nil } @@ -214,105 +203,6 @@ func (m *VerificationFlow) validateType(formats strfmt.Registry) error { return nil } -// ContextValidate validate this verification flow based on the context it is used -func (m *VerificationFlow) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMessages(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMethods(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateState(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VerificationFlow) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ID.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("id") - } - return err - } - - return nil -} - -func (m *VerificationFlow) contextValidateMessages(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Messages.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("messages") - } - return err - } - - return nil -} - -func (m *VerificationFlow) contextValidateMethods(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.Required("methods", "body", m.Methods); err != nil { - return err - } - - for k := range m.Methods { - - if val, ok := m.Methods[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - return nil -} - -func (m *VerificationFlow) contextValidateState(ctx context.Context, formats strfmt.Registry) error { - - if m.State != nil { - if err := m.State.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("state") - } - return err - } - } - - return nil -} - -func (m *VerificationFlow) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } - return err - } - - return nil -} - // MarshalBinary interface implementation func (m *VerificationFlow) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/verification_flow_method.go b/internal/httpclient/models/verification_flow_method.go index c28c3e9f9b7..ae4bf2b2050 100644 --- a/internal/httpclient/models/verification_flow_method.go +++ b/internal/httpclient/models/verification_flow_method.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -73,34 +71,6 @@ func (m *VerificationFlowMethod) validateMethod(formats strfmt.Registry) error { return nil } -// ContextValidate validate this verification flow method based on the context it is used -func (m *VerificationFlowMethod) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VerificationFlowMethod) contextValidateConfig(ctx context.Context, formats strfmt.Registry) error { - - if m.Config != nil { - if err := m.Config.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("config") - } - return err - } - } - - return nil -} - // MarshalBinary interface implementation func (m *VerificationFlowMethod) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/verification_flow_method_config.go b/internal/httpclient/models/verification_flow_method_config.go index 00363f302db..cfad944a473 100644 --- a/internal/httpclient/models/verification_flow_method_config.go +++ b/internal/httpclient/models/verification_flow_method_config.go @@ -6,15 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) -// VerificationFlowMethodConfig verification flow method config +// VerificationFlowMethodConfig VerificationFlowMethodConfig verification flow method config // // swagger:model verificationFlowMethodConfig type VerificationFlowMethodConfig struct { @@ -87,6 +85,7 @@ func (m *VerificationFlowMethodConfig) validateFields(formats strfmt.Registry) e } func (m *VerificationFlowMethodConfig) validateMessages(formats strfmt.Registry) error { + if swag.IsZero(m.Messages) { // not required return nil } @@ -110,48 +109,6 @@ func (m *VerificationFlowMethodConfig) validateMethod(formats strfmt.Registry) e return nil } -// ContextValidate validate this verification flow method config based on the context it is used -func (m *VerificationFlowMethodConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateFields(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMessages(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VerificationFlowMethodConfig) contextValidateFields(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Fields.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("fields") - } - return err - } - - return nil -} - -func (m *VerificationFlowMethodConfig) contextValidateMessages(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Messages.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("messages") - } - return err - } - - return nil -} - // MarshalBinary interface implementation func (m *VerificationFlowMethodConfig) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/version.go b/internal/httpclient/models/version.go index 3f700bb2d9d..5c3daa37852 100644 --- a/internal/httpclient/models/version.go +++ b/internal/httpclient/models/version.go @@ -6,13 +6,11 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) -// Version Version Version Version Version Version version +// Version Version version // // swagger:model version type Version struct { @@ -26,11 +24,6 @@ func (m *Version) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validates this version based on context it is used -func (m *Version) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *Version) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/x/nosurf.go b/x/nosurf.go index dd0510e32c2..c32c3655692 100644 --- a/x/nosurf.go +++ b/x/nosurf.go @@ -110,10 +110,10 @@ func NosurfBaseCookieHandler(reg interface { func NewCSRFHandler( router http.Handler, reg interface { - config.Provider - LoggingProvider - WriterProvider -}) *nosurf.CSRFHandler { + config.Provider + LoggingProvider + WriterProvider + }) *nosurf.CSRFHandler { n := nosurf.New(router) n.SetBaseCookieFunc(NosurfBaseCookieHandler(reg))