lib/api/crm/crm_client/contracts/delete_contract_responses.go

316 lines
9.4 KiB
Go
Raw Permalink Normal View History

2022-05-28 19:45:41 +00:00
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package contracts
// 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/vernonkeenan/lib/api/crm/crm_models"
)
// DeleteContractReader is a Reader for the DeleteContract structure.
type DeleteContractReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *DeleteContractReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewDeleteContractOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewDeleteContractUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewDeleteContractForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewDeleteContractNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewDeleteContractUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewDeleteContractInternalServerError()
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())
}
}
// NewDeleteContractOK creates a DeleteContractOK with default headers values
func NewDeleteContractOK() *DeleteContractOK {
return &DeleteContractOK{}
}
/* DeleteContractOK describes a response with status code 200, with default header values.
Taxnexus Response with Message Objects with Delete Status
*/
type DeleteContractOK struct {
AccessControlAllowOrigin string
Payload *crm_models.DeleteResponse
}
func (o *DeleteContractOK) Error() string {
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractOK %+v", 200, o.Payload)
}
func (o *DeleteContractOK) GetPayload() *crm_models.DeleteResponse {
return o.Payload
}
func (o *DeleteContractOK) 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(crm_models.DeleteResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewDeleteContractUnauthorized creates a DeleteContractUnauthorized with default headers values
func NewDeleteContractUnauthorized() *DeleteContractUnauthorized {
return &DeleteContractUnauthorized{}
}
/* DeleteContractUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type DeleteContractUnauthorized struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *DeleteContractUnauthorized) Error() string {
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractUnauthorized %+v", 401, o.Payload)
}
func (o *DeleteContractUnauthorized) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *DeleteContractUnauthorized) 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(crm_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewDeleteContractForbidden creates a DeleteContractForbidden with default headers values
func NewDeleteContractForbidden() *DeleteContractForbidden {
return &DeleteContractForbidden{}
}
/* DeleteContractForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type DeleteContractForbidden struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *DeleteContractForbidden) Error() string {
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractForbidden %+v", 403, o.Payload)
}
func (o *DeleteContractForbidden) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *DeleteContractForbidden) 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(crm_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewDeleteContractNotFound creates a DeleteContractNotFound with default headers values
func NewDeleteContractNotFound() *DeleteContractNotFound {
return &DeleteContractNotFound{}
}
/* DeleteContractNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type DeleteContractNotFound struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *DeleteContractNotFound) Error() string {
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractNotFound %+v", 404, o.Payload)
}
func (o *DeleteContractNotFound) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *DeleteContractNotFound) 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(crm_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewDeleteContractUnprocessableEntity creates a DeleteContractUnprocessableEntity with default headers values
func NewDeleteContractUnprocessableEntity() *DeleteContractUnprocessableEntity {
return &DeleteContractUnprocessableEntity{}
}
/* DeleteContractUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type DeleteContractUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *DeleteContractUnprocessableEntity) Error() string {
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractUnprocessableEntity %+v", 422, o.Payload)
}
func (o *DeleteContractUnprocessableEntity) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *DeleteContractUnprocessableEntity) 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(crm_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewDeleteContractInternalServerError creates a DeleteContractInternalServerError with default headers values
func NewDeleteContractInternalServerError() *DeleteContractInternalServerError {
return &DeleteContractInternalServerError{}
}
/* DeleteContractInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type DeleteContractInternalServerError struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *DeleteContractInternalServerError) Error() string {
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractInternalServerError %+v", 500, o.Payload)
}
func (o *DeleteContractInternalServerError) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *DeleteContractInternalServerError) 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(crm_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}