lib/api/kazoo/kazoo_client/device/get_account_devices_respons...

148 lines
4.4 KiB
Go
Raw Permalink 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 device
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"code.tnxs.net/telnexus/lib/api/kazoo/kazoo_models"
)
// GetAccountDevicesReader is a Reader for the GetAccountDevices structure.
type GetAccountDevicesReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetAccountDevicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetAccountDevicesOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetAccountDevicesUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetAccountDevicesNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewGetAccountDevicesOK creates a GetAccountDevicesOK with default headers values
func NewGetAccountDevicesOK() *GetAccountDevicesOK {
return &GetAccountDevicesOK{}
}
/* GetAccountDevicesOK describes a response with status code 200, with default header values.
Kazoo response
*/
type GetAccountDevicesOK struct {
Payload *kazoo_models.GetDeviceResponse
}
func (o *GetAccountDevicesOK) Error() string {
return fmt.Sprintf("[GET /accounts/{accountId}/devices][%d] getAccountDevicesOK %+v", 200, o.Payload)
}
func (o *GetAccountDevicesOK) GetPayload() *kazoo_models.GetDeviceResponse {
return o.Payload
}
func (o *GetAccountDevicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(kazoo_models.GetDeviceResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetAccountDevicesUnauthorized creates a GetAccountDevicesUnauthorized with default headers values
func NewGetAccountDevicesUnauthorized() *GetAccountDevicesUnauthorized {
return &GetAccountDevicesUnauthorized{}
}
/* GetAccountDevicesUnauthorized describes a response with status code 401, with default header values.
Access Unauthorized, invalid API-KEY was used
*/
type GetAccountDevicesUnauthorized struct {
Payload *kazoo_models.Error
}
func (o *GetAccountDevicesUnauthorized) Error() string {
return fmt.Sprintf("[GET /accounts/{accountId}/devices][%d] getAccountDevicesUnauthorized %+v", 401, o.Payload)
}
func (o *GetAccountDevicesUnauthorized) GetPayload() *kazoo_models.Error {
return o.Payload
}
func (o *GetAccountDevicesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(kazoo_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetAccountDevicesNotFound creates a GetAccountDevicesNotFound with default headers values
func NewGetAccountDevicesNotFound() *GetAccountDevicesNotFound {
return &GetAccountDevicesNotFound{}
}
/* GetAccountDevicesNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type GetAccountDevicesNotFound struct {
Payload *kazoo_models.Error
}
func (o *GetAccountDevicesNotFound) Error() string {
return fmt.Sprintf("[GET /accounts/{accountId}/devices][%d] getAccountDevicesNotFound %+v", 404, o.Payload)
}
func (o *GetAccountDevicesNotFound) GetPayload() *kazoo_models.Error {
return o.Payload
}
func (o *GetAccountDevicesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(kazoo_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}