lib/api/members/members_client/tickets/get_tickets_responses.go

487 lines
14 KiB
Go
Raw Permalink Normal View History

2023-03-28 17:47:34 +00:00
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
2023-04-07 18:00:15 +00:00
package tickets
2023-03-28 17:47:34 +00:00
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
2023-05-13 16:46:48 +00:00
"io"
2023-03-28 17:47:34 +00:00
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
2023-05-13 16:46:48 +00:00
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
2023-03-28 17:47:34 +00:00
)
// GetTicketsReader is a Reader for the GetTickets structure.
type GetTicketsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetTicketsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetTicketsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
2023-05-13 16:46:48 +00:00
case 401:
result := NewGetTicketsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetTicketsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetTicketsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetTicketsUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetTicketsInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
2023-03-28 17:47:34 +00:00
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())
}
}
// NewGetTicketsOK creates a GetTicketsOK with default headers values
func NewGetTicketsOK() *GetTicketsOK {
return &GetTicketsOK{}
}
/*
GetTicketsOK describes a response with status code 200, with default header values.
2023-05-13 16:46:48 +00:00
Ticket Response Object
2023-03-28 17:47:34 +00:00
*/
type GetTicketsOK struct {
2023-05-13 16:46:48 +00:00
Payload *members_models.TicketResponse
2023-03-28 17:47:34 +00:00
}
// IsSuccess returns true when this get tickets o k response has a 2xx status code
func (o *GetTicketsOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this get tickets o k response has a 3xx status code
func (o *GetTicketsOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this get tickets o k response has a 4xx status code
func (o *GetTicketsOK) IsClientError() bool {
return false
}
// IsServerError returns true when this get tickets o k response has a 5xx status code
func (o *GetTicketsOK) IsServerError() bool {
return false
}
// IsCode returns true when this get tickets o k response a status code equal to that given
func (o *GetTicketsOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the get tickets o k response
func (o *GetTicketsOK) Code() int {
return 200
}
func (o *GetTicketsOK) Error() string {
2023-05-13 16:46:48 +00:00
return fmt.Sprintf("[GET /tickets][%d] getTicketsOK %+v", 200, o.Payload)
2023-03-28 17:47:34 +00:00
}
func (o *GetTicketsOK) String() string {
2023-05-13 16:46:48 +00:00
return fmt.Sprintf("[GET /tickets][%d] getTicketsOK %+v", 200, o.Payload)
}
func (o *GetTicketsOK) GetPayload() *members_models.TicketResponse {
return o.Payload
2023-03-28 17:47:34 +00:00
}
func (o *GetTicketsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
2023-05-13 16:46:48 +00:00
o.Payload = new(members_models.TicketResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetTicketsUnauthorized creates a GetTicketsUnauthorized with default headers values
func NewGetTicketsUnauthorized() *GetTicketsUnauthorized {
return &GetTicketsUnauthorized{}
}
/*
GetTicketsUnauthorized describes a response with status code 401, with default header values.
Access Unauthorized, invalid API-KEY was used
*/
type GetTicketsUnauthorized struct {
Payload *members_models.Error
}
// IsSuccess returns true when this get tickets unauthorized response has a 2xx status code
func (o *GetTicketsUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get tickets unauthorized response has a 3xx status code
func (o *GetTicketsUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this get tickets unauthorized response has a 4xx status code
func (o *GetTicketsUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this get tickets unauthorized response has a 5xx status code
func (o *GetTicketsUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this get tickets unauthorized response a status code equal to that given
func (o *GetTicketsUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the get tickets unauthorized response
func (o *GetTicketsUnauthorized) Code() int {
return 401
}
func (o *GetTicketsUnauthorized) Error() string {
return fmt.Sprintf("[GET /tickets][%d] getTicketsUnauthorized %+v", 401, o.Payload)
}
func (o *GetTicketsUnauthorized) String() string {
return fmt.Sprintf("[GET /tickets][%d] getTicketsUnauthorized %+v", 401, o.Payload)
}
func (o *GetTicketsUnauthorized) GetPayload() *members_models.Error {
return o.Payload
}
func (o *GetTicketsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(members_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetTicketsForbidden creates a GetTicketsForbidden with default headers values
func NewGetTicketsForbidden() *GetTicketsForbidden {
return &GetTicketsForbidden{}
}
/*
GetTicketsForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type GetTicketsForbidden struct {
AccessControlAllowOrigin string
Payload *members_models.Error
}
// IsSuccess returns true when this get tickets forbidden response has a 2xx status code
func (o *GetTicketsForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get tickets forbidden response has a 3xx status code
func (o *GetTicketsForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this get tickets forbidden response has a 4xx status code
func (o *GetTicketsForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this get tickets forbidden response has a 5xx status code
func (o *GetTicketsForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this get tickets forbidden response a status code equal to that given
func (o *GetTicketsForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the get tickets forbidden response
func (o *GetTicketsForbidden) Code() int {
return 403
}
func (o *GetTicketsForbidden) Error() string {
return fmt.Sprintf("[GET /tickets][%d] getTicketsForbidden %+v", 403, o.Payload)
}
func (o *GetTicketsForbidden) String() string {
return fmt.Sprintf("[GET /tickets][%d] getTicketsForbidden %+v", 403, o.Payload)
}
func (o *GetTicketsForbidden) GetPayload() *members_models.Error {
return o.Payload
}
func (o *GetTicketsForbidden) 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(members_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetTicketsNotFound creates a GetTicketsNotFound with default headers values
func NewGetTicketsNotFound() *GetTicketsNotFound {
return &GetTicketsNotFound{}
}
/*
GetTicketsNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type GetTicketsNotFound struct {
Payload *members_models.Error
}
// IsSuccess returns true when this get tickets not found response has a 2xx status code
func (o *GetTicketsNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get tickets not found response has a 3xx status code
func (o *GetTicketsNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this get tickets not found response has a 4xx status code
func (o *GetTicketsNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this get tickets not found response has a 5xx status code
func (o *GetTicketsNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this get tickets not found response a status code equal to that given
func (o *GetTicketsNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the get tickets not found response
func (o *GetTicketsNotFound) Code() int {
return 404
}
func (o *GetTicketsNotFound) Error() string {
return fmt.Sprintf("[GET /tickets][%d] getTicketsNotFound %+v", 404, o.Payload)
}
func (o *GetTicketsNotFound) String() string {
return fmt.Sprintf("[GET /tickets][%d] getTicketsNotFound %+v", 404, o.Payload)
}
func (o *GetTicketsNotFound) GetPayload() *members_models.Error {
return o.Payload
}
func (o *GetTicketsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(members_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetTicketsUnprocessableEntity creates a GetTicketsUnprocessableEntity with default headers values
func NewGetTicketsUnprocessableEntity() *GetTicketsUnprocessableEntity {
return &GetTicketsUnprocessableEntity{}
}
/*
GetTicketsUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetTicketsUnprocessableEntity struct {
Payload *members_models.Error
}
// IsSuccess returns true when this get tickets unprocessable entity response has a 2xx status code
func (o *GetTicketsUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get tickets unprocessable entity response has a 3xx status code
func (o *GetTicketsUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this get tickets unprocessable entity response has a 4xx status code
func (o *GetTicketsUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this get tickets unprocessable entity response has a 5xx status code
func (o *GetTicketsUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this get tickets unprocessable entity response a status code equal to that given
func (o *GetTicketsUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the get tickets unprocessable entity response
func (o *GetTicketsUnprocessableEntity) Code() int {
return 422
}
func (o *GetTicketsUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /tickets][%d] getTicketsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetTicketsUnprocessableEntity) String() string {
return fmt.Sprintf("[GET /tickets][%d] getTicketsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetTicketsUnprocessableEntity) GetPayload() *members_models.Error {
return o.Payload
}
func (o *GetTicketsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(members_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetTicketsInternalServerError creates a GetTicketsInternalServerError with default headers values
func NewGetTicketsInternalServerError() *GetTicketsInternalServerError {
return &GetTicketsInternalServerError{}
}
/*
GetTicketsInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type GetTicketsInternalServerError struct {
Payload *members_models.Error
}
// IsSuccess returns true when this get tickets internal server error response has a 2xx status code
func (o *GetTicketsInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get tickets internal server error response has a 3xx status code
func (o *GetTicketsInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this get tickets internal server error response has a 4xx status code
func (o *GetTicketsInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this get tickets internal server error response has a 5xx status code
func (o *GetTicketsInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this get tickets internal server error response a status code equal to that given
func (o *GetTicketsInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the get tickets internal server error response
func (o *GetTicketsInternalServerError) Code() int {
return 500
}
func (o *GetTicketsInternalServerError) Error() string {
return fmt.Sprintf("[GET /tickets][%d] getTicketsInternalServerError %+v", 500, o.Payload)
}
func (o *GetTicketsInternalServerError) String() string {
return fmt.Sprintf("[GET /tickets][%d] getTicketsInternalServerError %+v", 500, o.Payload)
}
func (o *GetTicketsInternalServerError) GetPayload() *members_models.Error {
return o.Payload
}
func (o *GetTicketsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(members_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
2023-03-28 17:47:34 +00:00
return nil
}