
    !in                     N   S r SSKrSSKrSSKrSSKJr  SSKrSSKJrJ	r	  SSK
JrJr  SSKJr  SSKJr  SSKJrJrJrJrJrJrJrJrJrJrJrJrJrJr  SS	K J!r!  SS
K"J#r#J$r$  \RJ                  " \&5      r'Sr(S0 0r) " S S5      r* " S S\*5      r+ " S S\,\5      r- " S S5      r.g)zResolves regions and endpoints.

This module implements endpoint resolution, including resolving endpoints for a
given service and region and resolving the available endpoints for a service
in a specific AWS partition.
    N)Enum)UNSIGNED
xform_name)AUTH_TYPE_MAPSHAS_CRTCRT_SUPPORTED_AUTH_TYPES)EndpointProvider)EndpointProviderErrorEndpointVariantError!InvalidEndpointConfigurationErrorInvalidHostLabelErrorMissingDependencyExceptionNoRegionErrorParamValidationError$UnknownEndpointResolutionBuiltInNameUnknownRegionErrorUnknownSignatureVersionError*UnsupportedS3AccesspointConfigurationErrorUnsupportedS3ConfigurationErrorUnsupportedS3ControlArnError&UnsupportedS3ControlConfigurationError)register_feature_id)ensure_booleaninstance_cachez{service}.{region}.{dnsSuffix}	endpointsc                   4    \ rS rSrSrSS jrS r S	S jrSrg)
BaseEndpointResolver7   z3Resolves regions and endpoints. Must be subclassed.Nc                     [         e)a  Resolves an endpoint for a service and region combination.

:type service_name: string
:param service_name: Name of the service to resolve an endpoint for
    (e.g., s3)

:type region_name: string
:param region_name: Region/endpoint name to resolve (e.g., us-east-1)
    if no region is provided, the first found partition-wide endpoint
    will be used if available.

:rtype: dict
:return: Returns a dict containing the following keys:
    - partition: (string, required) Resolved partition name
    - endpointName: (string, required) Resolved endpoint name
    - hostname: (string, required) Hostname to use for this endpoint
    - sslCommonName: (string) sslCommonName to use for this endpoint.
    - credentialScope: (dict) Signature version 4 credential scope
      - region: (string) region name override when signing.
      - service: (string) service name override when signing.
    - signatureVersions: (list<string>) A list of possible signature
      versions, including s3, v4, v2, and s3v4
    - protocols: (list<string>) A list of supported protocols
      (e.g., http, https)
    - ...: Other keys may be included as well based on the metadata
NotImplementedError)selfservice_nameregion_names      O/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/botocore/regions.pyconstruct_endpoint'BaseEndpointResolver.construct_endpoint:   s
    6 "!    c                     [         e)zLists the partitions available to the endpoint resolver.

:return: Returns a list of partition names (e.g., ["aws", "aws-cn"]).
r!   )r#   s    r&   get_available_partitions-BaseEndpointResolver.get_available_partitionsW   s
    
 "!r)   c                     [         e)ar  Lists the endpoint names of a particular partition.

:type service_name: string
:param service_name: Name of a service to list endpoint for (e.g., s3)

: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"]).
r!   )r#   r$   partition_nameallow_non_regionals       r&   get_available_endpoints,BaseEndpointResolver.get_available_endpoints^   s
    & "!r)    N)awsF)	__name__
__module____qualname____firstlineno____doc__r'   r+   r0   __static_attributes__r2   r)   r&   r   r   7   s    =":" FK"r)   r   c                       \ rS rSrSrSS/rSS jrSS jrS r   SS	 jr	 SS
 jr
    SS jrS r SS jrS rS rS rS rS rS rS rSrg)EndpointResolvert   z7Resolves endpoints based on partition endpoint metadatazaws-isoz	aws-iso-bc                 >    SU;  a  [        S5      eXl        X l        g)z
:type endpoint_data: dict
:param endpoint_data: A dict of partition data.

:type uses_builtin_data: boolean
:param uses_builtin_data: Whether the endpoint data originates in the
    package's data directory.

