lib/api/auth0/auth0_models/user.go

427 lines
10 KiB
Go

// 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 (
"context"
"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
// Example: 2018-06-06T16:00:55.930Z
CreatedAt string `json:"created_at,omitempty"`
// email
// Example: vern@taxnexus.net
Email string `json:"email,omitempty"`
// email verified
// Example: true
EmailVerified bool `json:"email_verified,omitempty"`
// family name
// Example: Keenan
FamilyName string `json:"family_name,omitempty"`
// given name
// Example: Vernon
GivenName string `json:"given_name,omitempty"`
// identities
Identities []*UserIdentitiesItems0 `json:"identities"`
// last ip
// Example: 67.188.106.161
LastIP string `json:"last_ip,omitempty"`
// last login
// Example: 2020-09-22T19:19:02.706Z
LastLogin string `json:"last_login,omitempty"`
// last password reset
// Example: 2020-09-21T00:11:47.397Z
LastPasswordReset string `json:"last_password_reset,omitempty"`
// logins count
// Example: 178
LoginsCount int64 `json:"logins_count,omitempty"`
// multifactor last modified
// Example: 2020-09-21T00:30:34.081Z
MultifactorLastModified string `json:"multifactor_last_modified,omitempty"`
// name
// Example: Vernon Keenan
Name string `json:"name,omitempty"`
// nickname
// Example: vern
Nickname string `json:"nickname,omitempty"`
// picture
// Example: https://s.gravatar.com/avatar/a08710b8d49416c729a0da8a9c34cdb0?s=480\u0026r=pg\u0026d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fve.png
Picture string `json:"picture,omitempty"`
// updated at
// Example: 2020-09-22T19:19:02.706Z
UpdatedAt string `json:"updated_at,omitempty"`
// user id
// Example: auth0|5b180537157859716f2c9df5
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")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("app_metadata")
}
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))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("identities" + "." + strconv.Itoa(i))
}
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")
} 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")
}
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
// Example: ["login"]
Roles []string `json:"roles"`
// taxnexus account id
// Example: 7f661ca6-ae4a-486f-9c3c-cd292685a46d
TaxnexusAccountID string `json:"taxnexus_account_id,omitempty"`
// taxnexus contact id
// Example: 9f79dca8-e875-4e2b-a5ad-001a3d32e83d
TaxnexusContactID string `json:"taxnexus_contact_id,omitempty"`
// taxnexus user id
// Example: f04da03d-70ad-46df-a46c-a676388aadd7
TaxnexusUserID string `json:"taxnexus_user_id,omitempty"`
}
// Validate validates this user app metadata
func (m *UserAppMetadata) Validate(formats strfmt.Registry) error {
return nil
}
// 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
}
// 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
// Example: Username-Password-Authentication
Connection string `json:"connection,omitempty"`
// is social
// Example: false
IsSocial bool `json:"isSocial,omitempty"`
// provider
// Example: auth0
Provider string `json:"provider,omitempty"`
// user id
// Example: 5b180537157859716f2c9df5
UserID string `json:"user_id,omitempty"`
}
// Validate validates this user identities items0
func (m *UserIdentitiesItems0) Validate(formats strfmt.Registry) error {
return nil
}
// 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
}
// 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
// Example: vern@taxnexus.net
TaxnexusEmail string `json:"taxnexus_email,omitempty"`
// taxnexus firstname
// Example: Vernon
TaxnexusFirstname string `json:"taxnexus_firstname,omitempty"`
// taxnexus fullname
// Example: Vernon Keenan
TaxnexusFullname string `json:"taxnexus_fullname,omitempty"`
// taxnexus lastname
// Example: Keenan
TaxnexusLastname string `json:"taxnexus_lastname,omitempty"`
// taxnexus phone
// Example: +15106791900
TaxnexusPhone string `json:"taxnexus_phone,omitempty"`
}
// Validate validates this user user metadata
func (m *UserUserMetadata) Validate(formats strfmt.Registry) error {
return nil
}
// 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
}
// 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
}