lib/api/sfgate/sfgate_client/users/post_user_responses.go

523 lines
15 KiB
Go
Raw Normal View History

2023-03-28 17:47:34 +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 users
// 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/sfgate/sfgate_models"
)
// PostUserReader is a Reader for the PostUser structure.
type PostUserReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PostUserReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPostUserOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPostUserUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPostUserForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPostUserNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPostUserUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPostUserInternalServerError()
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())
}
}
// NewPostUserOK creates a PostUserOK with default headers values
func NewPostUserOK() *PostUserOK {
return &PostUserOK{}
}
/*
PostUserOK describes a response with status code 200, with default header values.
Response from Salesforce
*/
type PostUserOK struct {
Payload *sfgate_models.SalesforcePostResponse
}
// IsSuccess returns true when this post user o k response has a 2xx status code
func (o *PostUserOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this post user o k response has a 3xx status code
func (o *PostUserOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this post user o k response has a 4xx status code
func (o *PostUserOK) IsClientError() bool {
return false
}
// IsServerError returns true when this post user o k response has a 5xx status code
func (o *PostUserOK) IsServerError() bool {
return false
}
// IsCode returns true when this post user o k response a status code equal to that given
func (o *PostUserOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the post user o k response
func (o *PostUserOK) Code() int {
return 200
}
func (o *PostUserOK) Error() string {
return fmt.Sprintf("[POST /users][%d] postUserOK %+v", 200, o.Payload)
}
func (o *PostUserOK) String() string {
return fmt.Sprintf("[POST /users][%d] postUserOK %+v", 200, o.Payload)
}
func (o *PostUserOK) GetPayload() *sfgate_models.SalesforcePostResponse {
return o.Payload
}
func (o *PostUserOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.SalesforcePostResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostUserUnauthorized creates a PostUserUnauthorized with default headers values
func NewPostUserUnauthorized() *PostUserUnauthorized {
return &PostUserUnauthorized{}
}
/*
PostUserUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type PostUserUnauthorized struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
// IsSuccess returns true when this post user unauthorized response has a 2xx status code
func (o *PostUserUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post user unauthorized response has a 3xx status code
func (o *PostUserUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this post user unauthorized response has a 4xx status code
func (o *PostUserUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this post user unauthorized response has a 5xx status code
func (o *PostUserUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this post user unauthorized response a status code equal to that given
func (o *PostUserUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the post user unauthorized response
func (o *PostUserUnauthorized) Code() int {
return 401
}
func (o *PostUserUnauthorized) Error() string {
return fmt.Sprintf("[POST /users][%d] postUserUnauthorized %+v", 401, o.Payload)
}
func (o *PostUserUnauthorized) String() string {
return fmt.Sprintf("[POST /users][%d] postUserUnauthorized %+v", 401, o.Payload)
}
func (o *PostUserUnauthorized) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostUserUnauthorized) 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(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostUserForbidden creates a PostUserForbidden with default headers values
func NewPostUserForbidden() *PostUserForbidden {
return &PostUserForbidden{}
}
/*
PostUserForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type PostUserForbidden struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
// IsSuccess returns true when this post user forbidden response has a 2xx status code
func (o *PostUserForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post user forbidden response has a 3xx status code
func (o *PostUserForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this post user forbidden response has a 4xx status code
func (o *PostUserForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this post user forbidden response has a 5xx status code
func (o *PostUserForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this post user forbidden response a status code equal to that given
func (o *PostUserForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the post user forbidden response
func (o *PostUserForbidden) Code() int {
return 403
}
func (o *PostUserForbidden) Error() string {
return fmt.Sprintf("[POST /users][%d] postUserForbidden %+v", 403, o.Payload)
}
func (o *PostUserForbidden) String() string {
return fmt.Sprintf("[POST /users][%d] postUserForbidden %+v", 403, o.Payload)
}
func (o *PostUserForbidden) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostUserForbidden) 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(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostUserNotFound creates a PostUserNotFound with default headers values
func NewPostUserNotFound() *PostUserNotFound {
return &PostUserNotFound{}
}
/*
PostUserNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PostUserNotFound struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
// IsSuccess returns true when this post user not found response has a 2xx status code
func (o *PostUserNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post user not found response has a 3xx status code
func (o *PostUserNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this post user not found response has a 4xx status code
func (o *PostUserNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this post user not found response has a 5xx status code
func (o *PostUserNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this post user not found response a status code equal to that given
func (o *PostUserNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the post user not found response
func (o *PostUserNotFound) Code() int {
return 404
}
func (o *PostUserNotFound) Error() string {
return fmt.Sprintf("[POST /users][%d] postUserNotFound %+v", 404, o.Payload)
}
func (o *PostUserNotFound) String() string {
return fmt.Sprintf("[POST /users][%d] postUserNotFound %+v", 404, o.Payload)
}
func (o *PostUserNotFound) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostUserNotFound) 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(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostUserUnprocessableEntity creates a PostUserUnprocessableEntity with default headers values
func NewPostUserUnprocessableEntity() *PostUserUnprocessableEntity {
return &PostUserUnprocessableEntity{}
}
/*
PostUserUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PostUserUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
// IsSuccess returns true when this post user unprocessable entity response has a 2xx status code
func (o *PostUserUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post user unprocessable entity response has a 3xx status code
func (o *PostUserUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this post user unprocessable entity response has a 4xx status code
func (o *PostUserUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this post user unprocessable entity response has a 5xx status code
func (o *PostUserUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this post user unprocessable entity response a status code equal to that given
func (o *PostUserUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the post user unprocessable entity response
func (o *PostUserUnprocessableEntity) Code() int {
return 422
}
func (o *PostUserUnprocessableEntity) Error() string {
return fmt.Sprintf("[POST /users][%d] postUserUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostUserUnprocessableEntity) String() string {
return fmt.Sprintf("[POST /users][%d] postUserUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostUserUnprocessableEntity) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostUserUnprocessableEntity) 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(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostUserInternalServerError creates a PostUserInternalServerError with default headers values
func NewPostUserInternalServerError() *PostUserInternalServerError {
return &PostUserInternalServerError{}
}
/*
PostUserInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PostUserInternalServerError struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
// IsSuccess returns true when this post user internal server error response has a 2xx status code
func (o *PostUserInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post user internal server error response has a 3xx status code
func (o *PostUserInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this post user internal server error response has a 4xx status code
func (o *PostUserInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this post user internal server error response has a 5xx status code
func (o *PostUserInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this post user internal server error response a status code equal to that given
func (o *PostUserInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the post user internal server error response
func (o *PostUserInternalServerError) Code() int {
return 500
}
func (o *PostUserInternalServerError) Error() string {
return fmt.Sprintf("[POST /users][%d] postUserInternalServerError %+v", 500, o.Payload)
}
func (o *PostUserInternalServerError) String() string {
return fmt.Sprintf("[POST /users][%d] postUserInternalServerError %+v", 500, o.Payload)
}
func (o *PostUserInternalServerError) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostUserInternalServerError) 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(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}