partitionsz%Missing "partitions" in endpoint dataN)
ValueError_endpoint_datauses_builtin_data)r#   endpoint_datarB   s      r&   __init__EndpointResolver.__init__y   s$     },DEE+!2r)   c                 l    U R                   S    H!  nUS   U:w  a  M  US   nX;  a  M  XA   S   s  $    g )Nr?   	partitionservicesr   )rA   )r#   r$   r.   rG   rH   s        r&   get_service_endpoints_data+EndpointResolver.get_service_endpoints_data   sH    ,,\:I%7 ,H+)+66 ;r)   c                 ^    / nU R                   S    H  nUR                  US   5        M     U$ )Nr?   rG   )rA   append)r#   resultrG   s      r&   r+   )EndpointResolver.get_available_partitions   s2    ,,\:IMM)K01 ;r)   Nc                 P   / nU R                   S    H  nUS   U:w  a  M  US   nX;  a  M  Xq   S   nU Hi  n	XS   ;   n
U(       a7  U
(       a0  U R                  X   U5      nU(       a  UR                  U	5        MF  MH  U(       d	  U
(       d  MX  UR                  U	5        Mk     M     U$ )Nr?   rG   rH   r   regions)rA   _retrieve_variant_datarL   )r#   r$   r.   r/   endpoint_variant_tagsrM   rG   rH   service_endpointsendpoint_nameis_regional_endpointvariant_datas               r&   r0   (EndpointResolver.get_available_endpoints   s     ,,\:I%7 ,H+ ( 6{ C!2'4)8L'L$(-A#'#>#>)8:O$L $m4 $'+?+?MM-0 "3 ;$ r)   c                     U R                   S    HS  nUS   U:X  d  M  U(       a9  U R                  UR                  S5      U5      nU(       a  SU;   a  US   s  $ ML  MN  US   s  $    g )Nr?   rG   defaults	dnsSuffix)rA   rQ   get)r#   r.   rR   rG   variants        r&   get_partition_dns_suffix)EndpointResolver.get_partition_dns_suffix   sx     ,,\:I%7("99!j13HG ;'#9&{33 $:w %[11 ; r)   c                 T   US:X  a  U(       a  Uc  SnUbA  S nU R                   S    H  nUS   U:X  d  M  UnM     Ub  U R                  UUUUUS5      nU$ g U R                   S    H?  nU(       a  US   U R                  ;   a  M  U R                  UUUUU5      nU(       d  M=  Us  $    g )Ns3z	us-east-1r?   rG   T)rA   _endpoint_for_partition!_UNSUPPORTED_DUALSTACK_PARTITIONS)	r#   r$   r%   r.   use_dualstack_endpointuse_fips_endpointvalid_partitionrG   rM   s	            r&   r'   #EndpointResolver.construct_endpoint   s     D &#%K%"O!00>	[)^;&/O ? *55# *%  ,,\:I%+&99: 11&!F v ;r)   c                 |    U R                   S    H   nU R                  X!5      (       d  M  US   s  $    [        USS9e)Nr?   rG   z,No partition found for provided region_name.)r%   	error_msg)rA   _region_matchr   )r#   r%   rG   s      r&   get_partition_for_region)EndpointResolver.get_partition_for_region   sH    ,,\:I!!)99 -- ; !#D
 	
r)   c                 P   US   nU(       a   XpR                   ;   a  SU S3n[        S/US9eUS   R                  U[        5      n	Uc  SU	;   a  U	S   nO
[	        5       eUUU	UUUS.n
X9S	   ;   a  U R
                  " S0 U
D6$ U R                  X5      (       d  U(       a  U	R                  S5      nU	R                  S
S5      nU(       a5  U(       d.  [        R                  SUUU5        XS'   U R
                  " S0 U
D6$ [        R                  SUU5        U R
                  " S0 U
D6$ g )NrG   z4Dualstack endpoints are currently not supported for z
 partition	dualstacktagsrh   rH   partitionEndpoint)rG   r$   service_datarT   rc   rd   r   isRegionalizedTz'Using partition endpoint for %s, %s: %srT   z*Creating a regex based endpoint for %s, %sr2   )	rb   r   r[   DEFAULT_SERVICE_DATAr   _resolveri   LOGdebug)r#   rG   r$   r%   rc   rd   force_partitionr.   rh   rq   resolve_kwargspartition_endpointis_regionalizeds                r&   ra   (EndpointResolver._endpoint_for_partition   sb    #;/""H"HH&'z3  '[MYOO !,00.
 "l2*+>?#o% #(((&<!2
 {33==2>22 i55!-!1!12E!F*../?FO!/		= &	 3E/}}6~66II<
 ==2>22% :Ir)   c                 r    X!S   ;   a  gSU;   a(  [         R                  " US   5      R                  U5      $ g)NrP   TregionRegexF)recompilematch)r#   rG   r%   s      r&   ri   EndpointResolver._region_match=  s:    I..I%::i67==kJJr)   c                     UR                  S/ 5      nU H2  n[        US   5      [        U5      :X  d  M   UR                  5       nUs  $    g )Nvariantsro   )r[   setcopy)r#   rC   ro   r   r\   rM   s         r&   rQ   'EndpointResolver._retrieve_variant_dataD  sC     $$Z4G76?#s4y0   r)   c                 j    / nU(       a  UR                  S5        U(       a  UR                  S5        U$ )Nrm   fips)rL   )r#   rc   rd   ro   s       r&   _create_tag_list!EndpointResolver._create_tag_listK  s*    !KK$KKr)   c                 v    0 nX#U4 H.  nU R                  Xa5      nU(       d  M  U R                  Xu5        M0     U$ r3   )rQ   _merge_keys)r#   ro   rC   service_defaultspartition_defaultsrM   r   r\   s           r&   _resolve_variant!EndpointResolver._resolve_variantS  sD     &:LMH11(AGw  1 N r)   c                    UR                  S0 5      R                  U0 5      nUR                  S5      (       a  [        R                  SU5        UR                  S0 5      nUR                  S0 5      n	U R                  XV5      n
U
(       a;  U R	                  XX5      nU0 :X  a  SU SU 3n[        XS9eU R                  X{5        OUnSU;  a  US   US'   US	   US	'   XKS
'   U R                  X5        U R                  X5        U R                  UUS   UUUS   5      US'   SU;   a  U R                  UUS   UUUS   5      US'   U$ )Nr   
deprecatedz5Client is configured with the deprecated endpoint: %srY   zEndpoint does not exist for z in region rn   rZ   rG   endpointNamehostnamesslCommonName)r[   ru   warningr   r   r   r   _expand_template)r#   rG   r$   rq   rT   rc   rd   rC   r   r   ro   rM   rh   s                r&   rt   EndpointResolver._resolve]  s    %((b9==2
 \**KKG
 (++J;&]]:r:$$%;O**%5F |2<. A!!.1  +JJ]3"F f$"+K"8F;'4{!.~ 	)2+4!22:;
z f$&*&;&;'{#'F?# r)   c                 0    U H  nX2;  d  M
  X   X#'   M     g r3   r2   )r#   	from_datarM   keys       r&   r   EndpointResolver._merge_keys  s    C 'n r)   c                 "    UR                  X4US9$ )N)serviceregionrZ   )format)r#   rG   templater$   rT   rZ   s         r&   r   !EndpointResolver._expand_template  s      )  
 	
r)   )rA   rB   )F)r4   )r4   FNr3   )NNFF)r5   r6   r7   r8   r9   rb   rD   rI   r+   r0   r]   r'   rj   ra   ri   rQ   r   r   rt   r   r   r:   r2   r)   r&   r<   r<   t   s    A)2K(@%37  ": 59$ $0d
  ?3B@D-

r)   r<   c                   L    \ rS rSrSrSrSrSrSrSr	Sr
S	rS
rSrSrSrSrSrSrg)EndpointResolverBuiltinsi  zAWS::RegionzAWS::UseFIPSzAWS::UseDualStackzAWS::STS::UseGlobalEndpointzAWS::S3::UseGlobalEndpointzAWS::S3::AcceleratezAWS::S3::ForcePathStylezAWS::S3::UseArnRegionz$AWS::S3::DisableS3ExpressSessionAuthzAWS::S3Control::UseArnRegionz'AWS::S3::DisableMultiRegionAccessPointszSDK::EndpointzAWS::Auth::AccountIdz AWS::Auth::AccountIdEndpointModer2   N)r5   r6   r7   r8   
AWS_REGIONAWS_USE_FIPSAWS_USE_DUALSTACKAWS_STS_USE_GLOBAL_ENDPOINTAWS_S3_USE_GLOBAL_ENDPOINTAWS_S3_ACCELERATEAWS_S3_FORCE_PATH_STYLEAWS_S3_USE_ARN_REGION#AWS_S3_DISABLE_EXPRESS_SESSION_AUTHAWS_S3CONTROL_USE_ARN_REGIONAWS_S3_DISABLE_MRAPSDK_ENDPOINT
ACCOUNT_IDACCOUNT_ID_ENDPOINT_MODEr:   r2   r)   r&   r   r     sd    J "L , #@ ">-7 4 	/ (
 $B C"L'JAr)   r   c                       \ rS rSrSr  SS jrS rS rS rS r	S	 r
S
 rS rS r\S 5       r\S 5       r\S 5       rS rS rS rS rS rS rSrg)EndpointRulesetResolveri  z5Resolves endpoints using a service's endpoint rulesetNc	                     [        UUS9U l        U R                  R                  R                  U l        X0l        X@l        XPl        X`l        Xpl	        Xl
        0 U l        g )N)ruleset_datapartition_data)r
   	_providerruleset
