lib/api/sf-gate/sf_gate_client/services/post_services_responses.go

262 lines
7.7 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
// All Code Copyright(c) 2018-2021 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package services
// 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/taxnexus/lib/api/sf-gate/sf_gate_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.
Taxnexus Response with Service objects
*/
type PostServicesOK struct {
Payload *sf_gate_models.ServiceResponse
}
func (o *PostServicesOK) Error() string {
return fmt.Sprintf("[POST /services][%d] postServicesOK %+v", 200, o.Payload)
}
func (o *PostServicesOK) GetPayload() *sf_gate_models.ServiceResponse {
return o.Payload
}
func (o *PostServicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sf_gate_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 {
Payload *sf_gate_models.Error
}
func (o *PostServicesUnauthorized) Error() string {
return fmt.Sprintf("[POST /services][%d] postServicesUnauthorized %+v", 401, o.Payload)
}
func (o *PostServicesUnauthorized) GetPayload() *sf_gate_models.Error {
return o.Payload
}
func (o *PostServicesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sf_gate_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 {
Payload *sf_gate_models.Error
}
func (o *PostServicesForbidden) Error() string {
return fmt.Sprintf("[POST /services][%d] postServicesForbidden %+v", 403, o.Payload)
}
func (o *PostServicesForbidden) GetPayload() *sf_gate_models.Error {
return o.Payload
}
func (o *PostServicesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sf_gate_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 {
Payload *sf_gate_models.Error
}
func (o *PostServicesNotFound) Error() string {
return fmt.Sprintf("[POST /services][%d] postServicesNotFound %+v", 404, o.Payload)
}
func (o *PostServicesNotFound) GetPayload() *sf_gate_models.Error {
return o.Payload
}
func (o *PostServicesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sf_gate_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 {
Payload *sf_gate_models.Error
}
func (o *PostServicesUnprocessableEntity) Error() string {
return fmt.Sprintf("[POST /services][%d] postServicesUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostServicesUnprocessableEntity) GetPayload() *sf_gate_models.Error {
return o.Payload
}
func (o *PostServicesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sf_gate_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 {
Payload *sf_gate_models.Error
}
func (o *PostServicesInternalServerError) Error() string {
return fmt.Sprintf("[POST /services][%d] postServicesInternalServerError %+v", 500, o.Payload)
}
func (o *PostServicesInternalServerError) GetPayload() *sf_gate_models.Error {
return o.Payload
}
func (o *PostServicesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sf_gate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}