lib/api/members/members_client/attendees/post_attendees_responses.go

487 lines
15 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 attendees
// 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"
)
// PostAttendeesReader is a Reader for the PostAttendees structure.
type PostAttendeesReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PostAttendeesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPostAttendeesOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPostAttendeesUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPostAttendeesForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPostAttendeesNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPostAttendeesUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPostAttendeesInternalServerError()
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())
}
}
// NewPostAttendeesOK creates a PostAttendeesOK with default headers values
func NewPostAttendeesOK() *PostAttendeesOK {
return &PostAttendeesOK{}
}
/*
PostAttendeesOK describes a response with status code 200, with default header values.
Attendee Response Object
*/
type PostAttendeesOK struct {
Payload *members_models.AttendeeResponse
}
// IsSuccess returns true when this post attendees o k response has a 2xx status code
func (o *PostAttendeesOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this post attendees o k response has a 3xx status code
func (o *PostAttendeesOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this post attendees o k response has a 4xx status code
func (o *PostAttendeesOK) IsClientError() bool {
return false
}
// IsServerError returns true when this post attendees o k response has a 5xx status code
func (o *PostAttendeesOK) IsServerError() bool {
return false
}
// IsCode returns true when this post attendees o k response a status code equal to that given
func (o *PostAttendeesOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the post attendees o k response
func (o *PostAttendeesOK) Code() int {
return 200
}
func (o *PostAttendeesOK) Error() string {
return fmt.Sprintf("[POST /attendees][%d] postAttendeesOK %+v", 200, o.Payload)
}
func (o *PostAttendeesOK) String() string {
return fmt.Sprintf("[POST /attendees][%d] postAttendeesOK %+v", 200, o.Payload)
}
func (o *PostAttendeesOK) GetPayload() *members_models.AttendeeResponse {
return o.Payload
}
func (o *PostAttendeesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(members_models.AttendeeResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostAttendeesUnauthorized creates a PostAttendeesUnauthorized with default headers values
func NewPostAttendeesUnauthorized() *PostAttendeesUnauthorized {
return &PostAttendeesUnauthorized{}
}
/*
PostAttendeesUnauthorized describes a response with status code 401, with default header values.
Access Unauthorized, invalid API-KEY was used
*/
type PostAttendeesUnauthorized struct {
Payload *members_models.Error
}
// IsSuccess returns true when this post attendees unauthorized response has a 2xx status code
func (o *PostAttendeesUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post attendees unauthorized response has a 3xx status code
func (o *PostAttendeesUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this post attendees unauthorized response has a 4xx status code
func (o *PostAttendeesUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this post attendees unauthorized response has a 5xx status code
func (o *PostAttendeesUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this post attendees unauthorized response a status code equal to that given
func (o *PostAttendeesUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the post attendees unauthorized response
func (o *PostAttendeesUnauthorized) Code() int {
return 401
}
func (o *PostAttendeesUnauthorized) Error() string {
return fmt.Sprintf("[POST /attendees][%d] postAttendeesUnauthorized %+v", 401, o.Payload)
}
func (o *PostAttendeesUnauthorized) String() string {
return fmt.Sprintf("[POST /attendees][%d] postAttendeesUnauthorized %+v", 401, o.Payload)
}
func (o *PostAttendeesUnauthorized) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostAttendeesUnauthorized) 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
}
// NewPostAttendeesForbidden creates a PostAttendeesForbidden with default headers values
func NewPostAttendeesForbidden() *PostAttendeesForbidden {
return &PostAttendeesForbidden{}
}
/*
PostAttendeesForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type PostAttendeesForbidden struct {
AccessControlAllowOrigin string
Payload *members_models.Error
}
// IsSuccess returns true when this post attendees forbidden response has a 2xx status code
func (o *PostAttendeesForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post attendees forbidden response has a 3xx status code
func (o *PostAttendeesForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this post attendees forbidden response has a 4xx status code
func (o *PostAttendeesForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this post attendees forbidden response has a 5xx status code
func (o *PostAttendeesForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this post attendees forbidden response a status code equal to that given
func (o *PostAttendeesForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the post attendees forbidden response
func (o *PostAttendeesForbidden) Code() int {
return 403
}
func (o *PostAttendeesForbidden) Error() string {
return fmt.Sprintf("[POST /attendees][%d] postAttendeesForbidden %+v", 403, o.Payload)
}
func (o *PostAttendeesForbidden) String() string {
return fmt.Sprintf("[POST /attendees][%d] postAttendeesForbidden %+v", 403, o.Payload)
}
func (o *PostAttendeesForbidden) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostAttendeesForbidden) 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
}
// NewPostAttendeesNotFound creates a PostAttendeesNotFound with default headers values
func NewPostAttendeesNotFound() *PostAttendeesNotFound {
return &PostAttendeesNotFound{}
}
/*
PostAttendeesNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PostAttendeesNotFound struct {
Payload *members_models.Error
}
// IsSuccess returns true when this post attendees not found response has a 2xx status code
func (o *PostAttendeesNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post attendees not found response has a 3xx status code
func (o *PostAttendeesNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this post attendees not found response has a 4xx status code
func (o *PostAttendeesNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this post attendees not found response has a 5xx status code
func (o *PostAttendeesNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this post attendees not found response a status code equal to that given
func (o *PostAttendeesNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the post attendees not found response
func (o *PostAttendeesNotFound) Code() int {
return 404
}
func (o *PostAttendeesNotFound) Error() string {
return fmt.Sprintf("[POST /attendees][%d] postAttendeesNotFound %+v", 404, o.Payload)
}
func (o *PostAttendeesNotFound) String() string {
return fmt.Sprintf("[POST /attendees][%d] postAttendeesNotFound %+v", 404, o.Payload)
}
func (o *PostAttendeesNotFound) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostAttendeesNotFound) 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
}
// NewPostAttendeesUnprocessableEntity creates a PostAttendeesUnprocessableEntity with default headers values
func NewPostAttendeesUnprocessableEntity() *PostAttendeesUnprocessableEntity {
return &PostAttendeesUnprocessableEntity{}
}
/*
PostAttendeesUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PostAttendeesUnprocessableEntity struct {
Payload *members_models.Error
}
// IsSuccess returns true when this post attendees unprocessable entity response has a 2xx status code
func (o *PostAttendeesUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post attendees unprocessable entity response has a 3xx status code
func (o *PostAttendeesUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this post attendees unprocessable entity response has a 4xx status code
func (o *PostAttendeesUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this post attendees unprocessable entity response has a 5xx status code
func (o *PostAttendeesUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this post attendees unprocessable entity response a status code equal to that given
func (o *PostAttendeesUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the post attendees unprocessable entity response
func (o *PostAttendeesUnprocessableEntity) Code() int {
return 422
}
func (o *PostAttendeesUnprocessableEntity) Error() string {
return fmt.Sprintf("[POST /attendees][%d] postAttendeesUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostAttendeesUnprocessableEntity) String() string {
return fmt.Sprintf("[POST /attendees][%d] postAttendeesUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostAttendeesUnprocessableEntity) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostAttendeesUnprocessableEntity) 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
}
// NewPostAttendeesInternalServerError creates a PostAttendeesInternalServerError with default headers values
func NewPostAttendeesInternalServerError() *PostAttendeesInternalServerError {
return &PostAttendeesInternalServerError{}
}
/*
PostAttendeesInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PostAttendeesInternalServerError struct {
Payload *members_models.Error
}
// IsSuccess returns true when this post attendees internal server error response has a 2xx status code
func (o *PostAttendeesInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post attendees internal server error response has a 3xx status code
func (o *PostAttendeesInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this post attendees internal server error response has a 4xx status code
func (o *PostAttendeesInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this post attendees internal server error response has a 5xx status code
func (o *PostAttendeesInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this post attendees internal server error response a status code equal to that given
func (o *PostAttendeesInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the post attendees internal server error response
func (o *PostAttendeesInternalServerError) Code() int {
return 500
}
func (o *PostAttendeesInternalServerError) Error() string {
return fmt.Sprintf("[POST /attendees][%d] postAttendeesInternalServerError %+v", 500, o.Payload)
}
func (o *PostAttendeesInternalServerError) String() string {
return fmt.Sprintf("[POST /attendees][%d] postAttendeesInternalServerError %+v", 500, o.Payload)
}
func (o *PostAttendeesInternalServerError) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostAttendeesInternalServerError) 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
}