487 lines
14 KiB
Go
487 lines
14 KiB
Go
|
// Code generated by go-swagger; DO NOT EDIT.
|
||
|
|
||
|
// (c) 2012-2023 by Vernon Keenan
|
||
|
// All rights reserved worldwide.
|
||
|
// Proprietary product; unlicensed use is not allowed
|
||
|
|
||
|
package tickets
|
||
|
|
||
|
// 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/work/lib/api/members/members_models"
|
||
|
)
|
||
|
|
||
|
// PutTicketsReader is a Reader for the PutTickets structure.
|
||
|
type PutTicketsReader struct {
|
||
|
formats strfmt.Registry
|
||
|
}
|
||
|
|
||
|
// ReadResponse reads a server response into the received o.
|
||
|
func (o *PutTicketsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||
|
switch response.Code() {
|
||
|
case 200:
|
||
|
result := NewPutTicketsOK()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return result, nil
|
||
|
case 401:
|
||
|
result := NewPutTicketsUnauthorized()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 403:
|
||
|
result := NewPutTicketsForbidden()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 404:
|
||
|
result := NewPutTicketsNotFound()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 422:
|
||
|
result := NewPutTicketsUnprocessableEntity()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 500:
|
||
|
result := NewPutTicketsInternalServerError()
|
||
|
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())
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// NewPutTicketsOK creates a PutTicketsOK with default headers values
|
||
|
func NewPutTicketsOK() *PutTicketsOK {
|
||
|
return &PutTicketsOK{}
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
PutTicketsOK describes a response with status code 200, with default header values.
|
||
|
|
||
|
Ticket Response Object
|
||
|
*/
|
||
|
type PutTicketsOK struct {
|
||
|
Payload *members_models.TicketResponse
|
||
|
}
|
||
|
|
||
|
// IsSuccess returns true when this put tickets o k response has a 2xx status code
|
||
|
func (o *PutTicketsOK) IsSuccess() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
// IsRedirect returns true when this put tickets o k response has a 3xx status code
|
||
|
func (o *PutTicketsOK) IsRedirect() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsClientError returns true when this put tickets o k response has a 4xx status code
|
||
|
func (o *PutTicketsOK) IsClientError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsServerError returns true when this put tickets o k response has a 5xx status code
|
||
|
func (o *PutTicketsOK) IsServerError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsCode returns true when this put tickets o k response a status code equal to that given
|
||
|
func (o *PutTicketsOK) IsCode(code int) bool {
|
||
|
return code == 200
|
||
|
}
|
||
|
|
||
|
// Code gets the status code for the put tickets o k response
|
||
|
func (o *PutTicketsOK) Code() int {
|
||
|
return 200
|
||
|
}
|
||
|
|
||
|
func (o *PutTicketsOK) Error() string {
|
||
|
return fmt.Sprintf("[PUT /tickets][%d] putTicketsOK %+v", 200, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PutTicketsOK) String() string {
|
||
|
return fmt.Sprintf("[PUT /tickets][%d] putTicketsOK %+v", 200, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PutTicketsOK) GetPayload() *members_models.TicketResponse {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *PutTicketsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||
|
|
||
|
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
|
||
|
}
|
||
|
|
||
|
// NewPutTicketsUnauthorized creates a PutTicketsUnauthorized with default headers values
|
||
|
func NewPutTicketsUnauthorized() *PutTicketsUnauthorized {
|
||
|
return &PutTicketsUnauthorized{}
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
PutTicketsUnauthorized describes a response with status code 401, with default header values.
|
||
|
|
||
|
Access Unauthorized, invalid API-KEY was used
|
||
|
*/
|
||
|
type PutTicketsUnauthorized struct {
|
||
|
Payload *members_models.Error
|
||
|
}
|
||
|
|
||
|
// IsSuccess returns true when this put tickets unauthorized response has a 2xx status code
|
||
|
func (o *PutTicketsUnauthorized) IsSuccess() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsRedirect returns true when this put tickets unauthorized response has a 3xx status code
|
||
|
func (o *PutTicketsUnauthorized) IsRedirect() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsClientError returns true when this put tickets unauthorized response has a 4xx status code
|
||
|
func (o *PutTicketsUnauthorized) IsClientError() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
// IsServerError returns true when this put tickets unauthorized response has a 5xx status code
|
||
|
func (o *PutTicketsUnauthorized) IsServerError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsCode returns true when this put tickets unauthorized response a status code equal to that given
|
||
|
func (o *PutTicketsUnauthorized) IsCode(code int) bool {
|
||
|
return code == 401
|
||
|
}
|
||
|
|
||
|
// Code gets the status code for the put tickets unauthorized response
|
||
|
func (o *PutTicketsUnauthorized) Code() int {
|
||
|
return 401
|
||
|
}
|
||
|
|
||
|
func (o *PutTicketsUnauthorized) Error() string {
|
||
|
return fmt.Sprintf("[PUT /tickets][%d] putTicketsUnauthorized %+v", 401, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PutTicketsUnauthorized) String() string {
|
||
|
return fmt.Sprintf("[PUT /tickets][%d] putTicketsUnauthorized %+v", 401, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PutTicketsUnauthorized) GetPayload() *members_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *PutTicketsUnauthorized) 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
|
||
|
}
|
||
|
|
||
|
// NewPutTicketsForbidden creates a PutTicketsForbidden with default headers values
|
||
|
func NewPutTicketsForbidden() *PutTicketsForbidden {
|
||
|
return &PutTicketsForbidden{}
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
PutTicketsForbidden describes a response with status code 403, with default header values.
|
||
|
|
||
|
Access forbidden, account lacks access
|
||
|
*/
|
||
|
type PutTicketsForbidden struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
|
||
|
Payload *members_models.Error
|
||
|
}
|
||
|
|
||
|
// IsSuccess returns true when this put tickets forbidden response has a 2xx status code
|
||
|
func (o *PutTicketsForbidden) IsSuccess() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsRedirect returns true when this put tickets forbidden response has a 3xx status code
|
||
|
func (o *PutTicketsForbidden) IsRedirect() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsClientError returns true when this put tickets forbidden response has a 4xx status code
|
||
|
func (o *PutTicketsForbidden) IsClientError() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
// IsServerError returns true when this put tickets forbidden response has a 5xx status code
|
||
|
func (o *PutTicketsForbidden) IsServerError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsCode returns true when this put tickets forbidden response a status code equal to that given
|
||
|
func (o *PutTicketsForbidden) IsCode(code int) bool {
|
||
|
return code == 403
|
||
|
}
|
||
|
|
||
|
// Code gets the status code for the put tickets forbidden response
|
||
|
func (o *PutTicketsForbidden) Code() int {
|
||
|
return 403
|
||
|
}
|
||
|
|
||
|
func (o *PutTicketsForbidden) Error() string {
|
||
|
return fmt.Sprintf("[PUT /tickets][%d] putTicketsForbidden %+v", 403, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PutTicketsForbidden) String() string {
|
||
|
return fmt.Sprintf("[PUT /tickets][%d] putTicketsForbidden %+v", 403, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PutTicketsForbidden) GetPayload() *members_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *PutTicketsForbidden) 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
|
||
|
}
|
||
|
|
||
|
// NewPutTicketsNotFound creates a PutTicketsNotFound with default headers values
|
||
|
func NewPutTicketsNotFound() *PutTicketsNotFound {
|
||
|
return &PutTicketsNotFound{}
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
PutTicketsNotFound describes a response with status code 404, with default header values.
|
||
|
|
||
|
Resource was not found
|
||
|
*/
|
||
|
type PutTicketsNotFound struct {
|
||
|
Payload *members_models.Error
|
||
|
}
|
||
|
|
||
|
// IsSuccess returns true when this put tickets not found response has a 2xx status code
|
||
|
func (o *PutTicketsNotFound) IsSuccess() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsRedirect returns true when this put tickets not found response has a 3xx status code
|
||
|
func (o *PutTicketsNotFound) IsRedirect() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsClientError returns true when this put tickets not found response has a 4xx status code
|
||
|
func (o *PutTicketsNotFound) IsClientError() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
// IsServerError returns true when this put tickets not found response has a 5xx status code
|
||
|
func (o *PutTicketsNotFound) IsServerError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsCode returns true when this put tickets not found response a status code equal to that given
|
||
|
func (o *PutTicketsNotFound) IsCode(code int) bool {
|
||
|
return code == 404
|
||
|
}
|
||
|
|
||
|
// Code gets the status code for the put tickets not found response
|
||
|
func (o *PutTicketsNotFound) Code() int {
|
||
|
return 404
|
||
|
}
|
||
|
|
||
|
func (o *PutTicketsNotFound) Error() string {
|
||
|
return fmt.Sprintf("[PUT /tickets][%d] putTicketsNotFound %+v", 404, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PutTicketsNotFound) String() string {
|
||
|
return fmt.Sprintf("[PUT /tickets][%d] putTicketsNotFound %+v", 404, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PutTicketsNotFound) GetPayload() *members_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *PutTicketsNotFound) 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
|
||
|
}
|
||
|
|
||
|
// NewPutTicketsUnprocessableEntity creates a PutTicketsUnprocessableEntity with default headers values
|
||
|
func NewPutTicketsUnprocessableEntity() *PutTicketsUnprocessableEntity {
|
||
|
return &PutTicketsUnprocessableEntity{}
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
PutTicketsUnprocessableEntity describes a response with status code 422, with default header values.
|
||
|
|
||
|
Unprocessable Entity, likely a bad parameter
|
||
|
*/
|
||
|
type PutTicketsUnprocessableEntity struct {
|
||
|
Payload *members_models.Error
|
||
|
}
|
||
|
|
||
|
// IsSuccess returns true when this put tickets unprocessable entity response has a 2xx status code
|
||
|
func (o *PutTicketsUnprocessableEntity) IsSuccess() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsRedirect returns true when this put tickets unprocessable entity response has a 3xx status code
|
||
|
func (o *PutTicketsUnprocessableEntity) IsRedirect() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsClientError returns true when this put tickets unprocessable entity response has a 4xx status code
|
||
|
func (o *PutTicketsUnprocessableEntity) IsClientError() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
// IsServerError returns true when this put tickets unprocessable entity response has a 5xx status code
|
||
|
func (o *PutTicketsUnprocessableEntity) IsServerError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsCode returns true when this put tickets unprocessable entity response a status code equal to that given
|
||
|
func (o *PutTicketsUnprocessableEntity) IsCode(code int) bool {
|
||
|
return code == 422
|
||
|
}
|
||
|
|
||
|
// Code gets the status code for the put tickets unprocessable entity response
|
||
|
func (o *PutTicketsUnprocessableEntity) Code() int {
|
||
|
return 422
|
||
|
}
|
||
|
|
||
|
func (o *PutTicketsUnprocessableEntity) Error() string {
|
||
|
return fmt.Sprintf("[PUT /tickets][%d] putTicketsUnprocessableEntity %+v", 422, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PutTicketsUnprocessableEntity) String() string {
|
||
|
return fmt.Sprintf("[PUT /tickets][%d] putTicketsUnprocessableEntity %+v", 422, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PutTicketsUnprocessableEntity) GetPayload() *members_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *PutTicketsUnprocessableEntity) 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
|
||
|
}
|
||
|
|
||
|
// NewPutTicketsInternalServerError creates a PutTicketsInternalServerError with default headers values
|
||
|
func NewPutTicketsInternalServerError() *PutTicketsInternalServerError {
|
||
|
return &PutTicketsInternalServerError{}
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
PutTicketsInternalServerError describes a response with status code 500, with default header values.
|
||
|
|
||
|
Server Internal Error
|
||
|
*/
|
||
|
type PutTicketsInternalServerError struct {
|
||
|
Payload *members_models.Error
|
||
|
}
|
||
|
|
||
|
// IsSuccess returns true when this put tickets internal server error response has a 2xx status code
|
||
|
func (o *PutTicketsInternalServerError) IsSuccess() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsRedirect returns true when this put tickets internal server error response has a 3xx status code
|
||
|
func (o *PutTicketsInternalServerError) IsRedirect() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsClientError returns true when this put tickets internal server error response has a 4xx status code
|
||
|
func (o *PutTicketsInternalServerError) IsClientError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsServerError returns true when this put tickets internal server error response has a 5xx status code
|
||
|
func (o *PutTicketsInternalServerError) IsServerError() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
// IsCode returns true when this put tickets internal server error response a status code equal to that given
|
||
|
func (o *PutTicketsInternalServerError) IsCode(code int) bool {
|
||
|
return code == 500
|
||
|
}
|
||
|
|
||
|
// Code gets the status code for the put tickets internal server error response
|
||
|
func (o *PutTicketsInternalServerError) Code() int {
|
||
|
return 500
|
||
|
}
|
||
|
|
||
|
func (o *PutTicketsInternalServerError) Error() string {
|
||
|
return fmt.Sprintf("[PUT /tickets][%d] putTicketsInternalServerError %+v", 500, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PutTicketsInternalServerError) String() string {
|
||
|
return fmt.Sprintf("[PUT /tickets][%d] putTicketsInternalServerError %+v", 500, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PutTicketsInternalServerError) GetPayload() *members_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *PutTicketsInternalServerError) 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
|
||
|
}
|