lib/api/auth/v0.0.1/auth_models/user.go

307 lines
6.5 KiB
Go
Raw Permalink Normal View History

2021-01-08 17:00:13 +00:00
// Code generated by go-swagger; DO NOT EDIT.
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package auth_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// User user
//
// swagger:model User
type User struct {
// API Key
APIKey string `json:"APIKey,omitempty"`
// About Me
AboutMe string `json:"AboutMe,omitempty"`
// Account ID
AccountID string `json:"AccountID,omitempty"`
// address
Address *Address `json:"Address,omitempty"`
// Alias
Alias string `json:"Alias,omitempty"`
// Auth0 User Id
Auth0UserID string `json:"Auth0UserID,omitempty"`
// Nickname
CommunityNickname string `json:"CommunityNickname,omitempty"`
// Company Name
CompanyName string `json:"CompanyName,omitempty"`
// Contact
ContactID string `json:"ContactID,omitempty"`
// Created User ID
CreatedByID string `json:"CreatedByID,omitempty"`
// Date Created
CreatedDate string `json:"CreatedDate,omitempty"`
// Delegated Approver
DelegatedApproverID string `json:"DelegatedApproverID,omitempty"`
// Department
Department string `json:"Department,omitempty"`
// Division
Division string `json:"Division,omitempty"`
// Email address
Email string `json:"Email,omitempty"`
// Employee Number
EmployeeNumber string `json:"EmployeeNumber,omitempty"`
// Time day ends
EndOfDay string `json:"EndOfDay,omitempty"`
// Environment
Environment string `json:"Environment,omitempty"`
// Extension
Extension string `json:"Extension,omitempty"`
// Fabric API Key
FabricAPIKey string `json:"FabricAPIKey,omitempty"`
// Fax
Fax string `json:"Fax,omitempty"`
// The first name
FirstName string `json:"FirstName,omitempty"`
// Allow Forecasting
ForecastEnabled bool `json:"ForecastEnabled,omitempty"`
// Full Photo URL
FullPhotoURL string `json:"FullPhotoURL,omitempty"`
// Taxnexus ID
ID string `json:"ID,omitempty"`
// Active
IsActive bool `json:"IsActive,omitempty"`
// Is the user enabled for Communities?
IsPortalEnabled bool `json:"IsPortalEnabled,omitempty"`
// Has Profile Photo
IsProphilePhotoActive bool `json:"IsProphilePhotoActive,omitempty"`
// is system controlled
IsSystemControlled bool `json:"IsSystemControlled,omitempty"`
// IP address of last login
LastIP string `json:"LastIP,omitempty"`
// Last login time
LastLogin string `json:"LastLogin,omitempty"`
// Last Modified User ID
LastModifiedByID string `json:"LastModifiedByID,omitempty"`
// Last Modified Date
LastModifiedDate string `json:"LastModifiedDate,omitempty"`
// The Last Name
LastName string `json:"LastName,omitempty"`
// Number of times user has logged in
LoginCount int64 `json:"LoginCount,omitempty"`
// Manager
ManagerID string `json:"ManagerID,omitempty"`
// Mobile
MobilePhone string `json:"MobilePhone,omitempty"`
// Name
Name string `json:"Name,omitempty"`
// Out of office message
OutOfOfficeMessage string `json:"OutOfOfficeMessage,omitempty"`
// Phone
Phone string `json:"Phone,omitempty"`
// Portal Role Level
PortalRole string `json:"PortalRole,omitempty"`
// Profile
ProfileID string `json:"ProfileID,omitempty"`
// Info Emails
ReceivesAdminEmails bool `json:"ReceivesAdminEmails,omitempty"`
// Admin Info Emails
ReceivesAdminInfoEmails bool `json:"ReceivesAdminInfoEmails,omitempty"`
// Email Sender Address
SenderEmail string `json:"SenderEmail,omitempty"`
// Email Sender Name
SenderName string `json:"SenderName,omitempty"`
// Email Signature
Signature string `json:"Signature,omitempty"`
// Small Photo URL
SmallPhotoURL string `json:"SmallPhotoURL,omitempty"`
// The time day starts
StartOfDay string `json:"StartOfDay,omitempty"`
// Taxnexus Account
TaxnexusAccount string `json:"TaxnexusAccount,omitempty"`
// Tenant ID associated with this user
TenantID string `json:"TenantID,omitempty"`
// tenant users
TenantUsers []*TenantUser `json:"TenantUsers"`
// Time Zone
TimeZone string `json:"TimeZone,omitempty"`
// Title
Title string `json:"Title,omitempty"`
// Role
UserRoleID string `json:"UserRoleID,omitempty"`
// user roles
UserRoles []*UserRole `json:"UserRoles"`
// User Type
UserType string `json:"UserType,omitempty"`
// Username
Username string `json:"Username,omitempty"`
}
// 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")
}
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))
}
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))
}
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
}