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

262 lines
7.7 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"
)
// PostEndpointsReader is a Reader for the PostEndpoints structure.
type PostEndpointsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PostEndpointsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPostEndpointsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPostEndpointsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPostEndpointsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPostEndpointsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPostEndpointsUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPostEndpointsInternalServerError()
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())
}
}
// NewPostEndpointsOK creates a PostEndpointsOK with default headers values
func NewPostEndpointsOK() *PostEndpointsOK {
return &PostEndpointsOK{}
}
/* PostEndpointsOK describes a response with status code 200, with default header values.
Telnexus Response with an array of PBX objects
*/
type PostEndpointsOK struct {
Payload *voip_models.EndpointResponse
}
func (o *PostEndpointsOK) Error() string {
return fmt.Sprintf("[POST /endpoints][%d] postEndpointsOK %+v", 200, o.Payload)
}
func (o *PostEndpointsOK) GetPayload() *voip_models.EndpointResponse {
return o.Payload
}
func (o *PostEndpointsOK) 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
}
// NewPostEndpointsUnauthorized creates a PostEndpointsUnauthorized with default headers values
func NewPostEndpointsUnauthorized() *PostEndpointsUnauthorized {
return &PostEndpointsUnauthorized{}
}
/* PostEndpointsUnauthorized describes a response with status code 401, with default header values.
Access Unauthorized, invalid API-KEY was used
*/
type PostEndpointsUnauthorized struct {
Payload *voip_models.Error
}
func (o *PostEndpointsUnauthorized) Error() string {
return fmt.Sprintf("[POST /endpoints][%d] postEndpointsUnauthorized %+v", 401, o.Payload)
}
func (o *PostEndpointsUnauthorized) GetPayload() *voip_models.Error {
return o.Payload
}
func (o *PostEndpointsUnauthorized) 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
}
// NewPostEndpointsForbidden creates a PostEndpointsForbidden with default headers values
func NewPostEndpointsForbidden() *PostEndpointsForbidden {
return &PostEndpointsForbidden{}
}
/* PostEndpointsForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type PostEndpointsForbidden struct {
Payload *voip_models.Error
}
func (o *PostEndpointsForbidden) Error() string {
return fmt.Sprintf("[POST /endpoints][%d] postEndpointsForbidden %+v", 403, o.Payload)
}
func (o *PostEndpointsForbidden) GetPayload() *voip_models.Error {
return o.Payload
}
func (o *PostEndpointsForbidden) 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
}
// NewPostEndpointsNotFound creates a PostEndpointsNotFound with default headers values
func NewPostEndpointsNotFound() *PostEndpointsNotFound {
return &PostEndpointsNotFound{}
}
/* PostEndpointsNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PostEndpointsNotFound struct {
Payload *voip_models.Error
}
func (o *PostEndpointsNotFound) Error() string {
return fmt.Sprintf("[POST /endpoints][%d] postEndpointsNotFound %+v", 404, o.Payload)
}
func (o *PostEndpointsNotFound) GetPayload() *voip_models.Error {
return o.Payload
}
func (o *PostEndpointsNotFound) 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
}
// NewPostEndpointsUnprocessableEntity creates a PostEndpointsUnprocessableEntity with default headers values
func NewPostEndpointsUnprocessableEntity() *PostEndpointsUnprocessableEntity {
return &PostEndpointsUnprocessableEntity{}
}
/* PostEndpointsUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PostEndpointsUnprocessableEntity struct {
Payload *voip_models.Error
}
func (o *PostEndpointsUnprocessableEntity) Error() string {
return fmt.Sprintf("[POST /endpoints][%d] postEndpointsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostEndpointsUnprocessableEntity) GetPayload() *voip_models.Error {
return o.Payload
}
func (o *PostEndpointsUnprocessableEntity) 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
}
// NewPostEndpointsInternalServerError creates a PostEndpointsInternalServerError with default headers values
func NewPostEndpointsInternalServerError() *PostEndpointsInternalServerError {
return &PostEndpointsInternalServerError{}
}
/* PostEndpointsInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PostEndpointsInternalServerError struct {
Payload *voip_models.Error
}
func (o *PostEndpointsInternalServerError) Error() string {
return fmt.Sprintf("[POST /endpoints][%d] postEndpointsInternalServerError %+v", 500, o.Payload)
}
func (o *PostEndpointsInternalServerError) GetPayload() *voip_models.Error {
return o.Payload
}
func (o *PostEndpointsInternalServerError) 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
}