lib/api/devops/devops_client/service/post_services_responses.go

340 lines
9.8 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 service
// 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/devops/devops_models"
)
// PostServicesReader is a Reader for the PostServices structure.
type PostServicesReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PostServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPostServicesOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPostServicesUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPostServicesForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPostServicesNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPostServicesUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPostServicesInternalServerError()
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())
}
}
// NewPostServicesOK creates a PostServicesOK with default headers values
func NewPostServicesOK() *PostServicesOK {
return &PostServicesOK{}
}
/* PostServicesOK describes a response with status code 200, with default header values.
Telnexus Response with Service objects
*/
type PostServicesOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload *devops_models.ServiceResponse
}
func (o *PostServicesOK) Error() string {
return fmt.Sprintf("[POST /services][%d] postServicesOK %+v", 200, o.Payload)
}
func (o *PostServicesOK) GetPayload() *devops_models.ServiceResponse {
return o.Payload
}
func (o *PostServicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
// hydrates response header Cache-Control
hdrCacheControl := response.GetHeader("Cache-Control")
if hdrCacheControl != "" {
o.CacheControl = hdrCacheControl
}
o.Payload = new(devops_models.ServiceResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostServicesUnauthorized creates a PostServicesUnauthorized with default headers values
func NewPostServicesUnauthorized() *PostServicesUnauthorized {
return &PostServicesUnauthorized{}
}
/* PostServicesUnauthorized describes a response with status code 401, with default header values.
Access Unauthorized, invalid API-KEY was used
*/
type PostServicesUnauthorized struct {
AccessControlAllowOrigin string
CacheControl string
Payload *devops_models.Error
}
func (o *PostServicesUnauthorized) Error() string {
return fmt.Sprintf("[POST /services][%d] postServicesUnauthorized %+v", 401, o.Payload)
}
func (o *PostServicesUnauthorized) GetPayload() *devops_models.Error {
return o.Payload
}
func (o *PostServicesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
// hydrates response header Cache-Control
hdrCacheControl := response.GetHeader("Cache-Control")
if hdrCacheControl != "" {
o.CacheControl = hdrCacheControl
}
o.Payload = new(devops_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostServicesForbidden creates a PostServicesForbidden with default headers values
func NewPostServicesForbidden() *PostServicesForbidden {
return &PostServicesForbidden{}
}
/* PostServicesForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type PostServicesForbidden struct {
AccessControlAllowOrigin string
Payload *devops_models.Error
}
func (o *PostServicesForbidden) Error() string {
return fmt.Sprintf("[POST /services][%d] postServicesForbidden %+v", 403, o.Payload)
}
func (o *PostServicesForbidden) GetPayload() *devops_models.Error {
return o.Payload
}
func (o *PostServicesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(devops_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostServicesNotFound creates a PostServicesNotFound with default headers values
func NewPostServicesNotFound() *PostServicesNotFound {
return &PostServicesNotFound{}
}
/* PostServicesNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PostServicesNotFound struct {
AccessControlAllowOrigin string
Payload *devops_models.Error
}
func (o *PostServicesNotFound) Error() string {
return fmt.Sprintf("[POST /services][%d] postServicesNotFound %+v", 404, o.Payload)
}
func (o *PostServicesNotFound) GetPayload() *devops_models.Error {
return o.Payload
}
func (o *PostServicesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(devops_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostServicesUnprocessableEntity creates a PostServicesUnprocessableEntity with default headers values
func NewPostServicesUnprocessableEntity() *PostServicesUnprocessableEntity {
return &PostServicesUnprocessableEntity{}
}
/* PostServicesUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PostServicesUnprocessableEntity struct {
AccessControlAllowOrigin string
CacheControl string
Payload *devops_models.Error
}
func (o *PostServicesUnprocessableEntity) Error() string {
return fmt.Sprintf("[POST /services][%d] postServicesUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostServicesUnprocessableEntity) GetPayload() *devops_models.Error {
return o.Payload
}
func (o *PostServicesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
// hydrates response header Cache-Control
hdrCacheControl := response.GetHeader("Cache-Control")
if hdrCacheControl != "" {
o.CacheControl = hdrCacheControl
}
o.Payload = new(devops_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostServicesInternalServerError creates a PostServicesInternalServerError with default headers values
func NewPostServicesInternalServerError() *PostServicesInternalServerError {
return &PostServicesInternalServerError{}
}
/* PostServicesInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PostServicesInternalServerError struct {
AccessControlAllowOrigin string
Payload *devops_models.Error
}
func (o *PostServicesInternalServerError) Error() string {
return fmt.Sprintf("[POST /services][%d] postServicesInternalServerError %+v", 500, o.Payload)
}
func (o *PostServicesInternalServerError) GetPayload() *devops_models.Error {
return o.Payload
}
func (o *PostServicesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(devops_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}