304 lines
8.5 KiB
Go
304 lines
8.5 KiB
Go
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
// All Code Copyright(c) 2018-2020 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"
|
|
|
|
"github.com/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("unknown error", response, response.Code())
|
|
}
|
|
}
|
|
|
|
// NewPostNotebooksOK creates a PostNotebooksOK with default headers values
|
|
func NewPostNotebooksOK() *PostNotebooksOK {
|
|
return &PostNotebooksOK{}
|
|
}
|
|
|
|
/*PostNotebooksOK handles this case 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 {
|
|
|
|
// response header Access-Control-Allow-Origin
|
|
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
|
|
|
// response header Cache-Control
|
|
o.CacheControl = response.GetHeader("Cache-Control")
|
|
|
|
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 handles this case 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 {
|
|
|
|
// response header Access-Control-Allow-Origin
|
|
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
|
|
|
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 handles this case 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 {
|
|
|
|
// response header Access-Control-Allow-Origin
|
|
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
|
|
|
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 handles this case 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 {
|
|
|
|
// response header Access-Control-Allow-Origin
|
|
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
|
|
|
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 handles this case 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 {
|
|
|
|
// response header Access-Control-Allow-Origin
|
|
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
|
|
|
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 handles this case 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 {
|
|
|
|
// response header Access-Control-Allow-Origin
|
|
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
|
|
|
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
|
|
}
|