540 lines
16 KiB
Go
540 lines
16 KiB
Go
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
// (c) 2012-2023 by Vernon Keenan
|
|
// All rights reserved worldwide.
|
|
// Proprietary product; unlicensed use is not allowed
|
|
|
|
package accounts
|
|
|
|
// 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/work/lib/api/crm/crm_models"
|
|
)
|
|
|
|
// PutAccountsReader is a Reader for the PutAccounts structure.
|
|
type PutAccountsReader struct {
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ReadResponse reads a server response into the received o.
|
|
func (o *PutAccountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
|
switch response.Code() {
|
|
case 200:
|
|
result := NewPutAccountsOK()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return result, nil
|
|
case 401:
|
|
result := NewPutAccountsUnauthorized()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 403:
|
|
result := NewPutAccountsForbidden()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 404:
|
|
result := NewPutAccountsNotFound()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 422:
|
|
result := NewPutAccountsUnprocessableEntity()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 500:
|
|
result := NewPutAccountsInternalServerError()
|
|
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())
|
|
}
|
|
}
|
|
|
|
// NewPutAccountsOK creates a PutAccountsOK with default headers values
|
|
func NewPutAccountsOK() *PutAccountsOK {
|
|
return &PutAccountsOK{}
|
|
}
|
|
|
|
/*
|
|
PutAccountsOK describes a response with status code 200, with default header values.
|
|
|
|
Response with Account objects with Contacts
|
|
*/
|
|
type PutAccountsOK struct {
|
|
AccessControlAllowOrigin string
|
|
CacheControl string
|
|
|
|
Payload *crm_models.AccountResponse
|
|
}
|
|
|
|
// IsSuccess returns true when this put accounts o k response has a 2xx status code
|
|
func (o *PutAccountsOK) IsSuccess() bool {
|
|
return true
|
|
}
|
|
|
|
// IsRedirect returns true when this put accounts o k response has a 3xx status code
|
|
func (o *PutAccountsOK) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this put accounts o k response has a 4xx status code
|
|
func (o *PutAccountsOK) IsClientError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsServerError returns true when this put accounts o k response has a 5xx status code
|
|
func (o *PutAccountsOK) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this put accounts o k response a status code equal to that given
|
|
func (o *PutAccountsOK) IsCode(code int) bool {
|
|
return code == 200
|
|
}
|
|
|
|
// Code gets the status code for the put accounts o k response
|
|
func (o *PutAccountsOK) Code() int {
|
|
return 200
|
|
}
|
|
|
|
func (o *PutAccountsOK) Error() string {
|
|
return fmt.Sprintf("[PUT /accounts][%d] putAccountsOK %+v", 200, o.Payload)
|
|
}
|
|
|
|
func (o *PutAccountsOK) String() string {
|
|
return fmt.Sprintf("[PUT /accounts][%d] putAccountsOK %+v", 200, o.Payload)
|
|
}
|
|
|
|
func (o *PutAccountsOK) GetPayload() *crm_models.AccountResponse {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PutAccountsOK) 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
|
|
}
|
|
|
|
// hydrates response header Cache-Control
|
|
hdrCacheControl := response.GetHeader("Cache-Control")
|
|
|
|
if hdrCacheControl != "" {
|
|
o.CacheControl = hdrCacheControl
|
|
}
|
|
|
|
o.Payload = new(crm_models.AccountResponse)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewPutAccountsUnauthorized creates a PutAccountsUnauthorized with default headers values
|
|
func NewPutAccountsUnauthorized() *PutAccountsUnauthorized {
|
|
return &PutAccountsUnauthorized{}
|
|
}
|
|
|
|
/*
|
|
PutAccountsUnauthorized describes a response with status code 401, with default header values.
|
|
|
|
Access unauthorized, invalid API-KEY was used
|
|
*/
|
|
type PutAccountsUnauthorized struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *crm_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this put accounts unauthorized response has a 2xx status code
|
|
func (o *PutAccountsUnauthorized) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this put accounts unauthorized response has a 3xx status code
|
|
func (o *PutAccountsUnauthorized) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this put accounts unauthorized response has a 4xx status code
|
|
func (o *PutAccountsUnauthorized) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this put accounts unauthorized response has a 5xx status code
|
|
func (o *PutAccountsUnauthorized) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this put accounts unauthorized response a status code equal to that given
|
|
func (o *PutAccountsUnauthorized) IsCode(code int) bool {
|
|
return code == 401
|
|
}
|
|
|
|
// Code gets the status code for the put accounts unauthorized response
|
|
func (o *PutAccountsUnauthorized) Code() int {
|
|
return 401
|
|
}
|
|
|
|
func (o *PutAccountsUnauthorized) Error() string {
|
|
return fmt.Sprintf("[PUT /accounts][%d] putAccountsUnauthorized %+v", 401, o.Payload)
|
|
}
|
|
|
|
func (o *PutAccountsUnauthorized) String() string {
|
|
return fmt.Sprintf("[PUT /accounts][%d] putAccountsUnauthorized %+v", 401, o.Payload)
|
|
}
|
|
|
|
func (o *PutAccountsUnauthorized) GetPayload() *crm_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PutAccountsUnauthorized) 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
|
|
}
|
|
|
|
// NewPutAccountsForbidden creates a PutAccountsForbidden with default headers values
|
|
func NewPutAccountsForbidden() *PutAccountsForbidden {
|
|
return &PutAccountsForbidden{}
|
|
}
|
|
|
|
/*
|
|
PutAccountsForbidden describes a response with status code 403, with default header values.
|
|
|
|
Access forbidden, account lacks access
|
|
*/
|
|
type PutAccountsForbidden struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *crm_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this put accounts forbidden response has a 2xx status code
|
|
func (o *PutAccountsForbidden) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this put accounts forbidden response has a 3xx status code
|
|
func (o *PutAccountsForbidden) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this put accounts forbidden response has a 4xx status code
|
|
func (o *PutAccountsForbidden) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this put accounts forbidden response has a 5xx status code
|
|
func (o *PutAccountsForbidden) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this put accounts forbidden response a status code equal to that given
|
|
func (o *PutAccountsForbidden) IsCode(code int) bool {
|
|
return code == 403
|
|
}
|
|
|
|
// Code gets the status code for the put accounts forbidden response
|
|
func (o *PutAccountsForbidden) Code() int {
|
|
return 403
|
|
}
|
|
|
|
func (o *PutAccountsForbidden) Error() string {
|
|
return fmt.Sprintf("[PUT /accounts][%d] putAccountsForbidden %+v", 403, o.Payload)
|
|
}
|
|
|
|
func (o *PutAccountsForbidden) String() string {
|
|
return fmt.Sprintf("[PUT /accounts][%d] putAccountsForbidden %+v", 403, o.Payload)
|
|
}
|
|
|
|
func (o *PutAccountsForbidden) GetPayload() *crm_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PutAccountsForbidden) 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
|
|
}
|
|
|
|
// NewPutAccountsNotFound creates a PutAccountsNotFound with default headers values
|
|
func NewPutAccountsNotFound() *PutAccountsNotFound {
|
|
return &PutAccountsNotFound{}
|
|
}
|
|
|
|
/*
|
|
PutAccountsNotFound describes a response with status code 404, with default header values.
|
|
|
|
Resource was not found
|
|
*/
|
|
type PutAccountsNotFound struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *crm_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this put accounts not found response has a 2xx status code
|
|
func (o *PutAccountsNotFound) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this put accounts not found response has a 3xx status code
|
|
func (o *PutAccountsNotFound) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this put accounts not found response has a 4xx status code
|
|
func (o *PutAccountsNotFound) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this put accounts not found response has a 5xx status code
|
|
func (o *PutAccountsNotFound) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this put accounts not found response a status code equal to that given
|
|
func (o *PutAccountsNotFound) IsCode(code int) bool {
|
|
return code == 404
|
|
}
|
|
|
|
// Code gets the status code for the put accounts not found response
|
|
func (o *PutAccountsNotFound) Code() int {
|
|
return 404
|
|
}
|
|
|
|
func (o *PutAccountsNotFound) Error() string {
|
|
return fmt.Sprintf("[PUT /accounts][%d] putAccountsNotFound %+v", 404, o.Payload)
|
|
}
|
|
|
|
func (o *PutAccountsNotFound) String() string {
|
|
return fmt.Sprintf("[PUT /accounts][%d] putAccountsNotFound %+v", 404, o.Payload)
|
|
}
|
|
|
|
func (o *PutAccountsNotFound) GetPayload() *crm_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PutAccountsNotFound) 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
|
|
}
|
|
|
|
// NewPutAccountsUnprocessableEntity creates a PutAccountsUnprocessableEntity with default headers values
|
|
func NewPutAccountsUnprocessableEntity() *PutAccountsUnprocessableEntity {
|
|
return &PutAccountsUnprocessableEntity{}
|
|
}
|
|
|
|
/*
|
|
PutAccountsUnprocessableEntity describes a response with status code 422, with default header values.
|
|
|
|
Unprocessable Entity, likely a bad parameter
|
|
*/
|
|
type PutAccountsUnprocessableEntity struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *crm_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this put accounts unprocessable entity response has a 2xx status code
|
|
func (o *PutAccountsUnprocessableEntity) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this put accounts unprocessable entity response has a 3xx status code
|
|
func (o *PutAccountsUnprocessableEntity) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this put accounts unprocessable entity response has a 4xx status code
|
|
func (o *PutAccountsUnprocessableEntity) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this put accounts unprocessable entity response has a 5xx status code
|
|
func (o *PutAccountsUnprocessableEntity) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this put accounts unprocessable entity response a status code equal to that given
|
|
func (o *PutAccountsUnprocessableEntity) IsCode(code int) bool {
|
|
return code == 422
|
|
}
|
|
|
|
// Code gets the status code for the put accounts unprocessable entity response
|
|
func (o *PutAccountsUnprocessableEntity) Code() int {
|
|
return 422
|
|
}
|
|
|
|
func (o *PutAccountsUnprocessableEntity) Error() string {
|
|
return fmt.Sprintf("[PUT /accounts][%d] putAccountsUnprocessableEntity %+v", 422, o.Payload)
|
|
}
|
|
|
|
func (o *PutAccountsUnprocessableEntity) String() string {
|
|
return fmt.Sprintf("[PUT /accounts][%d] putAccountsUnprocessableEntity %+v", 422, o.Payload)
|
|
}
|
|
|
|
func (o *PutAccountsUnprocessableEntity) GetPayload() *crm_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PutAccountsUnprocessableEntity) 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
|
|
}
|
|
|
|
// NewPutAccountsInternalServerError creates a PutAccountsInternalServerError with default headers values
|
|
func NewPutAccountsInternalServerError() *PutAccountsInternalServerError {
|
|
return &PutAccountsInternalServerError{}
|
|
}
|
|
|
|
/*
|
|
PutAccountsInternalServerError describes a response with status code 500, with default header values.
|
|
|
|
Server Internal Error
|
|
*/
|
|
type PutAccountsInternalServerError struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *crm_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this put accounts internal server error response has a 2xx status code
|
|
func (o *PutAccountsInternalServerError) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this put accounts internal server error response has a 3xx status code
|
|
func (o *PutAccountsInternalServerError) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this put accounts internal server error response has a 4xx status code
|
|
func (o *PutAccountsInternalServerError) IsClientError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsServerError returns true when this put accounts internal server error response has a 5xx status code
|
|
func (o *PutAccountsInternalServerError) IsServerError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsCode returns true when this put accounts internal server error response a status code equal to that given
|
|
func (o *PutAccountsInternalServerError) IsCode(code int) bool {
|
|
return code == 500
|
|
}
|
|
|
|
// Code gets the status code for the put accounts internal server error response
|
|
func (o *PutAccountsInternalServerError) Code() int {
|
|
return 500
|
|
}
|
|
|
|
func (o *PutAccountsInternalServerError) Error() string {
|
|
return fmt.Sprintf("[PUT /accounts][%d] putAccountsInternalServerError %+v", 500, o.Payload)
|
|
}
|
|
|
|
func (o *PutAccountsInternalServerError) String() string {
|
|
return fmt.Sprintf("[PUT /accounts][%d] putAccountsInternalServerError %+v", 500, o.Payload)
|
|
}
|
|
|
|
func (o *PutAccountsInternalServerError) GetPayload() *crm_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PutAccountsInternalServerError) 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
|
|
}
|