
    s                         d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm	Z	 ddlm
Z
 ej                   G d	 d
ej                               Zy)zThe gcloud run regions group.    )absolute_import)division)unicode_literals)base)
exceptions)flags)	platformsc                   ,    e Zd ZdZed        Zd Zd Zy)Regionsz1View available Cloud Run (fully managed) regions.c                 2    t        j                  | d       y)z-Adds --platform and the various related args.T)managed_onlyN)r   AddPlatformArg)parsers    #lib/surface/run/regions/__init__.pyArgszRegions.Args   s     
d3    c                     t        j                  || j                         t         j                  j                         | j                          |S )z@Runs before command.Run and validates platform with passed args.)r   GetAndValidatePlatformReleaseTrackProductRUN_CheckPlatform)selfcontextargss      r   FilterzRegions.Filter$   s=     
  d!5==#4#46Nr   c                     t        j                         }|)|t         j                  k7  rt        j                  d      y y )NzOThis command group only supports listing regions for Cloud Run (fully managed).)r	   GetPlatformPLATFORM_MANAGEDr   PlatformError)r   platforms     r   r   zRegions._CheckPlatform-   sD    $$&HI,F,F F$$'( ( !Gr   N)__name__
__module____qualname____doc__staticmethodr   r   r    r   r   r   r      s!    94 4(r   r   N)r%   
__future__r   r   r   googlecloudsdk.callioper   googlecloudsdk.command_lib.runr   r   r	   UniverseCompatibleGroupr   r'   r   r   <module>r-      sD    $ &  ' ( 5 0 4 (djj ( (r   