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

307 lines
9.4 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package admin
// 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"
)
// AdminDeleteUserReader is a Reader for the AdminDeleteUser structure.
type AdminDeleteUserReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *AdminDeleteUserReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 204:
result := NewAdminDeleteUserNoContent()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 403:
result := NewAdminDeleteUserForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewAdminDeleteUserNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewAdminDeleteUserUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[DELETE /admin/users/{username}] adminDeleteUser", response, response.Code())
}
}
// NewAdminDeleteUserNoContent creates a AdminDeleteUserNoContent with default headers values
func NewAdminDeleteUserNoContent() *AdminDeleteUserNoContent {
return &AdminDeleteUserNoContent{}
}
/*
AdminDeleteUserNoContent describes a response with status code 204, with default header values.
APIEmpty is an empty response
*/
type AdminDeleteUserNoContent struct {
}
// IsSuccess returns true when this admin delete user no content response has a 2xx status code
func (o *AdminDeleteUserNoContent) IsSuccess() bool {
return true
}
// IsRedirect returns true when this admin delete user no content response has a 3xx status code
func (o *AdminDeleteUserNoContent) IsRedirect() bool {
return false
}
// IsClientError returns true when this admin delete user no content response has a 4xx status code
func (o *AdminDeleteUserNoContent) IsClientError() bool {
return false
}
// IsServerError returns true when this admin delete user no content response has a 5xx status code
func (o *AdminDeleteUserNoContent) IsServerError() bool {
return false
}
// IsCode returns true when this admin delete user no content response a status code equal to that given
func (o *AdminDeleteUserNoContent) IsCode(code int) bool {
return code == 204
}
// Code gets the status code for the admin delete user no content response
func (o *AdminDeleteUserNoContent) Code() int {
return 204
}
func (o *AdminDeleteUserNoContent) Error() string {
return fmt.Sprintf("[DELETE /admin/users/{username}][%d] adminDeleteUserNoContent", 204)
}
func (o *AdminDeleteUserNoContent) String() string {
return fmt.Sprintf("[DELETE /admin/users/{username}][%d] adminDeleteUserNoContent", 204)
}
func (o *AdminDeleteUserNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAdminDeleteUserForbidden creates a AdminDeleteUserForbidden with default headers values
func NewAdminDeleteUserForbidden() *AdminDeleteUserForbidden {
return &AdminDeleteUserForbidden{}
}
/*
AdminDeleteUserForbidden describes a response with status code 403, with default header values.
APIForbiddenError is a forbidden error response
*/
type AdminDeleteUserForbidden struct {
Message string
URL string
}
// IsSuccess returns true when this admin delete user forbidden response has a 2xx status code
func (o *AdminDeleteUserForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this admin delete user forbidden response has a 3xx status code
func (o *AdminDeleteUserForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this admin delete user forbidden response has a 4xx status code
func (o *AdminDeleteUserForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this admin delete user forbidden response has a 5xx status code
func (o *AdminDeleteUserForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this admin delete user forbidden response a status code equal to that given
func (o *AdminDeleteUserForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the admin delete user forbidden response
func (o *AdminDeleteUserForbidden) Code() int {
return 403
}
func (o *AdminDeleteUserForbidden) Error() string {
return fmt.Sprintf("[DELETE /admin/users/{username}][%d] adminDeleteUserForbidden", 403)
}
func (o *AdminDeleteUserForbidden) String() string {
return fmt.Sprintf("[DELETE /admin/users/{username}][%d] adminDeleteUserForbidden", 403)
}
func (o *AdminDeleteUserForbidden) 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
}
// NewAdminDeleteUserNotFound creates a AdminDeleteUserNotFound with default headers values
func NewAdminDeleteUserNotFound() *AdminDeleteUserNotFound {
return &AdminDeleteUserNotFound{}
}
/*
AdminDeleteUserNotFound describes a response with status code 404, with default header values.
APINotFound is a not found empty response
*/
type AdminDeleteUserNotFound struct {
}
// IsSuccess returns true when this admin delete user not found response has a 2xx status code
func (o *AdminDeleteUserNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this admin delete user not found response has a 3xx status code
func (o *AdminDeleteUserNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this admin delete user not found response has a 4xx status code
func (o *AdminDeleteUserNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this admin delete user not found response has a 5xx status code
func (o *AdminDeleteUserNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this admin delete user not found response a status code equal to that given
func (o *AdminDeleteUserNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the admin delete user not found response
func (o *AdminDeleteUserNotFound) Code() int {
return 404
}
func (o *AdminDeleteUserNotFound) Error() string {
return fmt.Sprintf("[DELETE /admin/users/{username}][%d] adminDeleteUserNotFound", 404)
}
func (o *AdminDeleteUserNotFound) String() string {
return fmt.Sprintf("[DELETE /admin/users/{username}][%d] adminDeleteUserNotFound", 404)
}
func (o *AdminDeleteUserNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAdminDeleteUserUnprocessableEntity creates a AdminDeleteUserUnprocessableEntity with default headers values
func NewAdminDeleteUserUnprocessableEntity() *AdminDeleteUserUnprocessableEntity {
return &AdminDeleteUserUnprocessableEntity{}
}
/*
AdminDeleteUserUnprocessableEntity describes a response with status code 422, with default header values.
APIValidationError is error format response related to input validation
*/
type AdminDeleteUserUnprocessableEntity struct {
Message string
URL string
}
// IsSuccess returns true when this admin delete user unprocessable entity response has a 2xx status code
func (o *AdminDeleteUserUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this admin delete user unprocessable entity response has a 3xx status code
func (o *AdminDeleteUserUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this admin delete user unprocessable entity response has a 4xx status code
func (o *AdminDeleteUserUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this admin delete user unprocessable entity response has a 5xx status code
func (o *AdminDeleteUserUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this admin delete user unprocessable entity response a status code equal to that given
func (o *AdminDeleteUserUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the admin delete user unprocessable entity response
func (o *AdminDeleteUserUnprocessableEntity) Code() int {
return 422
}
func (o *AdminDeleteUserUnprocessableEntity) Error() string {
return fmt.Sprintf("[DELETE /admin/users/{username}][%d] adminDeleteUserUnprocessableEntity", 422)
}
func (o *AdminDeleteUserUnprocessableEntity) String() string {
return fmt.Sprintf("[DELETE /admin/users/{username}][%d] adminDeleteUserUnprocessableEntity", 422)
}
func (o *AdminDeleteUserUnprocessableEntity) 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
}