
                         4   S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r
  SS	KJr  SS
KJr  SSKJr   " S S\R"                  5      r " S S\R"                  5      r " S S\R"                  5      rSTS jrS rS rS rSUS jr  SVS jrS r SWS jrS rS rSXS jrS r S r!SXS jr"S  r#S! r$S" r%S# r&S$ r'S% r(S& r)S' r*SYS( jr+SYS) jr,S* r-S+ r.S, r/S- r0SYS. jr1S/ r2SYS0 jr3SYS1 jr4SYS2 jr5SYS3 jr6 SZS4 jr7SYS5 jr8SYS6 jr9S[S7 jr:SYS8 jr;SYS9 jr<SYS: jr= SZS; jr>SYS< jr?SYS= jr@S>rAS? rBS@ rCSA rDSB\D0rESCrFSYSD jrGSE rHSF rISG rJSH rKSI rLSJ rMS\SK jrNS\SL jrOSM rPSYSN jrQSYSO\RSP\R                  4SQ jjrTSYSO\RSP\R                  4SR jjrUgS)]z*Common flags for some of the DNS commands.    )absolute_import)division)unicode_literals)actions)arg_parsers)base)concepts)
completers)	arg_utils)concept_parsersc                   (   ^  \ rS rSrU 4S jrSrU =r$ )BetaKeyCompleter   c           	      <   > [         [        U ]
  " SSSSSS/S.UD6  g )Ndns.dnsKeysv1beta2z-beta dns dns-keys list --format=value(keyTag)Tzone
collectionapi_versionlist_commandparse_outputflags )superr   __init__selfkwargs	__class__s     +lib/googlecloudsdk/command_lib/dns/flags.pyr   BetaKeyCompleter.__init__    s3    	
D*  Dh     r   __name__
__module____qualname____firstlineno__r   __static_attributes____classcell__r    s   @r!   r   r           r#   r   c                   (   ^  \ rS rSrU 4S jrSrU =r$ )KeyCompleter+   c           	      <   > [         [        U ]
  " SSSSSS/S.UD6  g )Nr   v1z(dns dns-keys list --format=value(keyTag)Tr   r   r   )r   r.   r   r   s     r!   r   KeyCompleter.__init__-   s2    	,&  ?h r#   r   r$   r+   s   @r!   r.   r.   +   r,   r#   r.   c                   (   ^  \ rS rSrU 4S jrSrU =r$ )ManagedZoneCompleter8   c                 4   > [         [        U ]
  " SSSS.UD6  g )Ndns.managedZoneszdns managed-zones list --uri)r   r   r   )r   r4   r   r   s     r!   r   ManagedZoneCompleter.__init__:   s(    	
. %3 r#   r   r$   r+   s   @r!   r4   r4   8   s     r#   r4   c                 X    [         R                  " SSU(       a	  [        U S9$ [        U S9$ )Nkey_idzKEY-IDmetavar	completerhelp)r   Argumentr   r.   )	help_textis_betas     r!   	GetKeyArgrB   B   s4    	$+ 	
  2>	
 r#   c                 8    [         R                  " SS[        U S9$ )Ndns_zone	ZONE_NAMEr;   )r   r?   r4   r@   s    r!   GetDnsZoneArgrG   K   s    	$	
 r#   c                  ,    [         R                  " SSS9$ )Nr   z&The Cloud DNS zone for the {resource}.)namer@   )r	    ResourceParameterAttributeConfigr   r#   r!   ZoneAttributeConfigrK   T   s    		2	2E
 r#   c                  ^    [         R                  " SS[        5       [         R                  SS9$ )Nr7   r   F)resource_namemanagedZoneprojectdisable_auto_completers)r	   ResourceSpecrK    DEFAULT_PROJECT_ATTRIBUTE_CONFIGr   r#   r!   GetZoneResourceSpecrS   Z   s-    			%'77#
 r#   c                     U(       a  SOSn[         R                  R                  U(       a  UOSR                  U5      [	        5       U USS9$ )Nzonesr   z--{}T)pluralrequired)r   ConceptParserForResourceformatrS   )r@   
positionalrV   arg_names       r!   GetZoneResourceArgr]   d   sH    WF(		&	&	2	2h&--"9 
3 
 r#   c           
         U(       aj  [         R                  " SS9nUR                  [         R                  " S[        U S95        UR                  [         R                  " SS[        U SS95        U$ [         R                  " SS[        U SS9$ )	zReturns the managed zone arg.TrW   z--zone)r=   r>   z-zr   )destr=   r>   hidden)r=   r>   rW   )r   ArgumentGroupAddArgumentr?   r4   )r@   hide_short_zone_flag
