package wallet // 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" "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" ) // GetCharactersCharacterIDWalletsJournalReader is a Reader for the GetCharactersCharacterIDWalletsJournal structure. type GetCharactersCharacterIDWalletsJournalReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. func (o *GetCharactersCharacterIDWalletsJournalReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewGetCharactersCharacterIDWalletsJournalOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 403: result := NewGetCharactersCharacterIDWalletsJournalForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 500: result := NewGetCharactersCharacterIDWalletsJournalInternalServerError() 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()) } } // NewGetCharactersCharacterIDWalletsJournalOK creates a GetCharactersCharacterIDWalletsJournalOK with default headers values func NewGetCharactersCharacterIDWalletsJournalOK() *GetCharactersCharacterIDWalletsJournalOK { return &GetCharactersCharacterIDWalletsJournalOK{} } /*GetCharactersCharacterIDWalletsJournalOK handles this case with default header values. Journal entries */ type GetCharactersCharacterIDWalletsJournalOK struct { /*The caching mechanism used */ CacheControl string /*RFC7231 formatted datetime string */ Expires string /*RFC7231 formatted datetime string */ LastModified string Payload []*GetCharactersCharacterIDWalletsJournalOKBodyItems0 } func (o *GetCharactersCharacterIDWalletsJournalOK) Error() string { return fmt.Sprintf("[GET /characters/{character_id}/wallets/journal/][%d] getCharactersCharacterIdWalletsJournalOK %+v", 200, o.Payload) } func (o *GetCharactersCharacterIDWalletsJournalOK) 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 } // NewGetCharactersCharacterIDWalletsJournalForbidden creates a GetCharactersCharacterIDWalletsJournalForbidden with default headers values func NewGetCharactersCharacterIDWalletsJournalForbidden() *GetCharactersCharacterIDWalletsJournalForbidden { return &GetCharactersCharacterIDWalletsJournalForbidden{} } /*GetCharactersCharacterIDWalletsJournalForbidden handles this case with default header values. Forbidden */ type GetCharactersCharacterIDWalletsJournalForbidden struct { Payload GetCharactersCharacterIDWalletsJournalForbiddenBody } func (o *GetCharactersCharacterIDWalletsJournalForbidden) Error() string { return fmt.Sprintf("[GET /characters/{character_id}/wallets/journal/][%d] getCharactersCharacterIdWalletsJournalForbidden %+v", 403, o.Payload) } func (o *GetCharactersCharacterIDWalletsJournalForbidden) 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 } // NewGetCharactersCharacterIDWalletsJournalInternalServerError creates a GetCharactersCharacterIDWalletsJournalInternalServerError with default headers values func NewGetCharactersCharacterIDWalletsJournalInternalServerError() *GetCharactersCharacterIDWalletsJournalInternalServerError { return &GetCharactersCharacterIDWalletsJournalInternalServerError{} } /*GetCharactersCharacterIDWalletsJournalInternalServerError handles this case with default header values. Internal server error */ type GetCharactersCharacterIDWalletsJournalInternalServerError struct { Payload GetCharactersCharacterIDWalletsJournalInternalServerErrorBody } func (o *GetCharactersCharacterIDWalletsJournalInternalServerError) Error() string { return fmt.Sprintf("[GET /characters/{character_id}/wallets/journal/][%d] getCharactersCharacterIdWalletsJournalInternalServerError %+v", 500, o.Payload) } func (o *GetCharactersCharacterIDWalletsJournalInternalServerError) 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 } /*GetCharactersCharacterIDWalletsJournalForbiddenBody get_characters_character_id_wallets_journal_forbidden // // Forbidden swagger:model GetCharactersCharacterIDWalletsJournalForbiddenBody */ type GetCharactersCharacterIDWalletsJournalForbiddenBody struct { // get_characters_character_id_wallets_journal_403_forbidden // // Forbidden message // Required: true Error *string `json:"error"` } // Validate validates this get characters character ID wallets journal forbidden body func (o *GetCharactersCharacterIDWalletsJournalForbiddenBody) 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 *GetCharactersCharacterIDWalletsJournalForbiddenBody) validateError(formats strfmt.Registry) error { if err := validate.Required("getCharactersCharacterIdWalletsJournalForbidden"+"."+"error", "body", o.Error); err != nil { return err } return nil } // MarshalBinary interface implementation func (o *GetCharactersCharacterIDWalletsJournalForbiddenBody) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } return swag.WriteJSON(o) } // UnmarshalBinary interface implementation func (o *GetCharactersCharacterIDWalletsJournalForbiddenBody) UnmarshalBinary(b []byte) error { var res GetCharactersCharacterIDWalletsJournalForbiddenBody if err := swag.ReadJSON(b, &res); err != nil { return err } *o = res return nil } /*GetCharactersCharacterIDWalletsJournalInternalServerErrorBody get_characters_character_id_wallets_journal_internal_server_error // // Internal server error swagger:model GetCharactersCharacterIDWalletsJournalInternalServerErrorBody */ type GetCharactersCharacterIDWalletsJournalInternalServerErrorBody struct { // get_characters_character_id_wallets_journal_500_internal_server_error // // Internal server error message // Required: true Error *string `json:"error"` } // Validate validates this get characters character ID wallets journal internal server error body func (o *GetCharactersCharacterIDWalletsJournalInternalServerErrorBody) 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 *GetCharactersCharacterIDWalletsJournalInternalServerErrorBody) validateError(formats strfmt.Registry) error { if err := validate.Required("getCharactersCharacterIdWalletsJournalInternalServerError"+"."+"error", "body", o.Error); err != nil { return err } return nil } // MarshalBinary interface implementation func (o *GetCharactersCharacterIDWalletsJournalInternalServerErrorBody) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } return swag.WriteJSON(o) } // UnmarshalBinary interface implementation func (o *GetCharactersCharacterIDWalletsJournalInternalServerErrorBody) UnmarshalBinary(b []byte) error { var res GetCharactersCharacterIDWalletsJournalInternalServerErrorBody if err := swag.ReadJSON(b, &res); err != nil { return err } *o = res return nil } /*GetCharactersCharacterIDWalletsJournalOKBodyItems0 get_characters_character_id_wallets_journal_200_ok // // 200 ok object swagger:model GetCharactersCharacterIDWalletsJournalOKBodyItems0 */ type GetCharactersCharacterIDWalletsJournalOKBodyItems0 struct { // get_characters_character_id_wallets_journal_amount // // Transaction amount. Positive when value transferred to the first party. Negative otherwise Amount float32 `json:"amount,omitempty"` // get_characters_character_id_wallets_journal_argument_name // // argument_name string ArgumentName string `json:"argument_name,omitempty"` // get_characters_character_id_wallets_journal_argument_value // // argument_value integer ArgumentValue int32 `json:"argument_value,omitempty"` // get_characters_character_id_wallets_journal_balance // // Wallet balance after transaction occurred Balance float32 `json:"balance,omitempty"` // get_characters_character_id_wallets_journal_date // // Date and time of transaction // Required: true Date *strfmt.DateTime `json:"date"` // get_characters_character_id_wallets_journal_first_party_id // // first_party_id integer FirstPartyID int32 `json:"first_party_id,omitempty"` // get_characters_character_id_wallets_journal_first_party_type // // first_party_type string FirstPartyType string `json:"first_party_type,omitempty"` // get_characters_character_id_wallets_journal_reason // // reason string Reason string `json:"reason,omitempty"` // get_characters_character_id_wallets_journal_ref_id // // Unique journal reference ID // Required: true RefID *int64 `json:"ref_id"` // get_characters_character_id_wallets_journal_ref_type_id // // Transaction type // Required: true RefTypeID *int32 `json:"ref_type_id"` // get_characters_character_id_wallets_journal_second_party_id // // second_party_id integer SecondPartyID int32 `json:"second_party_id,omitempty"` // get_characters_character_id_wallets_journal_second_party_type // // second_party_type string SecondPartyType string `json:"second_party_type,omitempty"` // get_characters_character_id_wallets_journal_tax_amount // // Tax amount received for tax related transactions TaxAmount float32 `json:"tax_amount,omitempty"` // get_characters_character_id_wallets_journal_tax_reciever_id // // For tax related transactions, gives the corporation ID of the entity receiving the tax TaxRecieverID int32 `json:"tax_reciever_id,omitempty"` } // Validate validates this get characters character ID wallets journal o k body items0 func (o *GetCharactersCharacterIDWalletsJournalOKBodyItems0) Validate(formats strfmt.Registry) error { var res []error if err := o.validateDate(formats); err != nil { // prop res = append(res, err) } if err := o.validateFirstPartyType(formats); err != nil { // prop res = append(res, err) } if err := o.validateRefID(formats); err != nil { // prop res = append(res, err) } if err := o.validateRefTypeID(formats); err != nil { // prop res = append(res, err) } if err := o.validateSecondPartyType(formats); err != nil { // prop res = append(res, err) } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } func (o *GetCharactersCharacterIDWalletsJournalOKBodyItems0) validateDate(formats strfmt.Registry) error { if err := validate.Required("date", "body", o.Date); err != nil { return err } return nil } var getCharactersCharacterIdWalletsJournalOKBodyItems0TypeFirstPartyTypePropEnum []interface{} func init() { var res []string if err := json.Unmarshal([]byte(`["character","corporation","alliance","faction"]`), &res); err != nil { panic(err) } for _, v := range res { getCharactersCharacterIdWalletsJournalOKBodyItems0TypeFirstPartyTypePropEnum = append(getCharactersCharacterIdWalletsJournalOKBodyItems0TypeFirstPartyTypePropEnum, v) } } const ( // GetCharactersCharacterIDWalletsJournalOKBodyItems0FirstPartyTypeCharacter captures enum value "character" GetCharactersCharacterIDWalletsJournalOKBodyItems0FirstPartyTypeCharacter string = "character" // GetCharactersCharacterIDWalletsJournalOKBodyItems0FirstPartyTypeCorporation captures enum value "corporation" GetCharactersCharacterIDWalletsJournalOKBodyItems0FirstPartyTypeCorporation string = "corporation" // GetCharactersCharacterIDWalletsJournalOKBodyItems0FirstPartyTypeAlliance captures enum value "alliance" GetCharactersCharacterIDWalletsJournalOKBodyItems0FirstPartyTypeAlliance string = "alliance" // GetCharactersCharacterIDWalletsJournalOKBodyItems0FirstPartyTypeFaction captures enum value "faction" GetCharactersCharacterIDWalletsJournalOKBodyItems0FirstPartyTypeFaction string = "faction" ) // prop value enum func (o *GetCharactersCharacterIDWalletsJournalOKBodyItems0) validateFirstPartyTypeEnum(path, location string, value string) error { if err := validate.Enum(path, location, value, getCharactersCharacterIdWalletsJournalOKBodyItems0TypeFirstPartyTypePropEnum); err != nil { return err } return nil } func (o *GetCharactersCharacterIDWalletsJournalOKBodyItems0) validateFirstPartyType(formats strfmt.Registry) error { if swag.IsZero(o.FirstPartyType) { // not required return nil } // value enum if err := o.validateFirstPartyTypeEnum("first_party_type", "body", o.FirstPartyType); err != nil { return err } return nil } func (o *GetCharactersCharacterIDWalletsJournalOKBodyItems0) validateRefID(formats strfmt.Registry) error { if err := validate.Required("ref_id", "body", o.RefID); err != nil { return err } return nil } func (o *GetCharactersCharacterIDWalletsJournalOKBodyItems0) validateRefTypeID(formats strfmt.Registry) error { if err := validate.Required("ref_type_id", "body", o.RefTypeID); err != nil { return err } return nil } var getCharactersCharacterIdWalletsJournalOKBodyItems0TypeSecondPartyTypePropEnum []interface{} func init() { var res []string if err := json.Unmarshal([]byte(`["character","corporation","alliance","faction"]`), &res); err != nil { panic(err) } for _, v := range res { getCharactersCharacterIdWalletsJournalOKBodyItems0TypeSecondPartyTypePropEnum = append(getCharactersCharacterIdWalletsJournalOKBodyItems0TypeSecondPartyTypePropEnum, v) } } const ( // GetCharactersCharacterIDWalletsJournalOKBodyItems0SecondPartyTypeCharacter captures enum value "character" GetCharactersCharacterIDWalletsJournalOKBodyItems0SecondPartyTypeCharacter string = "character" // GetCharactersCharacterIDWalletsJournalOKBodyItems0SecondPartyTypeCorporation captures enum value "corporation" GetCharactersCharacterIDWalletsJournalOKBodyItems0SecondPartyTypeCorporation string = "corporation" // GetCharactersCharacterIDWalletsJournalOKBodyItems0SecondPartyTypeAlliance captures enum value "alliance" GetCharactersCharacterIDWalletsJournalOKBodyItems0SecondPartyTypeAlliance string = "alliance" // GetCharactersCharacterIDWalletsJournalOKBodyItems0SecondPartyTypeFaction captures enum value "faction" GetCharactersCharacterIDWalletsJournalOKBodyItems0SecondPartyTypeFaction string = "faction" ) // prop value enum func (o *GetCharactersCharacterIDWalletsJournalOKBodyItems0) validateSecondPartyTypeEnum(path, location string, value string) error { if err := validate.Enum(path, location, value, getCharactersCharacterIdWalletsJournalOKBodyItems0TypeSecondPartyTypePropEnum); err != nil { return err } return nil } func (o *GetCharactersCharacterIDWalletsJournalOKBodyItems0) validateSecondPartyType(formats strfmt.Registry) error { if swag.IsZero(o.SecondPartyType) { // not required return nil } // value enum if err := o.validateSecondPartyTypeEnum("second_party_type", "body", o.SecondPartyType); err != nil { return err } return nil } // MarshalBinary interface implementation func (o *GetCharactersCharacterIDWalletsJournalOKBodyItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } return swag.WriteJSON(o) } // UnmarshalBinary interface implementation func (o *GetCharactersCharacterIDWalletsJournalOKBodyItems0) UnmarshalBinary(b []byte) error { var res GetCharactersCharacterIDWalletsJournalOKBodyItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } *o = res return nil }