// Code generated by go-swagger; DO NOT EDIT.

package model

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"context"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/strfmt"
	"github.com/go-openapi/swag"
	"github.com/go-openapi/validate"
)

// CentralUserProfileOrg central user profile org
//
// swagger:model centralUserProfileOrg
type CentralUserProfileOrg struct {

	// company name
	CompanyName string `json:"company_name,omitempty"`

	// country
	Country string `json:"country,omitempty"`

	// created at
	// Format: date-time
	CreatedAt strfmt.DateTime `json:"created_at,omitempty"`

	// email
	Email string `json:"email,omitempty"`

	// id
	ID string `json:"id,omitempty"`

	// name
	Name string `json:"name,omitempty"`

	// org tag
	OrgTag string `json:"org_tag,omitempty"`

	// org type
	OrgType string `json:"org_type,omitempty"`

	// third party account code
	ThirdPartyAccountCode string `json:"third_party_account_code,omitempty"`

	// third party account provider
	ThirdPartyAccountProvider string `json:"third_party_account_provider,omitempty"`

	// timezone
	Timezone int32 `json:"timezone,omitempty"`

	// user set timezone
	UserSetTimezone string `json:"user_set_timezone,omitempty"`
}

// Validate validates this central user profile org
func (m *CentralUserProfileOrg) Validate(formats strfmt.Registry) error {
	var res []error

	if err := m.validateCreatedAt(formats); err != nil {
		res = append(res, err)
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}

func (m *CentralUserProfileOrg) validateCreatedAt(formats strfmt.Registry) error {
	if swag.IsZero(m.CreatedAt) { // not required
		return nil
	}

	if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil {
		return err
	}

	return nil
}

// ContextValidate validates this central user profile org based on context it is used
func (m *CentralUserProfileOrg) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

// MarshalBinary interface implementation
func (m *CentralUserProfileOrg) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}

// UnmarshalBinary interface implementation
func (m *CentralUserProfileOrg) UnmarshalBinary(b []byte) error {
	var res CentralUserProfileOrg
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*m = res
	return nil
}
