MCPcopy Index your code
hub / github.com/aws/aws-cli / save_file

Method save_file

awscli/customizations/s3events.py:114–129  ·  view source on GitHub ↗
(self, parsed, **kwargs)

Source from the content-addressed store, hash-verified

112 )
113
114 def save_file(self, parsed, **kwargs):
115 # This method is hooked into after-call which fires
116 # before the error checking happens in the client.
117 # Therefore if the stream_key is not in the parsed
118 # response we immediately return and let the default
119 # error handling happen.
120 if self._stream_key not in parsed:
121 return
122 event_stream = parsed[self._stream_key]
123 with open(self._output_file, 'wb') as fp:
124 for event in event_stream:
125 if 'Records' in event:
126 fp.write(event['Records']['Payload'])
127 # We don't want to include the streaming param in
128 # the returned response, it's not JSON serializable.
129 del parsed[self._stream_key]

Callers

nothing calls this directly

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected