MCPcopy Create free account
hub / github.com/aws/aws-cli / serialize_to_request

Method serialize_to_request

awscli/botocore/serialize.py:216–238  ·  view source on GitHub ↗
(self, parameters, operation_model)

Source from the content-addressed store, hash-verified

214 TIMESTAMP_FORMAT = 'iso8601'
215
216 def serialize_to_request(self, parameters, operation_model):
217 shape = operation_model.input_shape
218 serialized = self._create_default_request()
219 serialized['method'] = operation_model.http.get(
220 'method', self.DEFAULT_METHOD
221 )
222 serialized['headers'] = {
223 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
224 }
225 # The query serializer only deals with body params so
226 # that's what we hand off the _serialize_* methods.
227 body_params = self.MAP_TYPE()
228 body_params['Action'] = operation_model.name
229 body_params['Version'] = operation_model.metadata['apiVersion']
230 if shape is not None:
231 self._serialize(body_params, parameters, shape)
232 serialized['body'] = body_params
233
234 host_prefix = self._expand_host_prefix(parameters, operation_model)
235 if host_prefix is not None:
236 serialized['host_prefix'] = host_prefix
237
238 return serialized
239
240 def _serialize(self, serialized, value, shape, prefix=''):
241 # serialized: The dict that is incrementally added to with the

Callers

nothing calls this directly

Calls 3

_serializeMethod · 0.95
_expand_host_prefixMethod · 0.80

Tested by

no test coverage detected