
    >Tf?                         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	m
Z
mZ d dlmZ d dlmZ d dlmZ d d	lT d d
lmZmZmZ ddlmZ dZ G d de          Z G d de          Z G d de          ZdS )    )ContentType)extend_schema_field)serializers)IPAddressSerializer)ChoiceFieldContentTypeFieldRelatedObjectCountField)NetBoxModelSerializer)TenantSerializer)get_serializer_for_model)*)TunnelTunnelGroupTunnelTermination   )IPSecProfileSerializer)TunnelGroupSerializerTunnelSerializerTunnelTerminationSerializerc                   >    e Zd Z ed          Z G d d          ZdS )r   tunnelsc                       e Zd ZeZg dZdZdS )TunnelGroupSerializer.Meta)idurldisplay_urldisplaynameslugdescriptiontagscustom_fieldscreatedlast_updatedtunnel_count)r   r   r   r   r   r    r%   N)__name__
__module____qualname__r   modelfieldsbrief_fields     A/var/www/html/netbox-4.1.3/netbox/vpn/api/serializers_/tunnels.pyMetar      s,        
 
 
 _r-   r/   N)r&   r'   r(   r	   r%   r/   r,   r-   r.   r   r      sX         +*955L_ _ _ _ _ _ _ _ _ _r-   r   c                       e Zd Z ee          Z edddd          Z ee          Z	 e
ddd          Z eddd          Z ed          Z G d d	          ZdS )
r   choicesTFN)nestedrequired
allow_nulldefaultr3   r4   r5   terminationsc                       e Zd ZeZdZdZdS )TunnelSerializer.Meta)r   r   r   r   r   statusgroupencapsulationipsec_profiletenant	tunnel_idr    commentsr!   r"   r#   r$   terminations_count)r   r   r   r   r    N)r&   r'   r(   r   r)   r*   r+   r,   r-   r.   r/   r:   B   s"        

 Gr-   r/   )r&   r'   r(   r   TunnelStatusChoicesr;   r   r<   TunnelEncapsulationChoicesr=   r   r>   r   r?   r	   rB   r/   r,   r-   r.   r   r   '   s        [#  F "!	  E  K*  M +*  M
   F 10@@G G G G G G G G G Gr-   r   c                   "   e Zd Z ed          Z ee          Z ee	j
                                                  Z ej        d          Z eddd          Z G d d	          Z e ej        d
                    d             ZdS )r   T)r3   r1   )queryset)	read_onlyFr7   c                       e Zd ZeZdZdZdS ) TunnelTerminationSerializer.Meta)r   r   r   r   tunnelroletermination_typetermination_idtermination
outside_ipr!   r"   r#   r$   )r   r   r   N)r&   r'   r(   r   r)   r*   r+   r,   r-   r.   r/   rI   _   s!        !
 0r-   r/   )r5   c                     |j         sd S t          |j                   }d| j        d         i} ||j         d|          j        S )NrequestT)r3   context)rN   r   rR   data)selfobj
serializerrR   s       r.   get_terminationz+TunnelTerminationSerializer.get_terminationg   sM     	4-co>>
dl956z#/$HHHMMr-   N)r&   r'   r(   r   rJ   r   TunnelTerminationRoleChoicesrK   r   r   objectsallrL   r   SerializerMethodFieldrN   r   rO   r/   r   	JSONFieldrW   r,   r-   r.   r   r   L   s         F ;,  D ('$((**   4+3  K %$  J0 0 0 0 0 0 0 0 ..$???@@N N A@N N Nr-   r   N)"django.contrib.contenttypes.modelsr   drf_spectacular.utilsr   rest_frameworkr   ipam.api.serializers_.ipr   netbox.api.fieldsr   r   r	   netbox.api.serializersr
    tenancy.api.serializers_.tenantsr   utilities.apir   vpn.choices
vpn.modelsr   r   r   cryptor   __all__r   r   r   r,   r-   r.   <module>ri      s   : : : : : : 5 5 5 5 5 5 & & & & & & 8 8 8 8 8 8 T T T T T T T T T T 8 8 8 8 8 8 = = = = = = 2 2 2 2 2 2     = = = = = = = = = = * * * * * *_ _ _ _ _1 _ _ _"G "G "G "G "G, "G "G "GJ!N !N !N !N !N"7 !N !N !N !N !Nr-   