
    
                         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
  G d d	ej                        Z G d
 d      ZdZdZd Zy)a  Stub implementation of SVCB and HTTPS records.

This module can be removed after updating to dnspython 2.x, which has built-in
support for these types.  (dnspython 2.x only supports Python 3, but this
codebase requires support for Python 2, so it is still using dnspython 1.x.)
    )absolute_import)division)unicode_literals)rdata)Name)	Tokenizerc                   <     e Zd ZdZ fdZddZedd       Z xZS )	_StubSVCBzStub implementation of SVCB RDATA.

  Wire format support is not needed here, so only trivial storage of the
  presentation format is implemented.
  c                 X    t         t        |   ||       || _        || _        || _        y N)superr
   __init__	_priority_target_params)selfrdclassrdtypeprioritytargetparams	__class__s         +lib/googlecloudsdk/api_lib/dns/svcb_stub.pyr   z_StubSVCB.__init__(   s)    	)T#GV4DNDLDL    c                     d| j                   z  | j                  j                  ||      j                         g| j                  z   }dj                  |      S )Nz%d )r   r   choose_relativityto_textr   join)r   origin
relativizekwargstokenss        r   r   z_StubSVCB.to_text/   sQ    t~~&&vz:BBD 	F 88Fr   c                    |j                         }|j                  |      j                  ||      }g }	 |j                         j	                         }	|	j                         rn|j                  |	j                         K | |||||      S r   )
get_uint16get_namer   getunescapeis_eol_or_eofappendvalue)
clsr   r   tokr    r!   r   r   r   tokens
             r   	from_textz_StubSVCB.from_text6   s     ~~H\\&!33FJGFF
ggi  "e				mmEKK 	  w&&99r   )NT)	__name__
__module____qualname____doc__r   r   classmethodr/   __classcell__)r   s   @r   r
   r
       s&     : :r   r
   c                       e Zd ZdZeZeZy)_FakeModulez~Fake module corresponding to dns.rdtypes.IN.SVCB.

  This is needed due to the calling convention of rdata.register_type().
  N)r0   r1   r2   r3   r
   SVCBHTTPS r   r   r7   r7   E   s    
 
$
%r   r7   @   A   c                      	 t        j                  t        t        d       t        j                  t        t        d       y # t         j
                  $ r Y y w xY w)Nr8   r9   )r   register_typer7   r8   r9   RdatatypeExistsr:   r   r   registerr@   S   sE    		T62	UG4			 	 		s   >A AAN)r3   
__future__r   r   r   dnsr   dns.namer   dns.tokenizerr   Rdatar
   r7   r8   r9   r@   r:   r   r   <module>rF      sJ     '  '   #": ":J  

	r   