mirror of https://github.com/vernonkeenan/lib
364 lines
10 KiB
Go
364 lines
10 KiB
Go
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
// (c) 2012-2020 by Telnexus LLC
|
|
// All rights reserved worldwide.
|
|
// Proprietary product; unlicensed use is not allowed
|
|
|
|
package zone
|
|
|
|
// 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/isp/isp_models"
|
|
)
|
|
|
|
// GetZonesReader is a Reader for the GetZones structure.
|
|
type GetZonesReader struct {
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ReadResponse reads a server response into the received o.
|
|
func (o *GetZonesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
|
switch response.Code() {
|
|
case 200:
|
|
result := NewGetZonesOK()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return result, nil
|
|
case 401:
|
|
result := NewGetZonesUnauthorized()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 403:
|
|
result := NewGetZonesForbidden()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 404:
|
|
result := NewGetZonesNotFound()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 422:
|
|
result := NewGetZonesUnprocessableEntity()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 500:
|
|
result := NewGetZonesInternalServerError()
|
|
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())
|
|
}
|
|
}
|
|
|
|
// NewGetZonesOK creates a GetZonesOK with default headers values
|
|
func NewGetZonesOK() *GetZonesOK {
|
|
return &GetZonesOK{}
|
|
}
|
|
|
|
/* GetZonesOK describes a response with status code 200, with default header values.
|
|
|
|
Telnexus Response with an array of Zone objects
|
|
*/
|
|
type GetZonesOK struct {
|
|
AccessControlAllowOrigin string
|
|
CacheControl string
|
|
|
|
Payload *isp_models.ZoneResponse
|
|
}
|
|
|
|
func (o *GetZonesOK) Error() string {
|
|
return fmt.Sprintf("[GET /zone][%d] getZonesOK %+v", 200, o.Payload)
|
|
}
|
|
func (o *GetZonesOK) GetPayload() *isp_models.ZoneResponse {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetZonesOK) 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(isp_models.ZoneResponse)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewGetZonesUnauthorized creates a GetZonesUnauthorized with default headers values
|
|
func NewGetZonesUnauthorized() *GetZonesUnauthorized {
|
|
return &GetZonesUnauthorized{}
|
|
}
|
|
|
|
/* GetZonesUnauthorized describes a response with status code 401, with default header values.
|
|
|
|
Access Unauthorized, invalid API-KEY was used
|
|
*/
|
|
type GetZonesUnauthorized struct {
|
|
AccessControlAllowOrigin string
|
|
CacheControl string
|
|
|
|
Payload *isp_models.Error
|
|
}
|
|
|
|
func (o *GetZonesUnauthorized) Error() string {
|
|
return fmt.Sprintf("[GET /zone][%d] getZonesUnauthorized %+v", 401, o.Payload)
|
|
}
|
|
func (o *GetZonesUnauthorized) GetPayload() *isp_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetZonesUnauthorized) 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(isp_models.Error)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewGetZonesForbidden creates a GetZonesForbidden with default headers values
|
|
func NewGetZonesForbidden() *GetZonesForbidden {
|
|
return &GetZonesForbidden{}
|
|
}
|
|
|
|
/* GetZonesForbidden describes a response with status code 403, with default header values.
|
|
|
|
Access forbidden, account lacks access
|
|
*/
|
|
type GetZonesForbidden struct {
|
|
AccessControlAllowOrigin string
|
|
CacheControl string
|
|
|
|
Payload *isp_models.Error
|
|
}
|
|
|
|
func (o *GetZonesForbidden) Error() string {
|
|
return fmt.Sprintf("[GET /zone][%d] getZonesForbidden %+v", 403, o.Payload)
|
|
}
|
|
func (o *GetZonesForbidden) GetPayload() *isp_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetZonesForbidden) 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(isp_models.Error)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewGetZonesNotFound creates a GetZonesNotFound with default headers values
|
|
func NewGetZonesNotFound() *GetZonesNotFound {
|
|
return &GetZonesNotFound{}
|
|
}
|
|
|
|
/* GetZonesNotFound describes a response with status code 404, with default header values.
|
|
|
|
Resource was not found
|
|
*/
|
|
type GetZonesNotFound struct {
|
|
AccessControlAllowOrigin string
|
|
CacheControl string
|
|
|
|
Payload *isp_models.Error
|
|
}
|
|
|
|
func (o *GetZonesNotFound) Error() string {
|
|
return fmt.Sprintf("[GET /zone][%d] getZonesNotFound %+v", 404, o.Payload)
|
|
}
|
|
func (o *GetZonesNotFound) GetPayload() *isp_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetZonesNotFound) 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(isp_models.Error)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewGetZonesUnprocessableEntity creates a GetZonesUnprocessableEntity with default headers values
|
|
func NewGetZonesUnprocessableEntity() *GetZonesUnprocessableEntity {
|
|
return &GetZonesUnprocessableEntity{}
|
|
}
|
|
|
|
/* GetZonesUnprocessableEntity describes a response with status code 422, with default header values.
|
|
|
|
Unprocessable Entity, likely a bad parameter
|
|
*/
|
|
type GetZonesUnprocessableEntity struct {
|
|
AccessControlAllowOrigin string
|
|
CacheControl string
|
|
|
|
Payload *isp_models.Error
|
|
}
|
|
|
|
func (o *GetZonesUnprocessableEntity) Error() string {
|
|
return fmt.Sprintf("[GET /zone][%d] getZonesUnprocessableEntity %+v", 422, o.Payload)
|
|
}
|
|
func (o *GetZonesUnprocessableEntity) GetPayload() *isp_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetZonesUnprocessableEntity) 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(isp_models.Error)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewGetZonesInternalServerError creates a GetZonesInternalServerError with default headers values
|
|
func NewGetZonesInternalServerError() *GetZonesInternalServerError {
|
|
return &GetZonesInternalServerError{}
|
|
}
|
|
|
|
/* GetZonesInternalServerError describes a response with status code 500, with default header values.
|
|
|
|
Server Internal Error
|
|
*/
|
|
type GetZonesInternalServerError struct {
|
|
AccessControlAllowOrigin string
|
|
CacheControl string
|
|
|
|
Payload *isp_models.Error
|
|
}
|
|
|
|
func (o *GetZonesInternalServerError) Error() string {
|
|
return fmt.Sprintf("[GET /zone][%d] getZonesInternalServerError %+v", 500, o.Payload)
|
|
}
|
|
func (o *GetZonesInternalServerError) GetPayload() *isp_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetZonesInternalServerError) 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(isp_models.Error)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|