def build_request(self, regids, data, collapse_key, ttl):
        payload = {'registration_ids': regids}
        if data:
            payload['data'] = data

        if ttl >= 0:
            payload['time_to_live'] = ttl

        if collapse_key:
            payload['collapse_key'] = collapse_key

        return json.dumps(payload)
dataset/ETHPy150Open airnotifier/airnotifier/pushservices/gcm.py/GCMClient.build_request/original