zone_groups      r!   
GetZoneArgrf   o   s    
 ##T2Jh*>YO *	
 ==& r#   c                  .    [         R                  " SSSS9$ )Nz
--dns-nameTz?The DNS name suffix that will be managed with the created zone.rW   r>   r   r?   r   r#   r!   GetManagedZonesDnsNameArgrj      s    	L
 r#   c                 .    [         R                  " SSU S9$ )Nz	--zone-idTrh   ri   rF   s    r!   GetZoneIdArgrl      s    
 
{T		BBr#   c                  .    [         R                  " SSSS9$ )N--target-networkTzSThe network url of the Google Compute Engine private network to forward queries to.rh   ri   r   r#   r!   GetPeeringZoneListArgro      s    	#	
 r#   c                  .    [         R                  " SSSS9$ )N--descriptionFz'Short description for the managed zone.rh   ri   r   r#   r!   GetManagedZonesDescriptionArgrr      s    	4
 r#   c                     SSSS.nUS:X  a4  UR                  5        VVs0 s H  u  p4UR                  5       U_M     nnnOUn[        R                  " SU R                  R
                  USS9$ s  snnf )	a  Returns a ChoiceEnumMapper for the --dnssec-state flag.

The v2 DNS API uses uppercase enum values for dnssec-state (e.g. 'ON'),
while v1 uses lowercase. To maintain a consistent user experience, gcloud
accepts lowercase values for all API versions. The `ChoiceEnumMapper`
validates that custom mapping keys are valid API enum values. For v2, this
requires mapping the uppercase API enum to the lowercase, user-facing
choice. The mapper then handles translating the user's input to the
correct value for the API request.

Args:
  messages: The messages module for the API version.
  api_version: The API version to use (e.g., 'v1', 'v2').

Returns:
  A ChoiceEnumMapper for the --dnssec-state flag.
)offz$Disable DNSSEC for the managed zone.)onz#Enable DNSSEC for the managed zone.)transferz=Enable DNSSEC and allow transferring a signed zone in or out.)rt   ru   rv   v2z--dnssec-statez'The DNSSEC state for this managed zone.)custom_mappingshelp_str)itemsupperr   ChoiceEnumMapperManagedZoneDnsSecConfigStateValueValuesEnum)messagesr   v1_mappingskvrx   s         r!   GetDnsSecStateFlagMapperr      s    & =9+ D0;0A0A0CD0Cqwwy!|0CODO!O		#	#&&;;%8	
  Es   A.c                 V    [         R                  " SU R                  R                  SS9$ )Nz--denial-of-existencezRequires DNSSEC enabled.ry   )r   r|   r}   NonExistenceValueValuesEnumr   s    r!   GetDoeFlagMapperr      s*    		#	#&&BB)
 r#   c                 t    [         R                  " SR                  U 5      UR                  R                  SS9$ )Nz--{}-algorithmz_String mnemonic specifying the DNSSEC algorithm of the key-signing key. Requires DNSSEC enabledr   )r   r|   rZ   
DnsKeySpecAlgorithmValueValuesEnum)key_typer   s     r!   GetKeyAlgorithmFlagMapperr      s7    		#	#h'225	
 r#   c                 |   [        X5      R                  R                  U 5        [        U5      R                  R                  U 5        [	        SU5      R                  R                  U 5        [	        SU5      R                  R                  U 5        U R                  S[        SS9  U R                  S[        SS9  g)	z4Add Common DNSSEC flags for the managed-zones group.kskzskz--ksk-key-lengthz?Length of the key-signing key in bits. Requires DNSSEC enabled.typer>   z--zsk-key-lengthz@Length of the zone-signing key in bits. Requires DNSSEC enabled.N)r   
choice_argAddToParserr   r   add_argumentint)parserr   r   s      r!   AddCommonManagedZonesDnssecArgsr      s    81<<HHP8''33F;E8,77CCFKE8,77CCFKL  
 	M  r#   c                  4    [         R                  " SSS/SSS9$ )Nz--visibilitypublicprivatezVisibility of the zone. Public zones are visible to the public internet. Private zones are only visible in your internal networks denoted by the `--networks` flag.)choicesdefaultr>   ri   r   r#   r!   GetManagedZoneVisibilityArgr      s&    	#7	
 	r#   c                  V    [         R                  " SS[        R                  " 5       SS9$ )N