parameters_param_definitions_service_model	_builtins_client_context_event_emitter_use_ssl_requested_auth_scheme_instance_cache)	r#   endpoint_ruleset_datar   service_modelbuiltinsclient_contextevent_emitteruse_sslrequested_auth_schemes	            r&   rD    EndpointRulesetResolver.__init__  sZ     *.)
 #'.."8"8"C"C+!-+&;#!r)   c           	      l   Uc  0 nUc  0 nU R                  XU5      n[        R                  SU5         U R                  R                  " S0 UD6n[        R                  SUR                  5        U R                  (       dE  UR                  R                  S5      (       a%  SU;  a  UR                  SUR                  SS  3S9nUR                  UR                  R                  5        VV	s0 s H
  u  pXS	   _M     sn	nS
9nU$ ! [
         a  nU R                  Xd5      nUc  e XveSnAff = fs  sn	nf )zAInvokes the provider with params defined in the service's rulesetNz-Calling endpoint provider with parameters: %szEndpoint provider result: %szhttps://Endpointzhttp://   )urlr   )headersr2   )_get_provider_paramsru   rv   r   resolve_endpointr   #ruleset_error_to_botocore_exceptionr   r   
startswith_replacer   items)
r#   operation_model	call_argsrequest_contextprovider_paramsprovider_resultexbotocore_exceptionr   vals
             r&   r'   *EndpointRulesetResolver.construct_endpoint  sX    I" O33
 			;_	
	1"nn== !O 			0/2E2EF ##..z::/1-66o11!"567 7 O *22,;,C,C,I,I,K,KV,K 3 
 ; % 	1!%!I!I" ")(0	10s   D .D0

D-D((D-c                    0 nU R                  XU5      nU R                  R                  5        HZ  u  pgU R                  UUUS9nUc'  UR                  b  U R                  UR                  US9nUc  ME  XU'   U R                  Xh5        M\     U$ )aU  Resolve a value for each parameter defined in the service's ruleset

The resolution order for parameter values is:
1. Operation-specific static context values from the service definition
2. Operation-specific dynamic context values from API parameters
3. Client-specific context parameters
4. Built-in values such as region, FIPS usage, ...
)
param_namer   r   )builtin_namer   )_get_customized_builtinsr   r   _resolve_param_from_contextbuiltin_resolve_param_as_builtin_register_endpoint_feature_ids)	r#   r   r   r   r   customized_builtinsr   	param_def	param_vals	            r&   r   ,EndpointRulesetResolver._get_provider_params%  s      #;;
 &*%<%<%B%B%D!J88% /# 9 I
  Y%6%6%B ::!*!2!20 ; 	 $.7
