diff --git a/client.gen.go b/client.gen.go index 6077bb0..0f40680 100644 --- a/client.gen.go +++ b/client.gen.go @@ -16864,6 +16864,7 @@ func (r UserTOTPSetupResponse) StatusCode() int { type UserTOTPVerifyResponse struct { Body []byte HTTPResponse *http.Response + JSON201 *UserTOTPVerify201Response JSON400 *BadRequest JSON401 *RequiresAuthentication JSON403 *Forbidden @@ -27391,6 +27392,13 @@ func ParseUserTOTPVerifyResponse(rsp *http.Response) (*UserTOTPVerifyResponse, e } switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest UserTOTPVerify201Response + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { diff --git a/models.gen.go b/models.gen.go index ea49bde..b5b4e10 100644 --- a/models.gen.go +++ b/models.gen.go @@ -3019,9 +3019,15 @@ type UserTOTPSetup200Response struct { Url string `json:"url"` } +// UserTOTPVerify201Response defines model for UserTOTPVerify_201_response. +type UserTOTPVerify201Response struct { + // CustomToken Token to exchange for ID token + CustomToken string `json:"custom_token"` +} + // UserTOTPVerifyRequest defines model for UserTOTPVerify_request. type UserTOTPVerifyRequest struct { - Otp string `json:"otp"` + OTP interface{} `json:"otp"` AdditionalProperties map[string]interface{} `json:"-"` } @@ -5672,7 +5678,7 @@ func (a *UserTOTPVerifyRequest) UnmarshalJSON(b []byte) error { } if raw, found := object["otp"]; found { - err = json.Unmarshal(raw, &a.Otp) + err = json.Unmarshal(raw, &a.OTP) if err != nil { return fmt.Errorf("error reading 'otp': %w", err) } @@ -5698,7 +5704,7 @@ func (a UserTOTPVerifyRequest) MarshalJSON() ([]byte, error) { var err error object := make(map[string]json.RawMessage) - object["otp"], err = json.Marshal(a.Otp) + object["otp"], err = json.Marshal(a.OTP) if err != nil { return nil, fmt.Errorf("error marshaling 'otp': %w", err) } diff --git a/spec.json b/spec.json index 932bcfa..5dfb903 100644 --- a/spec.json +++ b/spec.json @@ -3730,6 +3730,34 @@ "204" : { "description" : "Authentication is complete.", "headers" : { + "Access-Control-Expose-Headers" : { + "description" : "Headers exposed to the client", + "explode" : false, + "schema" : { + "type" : "string" + }, + "style" : "simple" + }, + "X-Cq-Mfa-Configured" : { + "description" : "Indicates if MFA is configured for the user", + "explode" : false, + "schema" : { + "enum" : [ "true", "" ], + "example" : "true", + "type" : "string" + }, + "style" : "simple" + }, + "X-Cq-Mfa-Required" : { + "description" : "Indicates if MFA is enforced", + "explode" : false, + "schema" : { + "enum" : [ "true", "" ], + "example" : "true", + "type" : "string" + }, + "style" : "simple" + }, "Set-Cookie" : { "description" : "Session cookie", "explode" : false, @@ -3820,19 +3848,15 @@ } }, "responses" : { - "204" : { - "description" : "Multifactor authentication is complete.", - "headers" : { - "Set-Cookie" : { - "description" : "Session cookie", - "explode" : false, + "201" : { + "content" : { + "application/json" : { "schema" : { - "example" : "__session=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9Cg...; HttpOnly; Secure; SameSite=None; Path=/; Max-Age=3600", - "type" : "string" - }, - "style" : "simple" + "$ref" : "#/components/schemas/UserTOTPVerify_201_response" + } } - } + }, + "description" : "Multifactor authentication is complete." }, "400" : { "$ref" : "#/components/responses/BadRequest" @@ -11271,11 +11295,20 @@ "additionalProperties" : { }, "properties" : { "otp" : { - "type" : "string" + "x-go-name" : "OTP" } }, "required" : [ "otp" ] }, + "UserTOTPVerify_201_response" : { + "properties" : { + "custom_token" : { + "description" : "Token to exchange for ID token", + "type" : "string" + } + }, + "required" : [ "custom_token" ] + }, "UserTOTPSetup_200_response" : { "properties" : { "url" : {