| 59 | |
| 60 | |
| 61 | class ClientArgsCreator: |
| 62 | def __init__( |
| 63 | self, |
| 64 | event_emitter, |
| 65 | user_agent, |
| 66 | response_parser_factory, |
| 67 | loader, |
| 68 | exceptions_factory, |
| 69 | config_store, |
| 70 | user_agent_creator=None, |
| 71 | ): |
| 72 | self._event_emitter = event_emitter |
| 73 | self._response_parser_factory = response_parser_factory |
| 74 | self._loader = loader |
| 75 | self._exceptions_factory = exceptions_factory |
| 76 | self._config_store = config_store |
| 77 | if user_agent_creator is None: |
| 78 | self._session_ua_creator = UserAgentString.from_environment() |
| 79 | else: |
| 80 | self._session_ua_creator = user_agent_creator |
| 81 | |
| 82 | def get_client_args( |
| 83 | self, |
| 84 | service_model, |
| 85 | region_name, |
| 86 | is_secure, |
| 87 | endpoint_url, |
| 88 | verify, |
| 89 | credentials, |
| 90 | scoped_config, |
| 91 | client_config, |
| 92 | endpoint_bridge, |
| 93 | auth_token=None, |
| 94 | endpoints_ruleset_data=None, |
| 95 | partition_data=None, |
| 96 | ): |
| 97 | final_args = self.compute_client_args( |
| 98 | service_model, |
| 99 | client_config, |
| 100 | endpoint_bridge, |
| 101 | region_name, |
| 102 | endpoint_url, |
| 103 | is_secure, |
| 104 | scoped_config, |
| 105 | ) |
| 106 | |
| 107 | service_name = final_args['service_name'] # noqa |
| 108 | parameter_validation = final_args['parameter_validation'] |
| 109 | endpoint_config = final_args['endpoint_config'] |
| 110 | protocol = final_args['protocol'] |
| 111 | config_kwargs = final_args['config_kwargs'] |
| 112 | s3_config = final_args['s3_config'] |
| 113 | partition = endpoint_config['metadata'].get('partition', None) |
| 114 | socket_options = final_args['socket_options'] |
| 115 | configured_endpoint_url = final_args['configured_endpoint_url'] |
| 116 | signing_region = endpoint_config['signing_region'] |
| 117 | endpoint_region_name = endpoint_config['region_name'] |
| 118 | account_id_endpoint_mode = config_kwargs['account_id_endpoint_mode'] |