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

262 lines
7.7 KiB
Go
Raw Normal View History

2021-01-08 17:40:28 +00:00
// Code generated by go-swagger; DO NOT EDIT.
2021-01-19 16:58:40 +00:00
// All Code Copyright(c) 2018-2021 by Taxnexus, Inc.
2021-01-08 17:40:28 +00:00
// 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"
2021-01-10 17:03:26 +00:00
"code.tnxs.net/taxnexus/lib/api/sf-gate/sf_gate_models"
2021-01-08 17:40:28 +00:00
)
// 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:
2021-02-09 16:56:57 +00:00
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
2021-01-08 17:40:28 +00:00
}
}
// NewPostServicesOK creates a PostServicesOK with default headers values
func NewPostServicesOK() *PostServicesOK {
return &PostServicesOK{}
}
2021-02-09 16:56:57 +00:00
/* PostServicesOK describes a response with status code 200, with default header values.
2021-01-08 17:40:28 +00:00
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{}
}
2021-02-09 16:56:57 +00:00
/* PostServicesUnauthorized describes a response with status code 401, with default header values.
2021-01-08 17:40:28 +00:00
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{}
}
2021-02-09 16:56:57 +00:00
/* PostServicesForbidden describes a response with status code 403, with default header values.
2021-01-08 17:40:28 +00:00
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{}
}
2021-02-09 16:56:57 +00:00
/* PostServicesNotFound describes a response with status code 404, with default header values.
2021-01-08 17:40:28 +00:00
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{}
}
2021-02-09 16:56:57 +00:00
/* PostServicesUnprocessableEntity describes a response with status code 422, with default header values.
2021-01-08 17:40:28 +00:00
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{}
}
2021-02-09 16:56:57 +00:00
/* PostServicesInternalServerError describes a response with status code 500, with default header values.
2021-01-08 17:40:28 +00:00
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
}