
    1                     
   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  G d d	ej                        Z G d
 de      Z G d dee
j$                        Z G d de      Z G d dee
j(                        Zy)z9Base classes for commands for MembershipFeature resource.    )absolute_import)division)unicode_literals)
exceptions)base)infoc                   0    e Zd ZdZdZed        Zd Zd Zy)MembershipFeatureCommandzZMembershipFeatureCommand is a mixin adding common utils to the MembershipFeature commands. c                 @    t        j                  | j                        S )z2The Feature info entry for this command's Feature.)r   Getmf_name)selfs    Ilib/googlecloudsdk/command_lib/container/fleet/membershipfeatures/base.pyfeaturez MembershipFeatureCommand.feature   s     88DLL!!    c                 $    | d| j                    S )zBBuilds the full MembershipFeature name, using the membership path.z
/features/)r   r   membership_paths     r   MembershipFeatureResourceNamez6MembershipFeatureCommand.MembershipFeatureResourceName$   s    j77r   c                 V    | j                   j                  | j                  |            S )z4Fetch this command's MembershipFeature from the API.)hubclient_v2GetMembershipFeaturer   r   s     r   r   z-MembershipFeatureCommand.GetMembershipFeature(   s)    11**?; r   N)	__name__
__module____qualname____doc__r   propertyr   r   r    r   r   r
   r
      s&    b'" "8r   r
   c                       e Zd ZdZd Zy)UpdateCommandMixinz8A mixin for functionality to update a MembershipFeature.c                     | j                  |      }| j                  j                  |||      }d| d}| j                  | j                  j                  ||d      S )NWaiting for MembershipFeature z to be updatedFmessagewarnings)r   r   UpdateMembershipFeatureWaitForHubOpmembership_feature_waiter)r   r   maskpatchmembershipfeature_pathopmsgs          r   UpdateV2zUpdateCommandMixin.UpdateV22   sw    !??P				2	2e
B ))?(@O  33
	   r   N)r   r   r   r   r/   r   r   r   r!   r!   /   s
    @r   r!   c                       e Zd ZdZy)UpdateCommandz<Base class for the command that updates a MembershipFeature.Nr   r   r   r   r   r   r   r1   r1   B       Dr   r1   c                       e Zd ZdZd Zy)DeleteCommandMixinz7A mixin for functionality to delte a MembershipFeature.c                     | j                  |      }	 | j                  j                  |      }d| d}| j                  | j                  j                  ||d      S # t        j                  $ r Y y w xY w)Nr#   z to be deletedFr$   )r   r   DeleteMembershipFeatureapitools_exceptionsHttpNotFoundErrorr(   resourceless_waiter)r   r   r,   r-   r.   s        r   DeleteV2zDeleteCommandMixin.DeleteV2I   s    !??P445KLb
 ))?(@O  --
	    00 s   A A32A3N)r   r   r   r   r;   r   r   r   r5   r5   F   s
    ?r   r5   c                       e Zd ZdZy)DeleteCommandz<Base class for the command that deletes a MembershipFeature.Nr2   r   r   r   r=   r=   \   r3   r   r=   N)r   
__future__r   r   r   apitools.base.pyr   r8   googlecloudsdk.callioper   calliope_base*googlecloudsdk.command_lib.container.fleethub_base3googlecloudsdk.command_lib.container.fleet.featuresr   
HubCommandr
   r!   r1   r5   r=   r   r   r   <module>rF      sz    @ &  ' > 9 G Dx22 (1 &E&(C(C E1 ,E&(C(C Er   