+33JJ &E r)   c                     U R                  X5      nUb  U$ U R                  XU5      nUb  U$ U R                  XU5      nUb  U$ U R                  U5      $ r3   )&_resolve_param_as_static_context_param'_resolve_param_as_dynamic_context_param)_resolve_param_as_operation_context_param&_resolve_param_as_client_context_param)r#   r   r   r   staticdynamicoperation_context_paramss          r&   r   3EndpointRulesetResolver._resolve_param_from_contextG  s}     <<
 M>>
 N::Y 	!
 $/++:::FFr)   c                 F    U R                  U5      nUR                  U5      $ r3   )_get_static_context_paramsr[   )r#   r   r   static_ctx_paramss       r&   r   >EndpointRulesetResolver._resolve_param_as_static_context_param]  s&     !;;OL $$Z00r)   c                 Z    U R                  U5      nX;   a  XA   nUR                  U5      $ g r3   )_get_dynamic_context_paramsr[   )r#   r   r   r   dynamic_ctx_paramsmember_names         r&   r   ?EndpointRulesetResolver._resolve_param_as_dynamic_context_paramc  s7     "==oN+,8K==-- ,r)   c                 l    U R                  5       nX;   a  X!   nU R                  R                  U5      $ g r3   )_get_client_context_paramsr   r[   )r#   r   client_ctx_paramsclient_ctx_varnames       r&   r   >EndpointRulesetResolver._resolve_param_as_client_context_paramk  s=     ;;=*!2!>''++,>?? +r)   c                 `    UR                   nX;   a  XA   S   n[        R                  " XS5      $ g )Npath)operation_context_parametersjmespathsearch)r#   r   r   r   operation_ctx_paramsr  s         r&   r   AEndpointRulesetResolver._resolve_param_as_operation_context_paramq  s7      /KK-'3F;D??433 .r)   c                     U[         R                  R                  5       ;  a	  [        US9eUR	                  U5      n[        U5      (       a  U" 5       $ U$ )N)name)r   __members__valuesr   r[   callable)r#   r   r   r   s       r&   r   1EndpointRulesetResolver._resolve_param_as_builtiny  sK    7CCJJLL6LII,,|,G9r)   c                 p    UR                    Vs0 s H  nUR                  UR                  _M     sn$ s  snf )z=Mapping of param names to static param value for an operation)static_context_parametersr
  valuer#   r   params      r&   r   2EndpointRulesetResolver._get_static_context_params  s<    
 )BB