--networksNETWORKzXList of networks that the zone should be visible in if the zone visibility is [private].r<   r   r>   r   r?   r   ArgListr   r#   r!   GetManagedZoneNetworksArgr     s*    	 %
 r#   c                  V    [         R                  " SS[        R                  " 5       SS9$ )N--gkeclustersGKECLUSTERSz\List of GKE clusters that the zone should be visible in if the zone visibility is [private].r   r   r   r#   r!   GetManagedZoneGkeClustersArgr     s*    	 %
 r#   c                      [         R                  " SS9n SnSnU R                  [         R                  " SSUS95        U R                  [         R                  " SSUS95        U $ )	z'Return arg group for DNS Peering flags.Fr_   zNNetwork ID of the Google Compute Engine private network to forward queries to.zNProject ID of the Google Compute Engine private network to forward queries to.rn   Trh   z--target-project)r   rb   rc   r?   )peering_grouptarget_network_help_texttarget_project_help_texts      r!   GetDnsPeeringArgsr      sv    $$e4- 
  
mm
t2J
 
mm
t2J
 
r#   c                  V    [         R                  " S[        R                  " 5       SSS9$ )Nz--forwarding-targetsIP_ADDRESSESa  List of IPv4/IPv6 addresses or one domain name of the target name server that the zone will forward queries to. Ignored for `public` visibility. Non-RFC1918 addresses will forward to the target through the Internet. RFC1918 addresses will forward through the VPC.r   r<   r>   r   r   r#   r!   GetForwardingTargetsArgr   8  s*    	 
 r#   c                  V    [         R                  " S[        R                  " 5       SSS9$ )Nz--private-forwarding-targetsr   zList of IPv4/IPv6 addresses or one domain name of the target name server that the zone will forward queries to. Ignored for `public` visibility. All addresses specified for this parameter will be reached through the VPC.r   r   r   r#   r!   GetPrivateForwardingTargetsArgr   G  s*    	$ &

 
r#   c                  0    [         R                  " SSS SS9$ )Nz--managed-reverse-lookup
store_truezSpecifies whether this zone is a managed reverse lookup zone, required for Cloud DNS to correctly resolve Non-RFC1918 PTR records.actionr   r>   ri   r   r#   r!   GetReverseLookupArgr   U  s"    	 Q
 r#   c                  .    [         R                  " SSSS9$ )Nz--service-directory-namespaceFzThe fully qualified URL of the service directory namespace that should be associated with the zone. Ignored for `public` visibility zones.rh   ri   r   r#   r!   GetServiceDirectoryArgr   a  s    	%	
 r#   c                 .    [         R                  " SU SS9$ )Nrq   zA description of the policy.rh   ri   r_   s    r!   GetPolicyDescriptionArgr   n  s    	/M
 r#   c                 X    [         R                  " S[        R                  " 5       SU SS9$ )Nr   NETWORKSzGThe comma separated list of network names to associate with the policy.)r   r<   rW   r>   r   r_   s    r!   GetPolicyNetworksArgr   t  s-    	 	
 	r#   c                  .    [         R                  " SSSS9$ )Nz--enable-inbound-forwardingr   zSpecifies whether to allow networks bound to this policy to receive DNS queries sent by VMs or applications over VPN connections. Defaults to False.r   r>   ri   r   r#   r!   GetPolicyInboundForwardingArgr     s    	#,	
 r#   c                  .    [         R                  " SSSS9$ )Nz--enable-loggingr   =Specifies whether to enable query logging. Defaults to False.r   ri   r   r#   r!   GetPolicyLoggingArgr     s    	J
 r#   c                  V    [         R                  " S[        R                  " 5       SSS9$ )Nz--alternative-name-serversNAME_SERVERSzList of alternative name servers to forward to. Non-RFC1918 addresses will forward to the target through the Internet.RFC1918 addresses will forward through the VPC.r   r   r   r#   r!   GetPolicyAltNameServersArgr     s*    	" <	
 	r#   c                  V    [         R                  " S[        R                  " 5       SSS9$ )Nz"--private-alternative-name-serversr   z{List of alternative name servers to forward to. All addresses specified for this parameter will be reached through the VPC.r   r   r   r#   r!   !GetPolicyPrivateAltNameServersArgr     s+    	* K
 r#   c                     U (       d  [         R                  " SSSSS9$ [         R                  " S[        R                  SS9$ )z>Returns the enable dns64 all queries arg for create or update.z--enable-dns64-all-queriesr   NzaSpecifies whether to allow networks bound to this policy to use DNS64 for IPv6-only VM instances.r   r   r   r?   r   StoreTrueFalseAction)updates    r!   GetEnableDns64AllQueriesArgr     sH    	==$0  ==$//0	 r#   c                  .    [         R                  " SSSS9$ )NrI   DNS_NAMEz%DNS or domain name of the record-set.)r<   r>   ri   r   r#   r!   GetResourceRecordSetsNameArgr     s    	j'N
 r#   c                 .    [         R                  " SU SS9$ )Nz--typez:DNS record type of the record-set (e.g. A, AAAA, MX etc.).rh   ri   r_   s    r!   GetResourceRecordSetsTypeArgr     s    	G
 r#   c                 8    [         R                  " S[        U SS9$ )Nz--ttlz&TTL (time to live) for the record-set.r   rW   r>   )r   r?   r   r_   s    r!   GetResourceRecordSetsTtlArgr     s    	3	
 r#   c                 X    [         R                  " SSU [        R                  " 5       SS9$ )Nz	--rrdatasRRDATAzDNS data (Address/CNAME/MX info, etc.) of the record-set. This is RDATA; the format of this information varies depending on the type and class of the resource record.r<   rW   r   r>   r   r_   s    r!   GetResourceRecordSetsRrdatasArgr     s-    	 :

 
