lib/api/kazoo/kazoo_models/get_device_response.go

210 lines
4.7 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"
)
// GetDeviceResponse get device response
//
// swagger:model GetDeviceResponse
type GetDeviceResponse struct {
// auth token
AuthToken string `json:"auth_token,omitempty"`
// data
Data []*GetDeviceResponseDataItems0 `json:"data"`
// node
// Example: dqZFtHthbelyE8MI6vU-LA
Node string `json:"node,omitempty"`
// page size
// Example: 4
PageSize float64 `json:"page_size,omitempty"`
// request id
// Example: 29c9cccc07016866243a9dbd9481c88a
RequestID string `json:"request_id,omitempty"`
// revision
// Example: 794a8debed3fca4330ba2373cd703773
Revision string `json:"revision,omitempty"`
// status
// Example: success
Status string `json:"status,omitempty"`
// timestamp
// Example: 2020-05-07T01:20:21Z
Timestamp string `json:"timestamp,omitempty"`
// version
// Example: 4.3.103
Version string `json:"version,omitempty"`
}
// Validate validates this get device response
func (m *GetDeviceResponse) 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 *GetDeviceResponse) 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 device response based on the context it is used
func (m *GetDeviceResponse) 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 *GetDeviceResponse) 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 *GetDeviceResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *GetDeviceResponse) UnmarshalBinary(b []byte) error {
var res GetDeviceResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// GetDeviceResponseDataItems0 get device response data items0
//
// swagger:model GetDeviceResponseDataItems0
type GetDeviceResponseDataItems0 struct {
// device type
// Example: softphone
DeviceType string `json:"device_type,omitempty"`
// enabled
// Example: true
Enabled bool `json:"enabled,omitempty"`
// id
// Example: f9627ff1bcca2d112931ee00dcfdb0c6
ID string `json:"id,omitempty"`
// mac address
// Example: string
MacAddress string `json:"mac_address,omitempty"`
// name
// Example: 2007 - Vern iPhone Personal
Name string `json:"name,omitempty"`
// owner id
// Example: c0a881b0dfbc7fc574cb67dcaf10879f
OwnerID string `json:"owner_id,omitempty"`
// username
// Example: user_jaemid
Username string `json:"username,omitempty"`
}
// Validate validates this get device response data items0
func (m *GetDeviceResponseDataItems0) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this get device response data items0 based on context it is used
func (m *GetDeviceResponseDataItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *GetDeviceResponseDataItems0) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *GetDeviceResponseDataItems0) UnmarshalBinary(b []byte) error {
var res GetDeviceResponseDataItems0
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}