
                             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  G d
 de	j                        Zd Zd Zd Zd Zd Zd Zd Z	 	 ddZ	 	 ddZ	 	 ddZy)z-Shared resource flags for Cloud DNS commands.    )absolute_import)division)unicode_literals)concepts)deps)
completers)concept_parsers)
propertiesc                        e Zd Z fdZ xZS )PolicyCompleterc                 6    t        t        | 
  dd|ddd| y )Ndns.policiesz,alpha dns policies list --format=value(name)T)
collectionapi_versionlist_commandparse_output )superr   __init__)selfr   kwargs	__class__s      3lib/googlecloudsdk/command_lib/dns/resource_args.pyr   zPolicyCompleter.__init__   s-    	/4) !C	
     )__name__
__module____qualname__r   __classcell__)r   s   @r   r   r      s     r   r   c                 F    t        j                  dt        |       d      S )Npolicyr   z%The Cloud DNS policy name {resource}.)name	completer	help_text)r    ResourceParameterAttributeConfigr   r!   s    r   PolicyAttributeConfigr&   (   s#    		2	2K87
9 9r   c                  0    t        j                  dd      S )Nzresponse-policyz.The Cloud DNS response policy name {resource}.r"   r$   r   r%   r   r   r   ResponsePolicyAttributeConfigr*   /   s    		2	2@
B Br   c                  0    t        j                  dd      S )Nresponse-policy-rulez3The Cloud DNS response policy rule name {resource}.r(   r)   r   r   r   !ResponsePolicyRuleAttributeConfigr-   5   s    		2	2!E
G Gr   c                      t        j                  ddt        j                  t        j
                  j                  j                        g      S )Nprojectz%The Cloud project for the {resource}.)r"   r$   fallthroughs)r   r%   r   PropertyFallthroughr
   VALUEScorer/   r   r   r   ProjectAttributeConfigr4   ;   s@    		2	27,,Z->->-C-C-K-KLM
O Or   c                 Z    t        j                  d| dt        |       t                     S )Nr   r    r!   )r   resource_namer    r/   )r   ResourceSpecr&   r4   r!   s    r   GetPolicyResourceSpecr8   B   s,    			"{;$&
( (r   c                 V    t        j                  d| dt               t                     S )Nzdns.responsePoliciesresponse_policy)r   r6   responsePolicyr/   )r   r7   r*   r4   r!   s    r   GetResponsePolicyResourceSpecr<   K   s*    			%24$&
( (r   c           	      h    t        j                  d| dt               t               t	                     S )Nzdns.responsePolicyRulesresponse_policy_rule)r   r6   r;   responsePolicyRuler/   )r   r7   r*   r-   r4   r!   s    r   GetResponsePolicyRuleSpecr@   T   s0    			*24:<$&
( (r   c                     |rd}nd}t         j                  j                  |t        |      dj	                  |      |      j                  |        y)a  Add a resource argument for a Cloud DNS Policy.

  Args:
    parser: the parser for the command.
    verb: str, the verb to describe the resource, such as 'to update'.
    api_version: str, the version of the API to use.
    positional: bool, if True, means that the policy name is a positional rather
      than a flag.
    required: bool, if True, means that the arg will be required.
  r    z--policyzThe policy {}.requiredN)r	   ConceptParserForResourcer8   formatAddToParserparserverbr   
positionalrC   r"   s         r   AddPolicyResourceArgrL   ^   sR     DD++
K(d#	 ,  %V,r   c                     |rd}nd}t         j                  j                  |t        |      dj	                  |      |      j                  |        y)a  Add a resource argument for a Cloud DNS Response Policy.

  Args:
    parser: the parser for the command.
    verb: str, the verb to describe the resource, such as 'to update'.
    api_version: str, the version of the API to use.
    positional: bool, if True, means that the policy name is a positional rather
      than a flag.
    required: bool, if True, means that the arg will be required.
  response_policiesz--response_policieszThe response policy {}.rB   N)r	   rD   rE   r<   rF   rG   rH   s         r   AddResponsePolicyResourceArgrO   x   sR     D D++
#K0&&t,	 ,  %V,r   c                     |rd}nd}t         j                  j                  |t        |      dj	                  |      ddi|      j                  |        y)a  Add a resource argument for a Cloud DNS Policy Rule.

  Args:
    parser: the parser for the command.
    verb: str, the verb to describe the resource, such as 'to update'.
    api_version: str, the version of the API to use.
    positional: bool, if True, means that the policy name is a positional rather
      than a flag.
    required: bool, if True, means that the arg will be required.
  r>   z--response_policy_rulezThe response policy rule {}.r,   )flag_name_overridesrC   N)r	   rD   rE   r@   rF   rG   rH   s         r   AddResponsePolicyRuleArgrR      s[     !D#D++
,$++D113IJ , 
 %V,r   N)TT)__doc__
__future__r   r   r    googlecloudsdk.calliope.conceptsr   r   googlecloudsdk.command_lib.utilr   (googlecloudsdk.command_lib.util.conceptsr	   googlecloudsdk.corer
   ListCommandCompleterr   r&   r*   r-   r4   r8   r<   r@   rL   rO   rR   r   r   r   <module>rZ      s     4 &  ' 5 1 6 D *j55 9BGO((( %)"&	-: -1*.	-: )-&*	-r   