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

Method _expand_host_prefix

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

Source from the content-addressed store, hash-verified

173 return base64.b64encode(value).strip().decode(self.DEFAULT_ENCODING)
174
175 def _expand_host_prefix(self, parameters, operation_model):
176 operation_endpoint = operation_model.endpoint
177 if (
178 operation_endpoint is None
179 or 'hostPrefix' not in operation_endpoint
180 ):
181 return None
182
183 host_prefix_expression = operation_endpoint['hostPrefix']
184 if operation_model.input_shape is None:
185 return host_prefix_expression
186 input_members = operation_model.input_shape.members
187 host_labels = [
188 member
189 for member, shape in input_members.items()
190 if shape.serialization.get('hostLabel')
191 ]
192 format_kwargs = dict((name, parameters[name]) for name in host_labels)
193
194 return host_prefix_expression.format(**format_kwargs)
195
196 def _is_shape_flattened(self, shape):
197 return shape.serialization.get('flattened')

Callers 4

serialize_to_requestMethod · 0.80
serialize_to_requestMethod · 0.80
serialize_to_requestMethod · 0.80
serialize_to_requestMethod · 0.80

Calls 1

formatMethod · 0.80

Tested by

no test coverage detected