416 lines
11 KiB
Go
416 lines
11 KiB
Go
package skills
|
|
|
|
// 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"
|
|
"strconv"
|
|
|
|
"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"
|
|
)
|
|
|
|
// GetCharactersCharacterIDSkillsReader is a Reader for the GetCharactersCharacterIDSkills structure.
|
|
type GetCharactersCharacterIDSkillsReader struct {
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ReadResponse reads a server response into the received o.
|
|
func (o *GetCharactersCharacterIDSkillsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
|
switch response.Code() {
|
|
|
|
case 200:
|
|
result := NewGetCharactersCharacterIDSkillsOK()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return result, nil
|
|
|
|
case 403:
|
|
result := NewGetCharactersCharacterIDSkillsForbidden()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
|
|
case 500:
|
|
result := NewGetCharactersCharacterIDSkillsInternalServerError()
|
|
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())
|
|
}
|
|
}
|
|
|
|
// NewGetCharactersCharacterIDSkillsOK creates a GetCharactersCharacterIDSkillsOK with default headers values
|
|
func NewGetCharactersCharacterIDSkillsOK() *GetCharactersCharacterIDSkillsOK {
|
|
return &GetCharactersCharacterIDSkillsOK{}
|
|
}
|
|
|
|
/*GetCharactersCharacterIDSkillsOK handles this case with default header values.
|
|
|
|
Known skills for the character
|
|
*/
|
|
type GetCharactersCharacterIDSkillsOK struct {
|
|
/*The caching mechanism used
|
|
*/
|
|
CacheControl string
|
|
/*RFC7231 formatted datetime string
|
|
*/
|
|
Expires string
|
|
/*RFC7231 formatted datetime string
|
|
*/
|
|
LastModified string
|
|
|
|
Payload GetCharactersCharacterIDSkillsOKBody
|
|
}
|
|
|
|
func (o *GetCharactersCharacterIDSkillsOK) Error() string {
|
|
return fmt.Sprintf("[GET /characters/{character_id}/skills/][%d] getCharactersCharacterIdSkillsOK %+v", 200, o.Payload)
|
|
}
|
|
|
|
func (o *GetCharactersCharacterIDSkillsOK) 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
|
|
}
|
|
|
|
// NewGetCharactersCharacterIDSkillsForbidden creates a GetCharactersCharacterIDSkillsForbidden with default headers values
|
|
func NewGetCharactersCharacterIDSkillsForbidden() *GetCharactersCharacterIDSkillsForbidden {
|
|
return &GetCharactersCharacterIDSkillsForbidden{}
|
|
}
|
|
|
|
/*GetCharactersCharacterIDSkillsForbidden handles this case with default header values.
|
|
|
|
Forbidden
|
|
*/
|
|
type GetCharactersCharacterIDSkillsForbidden struct {
|
|
Payload GetCharactersCharacterIDSkillsForbiddenBody
|
|
}
|
|
|
|
func (o *GetCharactersCharacterIDSkillsForbidden) Error() string {
|
|
return fmt.Sprintf("[GET /characters/{character_id}/skills/][%d] getCharactersCharacterIdSkillsForbidden %+v", 403, o.Payload)
|
|
}
|
|
|
|
func (o *GetCharactersCharacterIDSkillsForbidden) 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
|
|
}
|
|
|
|
// NewGetCharactersCharacterIDSkillsInternalServerError creates a GetCharactersCharacterIDSkillsInternalServerError with default headers values
|
|
func NewGetCharactersCharacterIDSkillsInternalServerError() *GetCharactersCharacterIDSkillsInternalServerError {
|
|
return &GetCharactersCharacterIDSkillsInternalServerError{}
|
|
}
|
|
|
|
/*GetCharactersCharacterIDSkillsInternalServerError handles this case with default header values.
|
|
|
|
Internal server error
|
|
*/
|
|
type GetCharactersCharacterIDSkillsInternalServerError struct {
|
|
Payload GetCharactersCharacterIDSkillsInternalServerErrorBody
|
|
}
|
|
|
|
func (o *GetCharactersCharacterIDSkillsInternalServerError) Error() string {
|
|
return fmt.Sprintf("[GET /characters/{character_id}/skills/][%d] getCharactersCharacterIdSkillsInternalServerError %+v", 500, o.Payload)
|
|
}
|
|
|
|
func (o *GetCharactersCharacterIDSkillsInternalServerError) 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
|
|
}
|
|
|
|
/*GetCharactersCharacterIDSkillsForbiddenBody get_characters_character_id_skills_forbidden
|
|
//
|
|
// Forbidden
|
|
swagger:model GetCharactersCharacterIDSkillsForbiddenBody
|
|
*/
|
|
type GetCharactersCharacterIDSkillsForbiddenBody struct {
|
|
|
|
// get_characters_character_id_skills_403_forbidden
|
|
//
|
|
// Forbidden message
|
|
// Required: true
|
|
Error *string `json:"error"`
|
|
}
|
|
|
|
// Validate validates this get characters character ID skills forbidden body
|
|
func (o *GetCharactersCharacterIDSkillsForbiddenBody) 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 *GetCharactersCharacterIDSkillsForbiddenBody) validateError(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("getCharactersCharacterIdSkillsForbidden"+"."+"error", "body", o.Error); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalBinary interface implementation
|
|
func (o *GetCharactersCharacterIDSkillsForbiddenBody) MarshalBinary() ([]byte, error) {
|
|
if o == nil {
|
|
return nil, nil
|
|
}
|
|
return swag.WriteJSON(o)
|
|
}
|
|
|
|
// UnmarshalBinary interface implementation
|
|
func (o *GetCharactersCharacterIDSkillsForbiddenBody) UnmarshalBinary(b []byte) error {
|
|
var res GetCharactersCharacterIDSkillsForbiddenBody
|
|
if err := swag.ReadJSON(b, &res); err != nil {
|
|
return err
|
|
}
|
|
*o = res
|
|
return nil
|
|
}
|
|
|
|
/*GetCharactersCharacterIDSkillsInternalServerErrorBody get_characters_character_id_skills_internal_server_error
|
|
//
|
|
// Internal server error
|
|
swagger:model GetCharactersCharacterIDSkillsInternalServerErrorBody
|
|
*/
|
|
type GetCharactersCharacterIDSkillsInternalServerErrorBody struct {
|
|
|
|
// get_characters_character_id_skills_500_internal_server_error
|
|
//
|
|
// Internal server error message
|
|
// Required: true
|
|
Error *string `json:"error"`
|
|
}
|
|
|
|
// Validate validates this get characters character ID skills internal server error body
|
|
func (o *GetCharactersCharacterIDSkillsInternalServerErrorBody) 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 *GetCharactersCharacterIDSkillsInternalServerErrorBody) validateError(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("getCharactersCharacterIdSkillsInternalServerError"+"."+"error", "body", o.Error); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalBinary interface implementation
|
|
func (o *GetCharactersCharacterIDSkillsInternalServerErrorBody) MarshalBinary() ([]byte, error) {
|
|
if o == nil {
|
|
return nil, nil
|
|
}
|
|
return swag.WriteJSON(o)
|
|
}
|
|
|
|
// UnmarshalBinary interface implementation
|
|
func (o *GetCharactersCharacterIDSkillsInternalServerErrorBody) UnmarshalBinary(b []byte) error {
|
|
var res GetCharactersCharacterIDSkillsInternalServerErrorBody
|
|
if err := swag.ReadJSON(b, &res); err != nil {
|
|
return err
|
|
}
|
|
*o = res
|
|
return nil
|
|
}
|
|
|
|
/*GetCharactersCharacterIDSkillsOKBody get_characters_character_id_skills_ok
|
|
//
|
|
// 200 ok object
|
|
swagger:model GetCharactersCharacterIDSkillsOKBody
|
|
*/
|
|
type GetCharactersCharacterIDSkillsOKBody struct {
|
|
|
|
// get_characters_character_id_skills_skills
|
|
//
|
|
// skills array
|
|
// Required: true
|
|
// Max Items: 1000
|
|
Skills []*SkillsItems0 `json:"skills"`
|
|
|
|
// get_characters_character_id_skills_total_sp
|
|
//
|
|
// total_sp integer
|
|
// Required: true
|
|
TotalSp *int64 `json:"total_sp"`
|
|
}
|
|
|
|
// Validate validates this get characters character ID skills o k body
|
|
func (o *GetCharactersCharacterIDSkillsOKBody) Validate(formats strfmt.Registry) error {
|
|
var res []error
|
|
|
|
if err := o.validateSkills(formats); err != nil {
|
|
// prop
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := o.validateTotalSp(formats); err != nil {
|
|
// prop
|
|
res = append(res, err)
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (o *GetCharactersCharacterIDSkillsOKBody) validateSkills(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("getCharactersCharacterIdSkillsOK"+"."+"skills", "body", o.Skills); err != nil {
|
|
return err
|
|
}
|
|
|
|
iSkillsSize := int64(len(o.Skills))
|
|
|
|
if err := validate.MaxItems("getCharactersCharacterIdSkillsOK"+"."+"skills", "body", iSkillsSize, 1000); err != nil {
|
|
return err
|
|
}
|
|
|
|
for i := 0; i < len(o.Skills); i++ {
|
|
|
|
if swag.IsZero(o.Skills[i]) { // not required
|
|
continue
|
|
}
|
|
|
|
if o.Skills[i] != nil {
|
|
|
|
if err := o.Skills[i].Validate(formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("getCharactersCharacterIdSkillsOK" + "." + "skills" + "." + strconv.Itoa(i))
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (o *GetCharactersCharacterIDSkillsOKBody) validateTotalSp(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("getCharactersCharacterIdSkillsOK"+"."+"total_sp", "body", o.TotalSp); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalBinary interface implementation
|
|
func (o *GetCharactersCharacterIDSkillsOKBody) MarshalBinary() ([]byte, error) {
|
|
if o == nil {
|
|
return nil, nil
|
|
}
|
|
return swag.WriteJSON(o)
|
|
}
|
|
|
|
// UnmarshalBinary interface implementation
|
|
func (o *GetCharactersCharacterIDSkillsOKBody) UnmarshalBinary(b []byte) error {
|
|
var res GetCharactersCharacterIDSkillsOKBody
|
|
if err := swag.ReadJSON(b, &res); err != nil {
|
|
return err
|
|
}
|
|
*o = res
|
|
return nil
|
|
}
|
|
|
|
/*SkillsItems0 get_characters_character_id_skills_skill
|
|
//
|
|
// skill object
|
|
swagger:model SkillsItems0
|
|
*/
|
|
type SkillsItems0 struct {
|
|
|
|
// get_characters_character_id_skills_current_skill_level
|
|
//
|
|
// current_skill_level integer
|
|
CurrentSkillLevel int32 `json:"current_skill_level,omitempty"`
|
|
|
|
// get_characters_character_id_skills_skill_id
|
|
//
|
|
// skill_id integer
|
|
SkillID int32 `json:"skill_id,omitempty"`
|
|
|
|
// get_characters_character_id_skills_skillpoints_in_skill
|
|
//
|
|
// skillpoints_in_skill integer
|
|
SkillpointsInSkill int64 `json:"skillpoints_in_skill,omitempty"`
|
|
}
|
|
|
|
// Validate validates this skills items0
|
|
func (o *SkillsItems0) Validate(formats strfmt.Registry) error {
|
|
var res []error
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// MarshalBinary interface implementation
|
|
func (o *SkillsItems0) MarshalBinary() ([]byte, error) {
|
|
if o == nil {
|
|
return nil, nil
|
|
}
|
|
return swag.WriteJSON(o)
|
|
}
|
|
|
|
// UnmarshalBinary interface implementation
|
|
func (o *SkillsItems0) UnmarshalBinary(b []byte) error {
|
|
var res SkillsItems0
|
|
if err := swag.ReadJSON(b, &res); err != nil {
|
|
return err
|
|
}
|
|
*o = res
|
|
return nil
|
|
}
|