B JJ#B
 	
 
   !3c                 p    UR                    Vs0 s H  nUR                  UR                  _M     sn$ s  snf )z7Mapping of param names to member names for an operation)context_parametersr
  r   r  s      r&   r   3EndpointRulesetResolver._get_dynamic_context_params  s>    
 );;
; JJ)));
 	
 
r  c                     U R                   R                   Vs0 s H#  nUR                  [        UR                  5      _M%     sn$ s  snf )z7Mapping of param names to client configuration variable)r   client_context_parametersr
  r   )r#   r  s     r&   r   2EndpointRulesetResolver._get_client_context_params  sG    
 ,,FF
F JJ
5::..F
 	
 
s   *Ac                     U R                   R                  R                  5       n[        R                  " U R                  5      nU R
                  R                  SU 3UUUUS9  U$ )Nzbefore-endpoint-resolution.)r   modelparamscontext)r   
service_id	hyphenizer   r   r   emit)r#   r   r   r   r   r   s         r&   r   0EndpointRulesetResolver._get_customized_builtins  sh     ((33==?
"ii7  )*6(!# 	! 	
 #"r)   c                 8  ^  [        U[        5      (       a  [        U5      S:X  a  [        S5      e[        R                  SSR                  U Vs/ s H  nSUR                  S5       S3PM     sn5      T R                  5        T R                  [        :X  a  S0 4$ U Vs/ s H  n0 UEST R                  US   5      0EPM     nnT R                  b   [        U 4S	 jU 5       5      u  pCO [        S
 U 5       5      u  pC0 nSU;   a	  US   US'   O/SU;   a)  [        US   5      S:  a  SR                  US   5      US'   SU;   a  UR#                  US   S9  SU;   a  [%        US   5      US'   [        R                  SUS   UU5        XG4$ s  snf s  snf ! [         a    S0 4s $ f = f! [         ab    SnU Vs/ s H  o"S   PM	     Os  snf nn[        (       d  [        S U 5       5      nU(       a	  [        SS9e[!        SR                  U5      S9ef = f)a  Convert an Endpoint's authSchemes property to a signing_context dict

