Ë
    €Ï>  ã                   óØ   — 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
 ddlmZ d	Zd
ZdZdZdd„Zdd„Zej&                  j(                  fd„Z G d„ de
j,                  «      Zy)zGKEHUB API client utils.é    )Úabsolute_import)Údivision)Úunicode_literals)Úencoding)Úapis)Úwaiter)ÚbaseÚgkehubÚv1alphaÚv1betaÚv1Nc                 ó<  — | st        j                  t        «      S | t        j                  j
                  k(  rt        S | t        j                  j                  k(  rt        S | t        j                  j                  k(  rt        S t        j                  t        «      S ©N)Ú	core_apisÚResolveVersionÚGKEHUB_API_NAMEr	   ÚReleaseTrackÚALPHAÚGKEHUB_ALPHA_API_VERSIONÚBETAÚGKEHUB_BETA_API_VERSIONÚGAÚGKEHUB_GA_API_VERSION©Úrelease_tracks    ú=lib/googlecloudsdk/api_lib/container/fleet/gkehub_api_util.pyÚGetApiVersionForTrackr   !   su   € Ù	Ü×#Ñ#¤OÓ4Ð4Øœ×)Ñ)×/Ñ/Ò/Ü#Ð#Øœ×)Ñ)×.Ñ.Ò.Ü"Ð"Øœ×)Ñ)×,Ñ,Ò,Ü Ð Ü	×	!Ñ	!¤/Ó	2Ð2ó    c                 ól   — | st        j                  t        «      } t        j                  t        | «      S r   )r   r   r   ÚGetClientInstance)Úapi_versions    r   ÚGetApiClientForApiVersionr"   -   s(   € Ù	Ü×*Ñ*¬?Ó;€KÜ	×	$Ñ	$¤_°kÓ	BÐBr   c                 ó,   — t        t        | ¬«      «      S )Nr   )r"   r   r   s    r   ÚGetApiClientForTrackr$   3   s   € Ü	"Ü¨-Ô8ó
ð r   c                   ó   — e Zd ZdZd„ Zd„ Zy)ÚHubFeatureOperationPollerz¯Poller for GKE Hub Feature API.

  This is necessary because the CloudOperationPoller library doesn't support
  setting the `returnPartialSuccess` field in the Get request.
  c                 ó    — || _         || _        y)a»  Sets up poller for cloud operations.

    Args:
      result_service: apitools.base.py.base_api.BaseApiService, api service for
        retrieving created result of initiated operation.
      operation_service: apitools.base.py.base_api.BaseApiService, api service
        for retrieving information about ongoing operation.

      Note that result_service and operation_service Get request must have
      single attribute called 'name'.
    N)Úresult_serviceÚoperation_service)Úselfr(   r)   s      r   Ú__init__z"HubFeatureOperationPoller.__init__@   s   € ð )€DÔØ.€DÕr   c                 óÂ   — | j                   j                  d«      }t        j                  |j                  «      }| j                   j                   ||d   d¬«      «      S )z‚Overrides.

    Args:
      operation: api_name_messages.Operation.

    Returns:
      result of result_service.Get request.
    ÚGetÚnameT)r.   ÚreturnPartialSuccess)r(   ÚGetRequestTyper   ÚMessageToPyValueÚresponser-   )r*   Ú	operationÚrequest_typeÚresponse_dicts       r   Ú	GetResultz#HubFeatureOperationPoller.GetResultO   sX   € ð ×&Ñ&×5Ñ5°eÓ<€LÜ×-Ñ-¨i×.@Ñ.@ÓA€MØ×Ñ×"Ñ"Ù˜-¨Ñ/ÀdÔKóð r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r+   r6   © r   r   r&   r&   9   s   „ ñò/ór   r&   r   )r:   Ú
__future__r   r   r   Úapitools.base.pyr   Úgooglecloudsdk.api_lib.utilr   r   r   Úgooglecloudsdk.callioper	   r   r   r   r   r   r"   r   r   r$   ÚCloudOperationPollerr&   r;   r   r   Ú<module>rA      sk   ðñ å &Ý Ý 'å %Ý 9Ý .Ý (ð €Ø$Ð Ø"Ð ØÐ ó	3óCð (,×'8Ñ'8×';Ñ';ó ô# × ;Ñ ;õ #r   