lib/api/ops/ops_client/invoice/delete_invoice_responses.go

316 lines
9.3 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 invoice
// 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/ops/ops_models"
)
// DeleteInvoiceReader is a Reader for the DeleteInvoice structure.
type DeleteInvoiceReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *DeleteInvoiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewDeleteInvoiceOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewDeleteInvoiceUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewDeleteInvoiceForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewDeleteInvoiceNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewDeleteInvoiceUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewDeleteInvoiceInternalServerError()
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())
}
}
// NewDeleteInvoiceOK creates a DeleteInvoiceOK with default headers values
func NewDeleteInvoiceOK() *DeleteInvoiceOK {
return &DeleteInvoiceOK{}
}
/* DeleteInvoiceOK describes a response with status code 200, with default header values.
Taxnexus Response with Message Objects with Delete Status
*/
type DeleteInvoiceOK struct {
AccessControlAllowOrigin string
Payload *ops_models.DeleteResponse
}
func (o *DeleteInvoiceOK) Error() string {
return fmt.Sprintf("[DELETE /invoices][%d] deleteInvoiceOK %+v", 200, o.Payload)
}
func (o *DeleteInvoiceOK) GetPayload() *ops_models.DeleteResponse {
return o.Payload
}
func (o *DeleteInvoiceOK) 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(ops_models.DeleteResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewDeleteInvoiceUnauthorized creates a DeleteInvoiceUnauthorized with default headers values
func NewDeleteInvoiceUnauthorized() *DeleteInvoiceUnauthorized {
return &DeleteInvoiceUnauthorized{}
}
/* DeleteInvoiceUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type DeleteInvoiceUnauthorized struct {
AccessControlAllowOrigin string
Payload *ops_models.Error
}
func (o *DeleteInvoiceUnauthorized) Error() string {
return fmt.Sprintf("[DELETE /invoices][%d] deleteInvoiceUnauthorized %+v", 401, o.Payload)
}
func (o *DeleteInvoiceUnauthorized) GetPayload() *ops_models.Error {
return o.Payload
}
func (o *DeleteInvoiceUnauthorized) 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(ops_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewDeleteInvoiceForbidden creates a DeleteInvoiceForbidden with default headers values
func NewDeleteInvoiceForbidden() *DeleteInvoiceForbidden {
return &DeleteInvoiceForbidden{}
}
/* DeleteInvoiceForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type DeleteInvoiceForbidden struct {
AccessControlAllowOrigin string
Payload *ops_models.Error
}
func (o *DeleteInvoiceForbidden) Error() string {
return fmt.Sprintf("[DELETE /invoices][%d] deleteInvoiceForbidden %+v", 403, o.Payload)
}
func (o *DeleteInvoiceForbidden) GetPayload() *ops_models.Error {
return o.Payload
}
func (o *DeleteInvoiceForbidden) 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(ops_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewDeleteInvoiceNotFound creates a DeleteInvoiceNotFound with default headers values
func NewDeleteInvoiceNotFound() *DeleteInvoiceNotFound {
return &DeleteInvoiceNotFound{}
}
/* DeleteInvoiceNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type DeleteInvoiceNotFound struct {
AccessControlAllowOrigin string
Payload *ops_models.Error
}
func (o *DeleteInvoiceNotFound) Error() string {
return fmt.Sprintf("[DELETE /invoices][%d] deleteInvoiceNotFound %+v", 404, o.Payload)
}
func (o *DeleteInvoiceNotFound) GetPayload() *ops_models.Error {
return o.Payload
}
func (o *DeleteInvoiceNotFound) 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(ops_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewDeleteInvoiceUnprocessableEntity creates a DeleteInvoiceUnprocessableEntity with default headers values
func NewDeleteInvoiceUnprocessableEntity() *DeleteInvoiceUnprocessableEntity {
return &DeleteInvoiceUnprocessableEntity{}
}
/* DeleteInvoiceUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type DeleteInvoiceUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *ops_models.Error
}
func (o *DeleteInvoiceUnprocessableEntity) Error() string {
return fmt.Sprintf("[DELETE /invoices][%d] deleteInvoiceUnprocessableEntity %+v", 422, o.Payload)
}
func (o *DeleteInvoiceUnprocessableEntity) GetPayload() *ops_models.Error {
return o.Payload
}
func (o *DeleteInvoiceUnprocessableEntity) 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(ops_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewDeleteInvoiceInternalServerError creates a DeleteInvoiceInternalServerError with default headers values
func NewDeleteInvoiceInternalServerError() *DeleteInvoiceInternalServerError {
return &DeleteInvoiceInternalServerError{}
}
/* DeleteInvoiceInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type DeleteInvoiceInternalServerError struct {
AccessControlAllowOrigin string
Payload *ops_models.Error
}
func (o *DeleteInvoiceInternalServerError) Error() string {
return fmt.Sprintf("[DELETE /invoices][%d] deleteInvoiceInternalServerError %+v", 500, o.Payload)
}
func (o *DeleteInvoiceInternalServerError) GetPayload() *ops_models.Error {
return o.Payload
}
func (o *DeleteInvoiceInternalServerError) 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(ops_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}