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

Method _render_uri_template

awscli/botocore/serialize.py:795–812  ·  view source on GitHub ↗
(self, uri_template, params)

Source from the content-addressed store, hash-verified

793 return serialized
794
795 def _render_uri_template(self, uri_template, params):
796 # We need to handle two cases::
797 #
798 # /{Bucket}/foo
799 # /{Key+}/bar
800 # A label ending with '+' is greedy. There can only
801 # be one greedy key.
802 encoded_params = {}
803 for template_param in re.findall(r'{(.*?)}', uri_template):
804 if template_param.endswith('+'):
805 encoded_params[template_param] = percent_encode(
806 params[template_param[:-1]], safe='/~'
807 )
808 else:
809 encoded_params[template_param] = percent_encode(
810 params[template_param]
811 )
812 return uri_template.format(**encoded_params)
813
814 def _serialize_payload(
815 self, partitioned, parameters, serialized, shape, shape_members

Callers 1

serialize_to_requestMethod · 0.95

Calls 2

percent_encodeFunction · 0.90
formatMethod · 0.80

Tested by

no test coverage detected