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

324 lines
9.4 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"
)
// GetNotebooksReader is a Reader for the GetNotebooks structure.
type GetNotebooksReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetNotebooksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetNotebooksOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetNotebooksUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetNotebooksForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetNotebooksNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetNotebooksUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetNotebooksInternalServerError()
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())
}
}
// NewGetNotebooksOK creates a GetNotebooksOK with default headers values
func NewGetNotebooksOK() *GetNotebooksOK {
return &GetNotebooksOK{}
}
/* GetNotebooksOK describes a response with status code 200, with default header values.
Taxnexus Response with Notebook objects
*/
type GetNotebooksOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload *regs_models.NotebookResponse
}
func (o *GetNotebooksOK) Error() string {
return fmt.Sprintf("[GET /notebooks][%d] getNotebooksOK %+v", 200, o.Payload)
}
func (o *GetNotebooksOK) GetPayload() *regs_models.NotebookResponse {
return o.Payload
}
func (o *GetNotebooksOK) 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
}
// NewGetNotebooksUnauthorized creates a GetNotebooksUnauthorized with default headers values
func NewGetNotebooksUnauthorized() *GetNotebooksUnauthorized {
return &GetNotebooksUnauthorized{}
}
/* GetNotebooksUnauthorized describes a response with status code 401, with default header values.
Access Unauthorized, invalid API-KEY was used
*/
type GetNotebooksUnauthorized struct {
AccessControlAllowOrigin string
Payload *regs_models.Error
}
func (o *GetNotebooksUnauthorized) Error() string {
return fmt.Sprintf("[GET /notebooks][%d] getNotebooksUnauthorized %+v", 401, o.Payload)
}
func (o *GetNotebooksUnauthorized) GetPayload() *regs_models.Error {
return o.Payload
}
func (o *GetNotebooksUnauthorized) 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
}
// NewGetNotebooksForbidden creates a GetNotebooksForbidden with default headers values
func NewGetNotebooksForbidden() *GetNotebooksForbidden {
return &GetNotebooksForbidden{}
}
/* GetNotebooksForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type GetNotebooksForbidden struct {
AccessControlAllowOrigin string
Payload *regs_models.Error
}
func (o *GetNotebooksForbidden) Error() string {
return fmt.Sprintf("[GET /notebooks][%d] getNotebooksForbidden %+v", 403, o.Payload)
}
func (o *GetNotebooksForbidden) GetPayload() *regs_models.Error {
return o.Payload
}
func (o *GetNotebooksForbidden) 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
}
// NewGetNotebooksNotFound creates a GetNotebooksNotFound with default headers values
func NewGetNotebooksNotFound() *GetNotebooksNotFound {
return &GetNotebooksNotFound{}
}
/* GetNotebooksNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type GetNotebooksNotFound struct {
AccessControlAllowOrigin string
Payload *regs_models.Error
}
func (o *GetNotebooksNotFound) Error() string {
return fmt.Sprintf("[GET /notebooks][%d] getNotebooksNotFound %+v", 404, o.Payload)
}
func (o *GetNotebooksNotFound) GetPayload() *regs_models.Error {
return o.Payload
}
func (o *GetNotebooksNotFound) 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
}
// NewGetNotebooksUnprocessableEntity creates a GetNotebooksUnprocessableEntity with default headers values
func NewGetNotebooksUnprocessableEntity() *GetNotebooksUnprocessableEntity {
return &GetNotebooksUnprocessableEntity{}
}
/* GetNotebooksUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetNotebooksUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *regs_models.Error
}
func (o *GetNotebooksUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /notebooks][%d] getNotebooksUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetNotebooksUnprocessableEntity) GetPayload() *regs_models.Error {
return o.Payload
}
func (o *GetNotebooksUnprocessableEntity) 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
}
// NewGetNotebooksInternalServerError creates a GetNotebooksInternalServerError with default headers values
func NewGetNotebooksInternalServerError() *GetNotebooksInternalServerError {
return &GetNotebooksInternalServerError{}
}
/* GetNotebooksInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type GetNotebooksInternalServerError struct {
AccessControlAllowOrigin string
Payload *regs_models.Error
}
func (o *GetNotebooksInternalServerError) Error() string {
return fmt.Sprintf("[GET /notebooks][%d] getNotebooksInternalServerError %+v", 500, o.Payload)
}
func (o *GetNotebooksInternalServerError) GetPayload() *regs_models.Error {
return o.Payload
}
func (o *GetNotebooksInternalServerError) 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
}