autogits/bots-common/gitea-generated/client/user/update_user_variable_responses.go
Adam Majer 598ecbbd5a .
2024-07-07 21:12:40 +02:00

291 lines
9.2 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package user
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
)
// UpdateUserVariableReader is a Reader for the UpdateUserVariable structure.
type UpdateUserVariableReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *UpdateUserVariableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 201:
result := NewUpdateUserVariableCreated()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 204:
result := NewUpdateUserVariableNoContent()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewUpdateUserVariableBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewUpdateUserVariableNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[PUT /user/actions/variables/{variablename}] updateUserVariable", response, response.Code())
}
}
// NewUpdateUserVariableCreated creates a UpdateUserVariableCreated with default headers values
func NewUpdateUserVariableCreated() *UpdateUserVariableCreated {
return &UpdateUserVariableCreated{}
}
/*
UpdateUserVariableCreated describes a response with status code 201, with default header values.
response when updating a variable
*/
type UpdateUserVariableCreated struct {
}
// IsSuccess returns true when this update user variable created response has a 2xx status code
func (o *UpdateUserVariableCreated) IsSuccess() bool {
return true
}
// IsRedirect returns true when this update user variable created response has a 3xx status code
func (o *UpdateUserVariableCreated) IsRedirect() bool {
return false
}
// IsClientError returns true when this update user variable created response has a 4xx status code
func (o *UpdateUserVariableCreated) IsClientError() bool {
return false
}
// IsServerError returns true when this update user variable created response has a 5xx status code
func (o *UpdateUserVariableCreated) IsServerError() bool {
return false
}
// IsCode returns true when this update user variable created response a status code equal to that given
func (o *UpdateUserVariableCreated) IsCode(code int) bool {
return code == 201
}
// Code gets the status code for the update user variable created response
func (o *UpdateUserVariableCreated) Code() int {
return 201
}
func (o *UpdateUserVariableCreated) Error() string {
return fmt.Sprintf("[PUT /user/actions/variables/{variablename}][%d] updateUserVariableCreated", 201)
}
func (o *UpdateUserVariableCreated) String() string {
return fmt.Sprintf("[PUT /user/actions/variables/{variablename}][%d] updateUserVariableCreated", 201)
}
func (o *UpdateUserVariableCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewUpdateUserVariableNoContent creates a UpdateUserVariableNoContent with default headers values
func NewUpdateUserVariableNoContent() *UpdateUserVariableNoContent {
return &UpdateUserVariableNoContent{}
}
/*
UpdateUserVariableNoContent describes a response with status code 204, with default header values.
response when updating a variable
*/
type UpdateUserVariableNoContent struct {
}
// IsSuccess returns true when this update user variable no content response has a 2xx status code
func (o *UpdateUserVariableNoContent) IsSuccess() bool {
return true
}
// IsRedirect returns true when this update user variable no content response has a 3xx status code
func (o *UpdateUserVariableNoContent) IsRedirect() bool {
return false
}
// IsClientError returns true when this update user variable no content response has a 4xx status code
func (o *UpdateUserVariableNoContent) IsClientError() bool {
return false
}
// IsServerError returns true when this update user variable no content response has a 5xx status code
func (o *UpdateUserVariableNoContent) IsServerError() bool {
return false
}
// IsCode returns true when this update user variable no content response a status code equal to that given
func (o *UpdateUserVariableNoContent) IsCode(code int) bool {
return code == 204
}
// Code gets the status code for the update user variable no content response
func (o *UpdateUserVariableNoContent) Code() int {
return 204
}
func (o *UpdateUserVariableNoContent) Error() string {
return fmt.Sprintf("[PUT /user/actions/variables/{variablename}][%d] updateUserVariableNoContent", 204)
}
func (o *UpdateUserVariableNoContent) String() string {
return fmt.Sprintf("[PUT /user/actions/variables/{variablename}][%d] updateUserVariableNoContent", 204)
}
func (o *UpdateUserVariableNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewUpdateUserVariableBadRequest creates a UpdateUserVariableBadRequest with default headers values
func NewUpdateUserVariableBadRequest() *UpdateUserVariableBadRequest {
return &UpdateUserVariableBadRequest{}
}
/*
UpdateUserVariableBadRequest describes a response with status code 400, with default header values.
APIError is error format response
*/
type UpdateUserVariableBadRequest struct {
Message string
URL string
}
// IsSuccess returns true when this update user variable bad request response has a 2xx status code
func (o *UpdateUserVariableBadRequest) IsSuccess() bool {
return false
}
// IsRedirect returns true when this update user variable bad request response has a 3xx status code
func (o *UpdateUserVariableBadRequest) IsRedirect() bool {
return false
}
// IsClientError returns true when this update user variable bad request response has a 4xx status code
func (o *UpdateUserVariableBadRequest) IsClientError() bool {
return true
}
// IsServerError returns true when this update user variable bad request response has a 5xx status code
func (o *UpdateUserVariableBadRequest) IsServerError() bool {
return false
}
// IsCode returns true when this update user variable bad request response a status code equal to that given
func (o *UpdateUserVariableBadRequest) IsCode(code int) bool {
return code == 400
}
// Code gets the status code for the update user variable bad request response
func (o *UpdateUserVariableBadRequest) Code() int {
return 400
}
func (o *UpdateUserVariableBadRequest) Error() string {
return fmt.Sprintf("[PUT /user/actions/variables/{variablename}][%d] updateUserVariableBadRequest", 400)
}
func (o *UpdateUserVariableBadRequest) String() string {
return fmt.Sprintf("[PUT /user/actions/variables/{variablename}][%d] updateUserVariableBadRequest", 400)
}
func (o *UpdateUserVariableBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header message
hdrMessage := response.GetHeader("message")
if hdrMessage != "" {
o.Message = hdrMessage
}
// hydrates response header url
hdrURL := response.GetHeader("url")
if hdrURL != "" {
o.URL = hdrURL
}
return nil
}
// NewUpdateUserVariableNotFound creates a UpdateUserVariableNotFound with default headers values
func NewUpdateUserVariableNotFound() *UpdateUserVariableNotFound {
return &UpdateUserVariableNotFound{}
}
/*
UpdateUserVariableNotFound describes a response with status code 404, with default header values.
APINotFound is a not found empty response
*/
type UpdateUserVariableNotFound struct {
}
// IsSuccess returns true when this update user variable not found response has a 2xx status code
func (o *UpdateUserVariableNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this update user variable not found response has a 3xx status code
func (o *UpdateUserVariableNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this update user variable not found response has a 4xx status code
func (o *UpdateUserVariableNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this update user variable not found response has a 5xx status code
func (o *UpdateUserVariableNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this update user variable not found response a status code equal to that given
func (o *UpdateUserVariableNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the update user variable not found response
func (o *UpdateUserVariableNotFound) Code() int {
return 404
}
func (o *UpdateUserVariableNotFound) Error() string {
return fmt.Sprintf("[PUT /user/actions/variables/{variablename}][%d] updateUserVariableNotFound", 404)
}
func (o *UpdateUserVariableNotFound) String() string {
return fmt.Sprintf("[PUT /user/actions/variables/{variablename}][%d] updateUserVariableNotFound", 404)
}
func (o *UpdateUserVariableNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}