use of POGOProtos.Networking.Requests.Messages.FortDetailsMessageOuterClass.FortDetailsMessage in project PokeGOAPI-Java by Grover-c13.
the class Pokestop method getDetailsAsync.
/**
* Get more detailed information about a pokestop.
*
* @return FortDetails
*/
public Observable<FortDetails> getDetailsAsync() {
FortDetailsMessage reqMsg = FortDetailsMessage.newBuilder().setFortId(getId()).setLatitude(getLatitude()).setLongitude(getLongitude()).build();
ServerRequest serverRequest = new ServerRequest(RequestTypeOuterClass.RequestType.FORT_DETAILS, reqMsg);
return api.getRequestHandler().sendAsyncServerRequests(serverRequest, true).map(new Func1<ByteString, FortDetails>() {
@Override
public FortDetails call(ByteString result) {
FortDetailsResponseOuterClass.FortDetailsResponse response = null;
try {
response = FortDetailsResponseOuterClass.FortDetailsResponse.parseFrom(result);
} catch (InvalidProtocolBufferException e) {
throw Exceptions.propagate(e);
}
return new FortDetails(response);
}
});
}
use of POGOProtos.Networking.Requests.Messages.FortDetailsMessageOuterClass.FortDetailsMessage in project PokeGOAPI-Java by Grover-c13.
the class Fort method getDetailsAsync.
/**
* Get more detailed information about a pokestop.
*
* @return FortDetails
*/
public Observable<FortDetails> getDetailsAsync() {
FortDetailsMessage reqMsg = FortDetailsMessage.newBuilder().setFortId(getId()).setLatitude(getLatitude()).setLongitude(getLongitude()).build();
ServerRequest serverRequest = new ServerRequest(RequestTypeOuterClass.RequestType.FORT_DETAILS, reqMsg);
return api.requestHandler.sendAsyncServerRequests(serverRequest, true).map(new Func1<ByteString, FortDetails>() {
@Override
public FortDetails call(ByteString result) {
FortDetailsResponseOuterClass.FortDetailsResponse response = null;
try {
response = FortDetailsResponseOuterClass.FortDetailsResponse.parseFrom(result);
} catch (InvalidProtocolBufferException e) {
throw Exceptions.propagate(e);
}
return new FortDetails(response);
}
});
}
Aggregations