
    
                         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	Zej                   G d
 dej                               Zy)z6`gcloud domains registrations search-domains` command.    )absolute_import)division)unicode_literals)registrations)base)resource_args)utilztable(
    domainName:label=DOMAIN,
    availability:label=AVAILABILITY,
    yearlyPrice.price():label=YEARLY_PRICE,
    domainNotices.list():label=NOTICES
)
c                   &    e Zd ZdZed        Zd Zy)SearchDomainsa  Search for available domains.

  Search for available domains relevant to a specified query.

  This command uses cached domain name availability information. Use the
  get-register-params command to get up-to-date availability information.

  ## EXAMPLES

  To search for domains for ``my-new-project'', run:

    $ {command} my-new-project

  To search for a specific domain, like ``example.com'', and get suggestions for
  other domain endings, run:

    $ {command} example.com
  c                    t        j                  | d       | j                  j                  dt        j
                  i       | j                  j                  t               t        j                  dd      j                  |        y )Nzto search domains inpricedomain_queryzDDomain search query. May be a domain name or arbitrary search terms.)help)r   AddLocationResourceArgdisplay_infoAddTransformsr	   TransformMoneyType	AddFormat_FORMATr   ArgumentAddToParser)parsers    3lib/surface/domains/registrations/search_domains.pyArgszSearchDomains.Args9   sg    ((1GH
%%w0G0G&HI
!!'*MM@ k&    c                    t        j                  |      }t        j                  |      }|j                  j                  j                         }|j                  ||j                        }|D ]'  }	 t        j                  |j                        |_
        ) |s)|j                  |j                  j                                |S # t        $ r Y bw xY w)zRun the search domains command.)r   GetApiVersionFromArgsRegistrationsClientCONCEPTSlocationParser   r   r	   PunycodeToUnicode
domainNameUnicodeErrorappendmessagesRegisterParameters)selfargsapi_versionclientlocation_refsuggestionsss          r   RunzSearchDomains.RunD   s    55d;K..{;F==))//1L &&|T5F5FGK--all; 
 ;;=>  s   1$C	CCN)__name__
__module____qualname____doc__staticmethodr   r/    r   r   r   r   $   s     &  r   r   N)r3   
__future__r   r   r   googlecloudsdk.api_lib.domainsr   googlecloudsdk.callioper   "googlecloudsdk.command_lib.domainsr   r	   r   DefaultUniverseOnlyDescribeCommandr   r5   r   r   <module>r<      sM    = &  ' 8 ( < 3 0D(( 0 0r   