(self, operation_name, api_params)
| 828 | |
| 829 | @with_current_context() |
| 830 | def _make_api_call(self, operation_name, api_params): |
| 831 | operation_model = self._service_model.operation_model(operation_name) |
| 832 | service_name = self._service_model.service_name |
| 833 | history_recorder.record( |
| 834 | 'API_CALL', |
| 835 | { |
| 836 | 'service': service_name, |
| 837 | 'operation': operation_name, |
| 838 | 'params': api_params, |
| 839 | }, |
| 840 | ) |
| 841 | if operation_model.deprecated: |
| 842 | logger.debug( |
| 843 | 'Warning: %s.%s() is deprecated', service_name, operation_name |
| 844 | ) |
| 845 | # If the operation has the `auth` property and the client has a |
| 846 | # configured auth scheme preference, use both to compute the |
| 847 | # auth type. Otherwise, fallback to auth/auth_type resolution. |
| 848 | if operation_model.auth and self.meta.config.auth_scheme_preference: |
| 849 | preferred_schemes = ( |
| 850 | self.meta.config.auth_scheme_preference.split(',') |
| 851 | ) |
| 852 | auth_type = resolve_auth_scheme_preference( |
| 853 | preferred_schemes, operation_model.auth |
| 854 | ) |
| 855 | else: |
| 856 | auth_type = operation_model.resolved_auth_type |
| 857 | request_context = { |
| 858 | 'client_region': self.meta.region_name, |
| 859 | 'client_config': self.meta.config, |
| 860 | 'has_streaming_input': operation_model.has_streaming_input, |
| 861 | 'auth_type': auth_type, |
| 862 | 'unsigned_payload': operation_model.unsigned_payload, |
| 863 | 'auth_options': self._service_model.metadata.get('auth'), |
| 864 | } |
| 865 | |
| 866 | api_params = self._emit_api_params( |
| 867 | api_params=api_params, |
| 868 | operation_model=operation_model, |
| 869 | context=request_context, |
| 870 | ) |
| 871 | |
| 872 | ( |
| 873 | endpoint_url, |
| 874 | additional_headers, |
| 875 | properties, |
| 876 | ) = self._resolve_endpoint_ruleset( |
| 877 | operation_model, api_params, request_context |
| 878 | ) |
| 879 | if properties: |
| 880 | # Pass arbitrary endpoint info with the Request |
| 881 | # for use during construction. |
| 882 | request_context['endpoint_properties'] = properties |
| 883 | request_dict = self._convert_to_request_dict( |
| 884 | api_params=api_params, |
| 885 | operation_model=operation_model, |
| 886 | endpoint_url=endpoint_url, |
| 887 | context=request_context, |
no test coverage detected