263 lines
7.6 KiB
Go
263 lines
7.6 KiB
Go
package character
|
|
|
|
// This file was generated by the swagger tool.
|
|
// Editing this file might prove futile when you re-run the swagger generate command
|
|
|
|
import (
|
|
"fmt"
|
|
"io"
|
|
|
|
"github.com/go-openapi/errors"
|
|
"github.com/go-openapi/runtime"
|
|
"github.com/go-openapi/swag"
|
|
"github.com/go-openapi/validate"
|
|
|
|
strfmt "github.com/go-openapi/strfmt"
|
|
)
|
|
|
|
// GetCharactersCharacterIDRolesReader is a Reader for the GetCharactersCharacterIDRoles structure.
|
|
type GetCharactersCharacterIDRolesReader struct {
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ReadResponse reads a server response into the received o.
|
|
func (o *GetCharactersCharacterIDRolesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
|
switch response.Code() {
|
|
|
|
case 200:
|
|
result := NewGetCharactersCharacterIDRolesOK()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return result, nil
|
|
|
|
case 403:
|
|
result := NewGetCharactersCharacterIDRolesForbidden()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
|
|
case 500:
|
|
result := NewGetCharactersCharacterIDRolesInternalServerError()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
|
|
default:
|
|
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
|
}
|
|
}
|
|
|
|
// NewGetCharactersCharacterIDRolesOK creates a GetCharactersCharacterIDRolesOK with default headers values
|
|
func NewGetCharactersCharacterIDRolesOK() *GetCharactersCharacterIDRolesOK {
|
|
return &GetCharactersCharacterIDRolesOK{}
|
|
}
|
|
|
|
/*GetCharactersCharacterIDRolesOK handles this case with default header values.
|
|
|
|
The character's roles in thier corporation
|
|
*/
|
|
type GetCharactersCharacterIDRolesOK struct {
|
|
/*The caching mechanism used
|
|
*/
|
|
CacheControl string
|
|
/*RFC7231 formatted datetime string
|
|
*/
|
|
Expires string
|
|
/*RFC7231 formatted datetime string
|
|
*/
|
|
LastModified string
|
|
|
|
Payload []string
|
|
}
|
|
|
|
func (o *GetCharactersCharacterIDRolesOK) Error() string {
|
|
return fmt.Sprintf("[GET /characters/{character_id}/roles/][%d] getCharactersCharacterIdRolesOK %+v", 200, o.Payload)
|
|
}
|
|
|
|
func (o *GetCharactersCharacterIDRolesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
// response header Cache-Control
|
|
o.CacheControl = response.GetHeader("Cache-Control")
|
|
|
|
// response header Expires
|
|
o.Expires = response.GetHeader("Expires")
|
|
|
|
// response header Last-Modified
|
|
o.LastModified = response.GetHeader("Last-Modified")
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewGetCharactersCharacterIDRolesForbidden creates a GetCharactersCharacterIDRolesForbidden with default headers values
|
|
func NewGetCharactersCharacterIDRolesForbidden() *GetCharactersCharacterIDRolesForbidden {
|
|
return &GetCharactersCharacterIDRolesForbidden{}
|
|
}
|
|
|
|
/*GetCharactersCharacterIDRolesForbidden handles this case with default header values.
|
|
|
|
Forbidden
|
|
*/
|
|
type GetCharactersCharacterIDRolesForbidden struct {
|
|
Payload GetCharactersCharacterIDRolesForbiddenBody
|
|
}
|
|
|
|
func (o *GetCharactersCharacterIDRolesForbidden) Error() string {
|
|
return fmt.Sprintf("[GET /characters/{character_id}/roles/][%d] getCharactersCharacterIdRolesForbidden %+v", 403, o.Payload)
|
|
}
|
|
|
|
func (o *GetCharactersCharacterIDRolesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewGetCharactersCharacterIDRolesInternalServerError creates a GetCharactersCharacterIDRolesInternalServerError with default headers values
|
|
func NewGetCharactersCharacterIDRolesInternalServerError() *GetCharactersCharacterIDRolesInternalServerError {
|
|
return &GetCharactersCharacterIDRolesInternalServerError{}
|
|
}
|
|
|
|
/*GetCharactersCharacterIDRolesInternalServerError handles this case with default header values.
|
|
|
|
Internal server error
|
|
*/
|
|
type GetCharactersCharacterIDRolesInternalServerError struct {
|
|
Payload GetCharactersCharacterIDRolesInternalServerErrorBody
|
|
}
|
|
|
|
func (o *GetCharactersCharacterIDRolesInternalServerError) Error() string {
|
|
return fmt.Sprintf("[GET /characters/{character_id}/roles/][%d] getCharactersCharacterIdRolesInternalServerError %+v", 500, o.Payload)
|
|
}
|
|
|
|
func (o *GetCharactersCharacterIDRolesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
/*GetCharactersCharacterIDRolesForbiddenBody get_characters_character_id_roles_forbidden
|
|
//
|
|
// Forbidden
|
|
swagger:model GetCharactersCharacterIDRolesForbiddenBody
|
|
*/
|
|
type GetCharactersCharacterIDRolesForbiddenBody struct {
|
|
|
|
// get_characters_character_id_roles_403_forbidden
|
|
//
|
|
// Forbidden message
|
|
// Required: true
|
|
Error *string `json:"error"`
|
|
}
|
|
|
|
// Validate validates this get characters character ID roles forbidden body
|
|
func (o *GetCharactersCharacterIDRolesForbiddenBody) Validate(formats strfmt.Registry) error {
|
|
var res []error
|
|
|
|
if err := o.validateError(formats); err != nil {
|
|
// prop
|
|
res = append(res, err)
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (o *GetCharactersCharacterIDRolesForbiddenBody) validateError(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("getCharactersCharacterIdRolesForbidden"+"."+"error", "body", o.Error); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalBinary interface implementation
|
|
func (o *GetCharactersCharacterIDRolesForbiddenBody) MarshalBinary() ([]byte, error) {
|
|
if o == nil {
|
|
return nil, nil
|
|
}
|
|
return swag.WriteJSON(o)
|
|
}
|
|
|
|
// UnmarshalBinary interface implementation
|
|
func (o *GetCharactersCharacterIDRolesForbiddenBody) UnmarshalBinary(b []byte) error {
|
|
var res GetCharactersCharacterIDRolesForbiddenBody
|
|
if err := swag.ReadJSON(b, &res); err != nil {
|
|
return err
|
|
}
|
|
*o = res
|
|
return nil
|
|
}
|
|
|
|
/*GetCharactersCharacterIDRolesInternalServerErrorBody get_characters_character_id_roles_internal_server_error
|
|
//
|
|
// Internal server error
|
|
swagger:model GetCharactersCharacterIDRolesInternalServerErrorBody
|
|
*/
|
|
type GetCharactersCharacterIDRolesInternalServerErrorBody struct {
|
|
|
|
// get_characters_character_id_roles_500_internal_server_error
|
|
//
|
|
// Internal server error message
|
|
// Required: true
|
|
Error *string `json:"error"`
|
|
}
|
|
|
|
// Validate validates this get characters character ID roles internal server error body
|
|
func (o *GetCharactersCharacterIDRolesInternalServerErrorBody) Validate(formats strfmt.Registry) error {
|
|
var res []error
|
|
|
|
if err := o.validateError(formats); err != nil {
|
|
// prop
|
|
res = append(res, err)
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (o *GetCharactersCharacterIDRolesInternalServerErrorBody) validateError(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("getCharactersCharacterIdRolesInternalServerError"+"."+"error", "body", o.Error); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalBinary interface implementation
|
|
func (o *GetCharactersCharacterIDRolesInternalServerErrorBody) MarshalBinary() ([]byte, error) {
|
|
if o == nil {
|
|
return nil, nil
|
|
}
|
|
return swag.WriteJSON(o)
|
|
}
|
|
|
|
// UnmarshalBinary interface implementation
|
|
func (o *GetCharactersCharacterIDRolesInternalServerErrorBody) UnmarshalBinary(b []byte) error {
|
|
var res GetCharactersCharacterIDRolesInternalServerErrorBody
|
|
if err := swag.ReadJSON(b, &res); err != nil {
|
|
return err
|
|
}
|
|
*o = res
|
|
return nil
|
|
}
|