
                            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 dd	l	mZ dd
lmZ  ej                  ej                   j"                  ej                   j$                         G d dej&                               Z ej                  ej                   j*                         G d de             Zdddde_        y)z8Implements the command for removing an OS Login profile.    )absolute_import)division)unicode_literals)client)base)log)
properties)	resources)
console_ioc                       e Zd ZdZd Zy)RemoveProfile:Remove the posix account information for the current user.c                 P   t        j                  | j                               }t        j                  j
                  j                  j                         xs2 t        j                  j                  j                  j                         }t        j                  j                  j                  j                  d      }t        j                  j                  |d|id      }|j                  |      }d }|j                   D ]  }|j"                  |k(  s|j"                  }  |r_t%        j&                  dj)                  |      dd       t+        |dd       }|j-                  ||      }	t/        j0                  |d	
       |	S t/        j2                  dj)                  |             y )NT)requireduserzoslogin.users.projects)params
collectionz@Posix accounts associated with project ID [{0}] will be deleted.)defaultcancel_on_nooperating_systemzposix account(s))detailsz%No profile found with accountId [{0}])r   OsloginClientReleaseTrackr	   VALUESauthimpersonate_service_accountGetcoreaccount	GetOrFailprojectr
   REGISTRYParseGetLoginProfileposixAccounts	accountIdr   PromptContinueformatgetattrDeletePosixAccountsr   DeletedResourcewarning)
selfargsoslogin_clientr   r!   project_refcurrent_profile
account_idr   ress
             .lib/surface/compute/os_login/remove_profile.pyRunzRemoveProfile.Run"   sd   ))$*;*;*=>N  %%AAEEG =##((00::< $$,,00$0?G$$**7FG;L6N + PK$44W=OJ"00			g	%&&
 1 
L6'?	
 !'94@..{<LMc	*.@Aj	kk9@@IJ    N)__name__
__module____qualname____doc__r5    r6   r4   r   r      s    BKr6   r   c                        e Zd ZdZed        Zy)RemoveProfileAlphar   c                 Z    t        j                  ddddd      }|j                  |        y )Nz--operating-system)linuxwindowsFr?   z%Specifies the profile type to remove.)choicesr   r   help_str)r   ChoiceArgumentAddToParser)parseros_args     r4   ArgszRemoveProfileAlpha.ArgsA   s1      $8:F vr6   N)r7   r8   r9   r:   staticmethodrG   r;   r6   r4   r=   r=   =   s    B r6   r=   r   a  
      *{command}* removes the posix account information for the current
      user where the account ID field is set to the current project ID.
      Posix account entries for G Suite users do not set the account ID
      field and can only be modified by a domain administrator.
      a  
      To remove all POSIX accounts associated with the current user and
      project, run:

        $ {command}

      To remove all POSIX accounts associated with the current user in the
      project named `example-project`, run:

        $ {command} --project=example-project
      )briefDESCRIPTIONEXAMPLESN)r:   
__future__r   r   r   googlecloudsdk.api_lib.osloginr   googlecloudsdk.callioper   googlecloudsdk.corer   r	   r
   googlecloudsdk.core.consoler   ReleaseTracksr   GABETACommandr   ALPHAr=   detailed_helpr;   r6   r4   <module>rW      s     ? &  ' 1 ( # * ) 2 D%%(($*;*;*@*@AKDLL K BK< D%%++,  - J


 r6   