
    N                         S r SSKrSSKJr  SSKJr  \" / SQ5      r\" / SQ5      r	Sr
SrS	rS
 r\R                  SS j5       r SS jrg)z/Utilities for operating on different endpoints.    N)
exceptions)
properties)
euzeurope-north2zeurope-west12znorthamerica-south1uszus-west8asiazasia-southeast3zeurope-west15global))zafrica-south1z
asia-east1z
asia-east2zasia-northeast1zasia-northeast2zasia-northeast3zasia-south1zasia-south2zasia-southeast1zasia-southeast2zaustralia-southeast1zaustralia-southeast2zeurope-central2zeurope-north1zeurope-southwest1zeurope-west1zeurope-west10zeurope-west2zeurope-west3zeurope-west4zeurope-west6zeurope-west8zeurope-west9zme-central1zme-central2zme-west1znorthamerica-northeast1znorthamerica-northeast2zsouthamerica-east1zsouthamerica-west1zus-central1zus-central2zus-east1zus-east4zus-east5zus-east7z	us-south1zus-west1zus-west2zus-west3zus-west4z$https://containeranalysis.{}.rep.{}/z.{protocol}{prefix}{location}-{format}.{domain}z2{protocol}{prefix}{format}.{location}.rep.{domain}c                     [         R                  R                  R                  R	                  5       n[
        R                  X5      nU$ N)r   VALUEScoreuniverse_domainGet!_CONTAINER_ANALYSIS_REP_STRUCTUREformat)regionr   regional_endpoints      9lib/googlecloudsdk/command_lib/artifacts/endpoint_util.py_GetRegionalEndpointr   `   s>    %%**::>>@/7>> 
    c              #   @  #    [         R                  R                  R                  R	                  5       nU c  OtU [
        ;  a  U [        ;  a  [        R                  " 5       eUcH  U [        ;  a>  [        U 5      n[         R                  R                  R                  R                  U5         Sv   [         R                  R                  R                  R                  U5        g! [         R                  R                  R                  R                  U5        f = f7f)a  WithRegion overrides artifact analysis endpoint with endpoint of region.

A call to WithRegion should be done in a with clause.
If an existing override exists, this command does not do anything.
If a rerouted region is passed in, this command does not do anything.
An error is raised if an invalid location is passed in.

Args:
  region: str, location

Raises:
  aa_exceptions.UnsupportedLocationError if location provided is invalid.

Yields:
  None
N)r   r   api_endpoint_overridescontaineranalysisr   $_CONTAINER_ANALYSIS_DIRECT_LOCATIONS&_CONTAINER_ANALYSIS_REROUTED_LOCATIONSar_exceptionsUnsupportedLocationErrorr   Set)r   overrider   s      r   
WithRegionr   h   s     $ 55GGKKM(^88
>
>

0
0
226)OO,V4,,>>BBM	,,>>BB8LJ,,>>BB8Ls   B+D.C& 24D&5DDc                 0   Sn[         R                  R                  R                  R	                  5       nU(       a6  US:w  a+  US:w  a%  [
        R                  " SR                  U5      5      eUS-   nU(       a  [        O[        nUR                  UUU UUS9$ )zCReturns the Artifact Registry domain endpoint for the given region.zpkg.devhttpshttpz+Invalid protocol: {}, must be https or httpz://)protocolprefixlocationr   domain)
r   r   	artifactsregistry_endpoint_prefixr   r   ArtifactRegistryErrorr   '_ARTIFACT_REGISTRY_FACADE_REP_STRUCTURE#_ARTIFACT_REGISTRY_FACADE_STRUCTURE)r%   repo_formatr#   repr&   r$   templates          r   ArtifactRegistryDomainEndpointr/      s    
 &&&??CCE&7x61//
7
>
>x
H  %H 
 .. 
 
 
 
 r   r
   ) F)__doc__
contextlib googlecloudsdk.api_lib.artifactsr   r   googlecloudsdk.corer   	frozensetr   r   r   r+   r*   r   contextmanagerr   r/    r   r   <module>r8      sy     6  H *
 *3 4 * &( (1 ,2 ,( $\ %K !&V #*^ ' #M #MN -2r   