autogits/bots-common/gitea-generated/client/admin/admin_add_user_badges_responses.go

167 lines
5.1 KiB
Go
Raw Normal View History

2024-07-07 21:08:41 +02:00
// 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"
)
// AdminAddUserBadgesReader is a Reader for the AdminAddUserBadges structure.
type AdminAddUserBadgesReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *AdminAddUserBadgesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 204:
result := NewAdminAddUserBadgesNoContent()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 403:
result := NewAdminAddUserBadgesForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[POST /admin/users/{username}/badges] adminAddUserBadges", response, response.Code())
}
}
// NewAdminAddUserBadgesNoContent creates a AdminAddUserBadgesNoContent with default headers values
func NewAdminAddUserBadgesNoContent() *AdminAddUserBadgesNoContent {
return &AdminAddUserBadgesNoContent{}
}
/*
AdminAddUserBadgesNoContent describes a response with status code 204, with default header values.
APIEmpty is an empty response
*/
type AdminAddUserBadgesNoContent struct {
}
// IsSuccess returns true when this admin add user badges no content response has a 2xx status code
func (o *AdminAddUserBadgesNoContent) IsSuccess() bool {
return true
}
// IsRedirect returns true when this admin add user badges no content response has a 3xx status code
func (o *AdminAddUserBadgesNoContent) IsRedirect() bool {
return false
}
// IsClientError returns true when this admin add user badges no content response has a 4xx status code
func (o *AdminAddUserBadgesNoContent) IsClientError() bool {
return false
}
// IsServerError returns true when this admin add user badges no content response has a 5xx status code
func (o *AdminAddUserBadgesNoContent) IsServerError() bool {
return false
}
// IsCode returns true when this admin add user badges no content response a status code equal to that given
func (o *AdminAddUserBadgesNoContent) IsCode(code int) bool {
return code == 204
}
// Code gets the status code for the admin add user badges no content response
func (o *AdminAddUserBadgesNoContent) Code() int {
return 204
}
func (o *AdminAddUserBadgesNoContent) Error() string {
return fmt.Sprintf("[POST /admin/users/{username}/badges][%d] adminAddUserBadgesNoContent", 204)
}
func (o *AdminAddUserBadgesNoContent) String() string {
return fmt.Sprintf("[POST /admin/users/{username}/badges][%d] adminAddUserBadgesNoContent", 204)
}
func (o *AdminAddUserBadgesNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAdminAddUserBadgesForbidden creates a AdminAddUserBadgesForbidden with default headers values
func NewAdminAddUserBadgesForbidden() *AdminAddUserBadgesForbidden {
return &AdminAddUserBadgesForbidden{}
}
/*
AdminAddUserBadgesForbidden describes a response with status code 403, with default header values.
APIForbiddenError is a forbidden error response
*/
type AdminAddUserBadgesForbidden struct {
Message string
URL string
}
// IsSuccess returns true when this admin add user badges forbidden response has a 2xx status code
func (o *AdminAddUserBadgesForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this admin add user badges forbidden response has a 3xx status code
func (o *AdminAddUserBadgesForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this admin add user badges forbidden response has a 4xx status code
func (o *AdminAddUserBadgesForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this admin add user badges forbidden response has a 5xx status code
func (o *AdminAddUserBadgesForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this admin add user badges forbidden response a status code equal to that given
func (o *AdminAddUserBadgesForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the admin add user badges forbidden response
func (o *AdminAddUserBadgesForbidden) Code() int {
return 403
}
func (o *AdminAddUserBadgesForbidden) Error() string {
return fmt.Sprintf("[POST /admin/users/{username}/badges][%d] adminAddUserBadgesForbidden", 403)
}
func (o *AdminAddUserBadgesForbidden) String() string {
return fmt.Sprintf("[POST /admin/users/{username}/badges][%d] adminAddUserBadgesForbidden", 403)
}
func (o *AdminAddUserBadgesForbidden) 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
}