lib/api/voip/voip_client/endpoint/get_endpoints_responses.go

262 lines
7.6 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 endpoint
// 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/voip/voip_models"
)
// GetEndpointsReader is a Reader for the GetEndpoints structure.
type GetEndpointsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetEndpointsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetEndpointsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetEndpointsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetEndpointsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetEndpointsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetEndpointsUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetEndpointsInternalServerError()
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())
}
}
// NewGetEndpointsOK creates a GetEndpointsOK with default headers values
func NewGetEndpointsOK() *GetEndpointsOK {
return &GetEndpointsOK{}
}
/* GetEndpointsOK describes a response with status code 200, with default header values.
Telnexus Response with an array of PBX objects
*/
type GetEndpointsOK struct {
Payload *voip_models.EndpointResponse
}
func (o *GetEndpointsOK) Error() string {
return fmt.Sprintf("[GET /endpoints][%d] getEndpointsOK %+v", 200, o.Payload)
}
func (o *GetEndpointsOK) GetPayload() *voip_models.EndpointResponse {
return o.Payload
}
func (o *GetEndpointsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(voip_models.EndpointResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetEndpointsUnauthorized creates a GetEndpointsUnauthorized with default headers values
func NewGetEndpointsUnauthorized() *GetEndpointsUnauthorized {
return &GetEndpointsUnauthorized{}
}
/* GetEndpointsUnauthorized describes a response with status code 401, with default header values.
Access Unauthorized, invalid API-KEY was used
*/
type GetEndpointsUnauthorized struct {
Payload *voip_models.Error
}
func (o *GetEndpointsUnauthorized) Error() string {
return fmt.Sprintf("[GET /endpoints][%d] getEndpointsUnauthorized %+v", 401, o.Payload)
}
func (o *GetEndpointsUnauthorized) GetPayload() *voip_models.Error {
return o.Payload
}
func (o *GetEndpointsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(voip_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetEndpointsForbidden creates a GetEndpointsForbidden with default headers values
func NewGetEndpointsForbidden() *GetEndpointsForbidden {
return &GetEndpointsForbidden{}
}
/* GetEndpointsForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type GetEndpointsForbidden struct {
Payload *voip_models.Error
}
func (o *GetEndpointsForbidden) Error() string {
return fmt.Sprintf("[GET /endpoints][%d] getEndpointsForbidden %+v", 403, o.Payload)
}
func (o *GetEndpointsForbidden) GetPayload() *voip_models.Error {
return o.Payload
}
func (o *GetEndpointsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(voip_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetEndpointsNotFound creates a GetEndpointsNotFound with default headers values
func NewGetEndpointsNotFound() *GetEndpointsNotFound {
return &GetEndpointsNotFound{}
}
/* GetEndpointsNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type GetEndpointsNotFound struct {
Payload *voip_models.Error
}
func (o *GetEndpointsNotFound) Error() string {
return fmt.Sprintf("[GET /endpoints][%d] getEndpointsNotFound %+v", 404, o.Payload)
}
func (o *GetEndpointsNotFound) GetPayload() *voip_models.Error {
return o.Payload
}
func (o *GetEndpointsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(voip_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetEndpointsUnprocessableEntity creates a GetEndpointsUnprocessableEntity with default headers values
func NewGetEndpointsUnprocessableEntity() *GetEndpointsUnprocessableEntity {
return &GetEndpointsUnprocessableEntity{}
}
/* GetEndpointsUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetEndpointsUnprocessableEntity struct {
Payload *voip_models.Error
}
func (o *GetEndpointsUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /endpoints][%d] getEndpointsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetEndpointsUnprocessableEntity) GetPayload() *voip_models.Error {
return o.Payload
}
func (o *GetEndpointsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(voip_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetEndpointsInternalServerError creates a GetEndpointsInternalServerError with default headers values
func NewGetEndpointsInternalServerError() *GetEndpointsInternalServerError {
return &GetEndpointsInternalServerError{}
}
/* GetEndpointsInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type GetEndpointsInternalServerError struct {
Payload *voip_models.Error
}
func (o *GetEndpointsInternalServerError) Error() string {
return fmt.Sprintf("[GET /endpoints][%d] getEndpointsInternalServerError %+v", 500, o.Payload)
}
func (o *GetEndpointsInternalServerError) GetPayload() *voip_models.Error {
return o.Payload
}
func (o *GetEndpointsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(voip_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}