示例#1
0
 def make_queue_event(data: schema.Data):
     s3_bucket.Object('/data/test.json').put(
         Body=data.to_json().encode('utf-8'))
     return {
         'Records': [{
             'body': '/data/test.json',
             'messageAttributes': {
                 's3FileName': {
                     'stringValue': '/data/test.json'
                 }
             }
         }]
     }
示例#2
0
 def put(self, data: Data, path: str = ''):
     data_json = data.to_json().encode('utf-8')
     return self.put_raw(data_json, ext='json', path=path)