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 ( "encoding/json" "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" ) // GetCharactersCharacterIDChatChannelsReader is a Reader for the GetCharactersCharacterIDChatChannels structure. type GetCharactersCharacterIDChatChannelsReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. func (o *GetCharactersCharacterIDChatChannelsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewGetCharactersCharacterIDChatChannelsOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 403: result := NewGetCharactersCharacterIDChatChannelsForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 500: result := NewGetCharactersCharacterIDChatChannelsInternalServerError() 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()) } } // NewGetCharactersCharacterIDChatChannelsOK creates a GetCharactersCharacterIDChatChannelsOK with default headers values func NewGetCharactersCharacterIDChatChannelsOK() *GetCharactersCharacterIDChatChannelsOK { return &GetCharactersCharacterIDChatChannelsOK{} } /*GetCharactersCharacterIDChatChannelsOK handles this case with default header values. A list of chat channels */ type GetCharactersCharacterIDChatChannelsOK struct { /*The caching mechanism used */ CacheControl string /*RFC7231 formatted datetime string */ Expires string /*RFC7231 formatted datetime string */ LastModified string Payload []*GetCharactersCharacterIDChatChannelsOKBodyItems0 } func (o *GetCharactersCharacterIDChatChannelsOK) Error() string { return fmt.Sprintf("[GET /characters/{character_id}/chat_channels/][%d] getCharactersCharacterIdChatChannelsOK %+v", 200, o.Payload) } func (o *GetCharactersCharacterIDChatChannelsOK) 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 } // NewGetCharactersCharacterIDChatChannelsForbidden creates a GetCharactersCharacterIDChatChannelsForbidden with default headers values func NewGetCharactersCharacterIDChatChannelsForbidden() *GetCharactersCharacterIDChatChannelsForbidden { return &GetCharactersCharacterIDChatChannelsForbidden{} } /*GetCharactersCharacterIDChatChannelsForbidden handles this case with default header values. Forbidden */ type GetCharactersCharacterIDChatChannelsForbidden struct { Payload GetCharactersCharacterIDChatChannelsForbiddenBody } func (o *GetCharactersCharacterIDChatChannelsForbidden) Error() string { return fmt.Sprintf("[GET /characters/{character_id}/chat_channels/][%d] getCharactersCharacterIdChatChannelsForbidden %+v", 403, o.Payload) } func (o *GetCharactersCharacterIDChatChannelsForbidden) 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 } // NewGetCharactersCharacterIDChatChannelsInternalServerError creates a GetCharactersCharacterIDChatChannelsInternalServerError with default headers values func NewGetCharactersCharacterIDChatChannelsInternalServerError() *GetCharactersCharacterIDChatChannelsInternalServerError { return &GetCharactersCharacterIDChatChannelsInternalServerError{} } /*GetCharactersCharacterIDChatChannelsInternalServerError handles this case with default header values. Internal server error */ type GetCharactersCharacterIDChatChannelsInternalServerError struct { Payload GetCharactersCharacterIDChatChannelsInternalServerErrorBody } func (o *GetCharactersCharacterIDChatChannelsInternalServerError) Error() string { return fmt.Sprintf("[GET /characters/{character_id}/chat_channels/][%d] getCharactersCharacterIdChatChannelsInternalServerError %+v", 500, o.Payload) } func (o *GetCharactersCharacterIDChatChannelsInternalServerError) 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 } /*GetCharactersCharacterIDChatChannelsForbiddenBody get_characters_character_id_chat_channels_forbidden // // Forbidden swagger:model GetCharactersCharacterIDChatChannelsForbiddenBody */ type GetCharactersCharacterIDChatChannelsForbiddenBody struct { // get_characters_character_id_chat_channels_403_forbidden // // Forbidden message // Required: true Error *string `json:"error"` } // Validate validates this get characters character ID chat channels forbidden body func (o *GetCharactersCharacterIDChatChannelsForbiddenBody) 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 *GetCharactersCharacterIDChatChannelsForbiddenBody) validateError(formats strfmt.Registry) error { if err := validate.Required("getCharactersCharacterIdChatChannelsForbidden"+"."+"error", "body", o.Error); err != nil { return err } return nil } // MarshalBinary interface implementation func (o *GetCharactersCharacterIDChatChannelsForbiddenBody) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } return swag.WriteJSON(o) } // UnmarshalBinary interface implementation func (o *GetCharactersCharacterIDChatChannelsForbiddenBody) UnmarshalBinary(b []byte) error { var res GetCharactersCharacterIDChatChannelsForbiddenBody if err := swag.ReadJSON(b, &res); err != nil { return err } *o = res return nil } /*GetCharactersCharacterIDChatChannelsInternalServerErrorBody get_characters_character_id_chat_channels_internal_server_error // // Internal server error swagger:model GetCharactersCharacterIDChatChannelsInternalServerErrorBody */ type GetCharactersCharacterIDChatChannelsInternalServerErrorBody struct { // get_characters_character_id_chat_channels_500_internal_server_error // // Internal server error message // Required: true Error *string `json:"error"` } // Validate validates this get characters character ID chat channels internal server error body func (o *GetCharactersCharacterIDChatChannelsInternalServerErrorBody) 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 *GetCharactersCharacterIDChatChannelsInternalServerErrorBody) validateError(formats strfmt.Registry) error { if err := validate.Required("getCharactersCharacterIdChatChannelsInternalServerError"+"."+"error", "body", o.Error); err != nil { return err } return nil } // MarshalBinary interface implementation func (o *GetCharactersCharacterIDChatChannelsInternalServerErrorBody) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } return swag.WriteJSON(o) } // UnmarshalBinary interface implementation func (o *GetCharactersCharacterIDChatChannelsInternalServerErrorBody) UnmarshalBinary(b []byte) error { var res GetCharactersCharacterIDChatChannelsInternalServerErrorBody if err := swag.ReadJSON(b, &res); err != nil { return err } *o = res return nil } /*GetCharactersCharacterIDChatChannelsOKBodyItems0 get_characters_character_id_chat_channels_200_ok // // 200 ok object swagger:model GetCharactersCharacterIDChatChannelsOKBodyItems0 */ type GetCharactersCharacterIDChatChannelsOKBodyItems0 struct { // get_characters_character_id_chat_channels_allowed // // allowed array // Required: true // Max Items: 1000 Allowed []*GetCharactersCharacterIDChatChannelsOKBodyItems0AllowedItems0 `json:"allowed"` // get_characters_character_id_chat_channels_blocked // // blocked array // Required: true // Max Items: 1000 Blocked []*GetCharactersCharacterIDChatChannelsOKBodyItems0BlockedItems0 `json:"blocked"` // get_characters_character_id_chat_channels_channel_id // // Unique channel ID. Always negative for player-created channels. Permanent (CCP created) channels have a positive ID, but don't appear in the API // Required: true ChannelID *int32 `json:"channel_id"` // get_characters_character_id_chat_channels_comparison_key // // Normalized, unique string used to compare channel names // Required: true ComparisonKey *string `json:"comparison_key"` // get_characters_character_id_chat_channels_has_password // // Whether this is a password protected channel // Required: true HasPassword *bool `json:"has_password"` // get_characters_character_id_chat_channels_motd // // Message of the day for this channel // Required: true Motd *string `json:"motd"` // get_characters_character_id_chat_channels_muted // // muted array // Required: true // Max Items: 1000 Muted []*GetCharactersCharacterIDChatChannelsOKBodyItems0MutedItems0 `json:"muted"` // get_characters_character_id_chat_channels_name // // Displayed name of channel // Required: true Name *string `json:"name"` // get_characters_character_id_chat_channels_operators // // operators array // Required: true // Max Items: 1000 Operators []*GetCharactersCharacterIDChatChannelsOKBodyItems0OperatorsItems0 `json:"operators"` // get_characters_character_id_chat_channels_owner_id // // owner_id integer // Required: true OwnerID *int32 `json:"owner_id"` } // Validate validates this get characters character ID chat channels o k body items0 func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0) Validate(formats strfmt.Registry) error { var res []error if err := o.validateAllowed(formats); err != nil { // prop res = append(res, err) } if err := o.validateBlocked(formats); err != nil { // prop res = append(res, err) } if err := o.validateChannelID(formats); err != nil { // prop res = append(res, err) } if err := o.validateComparisonKey(formats); err != nil { // prop res = append(res, err) } if err := o.validateHasPassword(formats); err != nil { // prop res = append(res, err) } if err := o.validateMotd(formats); err != nil { // prop res = append(res, err) } if err := o.validateMuted(formats); err != nil { // prop res = append(res, err) } if err := o.validateName(formats); err != nil { // prop res = append(res, err) } if err := o.validateOperators(formats); err != nil { // prop res = append(res, err) } if err := o.validateOwnerID(formats); err != nil { // prop res = append(res, err) } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0) validateAllowed(formats strfmt.Registry) error { if err := validate.Required("allowed", "body", o.Allowed); err != nil { return err } iAllowedSize := int64(len(o.Allowed)) if err := validate.MaxItems("allowed", "body", iAllowedSize, 1000); err != nil { return err } for i := 0; i < len(o.Allowed); i++ { if swag.IsZero(o.Allowed[i]) { // not required continue } if o.Allowed[i] != nil { if err := o.Allowed[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("allowed" + "." + strconv.Itoa(i)) } return err } } } return nil } func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0) validateBlocked(formats strfmt.Registry) error { if err := validate.Required("blocked", "body", o.Blocked); err != nil { return err } iBlockedSize := int64(len(o.Blocked)) if err := validate.MaxItems("blocked", "body", iBlockedSize, 1000); err != nil { return err } for i := 0; i < len(o.Blocked); i++ { if swag.IsZero(o.Blocked[i]) { // not required continue } if o.Blocked[i] != nil { if err := o.Blocked[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("blocked" + "." + strconv.Itoa(i)) } return err } } } return nil } func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0) validateChannelID(formats strfmt.Registry) error { if err := validate.Required("channel_id", "body", o.ChannelID); err != nil { return err } return nil } func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0) validateComparisonKey(formats strfmt.Registry) error { if err := validate.Required("comparison_key", "body", o.ComparisonKey); err != nil { return err } return nil } func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0) validateHasPassword(formats strfmt.Registry) error { if err := validate.Required("has_password", "body", o.HasPassword); err != nil { return err } return nil } func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0) validateMotd(formats strfmt.Registry) error { if err := validate.Required("motd", "body", o.Motd); err != nil { return err } return nil } func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0) validateMuted(formats strfmt.Registry) error { if err := validate.Required("muted", "body", o.Muted); err != nil { return err } iMutedSize := int64(len(o.Muted)) if err := validate.MaxItems("muted", "body", iMutedSize, 1000); err != nil { return err } for i := 0; i < len(o.Muted); i++ { if swag.IsZero(o.Muted[i]) { // not required continue } if o.Muted[i] != nil { if err := o.Muted[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("muted" + "." + strconv.Itoa(i)) } return err } } } return nil } func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", o.Name); err != nil { return err } return nil } func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0) validateOperators(formats strfmt.Registry) error { if err := validate.Required("operators", "body", o.Operators); err != nil { return err } iOperatorsSize := int64(len(o.Operators)) if err := validate.MaxItems("operators", "body", iOperatorsSize, 1000); err != nil { return err } for i := 0; i < len(o.Operators); i++ { if swag.IsZero(o.Operators[i]) { // not required continue } if o.Operators[i] != nil { if err := o.Operators[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("operators" + "." + strconv.Itoa(i)) } return err } } } return nil } func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0) validateOwnerID(formats strfmt.Registry) error { if err := validate.Required("owner_id", "body", o.OwnerID); err != nil { return err } return nil } // MarshalBinary interface implementation func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } return swag.WriteJSON(o) } // UnmarshalBinary interface implementation func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0) UnmarshalBinary(b []byte) error { var res GetCharactersCharacterIDChatChannelsOKBodyItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } *o = res return nil } /*GetCharactersCharacterIDChatChannelsOKBodyItems0AllowedItems0 get_characters_character_id_chat_channels_allowed // // allowed object swagger:model GetCharactersCharacterIDChatChannelsOKBodyItems0AllowedItems0 */ type GetCharactersCharacterIDChatChannelsOKBodyItems0AllowedItems0 struct { // get_characters_character_id_chat_channels_accessor_id // // ID of an allowed channel member // Required: true AccessorID *int32 `json:"accessor_id"` // get_characters_character_id_chat_channels_accessor_type // // accessor_type string // Required: true AccessorType *string `json:"accessor_type"` } // Validate validates this get characters character ID chat channels o k body items0 allowed items0 func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0AllowedItems0) Validate(formats strfmt.Registry) error { var res []error if err := o.validateAccessorID(formats); err != nil { // prop res = append(res, err) } if err := o.validateAccessorType(formats); err != nil { // prop res = append(res, err) } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0AllowedItems0) validateAccessorID(formats strfmt.Registry) error { if err := validate.Required("accessor_id", "body", o.AccessorID); err != nil { return err } return nil } var getCharactersCharacterIdChatChannelsOKBodyItems0AllowedItems0TypeAccessorTypePropEnum []interface{} func init() { var res []string if err := json.Unmarshal([]byte(`["character","corporation","alliance"]`), &res); err != nil { panic(err) } for _, v := range res { getCharactersCharacterIdChatChannelsOKBodyItems0AllowedItems0TypeAccessorTypePropEnum = append(getCharactersCharacterIdChatChannelsOKBodyItems0AllowedItems0TypeAccessorTypePropEnum, v) } } const ( // GetCharactersCharacterIDChatChannelsOKBodyItems0AllowedItems0AccessorTypeCharacter captures enum value "character" GetCharactersCharacterIDChatChannelsOKBodyItems0AllowedItems0AccessorTypeCharacter string = "character" // GetCharactersCharacterIDChatChannelsOKBodyItems0AllowedItems0AccessorTypeCorporation captures enum value "corporation" GetCharactersCharacterIDChatChannelsOKBodyItems0AllowedItems0AccessorTypeCorporation string = "corporation" // GetCharactersCharacterIDChatChannelsOKBodyItems0AllowedItems0AccessorTypeAlliance captures enum value "alliance" GetCharactersCharacterIDChatChannelsOKBodyItems0AllowedItems0AccessorTypeAlliance string = "alliance" ) // prop value enum func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0AllowedItems0) validateAccessorTypeEnum(path, location string, value string) error { if err := validate.Enum(path, location, value, getCharactersCharacterIdChatChannelsOKBodyItems0AllowedItems0TypeAccessorTypePropEnum); err != nil { return err } return nil } func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0AllowedItems0) validateAccessorType(formats strfmt.Registry) error { if err := validate.Required("accessor_type", "body", o.AccessorType); err != nil { return err } // value enum if err := o.validateAccessorTypeEnum("accessor_type", "body", *o.AccessorType); err != nil { return err } return nil } // MarshalBinary interface implementation func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0AllowedItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } return swag.WriteJSON(o) } // UnmarshalBinary interface implementation func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0AllowedItems0) UnmarshalBinary(b []byte) error { var res GetCharactersCharacterIDChatChannelsOKBodyItems0AllowedItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } *o = res return nil } /*GetCharactersCharacterIDChatChannelsOKBodyItems0BlockedItems0 get_characters_character_id_chat_channels_blocked // // blocked object swagger:model GetCharactersCharacterIDChatChannelsOKBodyItems0BlockedItems0 */ type GetCharactersCharacterIDChatChannelsOKBodyItems0BlockedItems0 struct { // get_characters_character_id_chat_channels_accessor_id // // ID of a blocked channel member // Required: true AccessorID *int32 `json:"accessor_id"` // get_characters_character_id_chat_channels_accessor_type // // accessor_type string // Required: true AccessorType *string `json:"accessor_type"` // get_characters_character_id_chat_channels_end_at // // Time at which this accessor will no longer be blocked EndAt strfmt.DateTime `json:"end_at,omitempty"` // get_characters_character_id_chat_channels_reason // // Reason this accessor is blocked Reason string `json:"reason,omitempty"` } // Validate validates this get characters character ID chat channels o k body items0 blocked items0 func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0BlockedItems0) Validate(formats strfmt.Registry) error { var res []error if err := o.validateAccessorID(formats); err != nil { // prop res = append(res, err) } if err := o.validateAccessorType(formats); err != nil { // prop res = append(res, err) } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0BlockedItems0) validateAccessorID(formats strfmt.Registry) error { if err := validate.Required("accessor_id", "body", o.AccessorID); err != nil { return err } return nil } var getCharactersCharacterIdChatChannelsOKBodyItems0BlockedItems0TypeAccessorTypePropEnum []interface{} func init() { var res []string if err := json.Unmarshal([]byte(`["character","corporation","alliance"]`), &res); err != nil { panic(err) } for _, v := range res { getCharactersCharacterIdChatChannelsOKBodyItems0BlockedItems0TypeAccessorTypePropEnum = append(getCharactersCharacterIdChatChannelsOKBodyItems0BlockedItems0TypeAccessorTypePropEnum, v) } } const ( // GetCharactersCharacterIDChatChannelsOKBodyItems0BlockedItems0AccessorTypeCharacter captures enum value "character" GetCharactersCharacterIDChatChannelsOKBodyItems0BlockedItems0AccessorTypeCharacter string = "character" // GetCharactersCharacterIDChatChannelsOKBodyItems0BlockedItems0AccessorTypeCorporation captures enum value "corporation" GetCharactersCharacterIDChatChannelsOKBodyItems0BlockedItems0AccessorTypeCorporation string = "corporation" // GetCharactersCharacterIDChatChannelsOKBodyItems0BlockedItems0AccessorTypeAlliance captures enum value "alliance" GetCharactersCharacterIDChatChannelsOKBodyItems0BlockedItems0AccessorTypeAlliance string = "alliance" ) // prop value enum func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0BlockedItems0) validateAccessorTypeEnum(path, location string, value string) error { if err := validate.Enum(path, location, value, getCharactersCharacterIdChatChannelsOKBodyItems0BlockedItems0TypeAccessorTypePropEnum); err != nil { return err } return nil } func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0BlockedItems0) validateAccessorType(formats strfmt.Registry) error { if err := validate.Required("accessor_type", "body", o.AccessorType); err != nil { return err } // value enum if err := o.validateAccessorTypeEnum("accessor_type", "body", *o.AccessorType); err != nil { return err } return nil } // MarshalBinary interface implementation func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0BlockedItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } return swag.WriteJSON(o) } // UnmarshalBinary interface implementation func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0BlockedItems0) UnmarshalBinary(b []byte) error { var res GetCharactersCharacterIDChatChannelsOKBodyItems0BlockedItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } *o = res return nil } /*GetCharactersCharacterIDChatChannelsOKBodyItems0MutedItems0 get_characters_character_id_chat_channels_muted // // muted object swagger:model GetCharactersCharacterIDChatChannelsOKBodyItems0MutedItems0 */ type GetCharactersCharacterIDChatChannelsOKBodyItems0MutedItems0 struct { // get_characters_character_id_chat_channels_accessor_id // // ID of a muted channel member // Required: true AccessorID *int32 `json:"accessor_id"` // get_characters_character_id_chat_channels_accessor_type // // accessor_type string // Required: true AccessorType *string `json:"accessor_type"` // get_characters_character_id_chat_channels_end_at // // Time at which this accessor will no longer be muted EndAt strfmt.DateTime `json:"end_at,omitempty"` // get_characters_character_id_chat_channels_reason // // Reason this accessor is muted Reason string `json:"reason,omitempty"` } // Validate validates this get characters character ID chat channels o k body items0 muted items0 func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0MutedItems0) Validate(formats strfmt.Registry) error { var res []error if err := o.validateAccessorID(formats); err != nil { // prop res = append(res, err) } if err := o.validateAccessorType(formats); err != nil { // prop res = append(res, err) } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0MutedItems0) validateAccessorID(formats strfmt.Registry) error { if err := validate.Required("accessor_id", "body", o.AccessorID); err != nil { return err } return nil } var getCharactersCharacterIdChatChannelsOKBodyItems0MutedItems0TypeAccessorTypePropEnum []interface{} func init() { var res []string if err := json.Unmarshal([]byte(`["character","corporation","alliance"]`), &res); err != nil { panic(err) } for _, v := range res { getCharactersCharacterIdChatChannelsOKBodyItems0MutedItems0TypeAccessorTypePropEnum = append(getCharactersCharacterIdChatChannelsOKBodyItems0MutedItems0TypeAccessorTypePropEnum, v) } } const ( // GetCharactersCharacterIDChatChannelsOKBodyItems0MutedItems0AccessorTypeCharacter captures enum value "character" GetCharactersCharacterIDChatChannelsOKBodyItems0MutedItems0AccessorTypeCharacter string = "character" // GetCharactersCharacterIDChatChannelsOKBodyItems0MutedItems0AccessorTypeCorporation captures enum value "corporation" GetCharactersCharacterIDChatChannelsOKBodyItems0MutedItems0AccessorTypeCorporation string = "corporation" // GetCharactersCharacterIDChatChannelsOKBodyItems0MutedItems0AccessorTypeAlliance captures enum value "alliance" GetCharactersCharacterIDChatChannelsOKBodyItems0MutedItems0AccessorTypeAlliance string = "alliance" ) // prop value enum func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0MutedItems0) validateAccessorTypeEnum(path, location string, value string) error { if err := validate.Enum(path, location, value, getCharactersCharacterIdChatChannelsOKBodyItems0MutedItems0TypeAccessorTypePropEnum); err != nil { return err } return nil } func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0MutedItems0) validateAccessorType(formats strfmt.Registry) error { if err := validate.Required("accessor_type", "body", o.AccessorType); err != nil { return err } // value enum if err := o.validateAccessorTypeEnum("accessor_type", "body", *o.AccessorType); err != nil { return err } return nil } // MarshalBinary interface implementation func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0MutedItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } return swag.WriteJSON(o) } // UnmarshalBinary interface implementation func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0MutedItems0) UnmarshalBinary(b []byte) error { var res GetCharactersCharacterIDChatChannelsOKBodyItems0MutedItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } *o = res return nil } /*GetCharactersCharacterIDChatChannelsOKBodyItems0OperatorsItems0 get_characters_character_id_chat_channels_operator // // operator object swagger:model GetCharactersCharacterIDChatChannelsOKBodyItems0OperatorsItems0 */ type GetCharactersCharacterIDChatChannelsOKBodyItems0OperatorsItems0 struct { // get_characters_character_id_chat_channels_accessor_id // // ID of a channel operator // Required: true AccessorID *int32 `json:"accessor_id"` // get_characters_character_id_chat_channels_accessor_type // // accessor_type string // Required: true AccessorType *string `json:"accessor_type"` } // Validate validates this get characters character ID chat channels o k body items0 operators items0 func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0OperatorsItems0) Validate(formats strfmt.Registry) error { var res []error if err := o.validateAccessorID(formats); err != nil { // prop res = append(res, err) } if err := o.validateAccessorType(formats); err != nil { // prop res = append(res, err) } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0OperatorsItems0) validateAccessorID(formats strfmt.Registry) error { if err := validate.Required("accessor_id", "body", o.AccessorID); err != nil { return err } return nil } var getCharactersCharacterIdChatChannelsOKBodyItems0OperatorsItems0TypeAccessorTypePropEnum []interface{} func init() { var res []string if err := json.Unmarshal([]byte(`["character","corporation","alliance"]`), &res); err != nil { panic(err) } for _, v := range res { getCharactersCharacterIdChatChannelsOKBodyItems0OperatorsItems0TypeAccessorTypePropEnum = append(getCharactersCharacterIdChatChannelsOKBodyItems0OperatorsItems0TypeAccessorTypePropEnum, v) } } const ( // GetCharactersCharacterIDChatChannelsOKBodyItems0OperatorsItems0AccessorTypeCharacter captures enum value "character" GetCharactersCharacterIDChatChannelsOKBodyItems0OperatorsItems0AccessorTypeCharacter string = "character" // GetCharactersCharacterIDChatChannelsOKBodyItems0OperatorsItems0AccessorTypeCorporation captures enum value "corporation" GetCharactersCharacterIDChatChannelsOKBodyItems0OperatorsItems0AccessorTypeCorporation string = "corporation" // GetCharactersCharacterIDChatChannelsOKBodyItems0OperatorsItems0AccessorTypeAlliance captures enum value "alliance" GetCharactersCharacterIDChatChannelsOKBodyItems0OperatorsItems0AccessorTypeAlliance string = "alliance" ) // prop value enum func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0OperatorsItems0) validateAccessorTypeEnum(path, location string, value string) error { if err := validate.Enum(path, location, value, getCharactersCharacterIdChatChannelsOKBodyItems0OperatorsItems0TypeAccessorTypePropEnum); err != nil { return err } return nil } func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0OperatorsItems0) validateAccessorType(formats strfmt.Registry) error { if err := validate.Required("accessor_type", "body", o.AccessorType); err != nil { return err } // value enum if err := o.validateAccessorTypeEnum("accessor_type", "body", *o.AccessorType); err != nil { return err } return nil } // MarshalBinary interface implementation func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0OperatorsItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } return swag.WriteJSON(o) } // UnmarshalBinary interface implementation func (o *GetCharactersCharacterIDChatChannelsOKBodyItems0OperatorsItems0) UnmarshalBinary(b []byte) error { var res GetCharactersCharacterIDChatChannelsOKBodyItems0OperatorsItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } *o = res return nil }