r#   c                    [         R                  " SSSS9nUR                  [        5       5        UR                  [	        5       5        [         R                  " SS9nUR                  [        SS95        UR                  U5        UR                  [        SS95        UR                  [        SS95        [         R                  " SSSS	9nUR                  [        U S
95        UR                  U5        UR                  [        5       5        [         R                  " SSS9n[         R                  " SSSS	9nUR                  [        SS95        UR                  [        SS95        UR                  [        SU S95        UR                  [        SS95        UR                  U5        UR                  U5        [         R                  " SSSS	9nUR                  [        SS95        UR                  U5        U$ )a  Returns arg group for rrdatas flags.

Args:
  use_deprecated_names: If true, uses snake_case names for flags
    --routing-policy-type and --routing-policy-data, --routing_policy_type and
    --routing_policy_data.  This group is defined with required=True and
    mutex=True, meaning that exactly one of these two arg configurations must
    be specified: --rrdatas --routing-policy-type AND --routing-policy-data
TzRouting policy backup data arguments for the primary backup routing policy. Specify either --routing-policy-backup-data or --routing-policy-backup-item, but not both.)mutexrW   r>   z/Configuration for primary backup routing policy)r>   r_   FzRouting policy data arguments. Allows setting one of [routing-policy-data, routing-policy-item, [routing-policy-primary-data, [routing-policy-backup-data, routing-policy-backup-item]]])rW   r   r>   )deprecated_namezRouting policy arguments. --routing-policy-type should be specified exactly when one of --routing-policy-data, --routing-policy-item, or --routing-policy-primary-data is set.rh   zkHealth checking arguments. You can specify one of --health-check or --enable-health-checking, but not both.)rW   r   zuResource record sets arguments. Can specify either --rrdatas or both --routing-policy-data and --routing-policy-type.)r   rb   rc   /GetResourceRecordSetsRoutingPolicyBackupDataArgGetRoutingPolicyBackupItemArg0GetResourceRecordSetsRoutingPolicyPrimaryDataArg3GetResourceRecordSetsRoutingPolicyBackupDataTypeArg+GetResourceRecordSetsBackupDataTrickleRatio)GetResourceRecordSetsRoutingPolicyDataArgGetRoutingPolicyItemArg)GetResourceRecordSetsEnableHealthCheckingGetHealthCheckArg)GetResourceRecordSetsRoutingPolicyTypeArg%GetResourceRecordSetsEnableFencingArgr   )use_deprecated_names routing_policy_backup_data_groupprimary_backup_data_grouppolicy_data_grouppolicy_grouphealth_checking_grouprrdatas_groups          r!   $GetResourceRecordSetsRrdatasArgGroupr     s    &*%7%79	&" #..57 #../L/NO"00< ''6E ''(HI''94H ''15A ((+		 /.
  9: 7 9: ##6, ,,5	 ##/? ##$5u$EF/)=
 +U; 01,-$$>	- ;UKLL)	r#   c                 L    U(       a  SOSn[         R                  " USU / SQSS9$ )z5Returns --routing-policy-type command line arg value.z--routing_policy_typez--routing-policy-typeROUTING_POLICY_TYPE)GEOWRRFAILOVERap  Indicates what type of routing policy is being specified. As of this time, this field can take on either "WRR" for weighted round robin, "GEO" for geo location, or "FAILOVER" for a primary-backup configuration. This field cannot be modified - once a policy has a chosen type, the only way to change it is to delete the policy and add a new one with the different type.r<   rW   r   r>   ri   )rW   r   	flag_names      r!   r   r   U  s6    
 "16M  
#(4
 r#   c                 0    [         R                  " SSU SS9$ )z4Returns --enable-geo-fencing command line arg value.z--enable-geo-fencingr   z4Specifies whether to enable fencing for geo queries.r   rW   r>   ri   r_   s    r!   r   r   l  s    	A	
 r#   c                 8    [         R                  " S[        U SS9$ )z;Returns --backup-data-trickle-ratio command line arg value.z--backup-data-trickle-ratiozlSpecifies the percentage of traffic to send to the backup targets even when the primary targets are healthy.r   )r   r?   floatr_   s    r!   r   r   v  s!    	#8
 r#   c                 4    [         R                  " SSU S/SS9$ )zAReturns --routing_policy_backup_data_type command line arg value.z!--routing-policy-backup-data-typeROUTING_POLICY_BACKUP_DATA_TYPEr   zkFor FAILOVER routing policies, the type of routing policy the backup data uses. Currently, this must be GEOr   ri   r_   s    r!   r   r     s&    	)/g4	
 	r#   c                 0    [         R                  " SSU SS9$ )z8Returns --enable-health-checking command line arg value.z--enable-health-checkingr   z8Required if specifying forwarding rule names for rrdata.r   ri   r_   s    r!   r   r     s    	 E	
 r#   c                 8    S n[         R                  " SSU USS9$ )z=Returns --routing-policy-primary-data command line arg value.c                 $    U R                  S5      $ )a  Converts --routing-policy-primary-data flag value to a list of policy data items.

Args:
  routing_policy_primary_data: String value specified in the
    --routing-policy-primary-data flag.

Returns:
  A list of forwarding configs in the following format:
    ['config1@region1', 'config2@region2', 'config3' ]
  OR a list of IP addresses in the following format:
    ['1.1.1.1', '2.2.2.2', '3.3.3.3']
,)split)routing_policy_primary_datas    r!   RoutingPolicyPrimaryDataArgUGetResourceRecordSetsRoutingPolicyPrimaryDataArg.<locals>.RoutingPolicyPrimaryDataArg  s     ',,S11r#   z--routing-policy-primary-dataROUTING_POLICY_PRIMARY_DATAzThe primary configuration for a primary backup routing policy. This configuration is a list of forwarding rules of the format "FORWARDING_RULE_NAME", "FORWARDING_RULE_NAME@scope", or the full resource path of the forwarding rule.r   ri   )rW   r  s     r!   r   r     s+    2" 
%+&2
 r#   c           	      `    S n[         R                  " S[        R                  " SSS9SU USS9$ )z<Returns --routing-policy-backup-data command line arg value.c                     / nU R                  S5      nU HV  nUR                  S5      n[        U5      S:w  a  [        R                  " S5      eUS   nUS   nUR	                  XVS.5        MX     U$ )a  Converts --routing-policy-backup-data flag value to a list of policy data items.

