lib/api/kazoo/kazoo_models/get_kazoo_number_response.go

182 lines
4.2 KiB
Go
Raw Normal View History

2021-07-31 03:05:02 +00:00
// 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 kazoo_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"
)
// GetKazooNumberResponse get kazoo number response
//
// swagger:model GetKazooNumberResponse
type GetKazooNumberResponse struct {
// auth token
AuthToken string `json:"auth_token,omitempty"`
// data
Data []*GetKazooNumberResponseDataItems0 `json:"data"`
// node
// Example: dqZFtHthbelyE8MI6vU-LA
Node string `json:"node,omitempty"`
// request id
// Example: b310489bd3933c740590b2dcec953de8
RequestID string `json:"request_id,omitempty"`
// status
// Example: success
Status string `json:"status,omitempty"`
// timestamp
// Example: 2020-05-07T02:30:03Z
Timestamp string `json:"timestamp,omitempty"`
// version
// Example: 4.3.103
Version string `json:"version,omitempty"`
}
// Validate validates this get kazoo number response
func (m *GetKazooNumberResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateData(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *GetKazooNumberResponse) validateData(formats strfmt.Registry) error {
if swag.IsZero(m.Data) { // not required
return nil
}
for i := 0; i < len(m.Data); i++ {
if swag.IsZero(m.Data[i]) { // not required
continue
}
if m.Data[i] != nil {
if err := m.Data[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this get kazoo number response based on the context it is used
func (m *GetKazooNumberResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateData(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *GetKazooNumberResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Data); i++ {
if m.Data[i] != nil {
if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("data" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *GetKazooNumberResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *GetKazooNumberResponse) UnmarshalBinary(b []byte) error {
var res GetKazooNumberResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// GetKazooNumberResponseDataItems0 get kazoo number response data items0
//
// swagger:model GetKazooNumberResponseDataItems0
type GetKazooNumberResponseDataItems0 struct {
// number
// Example: +15183486324
Number string `json:"number,omitempty"`
// state
// Example: discovery
State string `json:"state,omitempty"`
}
// Validate validates this get kazoo number response data items0
func (m *GetKazooNumberResponseDataItems0) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this get kazoo number response data items0 based on context it is used
func (m *GetKazooNumberResponseDataItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *GetKazooNumberResponseDataItems0) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *GetKazooNumberResponseDataItems0) UnmarshalBinary(b []byte) error {
var res GetKazooNumberResponseDataItems0
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}