decentral1se
e4ade9c758
All checks were successful
continuous-integration/drone/push Build is passing
417 lines
12 KiB
Go
417 lines
12 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"
|
|
)
|
|
|
|
// MediaUpdateReader is a Reader for the MediaUpdate structure.
|
|
type MediaUpdateReader struct {
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ReadResponse reads a server response into the received o.
|
|
func (o *MediaUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
|
switch response.Code() {
|
|
case 200:
|
|
result := NewMediaUpdateOK()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return result, nil
|
|
case 400:
|
|
result := NewMediaUpdateBadRequest()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 401:
|
|
result := NewMediaUpdateUnauthorized()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 404:
|
|
result := NewMediaUpdateNotFound()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 406:
|
|
result := NewMediaUpdateNotAcceptable()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 500:
|
|
result := NewMediaUpdateInternalServerError()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
default:
|
|
return nil, runtime.NewAPIError("[PUT /api/v1/media/{id}] mediaUpdate", response, response.Code())
|
|
}
|
|
}
|
|
|
|
// NewMediaUpdateOK creates a MediaUpdateOK with default headers values
|
|
func NewMediaUpdateOK() *MediaUpdateOK {
|
|
return &MediaUpdateOK{}
|
|
}
|
|
|
|
/*
|
|
MediaUpdateOK describes a response with status code 200, with default header values.
|
|
|
|
The newly-updated media attachment.
|
|
*/
|
|
type MediaUpdateOK struct {
|
|
Payload *models.Attachment
|
|
}
|
|
|
|
// IsSuccess returns true when this media update o k response has a 2xx status code
|
|
func (o *MediaUpdateOK) IsSuccess() bool {
|
|
return true
|
|
}
|
|
|
|
// IsRedirect returns true when this media update o k response has a 3xx status code
|
|
func (o *MediaUpdateOK) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this media update o k response has a 4xx status code
|
|
func (o *MediaUpdateOK) IsClientError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsServerError returns true when this media update o k response has a 5xx status code
|
|
func (o *MediaUpdateOK) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this media update o k response a status code equal to that given
|
|
func (o *MediaUpdateOK) IsCode(code int) bool {
|
|
return code == 200
|
|
}
|
|
|
|
// Code gets the status code for the media update o k response
|
|
func (o *MediaUpdateOK) Code() int {
|
|
return 200
|
|
}
|
|
|
|
func (o *MediaUpdateOK) Error() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[PUT /api/v1/media/{id}][%d] mediaUpdateOK %s", 200, payload)
|
|
}
|
|
|
|
func (o *MediaUpdateOK) String() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[PUT /api/v1/media/{id}][%d] mediaUpdateOK %s", 200, payload)
|
|
}
|
|
|
|
func (o *MediaUpdateOK) GetPayload() *models.Attachment {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *MediaUpdateOK) 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
|
|
}
|
|
|
|
// NewMediaUpdateBadRequest creates a MediaUpdateBadRequest with default headers values
|
|
func NewMediaUpdateBadRequest() *MediaUpdateBadRequest {
|
|
return &MediaUpdateBadRequest{}
|
|
}
|
|
|
|
/*
|
|
MediaUpdateBadRequest describes a response with status code 400, with default header values.
|
|
|
|
bad request
|
|
*/
|
|
type MediaUpdateBadRequest struct {
|
|
}
|
|
|
|
// IsSuccess returns true when this media update bad request response has a 2xx status code
|
|
func (o *MediaUpdateBadRequest) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this media update bad request response has a 3xx status code
|
|
func (o *MediaUpdateBadRequest) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this media update bad request response has a 4xx status code
|
|
func (o *MediaUpdateBadRequest) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this media update bad request response has a 5xx status code
|
|
func (o *MediaUpdateBadRequest) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this media update bad request response a status code equal to that given
|
|
func (o *MediaUpdateBadRequest) IsCode(code int) bool {
|
|
return code == 400
|
|
}
|
|
|
|
// Code gets the status code for the media update bad request response
|
|
func (o *MediaUpdateBadRequest) Code() int {
|
|
return 400
|
|
}
|
|
|
|
func (o *MediaUpdateBadRequest) Error() string {
|
|
return fmt.Sprintf("[PUT /api/v1/media/{id}][%d] mediaUpdateBadRequest", 400)
|
|
}
|
|
|
|
func (o *MediaUpdateBadRequest) String() string {
|
|
return fmt.Sprintf("[PUT /api/v1/media/{id}][%d] mediaUpdateBadRequest", 400)
|
|
}
|
|
|
|
func (o *MediaUpdateBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewMediaUpdateUnauthorized creates a MediaUpdateUnauthorized with default headers values
|
|
func NewMediaUpdateUnauthorized() *MediaUpdateUnauthorized {
|
|
return &MediaUpdateUnauthorized{}
|
|
}
|
|
|
|
/*
|
|
MediaUpdateUnauthorized describes a response with status code 401, with default header values.
|
|
|
|
unauthorized
|
|
*/
|
|
type MediaUpdateUnauthorized struct {
|
|
}
|
|
|
|
// IsSuccess returns true when this media update unauthorized response has a 2xx status code
|
|
func (o *MediaUpdateUnauthorized) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this media update unauthorized response has a 3xx status code
|
|
func (o *MediaUpdateUnauthorized) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this media update unauthorized response has a 4xx status code
|
|
func (o *MediaUpdateUnauthorized) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this media update unauthorized response has a 5xx status code
|
|
func (o *MediaUpdateUnauthorized) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this media update unauthorized response a status code equal to that given
|
|
func (o *MediaUpdateUnauthorized) IsCode(code int) bool {
|
|
return code == 401
|
|
}
|
|
|
|
// Code gets the status code for the media update unauthorized response
|
|
func (o *MediaUpdateUnauthorized) Code() int {
|
|
return 401
|
|
}
|
|
|
|
func (o *MediaUpdateUnauthorized) Error() string {
|
|
return fmt.Sprintf("[PUT /api/v1/media/{id}][%d] mediaUpdateUnauthorized", 401)
|
|
}
|
|
|
|
func (o *MediaUpdateUnauthorized) String() string {
|
|
return fmt.Sprintf("[PUT /api/v1/media/{id}][%d] mediaUpdateUnauthorized", 401)
|
|
}
|
|
|
|
func (o *MediaUpdateUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewMediaUpdateNotFound creates a MediaUpdateNotFound with default headers values
|
|
func NewMediaUpdateNotFound() *MediaUpdateNotFound {
|
|
return &MediaUpdateNotFound{}
|
|
}
|
|
|
|
/*
|
|
MediaUpdateNotFound describes a response with status code 404, with default header values.
|
|
|
|
not found
|
|
*/
|
|
type MediaUpdateNotFound struct {
|
|
}
|
|
|
|
// IsSuccess returns true when this media update not found response has a 2xx status code
|
|
func (o *MediaUpdateNotFound) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this media update not found response has a 3xx status code
|
|
func (o *MediaUpdateNotFound) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this media update not found response has a 4xx status code
|
|
func (o *MediaUpdateNotFound) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this media update not found response has a 5xx status code
|
|
func (o *MediaUpdateNotFound) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this media update not found response a status code equal to that given
|
|
func (o *MediaUpdateNotFound) IsCode(code int) bool {
|
|
return code == 404
|
|
}
|
|
|
|
// Code gets the status code for the media update not found response
|
|
func (o *MediaUpdateNotFound) Code() int {
|
|
return 404
|
|
}
|
|
|
|
func (o *MediaUpdateNotFound) Error() string {
|
|
return fmt.Sprintf("[PUT /api/v1/media/{id}][%d] mediaUpdateNotFound", 404)
|
|
}
|
|
|
|
func (o *MediaUpdateNotFound) String() string {
|
|
return fmt.Sprintf("[PUT /api/v1/media/{id}][%d] mediaUpdateNotFound", 404)
|
|
}
|
|
|
|
func (o *MediaUpdateNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewMediaUpdateNotAcceptable creates a MediaUpdateNotAcceptable with default headers values
|
|
func NewMediaUpdateNotAcceptable() *MediaUpdateNotAcceptable {
|
|
return &MediaUpdateNotAcceptable{}
|
|
}
|
|
|
|
/*
|
|
MediaUpdateNotAcceptable describes a response with status code 406, with default header values.
|
|
|
|
not acceptable
|
|
*/
|
|
type MediaUpdateNotAcceptable struct {
|
|
}
|
|
|
|
// IsSuccess returns true when this media update not acceptable response has a 2xx status code
|
|
func (o *MediaUpdateNotAcceptable) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this media update not acceptable response has a 3xx status code
|
|
func (o *MediaUpdateNotAcceptable) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this media update not acceptable response has a 4xx status code
|
|
func (o *MediaUpdateNotAcceptable) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this media update not acceptable response has a 5xx status code
|
|
func (o *MediaUpdateNotAcceptable) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this media update not acceptable response a status code equal to that given
|
|
func (o *MediaUpdateNotAcceptable) IsCode(code int) bool {
|
|
return code == 406
|
|
}
|
|
|
|
// Code gets the status code for the media update not acceptable response
|
|
func (o *MediaUpdateNotAcceptable) Code() int {
|
|
return 406
|
|
}
|
|
|
|
func (o *MediaUpdateNotAcceptable) Error() string {
|
|
return fmt.Sprintf("[PUT /api/v1/media/{id}][%d] mediaUpdateNotAcceptable", 406)
|
|
}
|
|
|
|
func (o *MediaUpdateNotAcceptable) String() string {
|
|
return fmt.Sprintf("[PUT /api/v1/media/{id}][%d] mediaUpdateNotAcceptable", 406)
|
|
}
|
|
|
|
func (o *MediaUpdateNotAcceptable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewMediaUpdateInternalServerError creates a MediaUpdateInternalServerError with default headers values
|
|
func NewMediaUpdateInternalServerError() *MediaUpdateInternalServerError {
|
|
return &MediaUpdateInternalServerError{}
|
|
}
|
|
|
|
/*
|
|
MediaUpdateInternalServerError describes a response with status code 500, with default header values.
|
|
|
|
internal server error
|
|
*/
|
|
type MediaUpdateInternalServerError struct {
|
|
}
|
|
|
|
// IsSuccess returns true when this media update internal server error response has a 2xx status code
|
|
func (o *MediaUpdateInternalServerError) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this media update internal server error response has a 3xx status code
|
|
func (o *MediaUpdateInternalServerError) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this media update internal server error response has a 4xx status code
|
|
func (o *MediaUpdateInternalServerError) IsClientError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsServerError returns true when this media update internal server error response has a 5xx status code
|
|
func (o *MediaUpdateInternalServerError) IsServerError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsCode returns true when this media update internal server error response a status code equal to that given
|
|
func (o *MediaUpdateInternalServerError) IsCode(code int) bool {
|
|
return code == 500
|
|
}
|
|
|
|
// Code gets the status code for the media update internal server error response
|
|
func (o *MediaUpdateInternalServerError) Code() int {
|
|
return 500
|
|
}
|
|
|
|
func (o *MediaUpdateInternalServerError) Error() string {
|
|
return fmt.Sprintf("[PUT /api/v1/media/{id}][%d] mediaUpdateInternalServerError", 500)
|
|
}
|
|
|
|
func (o *MediaUpdateInternalServerError) String() string {
|
|
return fmt.Sprintf("[PUT /api/v1/media/{id}][%d] mediaUpdateInternalServerError", 500)
|
|
}
|
|
|
|
func (o *MediaUpdateInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
}
|