245 lines
8.0 KiB
Go
245 lines
8.0 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"
|
|
)
|
|
|
|
// AdminDeleteUserBadgesReader is a Reader for the AdminDeleteUserBadges structure.
|
|
type AdminDeleteUserBadgesReader struct {
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ReadResponse reads a server response into the received o.
|
|
func (o *AdminDeleteUserBadgesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
|
switch response.Code() {
|
|
case 204:
|
|
result := NewAdminDeleteUserBadgesNoContent()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return result, nil
|
|
case 403:
|
|
result := NewAdminDeleteUserBadgesForbidden()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 422:
|
|
result := NewAdminDeleteUserBadgesUnprocessableEntity()
|
|
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}/badges] adminDeleteUserBadges", response, response.Code())
|
|
}
|
|
}
|
|
|
|
// NewAdminDeleteUserBadgesNoContent creates a AdminDeleteUserBadgesNoContent with default headers values
|
|
func NewAdminDeleteUserBadgesNoContent() *AdminDeleteUserBadgesNoContent {
|
|
return &AdminDeleteUserBadgesNoContent{}
|
|
}
|
|
|
|
/*
|
|
AdminDeleteUserBadgesNoContent describes a response with status code 204, with default header values.
|
|
|
|
APIEmpty is an empty response
|
|
*/
|
|
type AdminDeleteUserBadgesNoContent struct {
|
|
}
|
|
|
|
// IsSuccess returns true when this admin delete user badges no content response has a 2xx status code
|
|
func (o *AdminDeleteUserBadgesNoContent) IsSuccess() bool {
|
|
return true
|
|
}
|
|
|
|
// IsRedirect returns true when this admin delete user badges no content response has a 3xx status code
|
|
func (o *AdminDeleteUserBadgesNoContent) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this admin delete user badges no content response has a 4xx status code
|
|
func (o *AdminDeleteUserBadgesNoContent) IsClientError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsServerError returns true when this admin delete user badges no content response has a 5xx status code
|
|
func (o *AdminDeleteUserBadgesNoContent) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this admin delete user badges no content response a status code equal to that given
|
|
func (o *AdminDeleteUserBadgesNoContent) IsCode(code int) bool {
|
|
return code == 204
|
|
}
|
|
|
|
// Code gets the status code for the admin delete user badges no content response
|
|
func (o *AdminDeleteUserBadgesNoContent) Code() int {
|
|
return 204
|
|
}
|
|
|
|
func (o *AdminDeleteUserBadgesNoContent) Error() string {
|
|
return fmt.Sprintf("[DELETE /admin/users/{username}/badges][%d] adminDeleteUserBadgesNoContent", 204)
|
|
}
|
|
|
|
func (o *AdminDeleteUserBadgesNoContent) String() string {
|
|
return fmt.Sprintf("[DELETE /admin/users/{username}/badges][%d] adminDeleteUserBadgesNoContent", 204)
|
|
}
|
|
|
|
func (o *AdminDeleteUserBadgesNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewAdminDeleteUserBadgesForbidden creates a AdminDeleteUserBadgesForbidden with default headers values
|
|
func NewAdminDeleteUserBadgesForbidden() *AdminDeleteUserBadgesForbidden {
|
|
return &AdminDeleteUserBadgesForbidden{}
|
|
}
|
|
|
|
/*
|
|
AdminDeleteUserBadgesForbidden describes a response with status code 403, with default header values.
|
|
|
|
APIForbiddenError is a forbidden error response
|
|
*/
|
|
type AdminDeleteUserBadgesForbidden struct {
|
|
Message string
|
|
URL string
|
|
}
|
|
|
|
// IsSuccess returns true when this admin delete user badges forbidden response has a 2xx status code
|
|
func (o *AdminDeleteUserBadgesForbidden) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this admin delete user badges forbidden response has a 3xx status code
|
|
func (o *AdminDeleteUserBadgesForbidden) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this admin delete user badges forbidden response has a 4xx status code
|
|
func (o *AdminDeleteUserBadgesForbidden) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this admin delete user badges forbidden response has a 5xx status code
|
|
func (o *AdminDeleteUserBadgesForbidden) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this admin delete user badges forbidden response a status code equal to that given
|
|
func (o *AdminDeleteUserBadgesForbidden) IsCode(code int) bool {
|
|
return code == 403
|
|
}
|
|
|
|
// Code gets the status code for the admin delete user badges forbidden response
|
|
func (o *AdminDeleteUserBadgesForbidden) Code() int {
|
|
return 403
|
|
}
|
|
|
|
func (o *AdminDeleteUserBadgesForbidden) Error() string {
|
|
return fmt.Sprintf("[DELETE /admin/users/{username}/badges][%d] adminDeleteUserBadgesForbidden", 403)
|
|
}
|
|
|
|
func (o *AdminDeleteUserBadgesForbidden) String() string {
|
|
return fmt.Sprintf("[DELETE /admin/users/{username}/badges][%d] adminDeleteUserBadgesForbidden", 403)
|
|
}
|
|
|
|
func (o *AdminDeleteUserBadgesForbidden) 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
|
|
}
|
|
|
|
// NewAdminDeleteUserBadgesUnprocessableEntity creates a AdminDeleteUserBadgesUnprocessableEntity with default headers values
|
|
func NewAdminDeleteUserBadgesUnprocessableEntity() *AdminDeleteUserBadgesUnprocessableEntity {
|
|
return &AdminDeleteUserBadgesUnprocessableEntity{}
|
|
}
|
|
|
|
/*
|
|
AdminDeleteUserBadgesUnprocessableEntity describes a response with status code 422, with default header values.
|
|
|
|
APIValidationError is error format response related to input validation
|
|
*/
|
|
type AdminDeleteUserBadgesUnprocessableEntity struct {
|
|
Message string
|
|
URL string
|
|
}
|
|
|
|
// IsSuccess returns true when this admin delete user badges unprocessable entity response has a 2xx status code
|
|
func (o *AdminDeleteUserBadgesUnprocessableEntity) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this admin delete user badges unprocessable entity response has a 3xx status code
|
|
func (o *AdminDeleteUserBadgesUnprocessableEntity) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this admin delete user badges unprocessable entity response has a 4xx status code
|
|
func (o *AdminDeleteUserBadgesUnprocessableEntity) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this admin delete user badges unprocessable entity response has a 5xx status code
|
|
func (o *AdminDeleteUserBadgesUnprocessableEntity) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this admin delete user badges unprocessable entity response a status code equal to that given
|
|
func (o *AdminDeleteUserBadgesUnprocessableEntity) IsCode(code int) bool {
|
|
return code == 422
|
|
}
|
|
|
|
// Code gets the status code for the admin delete user badges unprocessable entity response
|
|
func (o *AdminDeleteUserBadgesUnprocessableEntity) Code() int {
|
|
return 422
|
|
}
|
|
|
|
func (o *AdminDeleteUserBadgesUnprocessableEntity) Error() string {
|
|
return fmt.Sprintf("[DELETE /admin/users/{username}/badges][%d] adminDeleteUserBadgesUnprocessableEntity", 422)
|
|
}
|
|
|
|
func (o *AdminDeleteUserBadgesUnprocessableEntity) String() string {
|
|
return fmt.Sprintf("[DELETE /admin/users/{username}/badges][%d] adminDeleteUserBadgesUnprocessableEntity", 422)
|
|
}
|
|
|
|
func (o *AdminDeleteUserBadgesUnprocessableEntity) 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
|
|
}
|