(self, uri_template, params)
| 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 |
no test coverage detected