Args:
  routing_policy_backup_data: String value specified in the
    --routing-policy-backup-data flag.

Returns:
  A list of policy data items in the format below:

[
    {
      'key': <location1>,
      'values': <list of forwarding configs and rrdatas>,
    },
    {
      'key': <location2>,
      'values': <list of forwarding configs and rrdatas>,
    },
    ...
]
;=   9Must specify exactly one "=" inside each policy data itemr      keyvaluesr  lenr   ArgumentTypeErrorappend)routing_policy_backup_databackup_datapolicy_itemspolicy_itemkey_value_splitr  values          r!   RoutingPolicyBackupDataArgSGetResourceRecordSetsRoutingPolicyBackupDataArg.<locals>.RoutingPolicyBackupDataArg  s    . K .33C8L##))#.o 
_		"++G
 	
 Aca e67 $ r#   z--routing-policy-backup-dataz`The `--routing-policy-backup-data` flag is deprecated. Use --routing-policy-backup-item instead.warnROUTING_POLICY_BACKUP_DATAzSpecify the backup configuration for a primary backup routing policy. This backup configuration uses the same format as the routing-policy-data argument because it functions as another geolocation routing policy.r   r<   rW   r   r>   r   r?   r   DeprecationAction)rW   r  s     r!   r   r     sD    )V 
