Cloud endpoint ResponseMessage seem straightforward to me. If I have a response message class
class FoodieResponseMessage(messages.Message):
name = messages.StringField(1)
fav_food = messages.StringField(2)
city = messages.StringField(3)
invoking it is as simple as
FoodieResponseMessage(name="A", fav_food="B", city="C")
But what of a RequestMessage with multiple fields? All I get from the service endpoint method is a request object. How do I know what field goes where?
class FoodieRequestMessage(messages.Message):
name = messages.StringField(1)
id = messages.StringField(2)
sitting_table = messages.StringField(3)
@endpoints.method(FoodieRequestMessage, FoodieResponseMessage)
def process(self, request):
name = request.name
id = request.id
table = request.sitting_table
How does the request match the field so that i don't end up getting a user's sitting_table when I do request.name?