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"
2021-08-01 00:08:25 +00:00
"code.tnxs.net/vernonkeenan/lib/api/voip/voip_models"
2021-07-31 03:05:02 +00:00
)
// PutEndpointsReader is a Reader for the PutEndpoints structure.
type PutEndpointsReader struct {
formats strfmt . Registry
}
// ReadResponse reads a server response into the received o.
func ( o * PutEndpointsReader ) ReadResponse ( response runtime . ClientResponse , consumer runtime . Consumer ) ( interface { } , error ) {
switch response . Code ( ) {
case 200 :
result := NewPutEndpointsOK ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return result , nil
case 401 :
result := NewPutEndpointsUnauthorized ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return nil , result
case 403 :
result := NewPutEndpointsForbidden ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return nil , result
case 404 :
result := NewPutEndpointsNotFound ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return nil , result
case 422 :
result := NewPutEndpointsUnprocessableEntity ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return nil , result
case 500 :
result := NewPutEndpointsInternalServerError ( )
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 ( ) )
}
}
// NewPutEndpointsOK creates a PutEndpointsOK with default headers values
func NewPutEndpointsOK ( ) * PutEndpointsOK {
return & PutEndpointsOK { }
}
/ * PutEndpointsOK describes a response with status code 200 , with default header values .
Telnexus Response with an array of PBX objects
* /
type PutEndpointsOK struct {
Payload * voip_models . EndpointResponse
}
func ( o * PutEndpointsOK ) Error ( ) string {
return fmt . Sprintf ( "[PUT /endpoints][%d] putEndpointsOK %+v" , 200 , o . Payload )
}
func ( o * PutEndpointsOK ) GetPayload ( ) * voip_models . EndpointResponse {
return o . Payload
}
func ( o * PutEndpointsOK ) 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
}
// NewPutEndpointsUnauthorized creates a PutEndpointsUnauthorized with default headers values
func NewPutEndpointsUnauthorized ( ) * PutEndpointsUnauthorized {
return & PutEndpointsUnauthorized { }
}
/ * PutEndpointsUnauthorized describes a response with status code 401 , with default header values .
Access Unauthorized , invalid API - KEY was used
* /
type PutEndpointsUnauthorized struct {
Payload * voip_models . Error
}
func ( o * PutEndpointsUnauthorized ) Error ( ) string {
return fmt . Sprintf ( "[PUT /endpoints][%d] putEndpointsUnauthorized %+v" , 401 , o . Payload )
}
func ( o * PutEndpointsUnauthorized ) GetPayload ( ) * voip_models . Error {
return o . Payload
}
func ( o * PutEndpointsUnauthorized ) 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
}
// NewPutEndpointsForbidden creates a PutEndpointsForbidden with default headers values
func NewPutEndpointsForbidden ( ) * PutEndpointsForbidden {
return & PutEndpointsForbidden { }
}
/ * PutEndpointsForbidden describes a response with status code 403 , with default header values .
Access forbidden , account lacks access
* /
type PutEndpointsForbidden struct {
Payload * voip_models . Error
}
func ( o * PutEndpointsForbidden ) Error ( ) string {
return fmt . Sprintf ( "[PUT /endpoints][%d] putEndpointsForbidden %+v" , 403 , o . Payload )
}
func ( o * PutEndpointsForbidden ) GetPayload ( ) * voip_models . Error {
return o . Payload
}
func ( o * PutEndpointsForbidden ) 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
}
// NewPutEndpointsNotFound creates a PutEndpointsNotFound with default headers values
func NewPutEndpointsNotFound ( ) * PutEndpointsNotFound {
return & PutEndpointsNotFound { }
}
/ * PutEndpointsNotFound describes a response with status code 404 , with default header values .
Resource was not found
* /
type PutEndpointsNotFound struct {
Payload * voip_models . Error
}
func ( o * PutEndpointsNotFound ) Error ( ) string {
return fmt . Sprintf ( "[PUT /endpoints][%d] putEndpointsNotFound %+v" , 404 , o . Payload )
}
func ( o * PutEndpointsNotFound ) GetPayload ( ) * voip_models . Error {
return o . Payload
}
func ( o * PutEndpointsNotFound ) 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
}
// NewPutEndpointsUnprocessableEntity creates a PutEndpointsUnprocessableEntity with default headers values
func NewPutEndpointsUnprocessableEntity ( ) * PutEndpointsUnprocessableEntity {
return & PutEndpointsUnprocessableEntity { }
}
/ * PutEndpointsUnprocessableEntity describes a response with status code 422 , with default header values .
Unprocessable Entity , likely a bad parameter
* /
type PutEndpointsUnprocessableEntity struct {
Payload * voip_models . Error
}
func ( o * PutEndpointsUnprocessableEntity ) Error ( ) string {
return fmt . Sprintf ( "[PUT /endpoints][%d] putEndpointsUnprocessableEntity %+v" , 422 , o . Payload )
}
func ( o * PutEndpointsUnprocessableEntity ) GetPayload ( ) * voip_models . Error {
return o . Payload
}
func ( o * PutEndpointsUnprocessableEntity ) 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
}
// NewPutEndpointsInternalServerError creates a PutEndpointsInternalServerError with default headers values
func NewPutEndpointsInternalServerError ( ) * PutEndpointsInternalServerError {
return & PutEndpointsInternalServerError { }
}
/ * PutEndpointsInternalServerError describes a response with status code 500 , with default header values .
Server Internal Error
* /
type PutEndpointsInternalServerError struct {
Payload * voip_models . Error
}
func ( o * PutEndpointsInternalServerError ) Error ( ) string {
return fmt . Sprintf ( "[PUT /endpoints][%d] putEndpointsInternalServerError %+v" , 500 , o . Payload )
}
func ( o * PutEndpointsInternalServerError ) GetPayload ( ) * voip_models . Error {
return o . Payload
}
func ( o * PutEndpointsInternalServerError ) 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
}