lib/api/voip/voip_client/queue/post_queues_responses.go

262 lines
7.4 KiB
Go

// 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 queue
// 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/vernonkeenan/lib/api/voip/voip_models"
)
// PostQueuesReader is a Reader for the PostQueues structure.
type PostQueuesReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PostQueuesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPostQueuesOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPostQueuesUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPostQueuesForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPostQueuesNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPostQueuesUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPostQueuesInternalServerError()
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())
}
}
// NewPostQueuesOK creates a PostQueuesOK with default headers values
func NewPostQueuesOK() *PostQueuesOK {
return &PostQueuesOK{}
}
/* PostQueuesOK describes a response with status code 200, with default header values.
Telnexus Response with an array of Queue objects
*/
type PostQueuesOK struct {
Payload *voip_models.QueueResponse
}
func (o *PostQueuesOK) Error() string {
return fmt.Sprintf("[POST /queues][%d] postQueuesOK %+v", 200, o.Payload)
}
func (o *PostQueuesOK) GetPayload() *voip_models.QueueResponse {
return o.Payload
}
func (o *PostQueuesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(voip_models.QueueResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostQueuesUnauthorized creates a PostQueuesUnauthorized with default headers values
func NewPostQueuesUnauthorized() *PostQueuesUnauthorized {
return &PostQueuesUnauthorized{}
}
/* PostQueuesUnauthorized describes a response with status code 401, with default header values.
Access Unauthorized, invalid API-KEY was used
*/
type PostQueuesUnauthorized struct {
Payload *voip_models.Error
}
func (o *PostQueuesUnauthorized) Error() string {
return fmt.Sprintf("[POST /queues][%d] postQueuesUnauthorized %+v", 401, o.Payload)
}
func (o *PostQueuesUnauthorized) GetPayload() *voip_models.Error {
return o.Payload
}
func (o *PostQueuesUnauthorized) 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
}
// NewPostQueuesForbidden creates a PostQueuesForbidden with default headers values
func NewPostQueuesForbidden() *PostQueuesForbidden {
return &PostQueuesForbidden{}
}
/* PostQueuesForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type PostQueuesForbidden struct {
Payload *voip_models.Error
}
func (o *PostQueuesForbidden) Error() string {
return fmt.Sprintf("[POST /queues][%d] postQueuesForbidden %+v", 403, o.Payload)
}
func (o *PostQueuesForbidden) GetPayload() *voip_models.Error {
return o.Payload
}
func (o *PostQueuesForbidden) 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
}
// NewPostQueuesNotFound creates a PostQueuesNotFound with default headers values
func NewPostQueuesNotFound() *PostQueuesNotFound {
return &PostQueuesNotFound{}
}
/* PostQueuesNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PostQueuesNotFound struct {
Payload *voip_models.Error
}
func (o *PostQueuesNotFound) Error() string {
return fmt.Sprintf("[POST /queues][%d] postQueuesNotFound %+v", 404, o.Payload)
}
func (o *PostQueuesNotFound) GetPayload() *voip_models.Error {
return o.Payload
}
func (o *PostQueuesNotFound) 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
}
// NewPostQueuesUnprocessableEntity creates a PostQueuesUnprocessableEntity with default headers values
func NewPostQueuesUnprocessableEntity() *PostQueuesUnprocessableEntity {
return &PostQueuesUnprocessableEntity{}
}
/* PostQueuesUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PostQueuesUnprocessableEntity struct {
Payload *voip_models.Error
}
func (o *PostQueuesUnprocessableEntity) Error() string {
return fmt.Sprintf("[POST /queues][%d] postQueuesUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostQueuesUnprocessableEntity) GetPayload() *voip_models.Error {
return o.Payload
}
func (o *PostQueuesUnprocessableEntity) 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
}
// NewPostQueuesInternalServerError creates a PostQueuesInternalServerError with default headers values
func NewPostQueuesInternalServerError() *PostQueuesInternalServerError {
return &PostQueuesInternalServerError{}
}
/* PostQueuesInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PostQueuesInternalServerError struct {
Payload *voip_models.Error
}
func (o *PostQueuesInternalServerError) Error() string {
return fmt.Sprintf("[POST /queues][%d] postQueuesInternalServerError %+v", 500, o.Payload)
}
func (o *PostQueuesInternalServerError) GetPayload() *voip_models.Error {
return o.Payload
}
func (o *PostQueuesInternalServerError) 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
}