lib/api/ops/ops_client/tax/post_taxes_quotes_responses.go

304 lines
8.7 KiB
Go
Raw Normal View History

2021-01-08 17:40:28 +00:00
// Code generated by go-swagger; DO NOT EDIT.
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package tax
// 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"
"github.com/taxnexus/go/lib/api/ops/ops_models"
)
// PostTaxesQuotesReader is a Reader for the PostTaxesQuotes structure.
type PostTaxesQuotesReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PostTaxesQuotesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPostTaxesQuotesOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPostTaxesQuotesUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPostTaxesQuotesForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPostTaxesQuotesNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPostTaxesQuotesUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPostTaxesQuotesInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("unknown error", response, response.Code())
}
}
// NewPostTaxesQuotesOK creates a PostTaxesQuotesOK with default headers values
func NewPostTaxesQuotesOK() *PostTaxesQuotesOK {
return &PostTaxesQuotesOK{}
}
/*PostTaxesQuotesOK handles this case with default header values.
Taxnexus Response with Tax Transaction Objects
*/
type PostTaxesQuotesOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload *ops_models.TaxTransactionResponse
}
func (o *PostTaxesQuotesOK) Error() string {
return fmt.Sprintf("[POST /taxes/quotes][%d] postTaxesQuotesOK %+v", 200, o.Payload)
}
func (o *PostTaxesQuotesOK) GetPayload() *ops_models.TaxTransactionResponse {
return o.Payload
}
func (o *PostTaxesQuotesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response header Access-Control-Allow-Origin
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
// response header Cache-Control
o.CacheControl = response.GetHeader("Cache-Control")
o.Payload = new(ops_models.TaxTransactionResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostTaxesQuotesUnauthorized creates a PostTaxesQuotesUnauthorized with default headers values
func NewPostTaxesQuotesUnauthorized() *PostTaxesQuotesUnauthorized {
return &PostTaxesQuotesUnauthorized{}
}
/*PostTaxesQuotesUnauthorized handles this case with default header values.
Access unauthorized, invalid API-KEY was used
*/
type PostTaxesQuotesUnauthorized struct {
AccessControlAllowOrigin string
Payload *ops_models.Error
}
func (o *PostTaxesQuotesUnauthorized) Error() string {
return fmt.Sprintf("[POST /taxes/quotes][%d] postTaxesQuotesUnauthorized %+v", 401, o.Payload)
}
func (o *PostTaxesQuotesUnauthorized) GetPayload() *ops_models.Error {
return o.Payload
}
func (o *PostTaxesQuotesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response header Access-Control-Allow-Origin
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
o.Payload = new(ops_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostTaxesQuotesForbidden creates a PostTaxesQuotesForbidden with default headers values
func NewPostTaxesQuotesForbidden() *PostTaxesQuotesForbidden {
return &PostTaxesQuotesForbidden{}
}
/*PostTaxesQuotesForbidden handles this case with default header values.
Access forbidden, account lacks access
*/
type PostTaxesQuotesForbidden struct {
AccessControlAllowOrigin string
Payload *ops_models.Error
}
func (o *PostTaxesQuotesForbidden) Error() string {
return fmt.Sprintf("[POST /taxes/quotes][%d] postTaxesQuotesForbidden %+v", 403, o.Payload)
}
func (o *PostTaxesQuotesForbidden) GetPayload() *ops_models.Error {
return o.Payload
}
func (o *PostTaxesQuotesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response header Access-Control-Allow-Origin
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
o.Payload = new(ops_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostTaxesQuotesNotFound creates a PostTaxesQuotesNotFound with default headers values
func NewPostTaxesQuotesNotFound() *PostTaxesQuotesNotFound {
return &PostTaxesQuotesNotFound{}
}
/*PostTaxesQuotesNotFound handles this case with default header values.
Resource was not found
*/
type PostTaxesQuotesNotFound struct {
AccessControlAllowOrigin string
Payload *ops_models.Error
}
func (o *PostTaxesQuotesNotFound) Error() string {
return fmt.Sprintf("[POST /taxes/quotes][%d] postTaxesQuotesNotFound %+v", 404, o.Payload)
}
func (o *PostTaxesQuotesNotFound) GetPayload() *ops_models.Error {
return o.Payload
}
func (o *PostTaxesQuotesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response header Access-Control-Allow-Origin
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
o.Payload = new(ops_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostTaxesQuotesUnprocessableEntity creates a PostTaxesQuotesUnprocessableEntity with default headers values
func NewPostTaxesQuotesUnprocessableEntity() *PostTaxesQuotesUnprocessableEntity {
return &PostTaxesQuotesUnprocessableEntity{}
}
/*PostTaxesQuotesUnprocessableEntity handles this case with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PostTaxesQuotesUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *ops_models.Error
}
func (o *PostTaxesQuotesUnprocessableEntity) Error() string {
return fmt.Sprintf("[POST /taxes/quotes][%d] postTaxesQuotesUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostTaxesQuotesUnprocessableEntity) GetPayload() *ops_models.Error {
return o.Payload
}
func (o *PostTaxesQuotesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response header Access-Control-Allow-Origin
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
o.Payload = new(ops_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostTaxesQuotesInternalServerError creates a PostTaxesQuotesInternalServerError with default headers values
func NewPostTaxesQuotesInternalServerError() *PostTaxesQuotesInternalServerError {
return &PostTaxesQuotesInternalServerError{}
}
/*PostTaxesQuotesInternalServerError handles this case with default header values.
Server Internal Error
*/
type PostTaxesQuotesInternalServerError struct {
AccessControlAllowOrigin string
Payload *ops_models.Error
}
func (o *PostTaxesQuotesInternalServerError) Error() string {
return fmt.Sprintf("[POST /taxes/quotes][%d] postTaxesQuotesInternalServerError %+v", 500, o.Payload)
}
func (o *PostTaxesQuotesInternalServerError) GetPayload() *ops_models.Error {
return o.Payload
}
func (o *PostTaxesQuotesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response header Access-Control-Allow-Origin
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
o.Payload = new(ops_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}