2021-08-05 19:37:53 +00:00
|
|
|
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
|
|
|
|
// (c) 2012-2020 by Taxnexus, Inc.
|
|
|
|
// All rights reserved worldwide.
|
|
|
|
// Proprietary product; unlicensed use is not allowed
|
|
|
|
|
|
|
|
package auth0_models
|
|
|
|
|
|
|
|
// This file was generated by the swagger tool.
|
|
|
|
// Editing this file might prove futile when you re-run the swagger generate command
|
|
|
|
|
|
|
|
import (
|
2023-03-22 20:49:01 +00:00
|
|
|
"context"
|
2021-08-05 19:37:53 +00:00
|
|
|
"strconv"
|
|
|
|
|
|
|
|
"github.com/go-openapi/errors"
|
|
|
|
"github.com/go-openapi/strfmt"
|
|
|
|
"github.com/go-openapi/swag"
|
|
|
|
)
|
|
|
|
|
|
|
|
// User user
|
|
|
|
//
|
|
|
|
// swagger:model User
|
|
|
|
type User struct {
|
|
|
|
|
|
|
|
// app metadata
|
|
|
|
AppMetadata *UserAppMetadata `json:"app_metadata,omitempty"`
|
|
|
|
|
|
|
|
// created at
|
2023-03-22 20:49:01 +00:00
|
|
|
// Example: 2018-06-06T16:00:55.930Z
|
2021-08-05 19:37:53 +00:00
|
|
|
CreatedAt string `json:"created_at,omitempty"`
|
|
|
|
|
|
|
|
// email
|
2023-03-22 20:49:01 +00:00
|
|
|
// Example: vern@taxnexus.net
|
2021-08-05 19:37:53 +00:00
|
|
|
Email string `json:"email,omitempty"`
|
|
|
|
|
|
|
|
// email verified
|
2023-03-22 20:49:01 +00:00
|
|
|
// Example: true
|
2021-08-05 19:37:53 +00:00
|
|
|
EmailVerified bool `json:"email_verified,omitempty"`
|
|
|
|
|
|
|
|
// family name
|
2023-03-22 20:49:01 +00:00
|
|
|
// Example: Keenan
|
2021-08-05 19:37:53 +00:00
|
|
|
FamilyName string `json:"family_name,omitempty"`
|
|
|
|
|
|
|
|
// given name
|
2023-03-22 20:49:01 +00:00
|
|
|
// Example: Vernon
|
2021-08-05 19:37:53 +00:00
|
|
|
GivenName string `json:"given_name,omitempty"`
|
|
|
|
|
|
|
|
// identities
|
|
|
|
Identities []*UserIdentitiesItems0 `json:"identities"`
|
|
|
|
|
|
|
|
// last ip
|
2023-03-22 20:49:01 +00:00
|
|
|
// Example: 67.188.106.161
|
2021-08-05 19:37:53 +00:00
|
|
|
LastIP string `json:"last_ip,omitempty"`
|
|
|
|
|
|
|
|
// last login
|
2023-03-22 20:49:01 +00:00
|
|
|
// Example: 2020-09-22T19:19:02.706Z
|
2021-08-05 19:37:53 +00:00
|
|
|
LastLogin string `json:"last_login,omitempty"`
|
|
|
|
|
|
|
|
// last password reset
|
2023-03-22 20:49:01 +00:00
|
|
|
// Example: 2020-09-21T00:11:47.397Z
|
2021-08-05 19:37:53 +00:00
|
|
|
LastPasswordReset string `json:"last_password_reset,omitempty"`
|
|
|
|
|
|
|
|
// logins count
|
2023-03-22 20:49:01 +00:00
|
|
|
// Example: 178
|
2021-08-05 19:37:53 +00:00
|
|
|
LoginsCount int64 `json:"logins_count,omitempty"`
|
|
|
|
|
|
|
|
// multifactor last modified
|
2023-03-22 20:49:01 +00:00
|
|
|
// Example: 2020-09-21T00:30:34.081Z
|
2021-08-05 19:37:53 +00:00
|
|
|
MultifactorLastModified string `json:"multifactor_last_modified,omitempty"`
|
|
|
|
|
|
|
|
// name
|
2023-03-22 20:49:01 +00:00
|
|
|
// Example: Vernon Keenan
|
2021-08-05 19:37:53 +00:00
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
|
|
|
|
// nickname
|
2023-03-22 20:49:01 +00:00
|
|
|
// Example: vern
|
2021-08-05 19:37:53 +00:00
|
|
|
Nickname string `json:"nickname,omitempty"`
|
|
|
|
|
|
|
|
// picture
|
2023-03-22 20:49:01 +00:00
|
|
|
// Example: https://s.gravatar.com/avatar/a08710b8d49416c729a0da8a9c34cdb0?s=480\u0026r=pg\u0026d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fve.png
|
2021-08-05 19:37:53 +00:00
|
|
|
Picture string `json:"picture,omitempty"`
|
|
|
|
|
|
|
|
// updated at
|
2023-03-22 20:49:01 +00:00
|
|
|
// Example: 2020-09-22T19:19:02.706Z
|
2021-08-05 19:37:53 +00:00
|
|
|
UpdatedAt string `json:"updated_at,omitempty"`
|
|
|
|
|
|
|
|
// user id
|
2023-03-22 20:49:01 +00:00
|
|
|
// Example: auth0|5b180537157859716f2c9df5
|
2021-08-05 19:37:53 +00:00
|
|
|
UserID string `json:"user_id,omitempty"`
|
|
|
|
|
|
|
|
// user metadata
|
|
|
|
UserMetadata *UserUserMetadata `json:"user_metadata,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// Validate validates this user
|
|
|
|
func (m *User) Validate(formats strfmt.Registry) error {
|
|
|
|
var res []error
|
|
|
|
|
|
|
|
if err := m.validateAppMetadata(formats); err != nil {
|
|
|
|
res = append(res, err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := m.validateIdentities(formats); err != nil {
|
|
|
|
res = append(res, err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := m.validateUserMetadata(formats); err != nil {
|
|
|
|
res = append(res, err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(res) > 0 {
|
|
|
|
return errors.CompositeValidationError(res...)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *User) validateAppMetadata(formats strfmt.Registry) error {
|
|
|
|
if swag.IsZero(m.AppMetadata) { // not required
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
if m.AppMetadata != nil {
|
|
|
|
if err := m.AppMetadata.Validate(formats); err != nil {
|
|
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
|
|
return ve.ValidateName("app_metadata")
|
2023-03-22 20:49:01 +00:00
|
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
|
|
return ce.ValidateName("app_metadata")
|
2021-08-05 19:37:53 +00:00
|
|
|
}
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *User) validateIdentities(formats strfmt.Registry) error {
|
|
|
|
if swag.IsZero(m.Identities) { // not required
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
for i := 0; i < len(m.Identities); i++ {
|
|
|
|
if swag.IsZero(m.Identities[i]) { // not required
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
|
|
|
|
if m.Identities[i] != nil {
|
|
|
|
if err := m.Identities[i].Validate(formats); err != nil {
|
|
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
|
|
return ve.ValidateName("identities" + "." + strconv.Itoa(i))
|
2023-03-22 20:49:01 +00:00
|
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
|
|
return ce.ValidateName("identities" + "." + strconv.Itoa(i))
|
2021-08-05 19:37:53 +00:00
|
|
|
}
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *User) validateUserMetadata(formats strfmt.Registry) error {
|
|
|
|
if swag.IsZero(m.UserMetadata) { // not required
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
if m.UserMetadata != nil {
|
|
|
|
if err := m.UserMetadata.Validate(formats); err != nil {
|
|
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
|
|
return ve.ValidateName("user_metadata")
|
2023-03-22 20:49:01 +00:00
|
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
|
|
return ce.ValidateName("user_metadata")
|
|
|
|
}
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// ContextValidate validate this user based on the context it is used
|
|
|
|
func (m *User) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
var res []error
|
|
|
|
|
|
|
|
if err := m.contextValidateAppMetadata(ctx, formats); err != nil {
|
|
|
|
res = append(res, err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := m.contextValidateIdentities(ctx, formats); err != nil {
|
|
|
|
res = append(res, err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := m.contextValidateUserMetadata(ctx, formats); err != nil {
|
|
|
|
res = append(res, err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(res) > 0 {
|
|
|
|
return errors.CompositeValidationError(res...)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *User) contextValidateAppMetadata(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
|
|
|
|
if m.AppMetadata != nil {
|
|
|
|
if err := m.AppMetadata.ContextValidate(ctx, formats); err != nil {
|
|
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
|
|
return ve.ValidateName("app_metadata")
|
|
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
|
|
return ce.ValidateName("app_metadata")
|
|
|
|
}
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *User) contextValidateIdentities(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
|
|
|
|
for i := 0; i < len(m.Identities); i++ {
|
|
|
|
|
|
|
|
if m.Identities[i] != nil {
|
|
|
|
if err := m.Identities[i].ContextValidate(ctx, formats); err != nil {
|
|
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
|
|
return ve.ValidateName("identities" + "." + strconv.Itoa(i))
|
|
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
|
|
return ce.ValidateName("identities" + "." + strconv.Itoa(i))
|
|
|
|
}
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *User) contextValidateUserMetadata(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
|
|
|
|
if m.UserMetadata != nil {
|
|
|
|
if err := m.UserMetadata.ContextValidate(ctx, formats); err != nil {
|
|
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
|
|
return ve.ValidateName("user_metadata")
|
|
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
|
|
return ce.ValidateName("user_metadata")
|
2021-08-05 19:37:53 +00:00
|
|
|
}
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// MarshalBinary interface implementation
|
|
|
|
func (m *User) MarshalBinary() ([]byte, error) {
|
|
|
|
if m == nil {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
return swag.WriteJSON(m)
|
|
|
|
}
|
|
|
|
|
|
|
|
// UnmarshalBinary interface implementation
|
|
|
|
func (m *User) UnmarshalBinary(b []byte) error {
|
|
|
|
var res User
|
|
|
|
if err := swag.ReadJSON(b, &res); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
*m = res
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// UserAppMetadata user app metadata
|
|
|
|
//
|
|
|
|
// swagger:model UserAppMetadata
|
|
|
|
type UserAppMetadata struct {
|
|
|
|
|
|
|
|
// roles
|
2023-03-22 20:49:01 +00:00
|
|
|
// Example: ["login"]
|
2021-08-05 19:37:53 +00:00
|
|
|
Roles []string `json:"roles"`
|
|
|
|
|
|
|
|
// taxnexus account id
|
2023-03-22 20:49:01 +00:00
|
|
|
// Example: 7f661ca6-ae4a-486f-9c3c-cd292685a46d
|
2021-08-05 19:37:53 +00:00
|
|
|
TaxnexusAccountID string `json:"taxnexus_account_id,omitempty"`
|
|
|
|
|
|
|
|
// taxnexus contact id
|
2023-03-22 20:49:01 +00:00
|
|
|
// Example: 9f79dca8-e875-4e2b-a5ad-001a3d32e83d
|
2021-08-05 19:37:53 +00:00
|
|
|
TaxnexusContactID string `json:"taxnexus_contact_id,omitempty"`
|
|
|
|
|
|
|
|
// taxnexus user id
|
2023-03-22 20:49:01 +00:00
|
|
|
// Example: f04da03d-70ad-46df-a46c-a676388aadd7
|
2021-08-05 19:37:53 +00:00
|
|
|
TaxnexusUserID string `json:"taxnexus_user_id,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// Validate validates this user app metadata
|
|
|
|
func (m *UserAppMetadata) Validate(formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-03-22 20:49:01 +00:00
|
|
|
// ContextValidate validates this user app metadata based on context it is used
|
|
|
|
func (m *UserAppMetadata) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2021-08-05 19:37:53 +00:00
|
|
|
// MarshalBinary interface implementation
|
|
|
|
func (m *UserAppMetadata) MarshalBinary() ([]byte, error) {
|
|
|
|
if m == nil {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
return swag.WriteJSON(m)
|
|
|
|
}
|
|
|
|
|
|
|
|
// UnmarshalBinary interface implementation
|
|
|
|
func (m *UserAppMetadata) UnmarshalBinary(b []byte) error {
|
|
|
|
var res UserAppMetadata
|
|
|
|
if err := swag.ReadJSON(b, &res); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
*m = res
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// UserIdentitiesItems0 user identities items0
|
|
|
|
//
|
|
|
|
// swagger:model UserIdentitiesItems0
|
|
|
|
type UserIdentitiesItems0 struct {
|
|
|
|
|
|
|
|
// connection
|
2023-03-22 20:49:01 +00:00
|
|
|
// Example: Username-Password-Authentication
|
2021-08-05 19:37:53 +00:00
|
|
|
Connection string `json:"connection,omitempty"`
|
|
|
|
|
|
|
|
// is social
|
2023-03-22 20:49:01 +00:00
|
|
|
// Example: false
|
2021-08-05 19:37:53 +00:00
|
|
|
IsSocial bool `json:"isSocial,omitempty"`
|
|
|
|
|
|
|
|
// provider
|
2023-03-22 20:49:01 +00:00
|
|
|
// Example: auth0
|
2021-08-05 19:37:53 +00:00
|
|
|
Provider string `json:"provider,omitempty"`
|
|
|
|
|
|
|
|
// user id
|
2023-03-22 20:49:01 +00:00
|
|
|
// Example: 5b180537157859716f2c9df5
|
2021-08-05 19:37:53 +00:00
|
|
|
UserID string `json:"user_id,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// Validate validates this user identities items0
|
|
|
|
func (m *UserIdentitiesItems0) Validate(formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-03-22 20:49:01 +00:00
|
|
|
// ContextValidate validates this user identities items0 based on context it is used
|
|
|
|
func (m *UserIdentitiesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2021-08-05 19:37:53 +00:00
|
|
|
// MarshalBinary interface implementation
|
|
|
|
func (m *UserIdentitiesItems0) MarshalBinary() ([]byte, error) {
|
|
|
|
if m == nil {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
return swag.WriteJSON(m)
|
|
|
|
}
|
|
|
|
|
|
|
|
// UnmarshalBinary interface implementation
|
|
|
|
func (m *UserIdentitiesItems0) UnmarshalBinary(b []byte) error {
|
|
|
|
var res UserIdentitiesItems0
|
|
|
|
if err := swag.ReadJSON(b, &res); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
*m = res
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// UserUserMetadata user user metadata
|
|
|
|
//
|
|
|
|
// swagger:model UserUserMetadata
|
|
|
|
type UserUserMetadata struct {
|
|
|
|
|
|
|
|
// taxnexus email
|
2023-03-22 20:49:01 +00:00
|
|
|
// Example: vern@taxnexus.net
|
2021-08-05 19:37:53 +00:00
|
|
|
TaxnexusEmail string `json:"taxnexus_email,omitempty"`
|
|
|
|
|
|
|
|
// taxnexus firstname
|
2023-03-22 20:49:01 +00:00
|
|
|
// Example: Vernon
|
2021-08-05 19:37:53 +00:00
|
|
|
TaxnexusFirstname string `json:"taxnexus_firstname,omitempty"`
|
|
|
|
|
|
|
|
// taxnexus fullname
|
2023-03-22 20:49:01 +00:00
|
|
|
// Example: Vernon Keenan
|
2021-08-05 19:37:53 +00:00
|
|
|
TaxnexusFullname string `json:"taxnexus_fullname,omitempty"`
|
|
|
|
|
|
|
|
// taxnexus lastname
|
2023-03-22 20:49:01 +00:00
|
|
|
// Example: Keenan
|
2021-08-05 19:37:53 +00:00
|
|
|
TaxnexusLastname string `json:"taxnexus_lastname,omitempty"`
|
|
|
|
|
|
|
|
// taxnexus phone
|
2023-03-22 20:49:01 +00:00
|
|
|
// Example: +15106791900
|
2021-08-05 19:37:53 +00:00
|
|
|
TaxnexusPhone string `json:"taxnexus_phone,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// Validate validates this user user metadata
|
|
|
|
func (m *UserUserMetadata) Validate(formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-03-22 20:49:01 +00:00
|
|
|
// ContextValidate validates this user user metadata based on context it is used
|
|
|
|
func (m *UserUserMetadata) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2021-08-05 19:37:53 +00:00
|
|
|
// MarshalBinary interface implementation
|
|
|
|
func (m *UserUserMetadata) MarshalBinary() ([]byte, error) {
|
|
|
|
if m == nil {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
return swag.WriteJSON(m)
|
|
|
|
}
|
|
|
|
|
|
|
|
// UnmarshalBinary interface implementation
|
|
|
|
func (m *UserUserMetadata) UnmarshalBinary(b []byte) error {
|
|
|
|
var res UserUserMetadata
|
|
|
|
if err := swag.ReadJSON(b, &res); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
*m = res
|
|
|
|
return nil
|
|
|
|
}
|