autogits/bots-common/gitea-generated/client/user/user_block_user_responses.go

229 lines
7.0 KiB
Go
Raw Normal View History

2024-07-07 21:08:41 +02:00
// 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"
)
// UserBlockUserReader is a Reader for the UserBlockUser structure.
type UserBlockUserReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *UserBlockUserReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 204:
result := NewUserBlockUserNoContent()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 404:
result := NewUserBlockUserNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewUserBlockUserUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[PUT /user/blocks/{username}] userBlockUser", response, response.Code())
}
}
// NewUserBlockUserNoContent creates a UserBlockUserNoContent with default headers values
func NewUserBlockUserNoContent() *UserBlockUserNoContent {
return &UserBlockUserNoContent{}
}
/*
UserBlockUserNoContent describes a response with status code 204, with default header values.
APIEmpty is an empty response
*/
type UserBlockUserNoContent struct {
}
// IsSuccess returns true when this user block user no content response has a 2xx status code
func (o *UserBlockUserNoContent) IsSuccess() bool {
return true
}
// IsRedirect returns true when this user block user no content response has a 3xx status code
func (o *UserBlockUserNoContent) IsRedirect() bool {
return false
}
// IsClientError returns true when this user block user no content response has a 4xx status code
func (o *UserBlockUserNoContent) IsClientError() bool {
return false
}
// IsServerError returns true when this user block user no content response has a 5xx status code
func (o *UserBlockUserNoContent) IsServerError() bool {
return false
}
// IsCode returns true when this user block user no content response a status code equal to that given
func (o *UserBlockUserNoContent) IsCode(code int) bool {
return code == 204
}
// Code gets the status code for the user block user no content response
func (o *UserBlockUserNoContent) Code() int {
return 204
}
func (o *UserBlockUserNoContent) Error() string {
return fmt.Sprintf("[PUT /user/blocks/{username}][%d] userBlockUserNoContent", 204)
}
func (o *UserBlockUserNoContent) String() string {
return fmt.Sprintf("[PUT /user/blocks/{username}][%d] userBlockUserNoContent", 204)
}
func (o *UserBlockUserNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewUserBlockUserNotFound creates a UserBlockUserNotFound with default headers values
func NewUserBlockUserNotFound() *UserBlockUserNotFound {
return &UserBlockUserNotFound{}
}
/*
UserBlockUserNotFound describes a response with status code 404, with default header values.
APINotFound is a not found empty response
*/
type UserBlockUserNotFound struct {
}
// IsSuccess returns true when this user block user not found response has a 2xx status code
func (o *UserBlockUserNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this user block user not found response has a 3xx status code
func (o *UserBlockUserNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this user block user not found response has a 4xx status code
func (o *UserBlockUserNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this user block user not found response has a 5xx status code
func (o *UserBlockUserNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this user block user not found response a status code equal to that given
func (o *UserBlockUserNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the user block user not found response
func (o *UserBlockUserNotFound) Code() int {
return 404
}
func (o *UserBlockUserNotFound) Error() string {
return fmt.Sprintf("[PUT /user/blocks/{username}][%d] userBlockUserNotFound", 404)
}
func (o *UserBlockUserNotFound) String() string {
return fmt.Sprintf("[PUT /user/blocks/{username}][%d] userBlockUserNotFound", 404)
}
func (o *UserBlockUserNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewUserBlockUserUnprocessableEntity creates a UserBlockUserUnprocessableEntity with default headers values
func NewUserBlockUserUnprocessableEntity() *UserBlockUserUnprocessableEntity {
return &UserBlockUserUnprocessableEntity{}
}
/*
UserBlockUserUnprocessableEntity describes a response with status code 422, with default header values.
APIValidationError is error format response related to input validation
*/
type UserBlockUserUnprocessableEntity struct {
Message string
URL string
}
// IsSuccess returns true when this user block user unprocessable entity response has a 2xx status code
func (o *UserBlockUserUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this user block user unprocessable entity response has a 3xx status code
func (o *UserBlockUserUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this user block user unprocessable entity response has a 4xx status code
func (o *UserBlockUserUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this user block user unprocessable entity response has a 5xx status code
func (o *UserBlockUserUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this user block user unprocessable entity response a status code equal to that given
func (o *UserBlockUserUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the user block user unprocessable entity response
func (o *UserBlockUserUnprocessableEntity) Code() int {
return 422
}
func (o *UserBlockUserUnprocessableEntity) Error() string {
return fmt.Sprintf("[PUT /user/blocks/{username}][%d] userBlockUserUnprocessableEntity", 422)
}
func (o *UserBlockUserUnprocessableEntity) String() string {
return fmt.Sprintf("[PUT /user/blocks/{username}][%d] userBlockUserUnprocessableEntity", 422)
}
func (o *UserBlockUserUnprocessableEntity) 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
}