$&&
(7 +%)
 r#   c           	      ~    S nU(       a  SOSn[         R                  " U[        R                  " USU S3S9SU USS	9$ )
z5Returns --routing-policy-data command line arg value.c                     / nU R                  S5      nU HW  nUR                  S5      n[        U5      S:w  a  [        R                  " S5      eUS   nUS   nUR	                  UUS.5        MY     U$ )a=  Converts --routing-policy-data flag value to a list of policy data items.

Args:
  routing_policy_data_value: String value specified in the
    --routing-policy-data flag.

Returns:
  A list of policy data items in the format below:

[
    {
      'key': <routing_policy_data_key1>,
      'values': <list of configs and rrdatas>,
    },
    {
      'key': <routing_policy_data_key2>,
      'values': <list of configs and rrdatas>,
    },
    ...
]

Where <routing_policy_data_key> is either a weight or location name,
depending on whether the user specified --routing-policy-type == WRR or
--routing-policy-type == GEO, respectively. We keep
<routing_policy_data_key> a string value, even in the case of weights
(which will eventually be interpereted as floats). This is to keep this
flag type generic between WRR and GEO types.
r  r  r  r  r   r  r  r  )routing_policy_data_valuerouting_policy_datar  r  r  r  r  s          r!   RoutingPolicyDataArgTypeKGetResourceRecordSetsRoutingPolicyDataArg.<locals>.RoutingPolicyDataArgType  s    :  -2237L##))#.o 
_		"++G
 	
 Aca e  " 	 $  r#   z--routing_policy_dataz--routing-policy-datazThe `z8` flag is deprecated. Use --routing-policy-item instead.r  ROUTING_POLICY_DATAat  The routing policy data supports one of two formats below, depending on the choice of routing-policy-type.

For --routing-policy-type = "WRR" this flag indicates the weighted round robin policy data. The field accepts a semicolon-delimited list of the format "${weight_percent}=${rrdata},${rrdata}". Specify weight as a non-negative number (0 is allowed). Ratio of traffic routed to the target is calculated from the ratio of individual weight over the total across all weights.

For --routing-policy-type = "GEO" this flag indicates the geo-locations policy data. The field accepts a semicolon-delimited list of the format "${region}=${rrdata},${rrdata}". Each rrdata can either be an IP address or a reference to a forwarding rule of the format "FORWARDING_RULE_NAME", "FORWARDING_RULE_NAME@{region}", "FORWARDING_RULE_NAME@global", or the full resource path of the forwarding rule.r"  r#  )rW   r   r)  r   s       r!   r   r      s`    
1h "16M  
&&
i[ !0 0 $#
 r#   c                 .    [         R                  " SU SS9$ )Nrq   z%A description of the response policy.rh   ri   r_   s    r!   GetResponsePolicyDescriptionArgr-  \  s    	2
 r#   c                 X    [         R                  " S[        R                  " 5       U SSS9$ )Nr   r   zPThe comma-separated list of network names to associate with the response policy.r   rW   r<   r>   r   r_   s    r!   GetResponsePolicyNetworksArgr0  d  s-    	 !	
 	r#   ztable(id, startTime, status)c                 >   ^  SnSR                  U 4S jU 5       5      $ )N)	ipAddressport
ipProtocol
networkUrlrO   regionloadBalancerTypez, c              3   <   >#    U  H  oT;   d  M
  TU   v   M     g 7fNr   ).0fhealth_check_targets     r!   	<genexpr>+_FormatHealthCheckTarget.<locals>.<genexpr>~  s#      &,5H0H!fs   	)join)r<  fieldss   ` r!   _FormatHealthCheckTargetrA  t  s*    & 
 &, 
 r#   c           	         / nSU ;   a  XS   -   nSU ;   aW  UU S   R                  S/ 5       Vs/ s H  nSR                  [        U5      5      PM     sn-   U S   R                  S/ 5      -   nSR                  U5      $ s  snf )NrrdatashealthCheckedTargetsinternalLoadBalancers"{}"externalEndpointsr  )getrZ   rA  r?  )routing_policy_itemrrdatatargets      r!   _FormatRrdatarL    s    &%%)44F22 ..DEII'
 MM26:;
	
 4
5
9
9
		
  
&	
s   $A>c           	      0   SU ;   aQ  / nU S   S    H0  nUR                  SR                  US   [        U5      5      5        M2     SR                  U5      nGO!SU ;   aP  / nU S   S    H0  nUR                  SR                  US   [        U5      5      5        M2     SR                  U5      nOSU ;   a  / nU S   S	   S    H0  nUR                  SR                  US   [        U5      5      5        M2     S
R                  U5      nSR                  [	        S U S   S   R                  S/ 5       5       5      U S   S   R                  S/ 5      -   5      nSR                  XT5      nOSR                  U 5      nSU ;   a  USR                  U S   5      -   nU$ )z5Format rrset based on rrdatas or routing policy type.wrrrz   z{}: {}weightz; geolocationprimaryBackupbackupGeoTargetsr  r  c              3   V   #    U  H  nS R                  [        U5      5      v   M!     g7f)rF  N)rZ   rA  )r:  rK  s     r!   r=  +_FormatResourceRecordSet.<locals>.<genexpr>  s-      
/ MM26:;;/s   ')primaryTargetsrE  rG  zPrimary: {} Backup: {}healthCheckz Health Check: {})r  rZ   rL  r?  listrH  )rrdatas_or_routing_policyrz   itemdatabackupprimarys         r!   _FormatResourceRecordSetr^    s   
''E)%09ll8??4>=3FGH :99UD))E)%09ll8??4
#3]45HIJ :99UD33E)/:;MN ll8??4
#3]45HIJ XXe_Fhh 
3OD c)2./
 	
 $O
