mirror of https://github.com/vernonkeenan/lib
135 lines
2.9 KiB
Go
135 lines
2.9 KiB
Go
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
// (c) 2012-2020 by Telnexus LLC
|
|
// All rights reserved worldwide.
|
|
// Proprietary product; unlicensed use is not allowed
|
|
|
|
package voip_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"
|
|
|
|
"github.com/go-openapi/errors"
|
|
"github.com/go-openapi/strfmt"
|
|
"github.com/go-openapi/swag"
|
|
)
|
|
|
|
// Recipient recipient
|
|
//
|
|
// swagger:model Recipient
|
|
type Recipient struct {
|
|
|
|
// availability state
|
|
AvailabilityState string `json:"AvailabilityState,omitempty"`
|
|
|
|
// available
|
|
Available string `json:"Available,omitempty"`
|
|
|
|
// handling call
|
|
HandlingCall string `json:"HandlingCall,omitempty"`
|
|
|
|
// Telnexus Record Identifier
|
|
ID string `json:"ID,omitempty"`
|
|
|
|
// node
|
|
Node string `json:"Node,omitempty"`
|
|
|
|
// offered call
|
|
OfferedCall string `json:"OfferedCall,omitempty"`
|
|
|
|
// queue availability
|
|
QueueAvailability string `json:"QueueAvailability,omitempty"`
|
|
|
|
// stats
|
|
Stats *RecipientStats `json:"Stats,omitempty"`
|
|
|
|
// wiretap mode
|
|
WiretapMode string `json:"WiretapMode,omitempty"`
|
|
|
|
// wiretapping recipient
|
|
WiretappingRecipient string `json:"WiretappingRecipient,omitempty"`
|
|
|
|
// wrapup time seconds
|
|
WrapupTimeSeconds string `json:"WrapupTimeSeconds,omitempty"`
|
|
}
|
|
|
|
// Validate validates this recipient
|
|
func (m *Recipient) Validate(formats strfmt.Registry) error {
|
|
var res []error
|
|
|
|
if err := m.validateStats(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Recipient) validateStats(formats strfmt.Registry) error {
|
|
if swag.IsZero(m.Stats) { // not required
|
|
return nil
|
|
}
|
|
|
|
if m.Stats != nil {
|
|
if err := m.Stats.Validate(formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("Stats")
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// ContextValidate validate this recipient based on the context it is used
|
|
func (m *Recipient) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
|
var res []error
|
|
|
|
if err := m.contextValidateStats(ctx, formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Recipient) contextValidateStats(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
if m.Stats != nil {
|
|
if err := m.Stats.ContextValidate(ctx, formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("Stats")
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalBinary interface implementation
|
|
func (m *Recipient) MarshalBinary() ([]byte, error) {
|
|
if m == nil {
|
|
return nil, nil
|
|
}
|
|
return swag.WriteJSON(m)
|
|
}
|
|
|
|
// UnmarshalBinary interface implementation
|
|
func (m *Recipient) UnmarshalBinary(b []byte) error {
|
|
var res Recipient
|
|
if err := swag.ReadJSON(b, &res); err != nil {
|
|
return err
|
|
}
|
|
*m = res
|
|
return nil
|
|
}
|