
                         P    d Z ddlmZ ddlmZ ddlmZ ddlmZ d Zd Zd Z	d	 Z
y
)z2Utils for Distributed Cloud Edge Network commands.    )absolute_import)division)unicode_literals)	resourcesc                     d|j                   v r|S t        j                  j                  d| j                  | j
                  | j                  |j                         }|j                         |j                  _         |S )zSets the subnet.network field with a relative resource path.

  Args:
    ref: reference to the subnet object.
    args: command line arguments.
    request: API request to be issued

  Returns:
    modified request
  	projects/-edgenetwork.projects.locations.zones.networks
projectsIdlocationsIdzonesId
networksId)	networkr   REGISTRYCreater   r   r   RelativeNamesubnetrefargsrequestr   s       Alib/googlecloudsdk/command_lib/edge_cloud/networking/resources.pySetResourcesPathForSubnetr      k     DLL N%%5//kk & ' #//1'..	.    c                     d|j                   v r|S t        j                  j                  d| j                  | j
                  | j                  |j                         }|j                         |j                  _         |S )zSets the router.network field with a relative resource path.

  Args:
    ref: reference to the router object.
    args: command line arguments.
    request: API request to be issued

  Returns:
    modified request
  r   r	   r
   )	r   r   r   r   r   r   r   r   routerr   s       r   SetResourcesPathForRouterr   1   r   r   c                     d|j                   v r|S t        j                  j                  d| j                  | j
                  | j                  |j                         }|j                         |j                  _         |S )zSets the route.network field with a relative resource path.

  Args:
    ref: reference to the route object.
    args: command line arguments.
    request: API request to be issued

  Returns:
    modified request
  r   r	   r
   )	r   r   r   r   r   r   r   r   router   s       r   SetResourcesPathForRouter!   K   sk     DLL N%%5//kk & ' "..0'--	.r   c                    d|j                   vrkt        j                  j                  d| j                  | j
                  | j                  |j                         }|j                         |j                  _         |j                  ryd|j                  vrkt        j                  j                  d| j                  | j
                  | j                  |j                        }|j                         |j                  _	        |S )a!  Sets the interconnectAttachment.router and interconnectAttachment.interconnect field with a relative resource path.

  Args:
    ref: reference to the interconnectAttachment object.
    args: command line arguments.
    request: API request to be issued

  Returns:
    modified request
  r   z2edgenetwork.projects.locations.zones.interconnects)r   r   r   interconnectsIdr	   r
   )
interconnectr   r   r   r   r   r   r   interconnectAttachmentr   )r   r   r   r$   r   s        r   SetResourcesPathForAttachmentr&   e   s     )))%%,,<>>OO)) - +L 3?2K2K2MG""/	\\k5  ''7>>OO<< ( !G .5-A-A-CG""*	.r   N)__doc__
__future__r   r   r   googlecloudsdk.corer   r   r   r!   r&    r   r   <module>r+      s*    9 &  ' )444r   