use of POGOProtos.Networking.Envelopes.RequestEnvelopeOuterClass.RequestEnvelope.PlatformRequest.Builder in project PokeGOAPI-Java by Grover-c13.
the class RequestHandler method buildRequest.
private RequestEnvelope.Builder buildRequest(ServerRequest[] requests, ServerPlatformRequest[] platformRequests) throws RequestFailedException {
RequestEnvelope.Builder builder = RequestEnvelope.newBuilder();
resetBuilder(builder);
for (ServerRequest serverRequest : requests) {
ByteString data = serverRequest.request.toByteString();
Request request = Request.newBuilder().setRequestMessage(data).setRequestType(serverRequest.type).build();
builder.addRequests(request);
}
Signature.setSignature(api, builder);
for (ServerPlatformRequest platformRequest : platformRequests) {
ByteString data = platformRequest.request;
Builder request = PlatformRequest.newBuilder().setType(platformRequest.type).setRequestMessage(data);
builder.addPlatformRequests(request);
}
return builder;
}
Aggregations