How can I pass more than one Entity from a client to a Google Cloud Endpoint?
For example, passing a single Entity is easily done in an Endpoint api source file in t
Use the 'named' annotation...
@ApiMethod(name = "sendStuff")
public void sendStuff( @Named("clientId") String clientId, @Named("stuff") String stuff )
And for android, the client code would look like this
SendStuff sl = service.sendStuff( clientId, stuff );
You can't send multiple entity types in the body of your request. You'll need to create a wrapper entity that contains those two entities, e.g.:
class MyWrapperEntity {
MyEntity someEntity;
MyOtherEntity someOtherEntity;
// ...
}
However, that's not what your example shows (the entities are the same type). Use a List<MyEntity>
or Map<String, MyEntity>
inside of a collection entity instead, e.g.:
class MyEntityCollection {
List<MyEntity> items;
// ...
}