:type auth_schemes: list
:param auth_schemes: A list of dictionaries taken from the
    ``authSchemes`` property of an Endpoint object returned by
    ``EndpointProvider``.

:rtype: str, dict
:return: Tuple of auth type string (to be used in
    ``request_context['auth_type']``) and signing context dict (for use
    in ``request_context['signing']``).
r   z&auth_schemes must be a non-empty list.z_Selecting from endpoint provider's list of auth schemes: %s. User selected auth scheme is: "%s"z, "r
  noneNc              3      >#    U  H9  nTR                  TR                  US    5      (       d  M)  TR                  U4v   M;     g7fr
  N)._does_botocore_authname_match_ruleset_authnamer   ).0sr#   s     r&   	<genexpr>FEndpointRulesetResolver.auth_schemes_to_signing_ctx.<locals>.<genexpr>  sB      $)JJ33QvY 5T00!4)s
   (AAc              3   N   #    U  H  nUS    [         ;   d  M  US    U4v   M     g7fr(  )r   )r*  r+  s     r&   r,  r-    s-      $)yN2 #QvYN)s   %%Fc              3   4   #    U  H  nU[         ;   v   M     g 7fr3   r   )r*  schemes     r&   r,  r-    s      +&7F "::&7s   zbThis operation requires an additional dependency. Use pip install botocore[crt] before proceeding.msg)signature_versionsigningRegionr   signingRegionSet,signingName)signing_namedisableDoubleEncodingz?Selected auth type "%s" as "%s" with signing context params: %s)
isinstancelistlen	TypeErrorru   rv   joinr[   r   r   _strip_sig_prefixnextStopIterationr   anyr   r   updater   )r#   auth_schemesr+  r0  r
  fixable_with_crtauth_type_optionssigning_contexts   `       r&   auth_schemes_to_signing_ctx3EndpointRulesetResolver.auth_schemes_to_signing_ctx  s    ,--\1Ba1GDEE		1II\B\155=/+\BC''		
 &&(22: '
& GvFvt55fVnEF& 	 
 &&2   $ $)$  f# $)$  6 f$(.(?OH%6)6,-.2,/HH-.-) F"""}0E"F"f,7E./8O34 			M6N		
 $$] C
  !   Rx	  !  $) 8D$E1vY$E!$Ew'* +&7+ ($
 $4L 
 7*.))4E*F %s7   F!$FF .F- F*)F*-H=GAHc                 <    UR                  S5      (       a  USS $ U$ )z6Normalize auth type names by removing any "sig" prefixsig   N)r   )r#   	auth_names     r&   r?  )EndpointRulesetResolver._strip_sig_prefix  s#     ) 4 4U ; ;y}JJr)   c                     U R                  U5      nUR                  S5      S   nUS:w  a  UR                  S5      (       a  USS nX!:H  $ )a  
Whether a valid string provided as signature_version parameter for
client construction refers to the same auth methods as a string
returned by the endpoint ruleset provider. This accounts for:

* The ruleset prefixes auth names with "sig"
* The s3 and s3control rulesets don't distinguish between v4[a] and
  s3v4[a] signers
* The v2, v3, and HMAC v1 based signers (s3, s3-*) are botocore legacy
  features and do not exist in the rulesets
* Only characters up to the first dash are considered

Example matches:
* v4, sigv4
* v4, v4
* s3v4, sigv4
* s3v7, sigv7 (hypothetical example)
* s3v4a, sigv4a
* s3v4-query, sigv4

Example mismatches:
* v4a, sigv4
* s3, sigv4
* s3-presign-post, sigv4
-r   r`      N)r?  splitr   )r#   botonamersnames      r&   r)  FEndpointRulesetResolver._does_botocore_authname_match_ruleset_authname  sS    4 ''/>>#&q)t 3 3D 9 9|H!!r)   c                    UR                   R                  S5      nUc  gUR                  S5      (       a   UR                  S5      S   n[        US9$ U R                  R                  nUS:X  a  US:X  d  US	:X  a	  [        US
9$ UR                  S5      (       dn  UR                  S5      (       dX  UR                  S5      (       dB  UR                  S5      (       d,  UR                  S5      (       d  UR                  S5      (       a	  [        US
9$ UR                  5       R                  S5      (       a	  [        US9$ US:X  at  UR                  S5      (       a  UR                  S5      n[        XcS9$ UR                  S5      (       d  UR                  S5      (       a	  [        US
9$ US:X  a	  [        US9$ US:X  a.  UR                  S5      (       a	  [        US
9$ US:X  a	  [        US
9$ g! [         a    Un GNf = f)ztAttempts to translate ruleset errors to pre-existing botocore
exception types by string matching exception strings.
r2  NzInvalid region in ARN: `   )labelr`   z/S3 Object Lambda does not support S3 Acceleratez#Accelerate cannot be used with FIPSr1  zS3 Outposts does not supportzS3 MRAP does not supportz!S3 Object Lambda does not supportzAccess Points do not supportzInvalid configuration:z#Client was configured for partitionzinvalid arn:)report	s3controlzInvalid ARN:Bucket)arnr2  z!AccountId is required but not seteventszUInvalid Configuration: FIPS is not supported with EventBridge multi-region endpoints.z&EndpointId must be a valid host label.)kwargsr[   r   rR  
IndexErrorr   r   r$   r   r   lowerr   r   r   r   )r#   ruleset_exceptionr  r2  rY  r$   r]  s          r&   r   ;EndpointRulesetResolver.ruleset_error_to_botocore_exception/  s     &&**51;>>344		#q) )u55**774HH??63??=>>>>"<==>>"EFF>>"@AA>>":;;>>"GHHAcJJyy{%%n55+377;&~~n--jj*3EE~~6773>>5< < >#FF99+3778#~~6  9SAA>>8SAAQ  s   G. .G>=G>c                 n    US:X  a  [        SUR                  5        35        g US:X  a  [        S5        g g )NAccountIdEndpointModeACCOUNT_ID_MODE_	AccountIdRESOLVED_ACCOUNT_ID)r   upper)r#   r   r   s      r&   r   6EndpointRulesetResolver._register_endpoint_feature_idsf  s9    00"29??3D2E FG;& 56 'r)   )	r   r   r   r   r   r   r   r   r   )TN)r5   r6   r7   r8   r9   rD   r'   r   r   r   r   r   r   r   r   r   r   r   r   rH  r?  r)  r   r   r:   r2   r)   r&   r   r     s    ? ""04l DG,1.@4 
 
 
 
 
 
#a%FK"@5n7r)   r   )/r9   r   loggingr~   enumr   r  botocorer   r   botocore.authr   r   botocore.crtr	   botocore.endpoint_providerr
   botocore.exceptionsr   r   r   r   r   r   r   r   r   r   r   r   r   r   botocore.useragentr   botocore.utilsr   r   	getLoggerr5   ru   DEFAULT_URI_TEMPLATErs   r   r<   strr   r   r2   r)   r&   <module>rw     s      	   ) 1 1 7     3 9!7 #R( :" :"zu
+ u
p	%BsD %BPV7 V7r)   