
                             S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJ	r	   " S S	\
5      r " S
 S\
5      rS rS rg)zFBase classes for abstracting away common logic for Deployment Manager.    )absolute_import)division)unicode_literals)apis)
properties)	resourcesc                       \ rS rSrSr " S S\5      r\" SSS5      r\" SSR                  S	5      S
5      r	\" SSR                  S	5      S5      r
\\	\
4rSrg)DmApiVersion   zAn enum representing the API version of Deployment Manager.

The DM API version controls which version of DM API to use for a certain
command under certain release track.
c                   *    \ rS rSrSrS rS rS rSrg)DmApiVersion._VERSION"   z;An enum representing the API version of Deployment Manager.c                 (    Xl         X l        X0l        g N)idhelp_tag	help_note)selfr   r   r   s       8lib/googlecloudsdk/api_lib/deployment_manager/dm_base.py__init__DmApiVersion._VERSION.__init__&   s    gm n    c                     U R                   $ r   r   r   s    r   __str__DmApiVersion._VERSION.__str__+   s    WWnr   c                 4    U R                   UR                   :H  $ r   r   )r   others     r   __eq__DmApiVersion._VERSION.__eq__.   s    WW  r   )r   r   r   N)	__name__
__module____qualname____firstlineno____doc__r   r   r    __static_attributes__ r   r   _VERSIONr   "   s    E!
!r   r)   v2Nalphaz{0}(ALPHA){0} *zAThe DM API currently used is ALPHA and may change without notice.v2betaz{0}(V2BETA){0} zBThe DM API currently used is V2BETA and may change without notice.r(   )r"   r#   r$   r%   r&   objectr)   V2formatALPHAV2BETA_ALLr'   r(   r   r   r
   r
      sq    ! ! dD!"
c"IK%
 s#JL&
 eV	$r   r
   c                       \ rS rSrSr\R                  rSrSr	Sr
S r\S 5       r\S 5       r\S 5       r\S 5       rS	rg)
	DmCommand@   z:DmCommand is a base class for Deployment Manager commands.Nc                     g r   r(   r   s    r   r   DmCommand.__init__H   s    r   c                     U R                   $ r   _dm_versionr   s    r   versionDmCommand.versionK   s    r   c                     U R                   c0  [        R                  " SU R                  R                  5      U l         U R                   $ )zSpecifies the DM client.deploymentmanager)
_dm_clientr   GetClientInstancer;   r   r   s    r   clientDmCommand.clientO   s=     ../B/3/?/?/B/BDdo??r   c                     U R                   c0  [        R                  " SU R                  R                  5      U l         U R                   $ )zSpecifies the DM messages.r?   )_dm_messagesr   GetMessagesModuler;   r   r   s    r   messagesDmCommand.messagesW   sB      001D151A1A1D1DFdr   c                     U R                   cS  [        R                  R                  5       U l         U R                   R	                  SU R
                  R                  5        U R                   $ )z0Specifies the resources parser for DM resources.r?   )_dm_resourcesr   REGISTRYCloneRegisterApiByNamer;   r   r   s    r   r   DmCommand.resources_   sZ     !$--335d
**+>+/+;+;+>+>@r   )r@   rE   rJ   )r"   r#   r$   r%   r&   r
   r/   r;   r@   rE   rJ   r   propertyr<   rB   rG   r   r'   r(   r   r   r5   r5   @   sr    B+*,-	        r   r5   c                    ^  U 4S jnU$ )zMark this command class to use given Deployment Manager API version.

Args:
  api_version: DM API version to use for the command

Returns:
  The decorator function
c                    > TU l         U $ )z#Wrapper function for the decorator.r:   )	cmd_classapi_versions    r   InitApiHolderUseDmApi.<locals>.InitApiHolderr   s     (Ir   r(   )rS   rT   s   ` r   UseDmApirV   i   s    
 
r   c                  d    [         R                  R                  R                  R	                  SS9$ )NT)required)r   VALUEScoreprojectGetr(   r   r   
GetProjectr]   z   s(    						'	'	+	+T	+	::r   N)r&   
__future__r   r   r   googlecloudsdk.api_lib.utilr   googlecloudsdk.corer   r   r.   r
   r5   rV   r]   r(   r   r   <module>ra      sA     M &  ' , * )"6 "J& &R";r   