package wars // 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/runtime" strfmt "github.com/go-openapi/strfmt" ) // GetWarsWarIDReader is a Reader for the GetWarsWarID structure. type GetWarsWarIDReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. func (o *GetWarsWarIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewGetWarsWarIDOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 422: result := NewGetWarsWarIDUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 500: result := NewGetWarsWarIDInternalServerError() 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()) } } // NewGetWarsWarIDOK creates a GetWarsWarIDOK with default headers values func NewGetWarsWarIDOK() *GetWarsWarIDOK { return &GetWarsWarIDOK{} } /*GetWarsWarIDOK handles this case with default header values. Details about a war */ type GetWarsWarIDOK struct { /*The caching mechanism used */ CacheControl string /*RFC7231 formatted datetime string */ Expires string /*RFC7231 formatted datetime string */ LastModified string Payload GetWarsWarIDOKBody } func (o *GetWarsWarIDOK) Error() string { return fmt.Sprintf("[GET /wars/{war_id}/][%d] getWarsWarIdOK %+v", 200, o.Payload) } func (o *GetWarsWarIDOK) 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 } // NewGetWarsWarIDUnprocessableEntity creates a GetWarsWarIDUnprocessableEntity with default headers values func NewGetWarsWarIDUnprocessableEntity() *GetWarsWarIDUnprocessableEntity { return &GetWarsWarIDUnprocessableEntity{} } /*GetWarsWarIDUnprocessableEntity handles this case with default header values. Errors in query parameters */ type GetWarsWarIDUnprocessableEntity struct { Payload GetWarsWarIDUnprocessableEntityBody } func (o *GetWarsWarIDUnprocessableEntity) Error() string { return fmt.Sprintf("[GET /wars/{war_id}/][%d] getWarsWarIdUnprocessableEntity %+v", 422, o.Payload) } func (o *GetWarsWarIDUnprocessableEntity) 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 } // NewGetWarsWarIDInternalServerError creates a GetWarsWarIDInternalServerError with default headers values func NewGetWarsWarIDInternalServerError() *GetWarsWarIDInternalServerError { return &GetWarsWarIDInternalServerError{} } /*GetWarsWarIDInternalServerError handles this case with default header values. Internal server error */ type GetWarsWarIDInternalServerError struct { Payload GetWarsWarIDInternalServerErrorBody } func (o *GetWarsWarIDInternalServerError) Error() string { return fmt.Sprintf("[GET /wars/{war_id}/][%d] getWarsWarIdInternalServerError %+v", 500, o.Payload) } func (o *GetWarsWarIDInternalServerError) 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 } /*AlliesItems0 get_wars_war_id_ally // // ally object swagger:model AlliesItems0 */ type AlliesItems0 struct { // get_wars_war_id_alliance_id // // Alliance ID if and only if this ally is an alliance AllianceID int32 `json:"alliance_id,omitempty"` // get_wars_war_id_corporation_id // // Corporation ID if and only if this ally is a corporation CorporationID int32 `json:"corporation_id,omitempty"` } /*GetWarsWarIDOKBodyDefender get_wars_war_id_defender // // The defending corporation or alliance that declared this war, only contains either corporation_id or alliance_id swagger:model GetWarsWarIDOKBodyDefender */ type GetWarsWarIDOKBodyDefender struct { // get_wars_war_id_alliance_id // // Alliance ID if and only if the defender is an alliance AllianceID int32 `json:"alliance_id,omitempty"` // get_wars_war_id_corporation_id // // Corporation ID if and only if the defender is a corporation CorporationID int32 `json:"corporation_id,omitempty"` // get_wars_war_id_isk_destroyed // // ISK value of ships the defender has killed // Required: true IskDestroyed *float32 `json:"isk_destroyed"` // get_wars_war_id_ships_killed // // The number of ships the defender has killed // Required: true ShipsKilled *int32 `json:"ships_killed"` } /*GetWarsWarIDOKBodyAggressor get_wars_war_id_aggressor // // The aggressor corporation or alliance that declared this war, only contains either corporation_id or alliance_id swagger:model GetWarsWarIDOKBodyAggressor */ type GetWarsWarIDOKBodyAggressor struct { // get_wars_war_id_alliance_id // // Alliance ID if and only if the aggressor is an alliance AllianceID int32 `json:"alliance_id,omitempty"` // get_wars_war_id_corporation_id // // Corporation ID if and only if the aggressor is a corporation CorporationID int32 `json:"corporation_id,omitempty"` // get_wars_war_id_isk_destroyed // // ISK value of ships the aggressor has destroyed // Required: true IskDestroyed *float32 `json:"isk_destroyed"` // get_wars_war_id_ships_killed // // The number of ships the aggressor has killed // Required: true ShipsKilled *int32 `json:"ships_killed"` } /*GetWarsWarIDOKBody get_wars_war_id_ok // // 200 ok object swagger:model GetWarsWarIDOKBody */ type GetWarsWarIDOKBody struct { // aggressor // Required: true Aggressor *GetWarsWarIDOKBodyAggressor `json:"aggressor"` // get_wars_war_id_allies // // allied corporations or alliances, each object contains either corporation_id or alliance_id // Required: true Allies []*AlliesItems0 `json:"allies"` // get_wars_war_id_declared // // Time that the war was declared // Required: true Declared *strfmt.DateTime `json:"declared"` // defender // Required: true Defender *GetWarsWarIDOKBodyDefender `json:"defender"` // get_wars_war_id_finished // // Time the war ended and shooting was no longer allowed // Required: true Finished *strfmt.DateTime `json:"finished"` // get_wars_war_id_id // // ID of the specified war // Required: true ID *int32 `json:"id"` // get_wars_war_id_mutual // // Was the war declared mutual by both parties // Required: true Mutual *bool `json:"mutual"` // get_wars_war_id_open_for_allies // // Is the war currently open for allies or not // Required: true OpenForAllies *bool `json:"open_for_allies"` // get_wars_war_id_retracted // // Time the war was retracted but both sides could still shoot each other // Required: true Retracted *strfmt.DateTime `json:"retracted"` // get_wars_war_id_started // // Time when the war started and both sides could shoot each other // Required: true Started *strfmt.DateTime `json:"started"` } /*GetWarsWarIDUnprocessableEntityBody get_wars_war_id_unprocessable_entity // // war_id is not valid swagger:model GetWarsWarIDUnprocessableEntityBody */ type GetWarsWarIDUnprocessableEntityBody struct { // get_wars_war_id_error // // error message // Required: true Error *string `json:"error"` } /*GetWarsWarIDInternalServerErrorBody get_wars_war_id_internal_server_error // // Internal server error swagger:model GetWarsWarIDInternalServerErrorBody */ type GetWarsWarIDInternalServerErrorBody struct { // get_wars_war_id_500_internal_server_error // // Internal server error message // Required: true Error *string `json:"error"` }