B =@Sa@sdZddlZddlZddlZddlZddlZddlZddlZddlm Z ddlm Z ddl Zddl Zddl ZddlmZddlmZddlmZddlmZdd lmZmZmZmZdd lmZdd lmZdd lmZmZdd lmZddlm Z ddl!m"Z"ddl#m$Z$ddl%m&Z&ddlm'Z'ddlm(Z(ddlm)Z)ddlm*Z*m+Z+ddlm,Z,ddl-m.Z.m/Z/ddl0m1Z1m2Z2e3e4Z5Gddde6Z7Gddde6Z8Gddde1Z9Gdd d e6Z:d#d!d"Z;dS)$zV This module contains the main interface to the botocore package, the Session object. N) __version__)UNSIGNED)ConfigValueStore)ConfigChainFactory)&create_botocore_default_config_mapping)!BOTOCORE_DEFAUT_SESSION_VARIABLES)ConfigNotFoundProfileNotFoundUnknownServiceErrorPartialCredentialsError)ClientExceptionsFactory)handlers)HierarchicalEmitterfirst_non_none_response) EventAliaser) create_loader)ResponseParserFactory)EndpointResolver) ServiceModel) monitoring)paginate)waiter) retryhandler translate)utils) EVENT_ALIASESvalidate_region_name)MutableMappingHAS_CRTc @seZdZdZeeZdZdnddZddZ d d Z d d Z d dZ ddZ ddZddZddZddZddZddZddZdd Zed!d"Zd#d$Zed%d&Zdod'd(Zd)d*Zd+d,Zd-d.Zd/d0Zed1d2Zd3d4Z d5d6Z!dpd7d8Z"d9d:Z#d;d<Z$d=d>Z%dqd?d@Z&drdAdBZ'dsdCdDZ(dtdEdFZ)dGdHZ*dudJdKZ+dvdLdMZ,dwdNdOZ-dxdQdRZ.dydSdTZ/dUdVZ0dWdXZ1dYdZZ2d[d\Z3d]d^Z4d_d`Z5dadbZ6dzdcddZ7dedfZ8dgdhZ9didjZ:d{dldmZ;dS)|Sessionae The Session object collects together useful functionality from `botocore` as well as important data such as configuration information and credentials into a single, easy-to-use object. :ivar available_profiles: A list of profiles defined in the config file associated with this session. :ivar profile: The current profile. z4%(asctime)s - %(name)s - %(levelname)s - %(message)sNTcCs|dkrt|_n||_t|j|_|r4||jd|_t|_d|_d|_ d|_ d|_ d|_ i|_ |dk rv||j d<d|_d|_t|_t|_|t||j|_|dk r|j|dS)a Create a new Session object. :type session_vars: dict :param session_vars: A dictionary that is used to override some or all of the environment variables associated with this session. The key/value pairs defined in this dictionary will override the corresponding variables defined in ``SESSION_VARIABLES``. :type event_hooks: BaseEventHooks :param event_hooks: The event hooks object to use. If one is not provided, an event hooks object will be automatically created for you. :type include_builtin_handlers: bool :param include_builtin_handlers: Indicates whether or not to automatically register builtin handlers. :type profile: str :param profile: The name of the profile to use for this session. Note that the profile can only be set when the session is created. NZBotocoreprofile)rZ_original_handlerr_events_register_builtin_handlersuser_agent_nameruser_agent_versionuser_agent_extra_profile_config _credentials _profile_map_session_instance_vars_client_config_last_client_region_usedComponentLocator _components_internal_components_register_componentsSessionVarDictSESSION_VARIABLESsession_var_mapupdate)self session_varsZ event_hooksZinclude_builtin_handlersr!r8h/private/var/folders/fg/1jzmct0d7d72tjkvm_1nhqc5sw67yj/T/pip-unpacked-wheel-ef76ia09/botocore/session.py__init__Ls0    zSession.__init__cCsD||||||||dS)N)_register_credential_provider_register_data_loader_register_endpoint_resolver_register_event_emitter!_register_response_parser_factory_register_exceptions_factory_register_config_store_register_monitor)r6r8r8r9r1szSession._register_componentscCs|jd|jdS)N event_emitter)r/register_componentr")r6r8r8r9r>szSession._register_event_emittercCs|jd|jdS)Ncredential_provider)r/lazy_register_component_create_credential_resolver)r6r8r8r9r;sz%Session._register_credential_providercCstjj||jdS)N) region_name)botocore credentialsZcreate_credential_resolverr-)r6r8r8r9rGsz#Session._create_credential_resolvercsjdfdddS)N data_loadercstdS)N data_path)rget_config_variabler8)r6r8r9z/Session._register_data_loader..)r/rF)r6r8)r6r9r<szSession._register_data_loadercsfdd}jd|dS)Ncsd}|d}t|S)NrK endpoints) get_component load_datar)loaderrP)r6r8r9create_default_resolvers  zDSession._register_endpoint_resolver..create_default_resolverendpoint_resolver)r0rF)r6rTr8)r6r9r=s z#Session._register_endpoint_resolvercCs|jdtdS)Nresponse_parser_factory)r/rDr)r6r8r8r9r?sz)Session._register_response_parser_factorycCs|jdtdS)Nexceptions_factory)r0rDr )r6r8r8r9r@sz$Session._register_exceptions_factorycCsrxltjD]b}t|dkr.|\}}|||q|\}}}|tjkrR|j||q|tjkr|j||qWdS)N) r ZBUILTIN_HANDLERSlenregisterZREGISTER_FIRSTr"Zregister_firstZ REGISTER_LASTZ register_last)r6eventsspec event_namehandlerZ register_typer8r8r9r#s     z"Session._register_builtin_handlerscCs tt|d}|jd|dS)N)mapping config_store)rrr/rD)r6config_store_componentr8r8r9rAs zSession._register_config_storecCs|jd|jdS)Nmonitor)r0rF_create_csm_monitor)r6r8r8r9rBszSession._register_monitorc Csd|dr`|d}|d}|d}tjttjttjtj||tj|ddd}|SdS)NZ csm_enabled csm_client_idZcsm_hostZcsm_port)rd)sockethostport serializer)adapterZ publisher) rMrZMonitorZMonitorEventAdapterZSocketPublisherreAF_INET SOCK_DGRAMZ CSMSerializer)r6Z client_idrfrgr^r8r8r9rcs    zSession._create_csm_monitorcCs.yddl}|djStk r(dSXdS)NrZawscrtUnknown) pkg_resourcesget_distributionversion Exception)r6rmr8r8r9_get_crt_versions  zSession._get_crt_versioncCst|S)N)list_build_profile_mapkeys)r6r8r8r9available_profilesszSession.available_profilescCs|jdkr|jd|_|jS)Nprofiles)r* full_config)r6r8r8r9rss  zSession._build_profile_mapcCs |jdkr|d}||_|jS)Nr!)r'rM)r6r!r8r8r9r!s  zSession.profilecCs$|dk r|||S|d|S)Nr`)(_get_config_variable_with_custom_methodsrQrM)r6 logical_namemethodsr8r8r9rMs  zSession.get_config_variablecCst||d}t|}xl|jD]^\}}|\}}} } | | d} d|krN|| d<d|kr^|| d<d|krn|| d<|jf| ||<q Wt|d } | |} | S) N)sessionrz)conversion_funcdefaultinstance instance_nameenv env_var_namesconfigconfig_property_name)r_)SubsetChainConfigFactoryrr4itemscreate_config_chainrrM)r6ryrzZ chain_builderr_nameconfig_options config_nameenv_varsr}typecastZbuild_chain_config_argsravaluer8r8r9rxs$   z0Session._get_config_variable_with_custom_methodscCstd||||j|<dS)aSet a configuration variable to a specific value. By using this method, you can override the normal lookup process used in ``get_config_variable`` by explicitly setting a value. Subsequent calls to ``get_config_variable`` will use the ``value``. This gives you per-session specific configuration values. :: >>> # Assume logical name 'foo' maps to env var 'FOO' >>> os.environ['FOO'] = 'myvalue' >>> s.get_config_variable('foo') 'myvalue' >>> s.set_config_variable('foo', 'othervalue') >>> s.get_config_variable('foo') 'othervalue' :type logical_name: str :param logical_name: The logical name of the session variable you want to set. These are the keys in ``SESSION_VARIABLES``. :param value: The value to associate with the config variable. z$Setting config variable for %s to %rN)loggerdebugr+)r6ryrr8r8r9set_config_variables zSession.set_config_variablecCs t|jS)N)copyr+)r6r8r8r9instance_variables;szSession.instance_variablescCsF|d}|}|dkr&|diS||kr:t|dn||SdS)a5 Returns the config values from the config file scoped to the current profile. The configuration data is loaded **only** from the config file. It does not resolve variables based on different locations (e.g. first from the session instance, then from environment variables, then from the config file). If you want this lookup behavior, use the ``get_config_variable`` method instead. Note that this configuration is specific to a single profile (the ``profile`` session variable). If the ``profile`` session variable is set and the profile does not exist in the config file, a ``ProfileNotFound`` exception will be raised. :raises: ConfigNotFound, ConfigParseError, ProfileNotFound :rtype: dict r!Nr})r!)rMrsgetr )r6Z profile_nameZ profile_mapr8r8r9get_scoped_config>s   zSession.get_scoped_configcCs|jdkry|d}tj||_Wntk rDdii|_YnXyb|d}tj|}xF|D]>}||}||jdkr||jd|<qd|jd||qdWWntk rYnX|jS)zReturn the parsed config file. The ``get_config`` method returns the config associated with the specified profile. This property returns the contents of the **entire** config file. :rtype: dict N config_filervZcredentials_file)r(rMrIZ configloaderZ load_configrZraw_config_parser5)r6rZ cred_fileZ cred_profilesr!Z cred_varsr8r8r9rwcs$    zSession.full_configcCs|jS)aRetrieves the default config for creating clients :rtype: botocore.client.Config :returns: The default client config object when creating clients. If the value is ``None`` then there is no default config object attached to the session. )r,)r6r8r8r9get_default_client_configsz!Session.get_default_client_configcCs ||_dS)a1Sets the default config for creating clients :type client_config: botocore.client.Config :param client_config: The default client config object when creating clients. If the value is ``None`` then there is no default config object attached to the session. N)r,)r6 client_configr8r8r9set_default_client_configsz!Session.set_default_client_configcCstj||||_dS)aO Manually create credentials for this session. If you would prefer to use botocore without a config file, environment variables, or IAM roles, you can pass explicit credentials into this method to establish credentials for this session. :type access_key: str :param access_key: The access key part of the credentials. :type secret_key: str :param secret_key: The secret key part of the credentials. :type token: str :param token: An option session token used by STS session credentials. N)rIrJ Credentialsr))r6 access_key secret_keytokenr8r8r9set_credentialsszSession.set_credentialscCs"|jdkr|jd|_|jS)a$ Return the :class:`botocore.credential.Credential` object associated with this session. If the credentials have not yet been loaded, this will attempt to load them. If they have already been loaded, this will return the cached credentials. NrE)r)r/rQZload_credentials)r6r8r8r9get_credentialss  zSession.get_credentialscCsrd|j|jtttf}tr6|d|7}tj ddk rZ|dtj d7}|j rn|d|j 7}|S)ak Return a string suitable for use as a User-Agent header. The string will be of the form: / Python/ / Where: - agent_name is the value of the `user_agent_name` attribute of the session object (`Botocore` by default). - agent_version is the value of the `user_agent_version` attribute of the session object (the botocore version by default). by default. - py_ver is the version of the Python interpreter beng used. - plat_name is the name of the platform (e.g. Darwin) - plat_ver is the version of the platform - exec_env is exec-env/$AWS_EXECUTION_ENV If ``user_agent_extra`` is not empty, then this value will be appended to the end of the user agent string. z%s/%s Python/%s %s/%sz awscrt/%sZAWS_EXECUTION_ENVNz exec-env/%sz %s) r$r%platformpython_versionsystemreleaserrqosenvironrr&)r6baser8r8r9 user_agents zSession.user_agentcCs|d|S)z Retrieve the data associated with `data_path`. :type data_path: str :param data_path: The path to the data you wish to retrieve. rK)rQrR)r6rLr8r8r9get_dataszSession.get_datacCs|||}t||dS)aGet the service model object. :type service_name: string :param service_name: The service name :type api_version: string :param api_version: The API version of the service. If none is provided, then the latest API version will be used. :rtype: L{botocore.model.ServiceModel} :return: The botocore service model for the service. ) service_name)get_service_datar)r6r api_versionZservice_descriptionr8r8r9get_service_models zSession.get_service_modelcCs"|d}||d|}t|S)NrKz waiters-2)rQload_service_modelrZ WaiterModel)r6rrrSZ waiter_configr8r8r9get_waiter_models  zSession.get_waiter_modelcCs"|d}||d|}t|S)NrKz paginators-1)rQrrZPaginatorModel)r6rrrSZpaginator_configr8r8r9get_paginator_models  zSession.get_paginator_modelcCsB|}|dj|d|d}t||}|jjd||||d|S)zK Retrieve the fully merged data associated with a service. rKz service-2) type_namerzservice-data-loaded.%s) service_datarr{)rQrrrr"emit)r6rrrLrZ service_idr8r8r9rs    zSession.get_service_datacCs|djddS)z? Return a list of names of available services. rKz service-2)r)rQZlist_available_services)r6r8r8r9get_available_servicess zSession.get_available_servicesrIcCs||tjdS)zk Convenience function to quickly configure full debug output to go to the console. N)set_stream_loggerloggingDEBUG)r6 logger_namer8r8r9set_debug_loggerszSession.set_debug_loggercCsZt|}|tjt|}|||dkr8|j}t|}||||dS)a Convenience method to configure a stream logger. :type logger_name: str :param logger_name: The name of the logger to configure :type log_level: str :param log_level: The log level to set for the logger. This is any param supported by the ``.setLevel()`` method of a ``Log`` object. :type stream: file :param stream: A file like object to log to. If none is provided then sys.stderr will be used. :type format_string: str :param format_string: The format string to use for the log formatter. If none is provided this will default to ``self.LOG_FORMAT``. N) r getLoggersetLevelr StreamHandler LOG_FORMAT Formatter setFormatter addHandler)r6r log_levelstream format_stringlogch formatterr8r8r9r&s      zSession.set_stream_loggercCsNt|}|tjt|}||t|j}||||dS)aV Convenience function to quickly configure any level of logging to a file. :type log_level: int :param log_level: A log level as specified in the `logging` module :type path: string :param path: Path to the log file. The file will be created if it doesn't already exist. N) rrrr FileHandlerrrrr)r6rpathrrrrr8r8r9set_file_loggerNs      zSession.set_file_loggerFcCs|jj||||ddS)a)Register a handler with an event. :type event_name: str :param event_name: The name of the event. :type handler: callable :param handler: The callback to invoke when the event is emitted. This object must be callable, and must accept ``**kwargs``. If either of these preconditions are not met, a ``ValueError`` will be raised. :type unique_id: str :param unique_id: An optional identifier to associate with the registration. A unique_id can only be used once for the entire session registration (unless it is unregistered). This can be used to prevent an event handler from being registered twice. :param unique_id_uses_count: boolean :param unique_id_uses_count: Specifies if the event should maintain a count when a ``unique_id`` is registered and unregisted. The event can only be completely unregistered once every register call using the unique id has been matched by an ``unregister`` call. If ``unique_id`` is specified, subsequent ``register`` calls must use the same value for ``unique_id_uses_count`` as the ``register`` call that first registered the event. :raises ValueError: If the call to ``register`` uses ``unique_id`` but the value for ``unique_id_uses_count`` differs from the ``unique_id_uses_count`` value declared by the very first ``register`` call for that ``unique_id``. )unique_id_uses_countN)r"rZ)r6r]r^ unique_idrr8r8r9rZjs" zSession.registercCs|jj||||ddS)aUnregister a handler with an event. :type event_name: str :param event_name: The name of the event. :type handler: callable :param handler: The callback to unregister. :type unique_id: str :param unique_id: A unique identifier identifying the callback to unregister. You can provide either the handler or the unique_id, you do not have to provide both. :param unique_id_uses_count: boolean :param unique_id_uses_count: Specifies if the event should maintain a count when a ``unique_id`` is registered and unregisted. The event can only be completely unregistered once every ``register`` call using the ``unique_id`` has been matched by an ``unregister`` call. If the ``unique_id`` is specified, subsequent ``unregister`` calls must use the same value for ``unique_id_uses_count`` as the ``register`` call that first registered the event. :raises ValueError: If the call to ``unregister`` uses ``unique_id`` but the value for ``unique_id_uses_count`` differs from the ``unique_id_uses_count`` value declared by the very first ``register`` call for that ``unique_id``. )r^rrN)r" unregister)r6r]r^rrr8r8r9rs zSession.unregistercKs|jj|f|S)N)r"r)r6r]kwargsr8r8r9rsz Session.emitcKs|jj|f|}t|S)N)r"rr)r6r]r responsesr8r8r9emit_first_non_none_responsesz$Session.emit_first_non_none_responsecCsLy |j|Stk rF|dkr@td|t|j|SYnXdS)N)rUrWzFetching the %s component with the get_component() method is deprecated as the component has always been considered an internal interface of botocore)r/rQ ValueErrorwarningswarnDeprecationWarningr0)r6rr8r8r9rQs  zSession.get_componentcCs |j|S)N)r0rQ)r6rr8r8r9_get_internal_componentszSession._get_internal_componentcCs|j||S)N)r0rD)r6r componentr8r8r9_register_internal_componentsz$Session._register_internal_componentcCs|j||dS)N)r/rD)r6rrr8r8r9rDszSession.register_componentcCs|j||dS)N)r/rF)r6rrr8r8r9rFszSession.lazy_register_componentc  Csp|} | dk r$| dk r$| | } n | dk r0| } ||| }|dkrN|d}|dkrh|d|d}|d} |d} |d}| dk r| jtkrd}nN|dk r|dk rtj j ||| d}n*| ||rt d| ||d n| }|d }|d }|d }tj| ||| tt||| }|j|||||||| |d }|d}|dk rl||jj|S)aP Create a botocore client. :type service_name: string :param service_name: The name of the service for which a client will be created. You can use the ``Session.get_available_services()`` method to get a list of all available service names. :type region_name: string :param region_name: The name of the region associated with the client. A client is associated with a single region. :type api_version: string :param api_version: The API version to use. By default, botocore will use the latest API version when creating a client. You only need to specify this parameter if you want to use a previous API version of the client. :type use_ssl: boolean :param use_ssl: Whether or not to use SSL. By default, SSL is used. Note that not all services support non-ssl connections. :type verify: boolean/string :param verify: Whether or not to verify SSL certificates. By default SSL certificates are verified. You can provide the following values: * False - do not validate SSL certificates. SSL will still be used (unless use_ssl is False), but SSL certificates will not be verified. * path/to/cert/bundle.pem - A filename of the CA cert bundle to uses. You can specify this argument if you want to use a different CA cert bundle than the one used by botocore. :type endpoint_url: string :param endpoint_url: The complete URL to use for the constructed client. Normally, botocore will automatically construct the appropriate URL to use when communicating with a service. You can specify a complete URL (including the "http/https" scheme) to override this behavior. If this value is provided, then ``use_ssl`` is ignored. :type aws_access_key_id: string :param aws_access_key_id: The access key to use when creating the client. This is entirely optional, and if not provided, the credentials configured for the session will automatically be used. You only need to provide this argument if you want to override the credentials used for this specific client. :type aws_secret_access_key: string :param aws_secret_access_key: The secret key to use when creating the client. Same semantics as aws_access_key_id above. :type aws_session_token: string :param aws_session_token: The session token to use when creating the client. Same semantics as aws_access_key_id above. :type config: botocore.client.Config :param config: Advanced client configuration options. If a value is specified in the client config, its value will take precedence over environment variables and configuration values, but not over a value passed explicitly to the method. If a default config object is set on the session, the config object used when creating the client will be the result of calling ``merge()`` on the default config with the config provided to this call. :rtype: botocore.client.BaseClient :return: A botocore client instance NZ ca_bundleZ api_versionsrKrCrV)rrrexplicit)ZproviderZcred_varrUrWr`) rrHZ is_secure endpoint_urlverifyrJZ scoped_configrrrb)rmerge_resolve_region_namerMrrQZsignature_versionrrIrJr_missing_cred_varsr rrclientZ ClientCreatorrrr create_clientrrZmetar[)r6rrHrZuse_sslrraws_access_key_idaws_secret_access_keyZaws_session_tokenrZdefault_client_configrSrCrVrJrUrWr`Zclient_creatorrrbr8r8r9rsZI               zSession.create_clientcCs:|dkr(|r|jdk r|j}n |d}t|||_|S)NZregion)rHrMrr-)r6rHrr8r8r9rYs  zSession._resolve_region_namecCs,|dk r|dkrdS|dk r(|dkr(dSdS)Nrrr8)r6rrr8r8r9ros zSession._missing_cred_varscCs|d}|S)zLists the available partitions found on disk :rtype: list :return: Returns a list of partition names (e.g., ["aws", "aws-cn"]) rU)rget_available_partitions)r6resolverr8r8r9rvs z Session.get_available_partitionsawscCsT|d}g}y,||}|dd|}||||}Wntk rNYnX|S)a]Lists the region and endpoint names of a particular partition. :type service_name: string :param service_name: Name of a service to list endpoint for (e.g., s3). This parameter accepts a service name (e.g., "elb") or endpoint prefix (e.g., "elasticloadbalancing"). :type partition_name: string :param partition_name: Name of the partition to limit endpoints to. (e.g., aws for the public AWS endpoints, aws-cn for AWS China endpoints, aws-us-gov for AWS GovCloud (US) Endpoints, etc. :type allow_non_regional: bool :param allow_non_regional: Set to True to include endpoints that are not regional endpoints (e.g., s3-external-1, fips-us-gov-west-1, etc). :return: Returns a list of endpoint names (e.g., ["us-east-1"]). rUmetadataZendpointPrefix)rrrZget_available_endpointsr )r6rZpartition_nameZallow_non_regionalrresultsrZendpoint_prefixr8r8r9get_available_regionss  zSession.get_available_regions)NNTN)N)N)N)N)N)N)rI)NN)rI)NF)NNF) NNTNNNNNN)rF)<__name__ __module__ __qualname____doc__rrr3rr:r1r>r;rGr<r=r?r@r#rArBrcrqpropertyrursr!rMrxrrrrwrrrrrrrrrrrrrrrZrrrrQrrrDrFrrrrrr8r8r8r9r<s|   8     % #  %      '  $ !   rc@s0eZdZdZddZddZddZdd Zd S) r.z'Service locator for session components.cCsi|_i|_dS)N)r/ _deferred)r6r8r8r9r:szComponentLocator.__init__cCsX||jkr(|j|}||j|<|j|=y |j|Stk rRtd|YnXdS)NzUnknown component: %s)rr/KeyErrorr)r6rfactoryr8r8r9rQs    zComponentLocator.get_componentcCs0||j|<y |j|=Wntk r*YnXdS)N)r/rr)r6rrr8r8r9rDs   z#ComponentLocator.register_componentcCs0||j|<y |j|=Wntk r*YnXdS)N)rr/r)r6rZno_arg_factoryr8r8r9rFs   z(ComponentLocator.lazy_register_componentN)rrrrr:rQrDrFr8r8r8r9r.s  r.c@sDeZdZddZddZddZddZd d Zd d Zd dZ dS)r2cCs||_t||_dS)N)_sessionr_store)r6r{r7r8r8r9r:szSessionVarDict.__init__cCs |j|S)N)r)r6keyr8r8r9 __getitem__szSessionVarDict.__getitem__cCs||j|<|||dS)N)r&_update_config_store_from_session_vars)r6rrr8r8r9 __setitem__s zSessionVarDict.__setitem__cCs |j|=dS)N)r)r6rr8r8r9 __delitem__szSessionVarDict.__delitem__cCs t|jS)N)iterr)r6r8r8r9__iter__szSessionVarDict.__iter__cCs t|jS)N)rYr)r6r8r8r9__len__szSessionVarDict.__len__c CsDt|jd}|\}}}}|jd}|||j|||||ddS)N)r{r`)rrconfig_property_namesr}r|)rrrQZset_config_providerr) r6ryrZconfig_chain_builderrrr}rr`r8r8r9rs   z5SessionVarDict._update_config_store_from_session_varsN) rrrr:rrrrrrr8r8r8r9r2sr2c@s$eZdZdZdddZdddZdS) ra`A class for creating backwards compatible configuration chains. This class can be used instead of :class:`botocore.configprovider.ConfigChainFactory` to make it honor the methods argument to get_config_variable. This class can be used to filter out providers that are not in the methods tuple when creating a new config chain. NcCst|||_||_dS)N)r_factory_supported_methods)r6r{rzrr8r8r9r:s z!SubsetChainConfigFactory.__init__cCs@d|jkrd}d|jkrd}d|jkr*d}|jj|||||dS)aBuild a config chain following the standard botocore pattern. This config chain factory will omit any providers not in the methods tuple provided at initialization. For example if given the tuple ('instance', 'config',) it will not inject the environment provider into the standard config chain. This lets the botocore session support the custom ``methods`` argument for all the default botocore config variables when calling ``get_config_variable``. r~Nrr)rrrr}r|)rrr)r6rrrr}r|r8r8r9rs   z,SubsetChainConfigFactory.create_config_chain)N)NNNNN)rrrrr:rr8r8r8r9rs  rcCst|S)z& Return a new session object. )r)rr8r8r9 get_sessionsr)N)sX                  j"-(