This repository has been archived on 2025-02-01. You can view files and clone it, but cannot push or open issues or pull requests.
eve-goclient/models/get_characters_character_id_o_k_body.go

272 lines
6.4 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/errors"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// GetCharactersCharacterIDOKBody get_characters_character_id_ok
//
// 200 ok object
// swagger:model getCharactersCharacterIdOKBody
type GetCharactersCharacterIDOKBody struct {
// get_characters_character_id_alliance_id
//
// The character's alliance ID
AllianceID int32 `json:"alliance_id,omitempty"`
// get_characters_character_id_ancestry_id
//
// ancestry_id integer
AncestryID int32 `json:"ancestry_id,omitempty"`
// get_characters_character_id_birthday
//
// Creation date of the character
// Required: true
Birthday *strfmt.DateTime `json:"birthday"`
// get_characters_character_id_bloodline_id
//
// bloodline_id integer
// Required: true
BloodlineID *int32 `json:"bloodline_id"`
// get_characters_character_id_corporation_id
//
// The character's corporation ID
// Required: true
CorporationID *int32 `json:"corporation_id"`
// get_characters_character_id_description
//
// description string
Description string `json:"description,omitempty"`
// get_characters_character_id_gender
//
// gender string
// Required: true
Gender *string `json:"gender"`
// get_characters_character_id_name
//
// name string
// Required: true
Name *string `json:"name"`
// get_characters_character_id_race_id
//
// race_id integer
// Required: true
RaceID *int32 `json:"race_id"`
// get_characters_character_id_security_status
//
// security_status number
// Maximum: 10
// Minimum: -10
SecurityStatus *float32 `json:"security_status,omitempty"`
}
/* polymorph getCharactersCharacterIdOKBody alliance_id false */
/* polymorph getCharactersCharacterIdOKBody ancestry_id false */
/* polymorph getCharactersCharacterIdOKBody birthday false */
/* polymorph getCharactersCharacterIdOKBody bloodline_id false */
/* polymorph getCharactersCharacterIdOKBody corporation_id false */
/* polymorph getCharactersCharacterIdOKBody description false */
/* polymorph getCharactersCharacterIdOKBody gender false */
/* polymorph getCharactersCharacterIdOKBody name false */
/* polymorph getCharactersCharacterIdOKBody race_id false */
/* polymorph getCharactersCharacterIdOKBody security_status false */
// Validate validates this get characters character Id o k body
func (m *GetCharactersCharacterIDOKBody) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateBirthday(formats); err != nil {
// prop
res = append(res, err)
}
if err := m.validateBloodlineID(formats); err != nil {
// prop
res = append(res, err)
}
if err := m.validateCorporationID(formats); err != nil {
// prop
res = append(res, err)
}
if err := m.validateGender(formats); err != nil {
// prop
res = append(res, err)
}
if err := m.validateName(formats); err != nil {
// prop
res = append(res, err)
}
if err := m.validateRaceID(formats); err != nil {
// prop
res = append(res, err)
}
if err := m.validateSecurityStatus(formats); err != nil {
// prop
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *GetCharactersCharacterIDOKBody) validateBirthday(formats strfmt.Registry) error {
if err := validate.Required("birthday", "body", m.Birthday); err != nil {
return err
}
if err := validate.FormatOf("birthday", "body", "date-time", m.Birthday.String(), formats); err != nil {
return err
}
return nil
}
func (m *GetCharactersCharacterIDOKBody) validateBloodlineID(formats strfmt.Registry) error {
if err := validate.Required("bloodline_id", "body", m.BloodlineID); err != nil {
return err
}
return nil
}
func (m *GetCharactersCharacterIDOKBody) validateCorporationID(formats strfmt.Registry) error {
if err := validate.Required("corporation_id", "body", m.CorporationID); err != nil {
return err
}
return nil
}
var getCharactersCharacterIdOKBodyTypeGenderPropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["female","male"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
getCharactersCharacterIdOKBodyTypeGenderPropEnum = append(getCharactersCharacterIdOKBodyTypeGenderPropEnum, v)
}
}
const (
// GetCharactersCharacterIDOKBodyGenderFemale captures enum value "female"
GetCharactersCharacterIDOKBodyGenderFemale string = "female"
// GetCharactersCharacterIDOKBodyGenderMale captures enum value "male"
GetCharactersCharacterIDOKBodyGenderMale string = "male"
)
// prop value enum
func (m *GetCharactersCharacterIDOKBody) validateGenderEnum(path, location string, value string) error {
if err := validate.Enum(path, location, value, getCharactersCharacterIdOKBodyTypeGenderPropEnum); err != nil {
return err
}
return nil
}
func (m *GetCharactersCharacterIDOKBody) validateGender(formats strfmt.Registry) error {
if err := validate.Required("gender", "body", m.Gender); err != nil {
return err
}
// value enum
if err := m.validateGenderEnum("gender", "body", *m.Gender); err != nil {
return err
}
return nil
}
func (m *GetCharactersCharacterIDOKBody) validateName(formats strfmt.Registry) error {
if err := validate.Required("name", "body", m.Name); err != nil {
return err
}
return nil
}
func (m *GetCharactersCharacterIDOKBody) validateRaceID(formats strfmt.Registry) error {
if err := validate.Required("race_id", "body", m.RaceID); err != nil {
return err
}
return nil
}
func (m *GetCharactersCharacterIDOKBody) validateSecurityStatus(formats strfmt.Registry) error {
if swag.IsZero(m.SecurityStatus) { // not required
return nil
}
if err := validate.Minimum("security_status", "body", float64(*m.SecurityStatus), -10, false); err != nil {
return err
}
if err := validate.Maximum("security_status", "body", float64(*m.SecurityStatus), 10, false); err != nil {
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *GetCharactersCharacterIDOKBody) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *GetCharactersCharacterIDOKBody) UnmarshalBinary(b []byte) error {
var res GetCharactersCharacterIDOKBody
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}