lib/api/members/members_models/user.go

395 lines
8.9 KiB
Go
Raw Normal View History

2021-07-31 03:05:02 +00:00
// Code generated by go-swagger; DO NOT EDIT.
2021-08-05 19:37:53 +00:00
// (c) 2012-2020 by Taxnexus, Inc.
2021-07-31 03:05:02 +00:00
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
2023-04-07 18:00:15 +00:00
package members_models
2021-07-31 03:05:02 +00:00
// 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
//
2023-05-13 16:46:48 +00:00
// swagger:model user
2021-07-31 03:05:02 +00:00
type User struct {
2023-04-14 17:01:59 +00:00
// API Gateway URL
2023-04-15 14:27:18 +00:00
APIGatewayURL *string `json:"APIGatewayURL,omitempty"`
2023-04-14 17:01:59 +00:00
// API Gateway User
2023-04-15 14:27:18 +00:00
APIGatewayUser *string `json:"APIGatewayUser,omitempty"`
2023-04-14 17:01:59 +00:00
2021-07-31 03:05:02 +00:00
// API Key
2023-04-15 14:27:18 +00:00
APIKey *string `json:"APIKey,omitempty"`
2021-07-31 03:05:02 +00:00
// About Me
2023-04-15 14:27:18 +00:00
AboutMe *string `json:"AboutMe,omitempty"`
2021-07-31 03:05:02 +00:00
// Account ID
2023-04-15 14:27:18 +00:00
AccountID *string `json:"AccountID,omitempty"`
2021-07-31 03:05:02 +00:00
// address
Address *Address `json:"Address,omitempty"`
// Alias
2023-04-15 14:27:18 +00:00
Alias *string `json:"Alias,omitempty"`
2021-07-31 03:05:02 +00:00
// Auth0 User Id
2023-04-15 14:27:18 +00:00
Auth0UserID *string `json:"Auth0UserID,omitempty"`
2021-07-31 03:05:02 +00:00
// Nickname
2023-04-15 14:27:18 +00:00
CommunityNickname *string `json:"CommunityNickname,omitempty"`
2021-07-31 03:05:02 +00:00
// Company Name
2023-04-15 14:27:18 +00:00
CompanyName *string `json:"CompanyName,omitempty"`
2021-07-31 03:05:02 +00:00
// Contact
2023-04-15 14:27:18 +00:00
ContactID *string `json:"ContactID,omitempty"`
2021-07-31 03:05:02 +00:00
// Created User ID
2023-04-15 14:27:18 +00:00
CreatedByID *string `json:"CreatedByID,omitempty"`
2021-07-31 03:05:02 +00:00
// Date Created
2023-04-15 14:27:18 +00:00
CreatedDate *string `json:"CreatedDate,omitempty"`
2021-07-31 03:05:02 +00:00
// Delegated Approver
2023-04-15 14:27:18 +00:00
DelegatedApproverID *string `json:"DelegatedApproverID,omitempty"`
2021-07-31 03:05:02 +00:00
// Department
2023-04-15 14:27:18 +00:00
Department *string `json:"Department,omitempty"`
2021-07-31 03:05:02 +00:00
// Division
2023-04-15 14:27:18 +00:00
Division *string `json:"Division,omitempty"`
2021-07-31 03:05:02 +00:00
// Email address
2023-04-15 14:27:18 +00:00
Email *string `json:"Email,omitempty"`
2021-07-31 03:05:02 +00:00
// Employee Number
2023-04-15 14:27:18 +00:00
EmployeeNumber *string `json:"EmployeeNumber,omitempty"`
2021-07-31 03:05:02 +00:00
// Time day ends
2023-04-15 14:27:18 +00:00
EndOfDay *string `json:"EndOfDay,omitempty"`
2021-07-31 03:05:02 +00:00
// Environment
2023-04-15 14:27:18 +00:00
Environment *string `json:"Environment,omitempty"`
2021-07-31 03:05:02 +00:00
// Extension
2023-04-15 14:27:18 +00:00
Extension *string `json:"Extension,omitempty"`
2021-07-31 03:05:02 +00:00
2023-06-05 00:09:35 +00:00
// Account
ExternalAccount *string `json:"ExternalAccount,omitempty"`
2021-07-31 03:05:02 +00:00
// Fax
2023-04-15 14:27:18 +00:00
Fax *string `json:"Fax,omitempty"`
2021-07-31 03:05:02 +00:00
// The first name
2023-04-15 14:27:18 +00:00
FirstName *string `json:"FirstName,omitempty"`
2021-07-31 03:05:02 +00:00
// Allow Forecasting
2023-04-15 14:27:18 +00:00
ForecastEnabled *bool `json:"ForecastEnabled,omitempty"`
2021-07-31 03:05:02 +00:00
// Full Photo URL
2023-04-15 14:27:18 +00:00
FullPhotoURL *string `json:"FullPhotoURL,omitempty"`
2021-07-31 03:05:02 +00:00
2023-04-14 17:01:59 +00:00
// GitHub
2023-04-15 14:27:18 +00:00
GitHub *string `json:"GitHub,omitempty"`
2023-04-14 17:01:59 +00:00
2023-03-28 17:47:34 +00:00
// Record ID
2021-07-31 03:05:02 +00:00
ID string `json:"ID,omitempty"`
// Active
2023-04-15 14:27:18 +00:00
IsActive *bool `json:"IsActive,omitempty"`
2021-07-31 03:05:02 +00:00
// Is the user enabled for Communities?
2023-04-15 14:27:18 +00:00
IsPortalEnabled *bool `json:"IsPortalEnabled,omitempty"`
2021-07-31 03:05:02 +00:00
// is system controlled
2023-04-15 14:27:18 +00:00
IsSystemControlled *bool `json:"IsSystemControlled,omitempty"`
2021-07-31 03:05:02 +00:00
// IP address of last login
2023-04-15 14:27:18 +00:00
LastIP *string `json:"LastIP,omitempty"`
2021-07-31 03:05:02 +00:00
// Last login time
2023-04-15 14:27:18 +00:00
LastLogin *string `json:"LastLogin,omitempty"`
2021-07-31 03:05:02 +00:00
// Last Modified User ID
2023-04-15 14:27:18 +00:00
LastModifiedByID *string `json:"LastModifiedByID,omitempty"`
2021-07-31 03:05:02 +00:00
// Last Modified Date
2023-04-15 14:27:18 +00:00
LastModifiedDate *string `json:"LastModifiedDate,omitempty"`
2021-07-31 03:05:02 +00:00
// The Last Name
2023-04-15 14:27:18 +00:00
LastName *string `json:"LastName,omitempty"`
2021-07-31 03:05:02 +00:00
2023-04-14 17:01:59 +00:00
// LinkedIn
2023-04-15 14:27:18 +00:00
LinkedIn *string `json:"LinkedIn,omitempty"`
2023-04-14 17:01:59 +00:00
2021-07-31 03:05:02 +00:00
// Number of times user has logged in
2023-04-15 14:27:18 +00:00
LoginCount *int64 `json:"LoginCount,omitempty"`
2021-07-31 03:05:02 +00:00
// Manager
2023-04-15 14:27:18 +00:00
ManagerID *string `json:"ManagerID,omitempty"`
2021-07-31 03:05:02 +00:00
// Mobile
2023-04-15 14:27:18 +00:00
MobilePhone *string `json:"MobilePhone,omitempty"`
2021-07-31 03:05:02 +00:00
// Name
2023-04-15 14:27:18 +00:00
Name *string `json:"Name,omitempty"`
2021-07-31 03:05:02 +00:00
// Out of office message
2023-04-15 14:27:18 +00:00
OutOfOfficeMessage *string `json:"OutOfOfficeMessage,omitempty"`
2021-07-31 03:05:02 +00:00
// Phone
2023-04-15 14:27:18 +00:00
Phone *string `json:"Phone,omitempty"`
2021-07-31 03:05:02 +00:00
// Portal Role Level
2023-04-15 14:27:18 +00:00
PortalRole *string `json:"PortalRole,omitempty"`
2021-07-31 03:05:02 +00:00
// Profile
2023-04-15 14:27:18 +00:00
ProfileID *string `json:"ProfileID,omitempty"`
2021-07-31 03:05:02 +00:00
// Info Emails
2023-04-15 14:27:18 +00:00
ReceivesAdminEmails *bool `json:"ReceivesAdminEmails,omitempty"`
2021-07-31 03:05:02 +00:00
// Email Sender Address
2023-04-15 14:27:18 +00:00
SenderEmail *string `json:"SenderEmail,omitempty"`
2021-07-31 03:05:02 +00:00
// Email Sender Name
2023-04-15 14:27:18 +00:00
SenderName *string `json:"SenderName,omitempty"`
2021-07-31 03:05:02 +00:00
// Small Photo URL
2023-04-15 14:27:18 +00:00
SmallPhotoURL *string `json:"SmallPhotoURL,omitempty"`
2021-07-31 03:05:02 +00:00
// The time day starts
2023-04-15 14:27:18 +00:00
StartOfDay *string `json:"StartOfDay,omitempty"`
2021-07-31 03:05:02 +00:00
2023-04-11 14:59:35 +00:00
// Onboarding Status
2023-04-15 14:27:18 +00:00
Status *string `json:"Status,omitempty"`
2023-04-11 14:59:35 +00:00
2021-07-31 03:05:02 +00:00
// Tenant ID associated with this user
2023-04-15 14:27:18 +00:00
TenantID *string `json:"TenantID,omitempty"`
2021-07-31 03:05:02 +00:00
// tenant users
TenantUsers []*TenantUser `json:"TenantUsers"`
// Time Zone
2023-04-15 14:27:18 +00:00
TimeZone *string `json:"TimeZone,omitempty"`
2021-07-31 03:05:02 +00:00
// Title
2023-04-15 14:27:18 +00:00
Title *string `json:"Title,omitempty"`
2021-07-31 03:05:02 +00:00
2023-04-14 17:01:59 +00:00
// Twitter
2023-04-15 14:27:18 +00:00
Twitter *string `json:"Twitter,omitempty"`
2023-04-14 17:01:59 +00:00
2021-07-31 03:05:02 +00:00
// Role
2023-04-15 14:27:18 +00:00
UserRoleID *string `json:"UserRoleID,omitempty"`
2021-07-31 03:05:02 +00:00
// user roles
UserRoles []*UserRole `json:"UserRoles"`
// User Type
2023-04-15 14:27:18 +00:00
UserType *string `json:"UserType,omitempty"`
2021-07-31 03:05:02 +00:00
// Username
2023-04-15 14:27:18 +00:00
Username *string `json:"Username,omitempty"`
2021-07-31 03:05:02 +00:00
}
// Validate validates this user
func (m *User) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateAddress(formats); err != nil {
res = append(res, err)
}
if err := m.validateTenantUsers(formats); err != nil {
res = append(res, err)
}
if err := m.validateUserRoles(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *User) validateAddress(formats strfmt.Registry) error {
if swag.IsZero(m.Address) { // not required
return nil
}
if m.Address != nil {
if err := m.Address.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Address")
2022-05-28 19:45:41 +00:00
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Address")
2021-07-31 03:05:02 +00:00
}
return err
}
}
return nil
}
func (m *User) validateTenantUsers(formats strfmt.Registry) error {
if swag.IsZero(m.TenantUsers) { // not required
return nil
}
for i := 0; i < len(m.TenantUsers); i++ {
if swag.IsZero(m.TenantUsers[i]) { // not required
continue
}
if m.TenantUsers[i] != nil {
if err := m.TenantUsers[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("TenantUsers" + "." + strconv.Itoa(i))
2022-05-28 19:45:41 +00:00
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("TenantUsers" + "." + strconv.Itoa(i))
2021-07-31 03:05:02 +00:00
}
return err
}
}
}
return nil
}
func (m *User) validateUserRoles(formats strfmt.Registry) error {
if swag.IsZero(m.UserRoles) { // not required
return nil
}
for i := 0; i < len(m.UserRoles); i++ {
if swag.IsZero(m.UserRoles[i]) { // not required
continue
}
if m.UserRoles[i] != nil {
if err := m.UserRoles[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("UserRoles" + "." + strconv.Itoa(i))
2022-05-28 19:45:41 +00:00
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("UserRoles" + "." + strconv.Itoa(i))
2021-07-31 03:05:02 +00:00
}
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.contextValidateAddress(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateTenantUsers(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateUserRoles(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *User) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error {
if m.Address != nil {
if err := m.Address.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Address")
2022-05-28 19:45:41 +00:00
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("Address")
2021-07-31 03:05:02 +00:00
}
return err
}
}
return nil
}
func (m *User) contextValidateTenantUsers(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.TenantUsers); i++ {
if m.TenantUsers[i] != nil {
if err := m.TenantUsers[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("TenantUsers" + "." + strconv.Itoa(i))
2022-05-28 19:45:41 +00:00
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("TenantUsers" + "." + strconv.Itoa(i))
2021-07-31 03:05:02 +00:00
}
return err
}
}
}
return nil
}
func (m *User) contextValidateUserRoles(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.UserRoles); i++ {
if m.UserRoles[i] != nil {
if err := m.UserRoles[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("UserRoles" + "." + strconv.Itoa(i))
2022-05-28 19:45:41 +00:00
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("UserRoles" + "." + strconv.Itoa(i))
2021-07-31 03:05:02 +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
}