45E
F
J
J
	

G $**7;D88-.D//%,,!-0 D 
+r#   formatrrsetzz
    table(
        name,
        type,
        ttl,
        firstof(rrdatas,routingPolicy).formatrrset():label=DATA)
    c                 X    [         R                  " S[        R                  " 5       U SSS9$ )Nr   r   zTThe comma-separated list of GKE cluster names to associate with the response policy.r/  r   r_   s    r!   GetResponsePolicyGkeClustersArgra    s-    	 !	
 	r#   c                 Z    [         R                  " SU R                  R                  S SS9$ )N
--behaviorc                     U S:g  $ )NbehaviorUnspecifiedr   )xs    r!   <lambda>:GetResponsePolicyRulesBehaviorFlagMapper.<locals>.<lambda>  s
    q$99r#   (The response policy rule query behavior.)include_filterry   )r   r|   ResponsePolicyRuleBehaviorValueValuesEnumr   s    r!   (GetResponsePolicyRulesBehaviorFlagMapperrm    s-    		#	#!!9999	
 r#   c                  2    [         R                  " SSS/SS9$ )Nrc  re  bypassResponsePolicyri  )r   r>   ri   r   r#   r!   GetResponsePolicyRulesBehaviorrp    s"    	$&<=5
 r#   c                 L    [        U5      R                  R                  U 5        g r9  )rm  r   r   )r   r   s     r!   &AddResponsePolicyRulesBehaviorFlagArgsrr    s    *84??KKr#   c            
          [         R                  " S[        R                  " [        [        [
        [        S.S9SSSS9$ )Nz--local-data)rI   r   ttlrC  spec
LOCAL_DATAr  a      All resource record sets for this selector, one per resource record
    type. The name must match the dns_name.

    This is a repeated argument that can be specified multiple times to specify
    multiple local data rrsets.
    (e.g. --local-data=name="zone.com.",type="A",ttl=21600,rrdata="1.2.3.4 "
    --local-data=name="www.zone.com.",type="CNAME",ttl=21600,rrdata="1.2.3.4|5.6.7.8")

    *name*::: The DnsName of a resource record set.

    *type*::: Type of all resource records in this set. For example, A, AAAA, SOA, MX,
    NS, TXT ...

    *ttl*::: Number of seconds that this ResourceRecordSet can be cached by resolvers.

    *rrdatas*::: The list of datas for this record, split by "|".
    )r   r<   r   r>   )r   r?   r   ArgDictstrr   r   r#   r!   GetLocalDataResourceRecordSetsrz    s=    	SE 
 r#   c                  4    [         R                  " S[        S9$ )Nrc  )r   )r   r?   	enumerater   r#   r!   GetResponsePolicyRuleBehaviorr}    s    	|)	44r#   c                  J    [         R                  " S[        R                  SS9$ )Nz--log-dns-queriesr   r   r   r   r#   r!   GetManagedZoneLoggingArgr    s"    	--J
 r#   c                 ~    U (       a  [         R                  " S[        SSS9$ [         R                  " S[        USSS9$ )Nresponse_policyRESPONSE_POLICY_NAMEName of the response policy.r   z--response_policyr/  r   r?   ry  r[   rW   s     r!   GetResponsePolicyNameArgr    sD    ==&+	  ==&+ r#   c                 ~    U (       a  [         R                  " S[        SSS9$ [         R                  " S[        USSS9$ )Nresponse_policiesr  r  r   z--response_policiesr/  r  r  s     r!   GetResponsePoliciesNameArgr  +  sD    ==&+	  ==&+ r#   c                  6    [         R                  " S[        SS9$ )Nz
--locationzSpecifies the desired service location the request is sent to. Defaults to Cloud DNS global service. Use --location=global if you want to target the global service.r   r  r   r#   r!   GetLocationArgr  =  s    	0	
 r#   c                 8    [         R                  " S[        U SS9$ )Nz--health-checkzSpecifies the health check to be used for public IP health checking. Either the health check name or full resource path should be provided.r   r  r_   s    r!   r   r   I  s!    		
 	r#   rW   returnc                     [         R                  " S[        R                  " [        [
        [
        [
        [
        S.S9U SSSS9$ )Nz--routing-policy-item)rO  rQ  rC  external_endpointsinternal_load_balancersru  ROUTING_POLICY_ITEMr  a      Specify this argument multiple times for a weighted round robin (WRR)
    or geolocation routing policy. Use this repeated argument for only one
    routing policy type (WRR or geolocation), not both. Similarly, use it
    only for health checking either internal load balancers or external IP
    addresses, not both.

    (e.g. --routing-policy-item=weight=1,rrdatas=1.2.3.4;2.3.4.5,external_endpoints=3.4.5.6;4.5.6.7
    --routing-policy-item=weight=1,rrdatas=10.0.0.1;10.0.0.2,external_endpoints=10.0.0.4)

    *weight*::: The weight of the item. This is specified only for WRR routing policy items.

    *location*::: The location corresponding to the item. This is specified only for GEO routing policy items.

    *rrdatas*::: The list of rrdatas, split by ";".

    *external_endpoints*::: The list of health checked ips, split by ";".

    *internal_load_balancers*::: The list of health checked internal load balancers, split by ";".
    r   rW   r<   r   r>   )r   r?   r   rx  r   ry  r_   s    r!   r   r   V  sH    	$'), #"
 "r#   c           
          [         R                  " S[        R                  " [        [        [        [        S.S9U SSSS9$ )Nz--routing-policy-backup-item)rQ  rC  r  r  ru  ROUTING_POLICY_BACKUP_ITEMr  aq      Specify this argument multiple times to define multiple items
    for a primary backup routing policy.

    (e.g. --routing-policy-backup-item=location=us-east1-a,rrdatas=1.2.3.4;2.3.4.5,external_endpoints=3.4.5.6;4.5.6.7
    --routing-policy-backup-item=location=us-east1-b,rrdatas=10.0.0.1;10.0.0.2,external_endpoints=10.0.0.4)

    *location*::: The location corresponding to the item.

    *rrdatas*::: The list of rrdatas, split by ";".

    *external_endpoints*::: The list of health checked ips, split by ";".

    *internal_load_balancers*::: The list of health checked internal load balancers, split by ";".
    r  )r   r?   r   rx  ry  r_   s    r!   r   r   |  sE    	$$'),	 *
 r#   N)zThe DNS key identifier.F)TF)z>Name of the managed zone whose record sets you want to manage.F)zBThe unique system generated id for the peering zone to deactivate.)r1   )F)FF)T)TT)V__doc__
__future__r   r   r   googlecloudsdk.callioper   r   r    googlecloudsdk.calliope.conceptsr	   googlecloudsdk.command_lib.utilr
   $googlecloudsdk.command_lib.util.apisr   (googlecloudsdk.command_lib.util.conceptsr   ListCommandCompleterr   r.   r4   rB   rG   rK   rS   r]   rf   rj   rl   ro   rr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r-  r0  CHANGES_FORMATrA  rL  r^  RESOURCERECORDSETS_TRANSFORMSRESOURCERECORDSETS_FORMATra  rm  rp  rr  rz  r}  r  r  r  r  r   boolr?   r   r   r   r#   r!   <module>r     s   1 &  ' + / ( 5 6 : D
z66 

:22 
:::  O< 	MC#L$
		0		
	
	0gV %*.
D@H %*Xx
 0(%R +!  
:5$$	
#d #t}} #LD T]] r#   