
    S                         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
e      Zy)z*Utilities Service Directory endpoints API.    )absolute_import)division)unicode_literals)
list_pager)basec                   z     e Zd ZdZej
                  j                  f fd	Z	 	 	 	 ddZd Z	d Z
d	dZd	dZ xZS )
EndpointsClientz2Client for endpoints in the Service Directory API.c                 b    t         t        |   |       | j                  j                  | _        y N)superr	   __init__client0projects_locations_namespaces_services_endpointsservice)selfrelease_track	__class__s     9lib/googlecloudsdk/api_lib/service_directory/endpoints.pyr   zEndpointsClient.__init__   s#    	/4)-8;;OODL    c                     | j                   j                  ||||      }| j                   j                  |j                         j	                         ||j
                        }| j                  j                  |      S )Endpoints create request.)addressportannotationsnetworkparentendpoint
endpointIdmsgsEndpointIServicedirectoryProjectsLocationsNamespacesServicesEndpointsCreateRequestParentRelativeNameendpointsIdr   Create)r   endpoint_refr   r   r   r   r   
create_reqs           r   r'   zEndpointsClient.Create!   sy     yy!!dW " NHdd""$113++ e -J <<z**r   c                     | j                   j                  |j                               }| j                  j	                  |      S )zEndpoints delete request.name)r!   IServicedirectoryProjectsLocationsNamespacesServicesEndpointsDeleteRequestr%   r   Delete)r   r(   
delete_reqs      r   r.   zEndpointsClient.Delete0   s=    dd&&( e *J<<z**r   c                     | j                   j                  |j                               }| j                  j	                  |      S )zEndpoints describe request.r+   )r!   FServicedirectoryProjectsLocationsNamespacesServicesEndpointsGetRequestr%   r   Get)r   r(   describe_reqs      r   DescribezEndpointsClient.Describe6   s=    99cc&&( d *L<<L))r   c                     | j                   j                  |j                         |||      }t        j                  | j
                  ||dd      S )zEndpoints list request.)r   filterorderBypageSize	endpointsr8   )
batch_sizefieldbatch_size_attribute)r!   GServicedirectoryProjectsLocationsNamespacesServicesEndpointsListRequestr%   r   YieldFromListr   )r   service_reffilter_order_by	page_sizelist_reqs         r   ListzEndpointsClient.List<   sY    yy``'')	 a H
 ##') )r   c                 `   g }||j                  d       ||j                  d       ||j                  d       | j                  j                  |||      }| j                  j                  |j	                         |dj                  |            }| j                  j                  |      S )Endpoints update request.r   r   r   )r   r   r   ,r,   r   
updateMaskappendr!   r"   HServicedirectoryProjectsLocationsNamespacesServicesEndpointsPatchRequestr%   joinr   Patch)r   r(   r   r   r   
mask_partsr   
update_reqs           r   UpdatezEndpointsClient.UpdateJ   s    J	"&yy!!d " =Hcc&&(88J' d )J <<j))r   NNNNNNN)__name__
__module____qualname____doc__r   ReleaseTrackGAr   r'   r.   r4   rD   rQ   __classcell__r   s   @r   r	   r	      sB    :#'#4#4#7#7 P ++*)*r   r	   c                   :     e Zd ZdZ fdZ	 	 	 	 ddZddZ xZS )EndpointsClientBetaz:Client for endpoints in the v1beta1 Service Directory API.c                 \    t         t        |   t        j                  j
                         y r   )r   r]   r   r   rX   BETA)r   r   s    r   r   zEndpointsClientBeta.__init__`   s    	
t-d.?.?.D.DEr   c                     | j                   j                  ||||      }| j                   j                  |j                         j	                         ||j
                        }| j                  j                  |      S )r   )r   r   metadatar   r   r    )r   r(   r   r   ra   r   r   r)   s           r   r'   zEndpointsClientBeta.Createc   sy     yy!!dXw " HHdd""$113++ e -J <<z**r   c                 `   g }||j                  d       ||j                  d       ||j                  d       | j                  j                  |||      }| j                  j                  |j	                         |dj                  |            }| j                  j                  |      S )rF   r   r   ra   )r   r   ra   rG   rH   rJ   )r   r(   r   r   ra   rO   r   rP   s           r   rQ   zEndpointsClientBeta.Updater   s    J	"
#yy!!'x!PHcc&&(88J' d )J <<j))r   rR   rS   )rT   rU   rV   rW   r   r'   rQ   rZ   r[   s   @r   r]   r]   ]   s$    BF
 +*r   r]   N)rW   
__future__r   r   r   apitools.base.pyr   (googlecloudsdk.api_lib.service_directoryr   sd_basegooglecloudsdk.calliopeServiceDirectoryApiLibBaser	   r]    r   r   <module>rj      s=    1 &  ' ' D (@*g88 @*F$*/ $*r   