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

316 lines
9.3 KiB
Go
Raw Permalink 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 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"
2021-01-10 17:03:26 +00:00
"code.tnxs.net/taxnexus/lib/api/ops/ops_models"
2021-01-08 17:40:28 +00:00
)
// 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:
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
}
}
// NewDeleteInvoiceOK creates a DeleteInvoiceOK with default headers values
func NewDeleteInvoiceOK() *DeleteInvoiceOK {
return &DeleteInvoiceOK{}
}
2021-02-09 16:56:57 +00:00
/* DeleteInvoiceOK describes a response with status code 200, with default header values.
2021-01-08 17:40:28 +00:00
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 {
2021-02-09 16:56:57 +00:00
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
2021-01-08 17:40:28 +00:00
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{}
}
2021-02-09 16:56:57 +00:00
/* DeleteInvoiceUnauthorized 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 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 {
2021-02-09 16:56:57 +00:00
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
2021-01-08 17:40:28 +00:00
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{}
}
2021-02-09 16:56:57 +00:00
/* DeleteInvoiceForbidden 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 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 {
2021-02-09 16:56:57 +00:00
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
2021-01-08 17:40:28 +00:00
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{}
}
2021-02-09 16:56:57 +00:00
/* DeleteInvoiceNotFound describes a response with status code 404, with default header values.
2021-01-08 17:40:28 +00:00
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 {
2021-02-09 16:56:57 +00:00
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
2021-01-08 17:40:28 +00:00
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{}
}
2021-02-09 16:56:57 +00:00
/* DeleteInvoiceUnprocessableEntity 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 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 {
2021-02-09 16:56:57 +00:00
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
2021-01-08 17:40:28 +00:00
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{}
}
2021-02-09 16:56:57 +00:00
/* DeleteInvoiceInternalServerError describes a response with status code 500, with default header values.
2021-01-08 17:40:28 +00:00
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 {
2021-02-09 16:56:57 +00:00
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
2021-01-08 17:40:28 +00:00
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
}