
    3                     d   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 ddlmZ dZedz   Z ej(                  ej*                  j,                  ej*                  j.                  ej*                  j0                         G d dej2                               Zd Zy)z+services peered-dns-domains delete command.    )absolute_import)division)unicode_literals)projects_api)peering)services_util)base)util)log)
propertiesz(gcloud services vpc-peerings operations zwait {0}c                   0    e Zd ZdZdddZed        Zd Zy)Deletez<Delete a peered DNS domain for a private service connection.zj          This command deletes a peered DNS domain from a private service
          connection.
          a            To delete a peered DNS domain called `example-com` from a private
          service connection between service `peering-service` and the consumer
          network `my-network` in the current project, run:

            $ {command} example-com --network=my-network \
                --service=peering-service

          To run the same command asynchronously (non-blocking), run:

            $ {command} example-com --network=my-network \
                --service=peering-service --async
          )DESCRIPTIONEXAMPLESc                     | j                  dd       | j                  dddd       | j                  d	d
dd       t        j                  j                  |        y)zArgs is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go on
        the command line after this command. Positional arguments are allowed.
    namez,The name of the peered DNS domain to delete.)helpz	--networkNETWORKTz<The network in the consumer project peered with the service.)metavarrequiredr   z	--serviceSERVICEz servicenetworking.googleapis.comz:The name of the service to delete a peered DNS domain for.)r   defaultr   N)add_argumentr	   
ASYNC_FLAGAddToParser)parsers    1lib/surface/services/peered_dns_domains/delete.pyArgszDelete.Args?   st     C  E
K	  M
 2I	  K
 	OO'    c                 (   t         j                  j                  j                  j	                  d      }t        |      }t        j                  ||j                  |j                  |j                        }|j                  rNt        j                  |j                        }t        j                  j!                  dj                  |             yt#        j$                  |j                  t        j&                        }t#        j(                  |       y)zRun 'services peered-dns-domains delete'.

    Args:
      args: argparse.Namespace, The arguments that this command was invoked
        with.
    T)r   zcAsynchronous operation is in progress... Use the following command to wait for its completion:
 {0}N)r   VALUEScoreprojectGet_GetProjectNumberr   DeletePeeredDnsDomainservicenetworkr   async__OP_WAIT_CMDformatr   statusPrintr   WaitOperationGetOperationPrintOperation)selfargsr#   project_numberopcmds         r   Runz
Delete.RunU   s     $$,,00$0?G&w/N		&	&			
B {{(c	jj ++16#;8 		$	$RWWg.B.B	CB  $r   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r6    r   r   r   r   !   s2     E
-, ( (*%r   r   c                 f    t        j                  t        j                  |             j                  S )N)r   r$   projects_utilParseProjectprojectNumber)
project_ids    r   r%   r%   n   s$    			-44Z@	A	O	OOr   N)r:   
__future__r   r   r   +googlecloudsdk.api_lib.cloudresourcemanagerr   googlecloudsdk.api_lib.servicesr   r   googlecloudsdk.callioper	   #googlecloudsdk.command_lib.projectsr
   r?   googlecloudsdk.corer   r   _OP_BASE_CMDr*   ReleaseTracksReleaseTrackALPHABETAGASilentCommandr   r%   r=   r   r   <module>rP      s    2 &  ' D 3 9 ( E # *9j( 
E%T E%
E%PPr   