gtslib/client/media/media_create_responses.go
decentral1se e4ade9c758
All checks were successful
continuous-integration/drone/push Build is passing
feat: init
2024-07-31 22:47:18 +02:00

355 lines
11 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package media
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"git.coopcloud.tech/decentral1se/gtslib/models"
)
// MediaCreateReader is a Reader for the MediaCreate structure.
type MediaCreateReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *MediaCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewMediaCreateOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewMediaCreateBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 401:
result := NewMediaCreateUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewMediaCreateUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewMediaCreateInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[POST /api/{api_version}/media] mediaCreate", response, response.Code())
}
}
// NewMediaCreateOK creates a MediaCreateOK with default headers values
func NewMediaCreateOK() *MediaCreateOK {
return &MediaCreateOK{}
}
/*
MediaCreateOK describes a response with status code 200, with default header values.
The newly-created media attachment.
*/
type MediaCreateOK struct {
Payload *models.Attachment
}
// IsSuccess returns true when this media create o k response has a 2xx status code
func (o *MediaCreateOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this media create o k response has a 3xx status code
func (o *MediaCreateOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this media create o k response has a 4xx status code
func (o *MediaCreateOK) IsClientError() bool {
return false
}
// IsServerError returns true when this media create o k response has a 5xx status code
func (o *MediaCreateOK) IsServerError() bool {
return false
}
// IsCode returns true when this media create o k response a status code equal to that given
func (o *MediaCreateOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the media create o k response
func (o *MediaCreateOK) Code() int {
return 200
}
func (o *MediaCreateOK) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /api/{api_version}/media][%d] mediaCreateOK %s", 200, payload)
}
func (o *MediaCreateOK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /api/{api_version}/media][%d] mediaCreateOK %s", 200, payload)
}
func (o *MediaCreateOK) GetPayload() *models.Attachment {
return o.Payload
}
func (o *MediaCreateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Attachment)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewMediaCreateBadRequest creates a MediaCreateBadRequest with default headers values
func NewMediaCreateBadRequest() *MediaCreateBadRequest {
return &MediaCreateBadRequest{}
}
/*
MediaCreateBadRequest describes a response with status code 400, with default header values.
bad request
*/
type MediaCreateBadRequest struct {
}
// IsSuccess returns true when this media create bad request response has a 2xx status code
func (o *MediaCreateBadRequest) IsSuccess() bool {
return false
}
// IsRedirect returns true when this media create bad request response has a 3xx status code
func (o *MediaCreateBadRequest) IsRedirect() bool {
return false
}
// IsClientError returns true when this media create bad request response has a 4xx status code
func (o *MediaCreateBadRequest) IsClientError() bool {
return true
}
// IsServerError returns true when this media create bad request response has a 5xx status code
func (o *MediaCreateBadRequest) IsServerError() bool {
return false
}
// IsCode returns true when this media create bad request response a status code equal to that given
func (o *MediaCreateBadRequest) IsCode(code int) bool {
return code == 400
}
// Code gets the status code for the media create bad request response
func (o *MediaCreateBadRequest) Code() int {
return 400
}
func (o *MediaCreateBadRequest) Error() string {
return fmt.Sprintf("[POST /api/{api_version}/media][%d] mediaCreateBadRequest", 400)
}
func (o *MediaCreateBadRequest) String() string {
return fmt.Sprintf("[POST /api/{api_version}/media][%d] mediaCreateBadRequest", 400)
}
func (o *MediaCreateBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewMediaCreateUnauthorized creates a MediaCreateUnauthorized with default headers values
func NewMediaCreateUnauthorized() *MediaCreateUnauthorized {
return &MediaCreateUnauthorized{}
}
/*
MediaCreateUnauthorized describes a response with status code 401, with default header values.
unauthorized
*/
type MediaCreateUnauthorized struct {
}
// IsSuccess returns true when this media create unauthorized response has a 2xx status code
func (o *MediaCreateUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this media create unauthorized response has a 3xx status code
func (o *MediaCreateUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this media create unauthorized response has a 4xx status code
func (o *MediaCreateUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this media create unauthorized response has a 5xx status code
func (o *MediaCreateUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this media create unauthorized response a status code equal to that given
func (o *MediaCreateUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the media create unauthorized response
func (o *MediaCreateUnauthorized) Code() int {
return 401
}
func (o *MediaCreateUnauthorized) Error() string {
return fmt.Sprintf("[POST /api/{api_version}/media][%d] mediaCreateUnauthorized", 401)
}
func (o *MediaCreateUnauthorized) String() string {
return fmt.Sprintf("[POST /api/{api_version}/media][%d] mediaCreateUnauthorized", 401)
}
func (o *MediaCreateUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewMediaCreateUnprocessableEntity creates a MediaCreateUnprocessableEntity with default headers values
func NewMediaCreateUnprocessableEntity() *MediaCreateUnprocessableEntity {
return &MediaCreateUnprocessableEntity{}
}
/*
MediaCreateUnprocessableEntity describes a response with status code 422, with default header values.
unprocessable
*/
type MediaCreateUnprocessableEntity struct {
}
// IsSuccess returns true when this media create unprocessable entity response has a 2xx status code
func (o *MediaCreateUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this media create unprocessable entity response has a 3xx status code
func (o *MediaCreateUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this media create unprocessable entity response has a 4xx status code
func (o *MediaCreateUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this media create unprocessable entity response has a 5xx status code
func (o *MediaCreateUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this media create unprocessable entity response a status code equal to that given
func (o *MediaCreateUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the media create unprocessable entity response
func (o *MediaCreateUnprocessableEntity) Code() int {
return 422
}
func (o *MediaCreateUnprocessableEntity) Error() string {
return fmt.Sprintf("[POST /api/{api_version}/media][%d] mediaCreateUnprocessableEntity", 422)
}
func (o *MediaCreateUnprocessableEntity) String() string {
return fmt.Sprintf("[POST /api/{api_version}/media][%d] mediaCreateUnprocessableEntity", 422)
}
func (o *MediaCreateUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewMediaCreateInternalServerError creates a MediaCreateInternalServerError with default headers values
func NewMediaCreateInternalServerError() *MediaCreateInternalServerError {
return &MediaCreateInternalServerError{}
}
/*
MediaCreateInternalServerError describes a response with status code 500, with default header values.
internal server error
*/
type MediaCreateInternalServerError struct {
}
// IsSuccess returns true when this media create internal server error response has a 2xx status code
func (o *MediaCreateInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this media create internal server error response has a 3xx status code
func (o *MediaCreateInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this media create internal server error response has a 4xx status code
func (o *MediaCreateInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this media create internal server error response has a 5xx status code
func (o *MediaCreateInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this media create internal server error response a status code equal to that given
func (o *MediaCreateInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the media create internal server error response
func (o *MediaCreateInternalServerError) Code() int {
return 500
}
func (o *MediaCreateInternalServerError) Error() string {
return fmt.Sprintf("[POST /api/{api_version}/media][%d] mediaCreateInternalServerError", 500)
}
func (o *MediaCreateInternalServerError) String() string {
return fmt.Sprintf("[POST /api/{api_version}/media][%d] mediaCreateInternalServerError", 500)
}
func (o *MediaCreateInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}