lib/api/regs/regs_client/notebook/post_notebooks_responses.go

324 lines
9.5 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 notebook
// 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/regs/regs_models"
)
// PostNotebooksReader is a Reader for the PostNotebooks structure.
type PostNotebooksReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PostNotebooksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPostNotebooksOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPostNotebooksUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPostNotebooksForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPostNotebooksNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPostNotebooksUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPostNotebooksInternalServerError()
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())
}
}
// NewPostNotebooksOK creates a PostNotebooksOK with default headers values
func NewPostNotebooksOK() *PostNotebooksOK {
return &PostNotebooksOK{}
}
/* PostNotebooksOK describes a response with status code 200, with default header values.
Taxnexus Response with Notebook objects
*/
type PostNotebooksOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload *regs_models.NotebookResponse
}
func (o *PostNotebooksOK) Error() string {
return fmt.Sprintf("[POST /notebooks][%d] postNotebooksOK %+v", 200, o.Payload)
}
func (o *PostNotebooksOK) GetPayload() *regs_models.NotebookResponse {
return o.Payload
}
func (o *PostNotebooksOK) 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(regs_models.NotebookResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostNotebooksUnauthorized creates a PostNotebooksUnauthorized with default headers values
func NewPostNotebooksUnauthorized() *PostNotebooksUnauthorized {
return &PostNotebooksUnauthorized{}
}
/* PostNotebooksUnauthorized describes a response with status code 401, with default header values.
Access Unauthorized, invalid API-KEY was used
*/
type PostNotebooksUnauthorized struct {
AccessControlAllowOrigin string
Payload *regs_models.Error
}
func (o *PostNotebooksUnauthorized) Error() string {
return fmt.Sprintf("[POST /notebooks][%d] postNotebooksUnauthorized %+v", 401, o.Payload)
}
func (o *PostNotebooksUnauthorized) GetPayload() *regs_models.Error {
return o.Payload
}
func (o *PostNotebooksUnauthorized) 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(regs_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostNotebooksForbidden creates a PostNotebooksForbidden with default headers values
func NewPostNotebooksForbidden() *PostNotebooksForbidden {
return &PostNotebooksForbidden{}
}
/* PostNotebooksForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type PostNotebooksForbidden struct {
AccessControlAllowOrigin string
Payload *regs_models.Error
}
func (o *PostNotebooksForbidden) Error() string {
return fmt.Sprintf("[POST /notebooks][%d] postNotebooksForbidden %+v", 403, o.Payload)
}
func (o *PostNotebooksForbidden) GetPayload() *regs_models.Error {
return o.Payload
}
func (o *PostNotebooksForbidden) 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(regs_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostNotebooksNotFound creates a PostNotebooksNotFound with default headers values
func NewPostNotebooksNotFound() *PostNotebooksNotFound {
return &PostNotebooksNotFound{}
}
/* PostNotebooksNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PostNotebooksNotFound struct {
AccessControlAllowOrigin string
Payload *regs_models.Error
}
func (o *PostNotebooksNotFound) Error() string {
return fmt.Sprintf("[POST /notebooks][%d] postNotebooksNotFound %+v", 404, o.Payload)
}
func (o *PostNotebooksNotFound) GetPayload() *regs_models.Error {
return o.Payload
}
func (o *PostNotebooksNotFound) 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(regs_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostNotebooksUnprocessableEntity creates a PostNotebooksUnprocessableEntity with default headers values
func NewPostNotebooksUnprocessableEntity() *PostNotebooksUnprocessableEntity {
return &PostNotebooksUnprocessableEntity{}
}
/* PostNotebooksUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PostNotebooksUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *regs_models.Error
}
func (o *PostNotebooksUnprocessableEntity) Error() string {
return fmt.Sprintf("[POST /notebooks][%d] postNotebooksUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostNotebooksUnprocessableEntity) GetPayload() *regs_models.Error {
return o.Payload
}
func (o *PostNotebooksUnprocessableEntity) 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(regs_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostNotebooksInternalServerError creates a PostNotebooksInternalServerError with default headers values
func NewPostNotebooksInternalServerError() *PostNotebooksInternalServerError {
return &PostNotebooksInternalServerError{}
}
/* PostNotebooksInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PostNotebooksInternalServerError struct {
AccessControlAllowOrigin string
Payload *regs_models.Error
}
func (o *PostNotebooksInternalServerError) Error() string {
return fmt.Sprintf("[POST /notebooks][%d] postNotebooksInternalServerError %+v", 500, o.Payload)
}
func (o *PostNotebooksInternalServerError) GetPayload() *regs_models.Error {
return o.Payload
}
func (o *PostNotebooksInternalServerError) 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(regs_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}