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

324 lines
9.5 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 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"
2021-01-10 17:03:26 +00:00
"code.tnxs.net/taxnexus/lib/api/regs/regs_models"
2021-01-08 17:40:28 +00:00
)
// 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:
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
}
}
// NewPostNotebooksOK creates a PostNotebooksOK with default headers values
func NewPostNotebooksOK() *PostNotebooksOK {
return &PostNotebooksOK{}
}
2021-02-09 16:56:57 +00:00
/* PostNotebooksOK describes a response with status code 200, with default header values.
2021-01-08 17:40:28 +00:00
Taxnexus Response with Notebook objects
*/
type PostNotebooksOK struct {
AccessControlAllowOrigin string
2021-02-09 16:56:57 +00:00
CacheControl string
2021-01-08 17:40:28 +00:00
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 {
2021-02-09 16:56:57 +00:00
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
2021-01-08 17:40:28 +00:00
2021-02-09 16:56:57 +00:00
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
// hydrates response header Cache-Control
hdrCacheControl := response.GetHeader("Cache-Control")
if hdrCacheControl != "" {
o.CacheControl = hdrCacheControl
}
2021-01-08 17:40:28 +00:00
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{}
}
2021-02-09 16:56:57 +00:00
/* PostNotebooksUnauthorized 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 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 {
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(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{}
}
2021-02-09 16:56:57 +00:00
/* PostNotebooksForbidden 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 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 {
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(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{}
}
2021-02-09 16:56:57 +00:00
/* PostNotebooksNotFound describes a response with status code 404, with default header values.
2021-01-08 17:40:28 +00:00
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 {
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(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{}
}
2021-02-09 16:56:57 +00:00
/* PostNotebooksUnprocessableEntity 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 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 {
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(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{}
}
2021-02-09 16:56:57 +00:00
/* PostNotebooksInternalServerError describes a response with status code 500, with default header values.
2021-01-08 17:40:28 +00:00
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 {
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(regs_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}