
                             d Z ddlmZ ddlmZ ddlmZ ddl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dlmZ ddlmZ  G d de      Z G d de      Z G d de      Z G d d      Zy)z"Version-agnostic Fleet API client.    )absolute_import)division)unicode_literalsN)	Generator)encoding)
list_pager)gkehub_api_util)types)util)waiter)base)	resourcesc                       e Zd ZdZej
                  j                  fdZd Zd Z	d Z
d ZddZedej                  d	ej"                  fd
       Zed        Zed        Zed        Zd Zd Zy)	HubClienta  Client for the GKE Hub API with related helper methods.

  If not provided, the default client is for the GA (v1) track. This client
  is a thin wrapper around the base client, and does not handle any exceptions.

  Fields:
    release_track: The release track of the command [ALPHA, BETA, GA].
    client: The raw GKE Hub API client for the specified release track.
    messages: The matching messages module for the client.
    resourceless_waiter: A waiter.CloudOperationPollerNoResources for polling
      LROs that do not return a resource (like Deletes).
    feature_waiter: A waiter.CloudOperationPoller for polling Feature LROs.
  c                 `   || _         t        j                  |      | _        t        j                  |      | _        t        j                  | j                  j                        | _	        t        j                  | j                  j                  | j                  j                        | _        y N)operation_service)result_servicer   )release_trackr   GetClientInstanceclientGetMessagesModulemessagesr   CloudOperationPollerNoResourcesprojects_locations_operationsresourceless_waiterr	   HubFeatureOperationPollerprojects_locations_featuresfeature_waiterselfr   s     4lib/googlecloudsdk/api_lib/container/fleet/client.py__init__zHubClient.__init__1   s}    &D((7DK**=9DM%EE++CC D *CC{{>>++CCD    c                     | j                   j                  |||      }| j                  j                  j	                  |      S )a  Creates a Feature and returns the long-running operation message.

    Args:
      parent: The parent in the form /projects/*/locations/*.
      feature_id: The short ID for this Feature in the Hub API.
      feature: A Feature message specifying the Feature data to create.

    Returns:
      The long running operation reference. Use the feature_waiter and
      OperationRef to watch the operation and get the final status, typically
      using waiter.WaitFor to present a user-friendly spinner.
    )feature	featureIdparent)r   ,GkehubProjectsLocationsFeaturesCreateRequestr   r   Create)r!   r(   
feature_idr&   reqs        r"   CreateFeaturezHubClient.CreateFeature=   sD     --
D
D E C
 ;;2299#>>r$   c                     | j                   j                  |d      }| j                  j                  j	                  |      S )zGets a Feature from the Hub API.

    Args:
      name: The full resource name in the form
        /projects/*/locations/*/features/*.

    Returns:
      The Feature message.
    T)namereturnPartialSuccess)r   )GkehubProjectsLocationsFeaturesGetRequestr   r   Getr!   r/   r,   s      r"   
GetFeaturezHubClient.GetFeatureQ   sA     --
A
A! B C ;;2266s;;r$   c                     | j                   j                  |d      }| j                  j                  j	                  |      }|j
                  S )zLists Features from the Hub API.

    Args:
      parent: The parent in the form /projects/*/locations/*.

    Returns:
      A list of Features.
    T)r(   r0   )r   *GkehubProjectsLocationsFeaturesListRequestr   r   Listr   )r!   r(   r,   resps       r"   ListFeatureszHubClient.ListFeaturesa   sJ     --
B
B! C C
 ;;2277<D>>r$   c                     | j                   j                  |dj                  |      |      }| j                  j                  j                  |      S )a%  Creates a Feature and returns the long-running operation message.

    Args:
      name: The full resource name in the form
        /projects/*/locations/*/features/*.
      mask: A string list of the field paths to update.
      feature: A Feature message containing the Feature data to update using the
        mask.

    Returns:
      The long running operation reference. Use the feature_waiter and
      OperationRef to watch the operation and get the final status, typically
      using waiter.WaitFor to present a user-friendly spinner.
    ,)r/   
updateMaskr&   )r   +GkehubProjectsLocationsFeaturesPatchRequestjoinr   r   Patch)r!   r/   maskr&   r,   s        r"   UpdateFeaturezHubClient.UpdateFeaturer   sL     --
C
C88D> D C
 ;;2288==r$   c                     | j                   j                  ||      }| j                  j                  j	                  |      S )a  Deletes a Feature and returns the long-running operation message.

    Args:
      name: The full resource name in the form
        /projects/*/locations/*/features/*.
      force: Indicates the Feature should be force deleted.

    Returns:
      The long running operation. Use the feature_waiter and OperationRef to
      watch the operation and get the final status, typically using
      waiter.WaitFor to present a user-friendly spinner.
    )r/   force)r   ,GkehubProjectsLocationsFeaturesDeleteRequestr   r   Delete)r!   r/   rC   r,   s       r"   DeleteFeaturezHubClient.DeleteFeature   sA     --
D
D E C ;;2299#>>r$   opreturnc                 X    t         j                  j                  | j                  d      S )z6Parses a gkehub Operation reference from an operation.$gkehub.projects.locations.operations
collection)r   REGISTRYParseRelativeNamer/   )rG   s    r"   OperationRefzHubClient.OperationRef   s,     //
B 0  r$   c                 n    | | j                   i S t        j                  d | j                   D              S )a  Helper to convert proto map Values to normal dictionaries.

    encoding.MessageToPyValue recursively converts values to dicts, while this
    method leaves the map values as proto objects.

    Args:
      proto_map_value: The map field "Value". For example, the `Feature.labels`
        value (of type `Features.LabelsValue`). Can be None.

    Returns:
      An OrderedDict of the map's keys/values, in the original order.
    c              3   L   K   | ]  }|j                   |j                  f  y wN)keyvalue).0ps     r"   	<genexpr>z%HubClient.ToPyDict.<locals>.<genexpr>   s"      #"FQ"Fs   "$)additionalPropertiescollectionsOrderedDict)proto_map_values    r"   ToPyDictzHubClient.ToPyDict   s@     /"F"F"Ni"" #"1"F"F#  r$   c                 d    t        j                  | |i       S t        j                  |            S )a  Helper to convert proto map Values to default dictionaries.

    encoding.MessageToPyValue recursively converts values to dicts, while this
    method leaves the map values as proto objects.

    Args:
      default_factory: Pass-through to collections.defaultdict.
      proto_map_value: The map field "Value". For example, the `Feature.labels`
        value (of type `Features.LabelsValue`). Can be None.

    Returns:
      An defaultdict of the map's keys/values.
    )rY   defaultdictr   r\   )default_factoryr[   s     r"   ToPyDefaultDictzHubClient.ToPyDefaultDict   s:     ""% +4+=+=o+N r$   c                 2    t        j                  || d      S )zCencoding.DictToAdditionalPropertyMessage wrapper to match ToPyDict.T)
sort_items)r   DictToAdditionalPropertyMessage)map_value_clsrT   s     r"   
ToProtoMapzHubClient.ToProtoMap   s     33} r$   c                 b    | j                  | j                  j                  j                  |      S )z?Convenience wrapper for ToProtoMap for Feature.membershipSpecs.)re   r   FeatureMembershipSpecsValuer!   spec_maps     r"   ToMembershipSpecszHubClient.ToMembershipSpecs   s#    ??4==00EExPPr$   c                 b    | j                  | j                  j                  j                  |      S )z:Convenience wrapper for ToProtoMap for Feature.scopeSpecs.)re   r   rg   ScopeSpecsValueri   s     r"   ToScopeSpecszHubClient.ToScopeSpecs   s#    ??4==00@@(KKr$   N)F)__name__
__module____qualname____doc__r   ReleaseTrackGAr#   r-   r4   r9   rA   rF   staticmethodr
   	Operationr   ResourcerO   r\   r`   re   rk   rn    r$   r"   r   r   "   s     $(#4#4#7#7 
?(< ">,?& u 9+=+=    &  &  QLr$   r   c                   Z    e Zd ZdZej
                  j                  fdZd Zd Z	d Z
d Zy)HubV2Clienta  Client for the GKE Hub V2 API with related helper methods.

  If not provided, the default client is for the GA (v2) track.
  This client is a thin wrapper around the base client, and does not handle
  any exceptions.

  Fields:
    release_track: The release track of the command [ALPHA].
    client: The raw GKE Hub API client for the specified release track.
    messages: The matching messages module for the client.
    resourceless_waiter: A waiter.CloudOperationPollerNoResources for polling
      LROs that do not return a resource (like Deletes).
    membership_feature_waiter: A waiter.CloudOperationPoller for polling
    Membership Feature LROs.
  c                 `   || _         t        j                  |      | _        t        j                  |      | _        t        j                  | j                  j                        | _	        t        j                  | j                  j                  | j                  j                        | _        y r   )r   r   GetV2ClientInstancer   GetV2MessagesModuler   r   r   r   r   CloudOperationPoller'projects_locations_memberships_featuresmembership_feature_waiterr    s     r"   r#   zHubV2Client.__init__   s}    &D**=9DK,,];DM%EE++CC D &,%@%@{{JJ++CC&D"r$   c                     | j                   j                  |||      }| j                  j                  j	                  |      S )aC  Creates a MembershipFeature and returns the long-running operation message.

    Args:
      parent: The parent in the form /projects/*/locations/*/memberships/*.
      feature_id: The short ID for this Feature in the Hub API.
      membership_feature: A MembershipFeature message specifying the
        MembershipFeature data to create.

    Returns:
      The long running operation reference. Use the membership_feature_waiter
      and OperationRef to watch the operation and get the final status,
      typically using waiter.WaitFor to present a user-friendly spinner.
    )membershipFeaturer'   r(   )r   7GkehubProjectsLocationsMembershipsFeaturesCreateRequestr   r   r*   )r!   r(   r+   membership_featurer,   s        r"   CreateMembershipFeaturez#HubV2Client.CreateMembershipFeature   sD     --
O
O, P C
 ;;>>EEcJJr$   c                     | j                   j                  |      }| j                  j                  j	                  |      S )zGets a MembershipFeature from the Hub V2 API.

    Args:
      name: The full resource name in the form
        /projects/*/locations/*/memberships/*/features/*.

    Returns:
      The MembershipFeature message.
    r/   )r   4GkehubProjectsLocationsMembershipsFeaturesGetRequestr   r   r2   r3   s      r"   GetMembershipFeaturez HubV2Client.GetMembershipFeature  s>     --
L
L M C ;;>>BB3GGr$   c                     | j                   j                  |dj                  |      |d      }| j                  j                  j                  |      S )ac  Updates a MembershipFeature and returns the long-running operation message.

    Args:
      name: The full resource name in the form
        /projects/*/locations/*/memberships/*/features/*.
      mask: A string list of the field paths to update.
      membership_feature: A MembershipFeature message containing the Feature
        data to update using the mask.

    Returns:
      The long running operation reference. Use the membership_feature_waiter
      and
      OperationRef to watch the operation and get the final status, typically
      using waiter.WaitFor to present a user-friendly spinner.
    r;   T)r/   r<   r   allowMissing)r   6GkehubProjectsLocationsMembershipsFeaturesPatchRequestr>   r   r   r?   )r!   r/   r@   r   r,   s        r"   UpdateMembershipFeaturez#HubV2Client.UpdateMembershipFeature  sO      --
N
N88D>,	 O C ;;>>DDSIIr$   c                     | j                   j                  |      }| j                  j                  j	                  |      S )a  Deletes a MembershipFeature and returns the long-running operation message.

    Args:
      name: The full resource name in the form
        /projects/*/locations/*/memberships/*/features/*.

    Returns:
      The long running operation. Use the membership_feature_waiter and
      OperationRef to
      watch the operation and get the final status, typically using
      waiter.WaitFor to present a user-friendly spinner.
    r   )r   7GkehubProjectsLocationsMembershipsFeaturesDeleteRequestr   r   rE   r3   s      r"   DeleteMembershipFeaturez#HubV2Client.DeleteMembershipFeature3  s>     --
O
O P C ;;>>EEcJJr$   N)ro   rp   rq   rr   r   rs   rt   r#   r   r   r   r   rx   r$   r"   rz   rz      s5      $(#4#4#7#7 
K*HJ0Kr$   rz   c                      e Zd ZdZej
                  j                  fdZd Zde	j                  fdZde	j                  de	j                  fdZde	j                  de	j                  fdZd	 Zd
 Zd Zd Zd Zd Zd Z	 d:dZd Z	 d;dZd Z	 d:dZd Zd Zd Zd Z d Z!d Z"d Z#d Z$d Z%d Z&d  Z'd! Z(	 d<d"Z)d# Z*d$ Z+d% Z,d& Z-d<d'Z.d=d(Z/d) Z0d* Z1d+ Z2d, Z3d- Z4d. Z5de	jl                  fd/Z7de	jp                  de	jr                  fd0Z:	 	 d;de	jv                  de	jx                  fd1Z=de	j|                  fd2Z?de	j                  fd3ZAde	j                  fd4ZCde	j                  fd5ZEde	j                  de	j                  fd6ZH	 	 d;de	j                  de	j                  fd7ZKde	j                  fd8ZMde	j                  fd9ZOy)>FleetClientaz  Client for the Fleet API with related helper methods.

  If not provided, the default client is for the alpha (v1) track. This client
  is a thin wrapper around the base client, and does not handle any exceptions.

  Fields:
    release_track: The release track of the command [ALPHA, BETA, GA].
    client: The raw Fleet API client for the specified release track.
    messages: The matching messages module for the client.
    resourceless_waiter: A waiter.CloudOperationPollerNoResources for polling
      LROs that do not return a resource (like Deletes).
    fleet_waiter: A waiter.CloudOperationPoller for polling fleet LROs.
  c                    || _         t        j                  |      | _        t        j                  |      | _        t        j                  | j                  j                        | _	        |t        j                  j                  k(  rEt        j                  | j                  j                  | j                  j                        | _        y y r   )r   r   r   r   r   r   r   r   r   r   r   rs   ALPHAr~   projects_locations_fleetsfleet_waiterr    s     r"   r#   zFleetClient.__init__U  s    &D((7DK**=9DM%EE++CC D ))/// 55>> KKEEd 0r$   c                     | j                   j                  t        j                  |            }| j                  j
                  j                  |      S )zGets a fleet resource from the Fleet API.

    Args:
      project: the project containing the fleet.

    Returns:
      A fleet resource

    Raises:
      apitools.base.py.HttpError: if the request returns an HTTP error
    r   )r   'GkehubProjectsLocationsFleetsGetRequestr   FleetResourceNamer   r   r2   r!   projectr,   s      r"   GetFleetzFleetClient.GetFleetc  sI     --
?
?##G, @ C ;;0044S99r$   r,   c                 L    | j                   j                  j                  |      S )aT  Creates a fleet resource from the Fleet API.

    Args:
      req: An HTTP create request to be sent to the API server.

    Returns:
      A long-running operation to be polled till completion, or returned
      directly if user specifies async flag.

    Raises:
      apitools.base.py.HttpError: if the request returns an HTTP error
    )r   r   r*   r!   r,   s     r"   CreateFleetzFleetClient.CreateFleett  s     ;;0077<<r$   rH   c                 L    | j                   j                  j                  |      S )aQ  Deletes a fleet resource from the Fleet API.

    Args:
      req: An HTTP delete request to send to the API server.

    Returns:
      A long-running operation to be polled till completion, or returned
      directly if user specifies async flag.

    Raises:
      apitools.base.py.HttpError: if the request returns an HTTP error
    )r   r   rE   r   s     r"   DeleteFleetzFleetClient.DeleteFleet  s     ;;0077<<r$   c                 L    | j                   j                  j                  |      S )aP  Updates a fleet resource from the Fleet API.

    Args:
      req: An HTTP patch request to send to the API server.

    Returns:
      A long-running operation to be polled till completion, or returned
      directly if user specifies async flag.

    Raises:
      apitools.base.py.HttpError: if the request returns an HTTP error
    )r   r   r?   r   s     r"   UpdateFleetzFleetClient.UpdateFleet  s     ;;0066s;;r$   c                     |rt        j                  |      }nt        j                  |      }| j                  j	                  d|      }t        j                  | j                  j                  |dd      S )a'  Lists fleets in an organization.

    Args:
      project: the project to search.
      organization: the organization to search.

    Returns:
      A ListFleetResponse (list of fleets and next page token)

    Raises:
      apitools.base.py.HttpError: if the request returns an HTTP error
     	pageTokenr(   fleetsNfieldbatch_size_attribute)	r   FleetOrgParentNameFleetParentNamer   (GkehubProjectsLocationsFleetsListRequestr   YieldFromListr   r   )r!   r   organizationr(   r,   s        r"   
ListFleetszFleetClient.ListFleets  sq     &&|4f##G,f
--
@
@V A C ##--!	 r$   c                     | j                   j                  |      }| j                  j                  j	                  |      S )zGets a scope resource from the GKEHub API.

    Args:
      scope_path: Full resource path of the scope.

    Returns:
      A scope resource.

    Raises:
      apitools.base.py.HttpError: If the request returns an HTTP error
    r   )r   'GkehubProjectsLocationsScopesGetRequestr   projects_locations_scopesr2   r!   
scope_pathr,   s      r"   GetScopezFleetClient.GetScope  s6     --
?
?Z
?
PC;;0044S99r$   c                     | j                   j                  |      }| j                  j                  j	                  |      S )zGets the IAM policy for a scope resource.

    Args:
      scope_path: Full resource path of the scope.

    Returns:
      An Iam Policy.

    Raises:
      apitools.base.py.HttpError: If the request returns an HTTP error
    )resource)r   0GkehubProjectsLocationsScopesGetIamPolicyRequestr   r   GetIamPolicyr   s      r"   GetScopeIamPolicyzFleetClient.GetScopeIamPolicy  s>     --
H
H I C ;;00==cBBr$   c                     | j                   j                  |      }| j                   j                  ||      }| j                  j                  j                  |      S )a  Sets the IAM policy for a scope resource.

    Args:
      scope_path: Full resource path of the scope.
      policy: IAM policy to be set for the scope.

    Returns:
      An Iam Policy.

    Raises:
      apitools.base.py.HttpError: If the request returns an HTTP error
    )policy)r   setIamPolicyRequest)r   SetIamPolicyRequest0GkehubProjectsLocationsScopesSetIamPolicyRequestr   r   SetIamPolicy)r!   r   r   policy_requestr,   s        r"   SetScopeIamPolicyzFleetClient.SetScopeIamPolicy  s_     ]]66 7 N --
H
H* I C ;;00==cBBr$   c                     t        j                  |      }| j                  j                  d|      }t	        j
                  | j                  j                  |dd      S )zLists scopes in a project.

    Args:
      project: Project containing the scope.

    Returns:
      A ListScopesResponse (list of scopes and next page token).

    Raises:
      apitools.base.py.HttpError: If the request returns an HTTP error
    r   r   scopesNr   )r   ScopeParentNamer   (GkehubProjectsLocationsScopesListRequestr   r   r   r   r!   r   r(   r,   s       r"   
ListScopeszFleetClient.ListScopes  s^     !!'*F
--
@
@V A C ##--!	 r$   c                     t        j                  |      }| j                  j                  d|      }t	        j
                  | j                  j                  |ddd      S )a8  Lists scopes in a project permitted to be viewed by the caller.

    Args:
      project: Project containing the scope.

    Returns:
      A ListPermittedScopesResponse (list of permitted scopes and next page
      token).

    Raises:
      apitools.base.py.HttpError: If the request returns an HTTP error
    r   r   ListPermittedr   Nmethodr   r   )r   r   r   1GkehubProjectsLocationsScopesListPermittedRequestr   r   r   r   r   s       r"   ListPermittedScopeszFleetClient.ListPermittedScopes  sa     !!'*F
--
I
IV J C ##--! r$   c                     | j                   j                  d|      }t        j                  | j                  j
                  |ddd      S )a0  Lists memberships bound to a scope.

    Args:
      scope_path: Full resource path of the scope for listing bound memberships.

    Returns:
      A ListMembershipsResponse (list of memberships and next page token)

    Raises:
      apitools.base.py.HttpError: if the request returns an HTTP error
    r   )r   	scopeNameListMembershipsmembershipsNr   )r   3GkehubProjectsLocationsScopesListMembershipsRequestr   r   r   r   r   s      r"   ListBoundMembershipsz FleetClient.ListBoundMemberships'  sQ     --
K
K
 L C ##-- ! r$   Nc                    | j                   j                  |||      }| j                   j                  |||      }| j                  j                  j                  |      }t        j                  j                  |j                  d      }t        j                  t        j                  | j                  j                  | j                  j                        |d      S )aP  Updates a scope resource in the fleet.

    Args:
      scope_path: Full resource path of the scope.
      labels:  Labels for the resource.
      namespace_labels:  Namespace-level labels for the cluster namespace.
      mask: A mask of the fields to update.

    Returns:
      A longrunning operation for updating the namespace.
    )r/   labelsnamespaceLabels)scoper/   r<   rJ   rK   zWaiting for scope to be updated)r   Scope)GkehubProjectsLocationsScopesPatchRequestr   r   r?   r   rM   rN   r/   r   WaitForr~   r   )	r!   r   r   namespace_labelsr@   r   r,   rG   op_resources	            r"   UpdateScopezFleetClient.UpdateScope>  s     MM(   E
 --
A
A B C
 
	.	.	4	4S	9B$$66
B 7 K >>##KK11KK55	
 	) r$   c                     | j                   j                  |      }| j                  j                  j	                  |      S )zGets a namespace resource from the GKEHub API.

    Args:
      namespace_path: Full resource path of the namespace.

    Returns:
      A namespace resource.

    Raises:
      apitools.base.py.HttpError: If the request returns an HTTP error
    r   )r   1GkehubProjectsLocationsScopesNamespacesGetRequestr   $projects_locations_scopes_namespacesr2   )r!   namespace_pathr,   s      r"   GetScopeNamespacezFleetClient.GetScopeNamespacec  s>     --
I
I J C ;;;;??DDr$   c                    | j                   j                  |d||      }| j                   j                  |||      }| j                  j                  j                  |      }t        j                  j                  |j                  d      }	t        j                  t        j                  | j                  j                  | j                  j                        |	d      S )a  Creates a namespace resource from the GKEHub API.

    Args:
      name: The namespace name.
      namespace_path: Full resource path of the namespace.
      parent: Full resource path of the scope containing the namespace.
      labels: labels for namespace resource.
      namespace_labels: Namespace-level labels for the cluster namespace.

    Returns:
      A namespace resource.

    Raises:
      apitools.base.py.HttpError: If the request returns an HTTP error.
    r   r/   r   r   r   )	namespacescopeNamespaceIdr(   rJ   rK   #Waiting for namespace to be created)r   	Namespace4GkehubProjectsLocationsScopesNamespacesCreateRequestr   r   r*   r   rM   rN   r/   r   r   r~   r   )
r!   r/   r   r(   r   r   r   r,   rG   r   s
             r"   CreateScopeNamespacez FleetClient.CreateScopeNamespacet  s    $ ''(	 ( I --
L
Ld6 M C 
	9	9	@	@	EB$$66
B 7 K >>##KK<<KK55	
 	- r$   c                 V   | j                   j                  |      }| j                  j                  j	                  |      }t
        j                  j                  |j                  d      }t        j                  t        j                  | j                  j                        |d      S )a  Deletes a namespace resource from the fleet.

    Args:
      namespace_path: Full resource path of the namespace.

    Returns:
      A long running operation for deleting the namespace.

    Raises:
      apitools.base.py.HttpError: If the request returns an HTTP error.
    r   rJ   rK   #Waiting for namespace to be deleted)r   4GkehubProjectsLocationsScopesNamespacesDeleteRequestr   r   rE   r   rM   rN   r/   r   r   r   r   )r!   r   r,   rG   r   s        r"   DeleteScopeNamespacez FleetClient.DeleteScopeNamespace  s     --
L
L M C 
	9	9	@	@	EB$$66
B 7 K >>..KK55	
 	- r$   c                    | j                   j                  |d||      }| j                   j                  |||      }| j                  j                  j                  |      }t        j                  j                  |j                  d      }t        j                  t        j                  | j                  j                  | j                  j                        |d      S )ai  Updates a namespace resource in the fleet.

    Args:
      namespace_path: Full resource path of the namespace.
      labels:  Labels for the resource.
      namespace_labels:  Namespace-level labels for the cluster namespace.
      mask: A mask of the fields to update.

    Returns:
      A longrunning operation for updating the namespace.

    Raises:
    r   r   r   r/   r<   rJ   rK   #Waiting for namespace to be updated)r   r   3GkehubProjectsLocationsScopesNamespacesPatchRequestr   r   r?   r   rM   rN   r/   r   r   r~   r   )	r!   r   r   r   r@   r   r,   rG   r   s	            r"   UpdateScopeNamespacez FleetClient.UpdateScopeNamespace  s    " ''(	 ( I --
K
K L C
 
	9	9	?	?	DB$$66
B 7 K >>##KK<<KK55	
 	- r$   c                     | j                   j                  d|      }t        j                  | j                  j
                  |dd      S )a!  Lists namespaces in a project.

    Args:
      parent: Full resource path of the scope containing the namespace.

    Returns:
      A ListNamespaceResponse (list of namespaces and next page token).

    Raises:
      apitools.base.py.HttpError: If the request returns an HTTP error.
    r   r   scopeNamespacesNr   )r   2GkehubProjectsLocationsScopesNamespacesListRequestr   r   r   r   )r!   r(   r,   s      r"   ListScopeNamespaceszFleetClient.ListScopeNamespaces  sN     --
J
JV K C ##88!	 r$   c                     | j                   j                  t        j                  ||            }| j                  j
                  j                  |      S )a  Gets a namespace resource from the GKEHub API.

    Args:
      project: the project containing the namespace.
      name: the namespace name.

    Returns:
      A namespace resource

    Raises:
      apitools.base.py.HttpError: if the request returns an HTTP error
    r   )r   +GkehubProjectsLocationsNamespacesGetRequestr   NamespaceResourceNamer   projects_locations_namespacesr2   )r!   r   r/   r,   s       r"   GetNamespacezFleetClient.GetNamespace  sK     --
C
C''6 D C ;;4488==r$   c                    | j                   j                  t        j                  ||      |      }| j                   j	                  ||t        j
                  |            }| j                  j                  j                  |      }t        j                  j                  |j                  d      }t        j                  t        j                  | j                  j                  | j                  j                         |d      S )aD  Creates a namespace resource from the GKEHub API.

    Args:
      name: the namespace name.
      scope: the scope containing the namespace.
      project: the project containing the namespace.

    Returns:
      A namespace resource

    Raises:
      apitools.base.py.HttpError: if the request returns an HTTP error
    r/   r   )r   namespaceIdr(   rJ   rK   r   )r   r   r   r   .GkehubProjectsLocationsNamespacesCreateRequestNamespaceParentNamer   r   r*   r   rM   rN   r/   r   r   r~   r   )r!   r/   r   r   r   r,   rG   r   s           r"   CreateNamespacezFleetClient.CreateNamespace  s     ''''6e ( I --
F
F''0 G C
 
	2	2	9	9#	>B$$66
B 7 K >>##KK55KK55	
 	- r$   c                 ~   | j                   j                  t        j                  ||            }| j                  j
                  j                  |      }t        j                  j                  |j                  d      }t        j                  t        j                  | j                  j                        |d      S )a  Deletes a namespace resource from the fleet.

    Args:
      project: the project containing the namespace.
      name: the name of the namespace.

    Returns:
      An operation

    Raises:
      apitools.base.py.HttpError: if the request returns an HTTP error
    r   rJ   rK   r   )r   .GkehubProjectsLocationsNamespacesDeleteRequestr   r   r   r   rE   r   rM   rN   r/   r   r   r   r   )r!   r   r/   r,   rG   r   s         r"   DeleteNamespacezFleetClient.DeleteNamespace+  s     --
F
F''6 G C 
	2	2	9	9#	>B$$66
B 7 K >>..KK55	
 	- r$   c                    | j                   j                  t        j                  ||      |      }| j                   j	                  |t        j                  ||      |      }| j
                  j                  j                  |      }t        j                  j                  |j                  d      }t        j                  t        j                  | j
                  j                  | j
                  j                        |d      S )aa  Updates a namespace resource in the fleet.

    Args:
      name: the namespace name.
      scope: the scope containing the namespace.
      project: the project containing the namespace.
      mask: a mask of the fields to update.

    Returns:
      An operation

    Raises:
      apitools.base.py.HttpError: if the request returns an HTTP error
    r  r   rJ   rK   r   )r   r   r   r   -GkehubProjectsLocationsNamespacesPatchRequestr   r   r?   r   rM   rN   r/   r   r   r~   r   )	r!   r/   r   r   r@   r   r,   rG   r   s	            r"   UpdateNamespacezFleetClient.UpdateNamespaceG  s      ''''6e ( I --
E
E''6 F C
 
	2	2	8	8	=B$$66
B 7 K >>##KK55KK55	
 	- r$   c                     | j                   j                  dt        j                  |            }t	        j
                  | j                  j                  |dd      S )a  Lists namespaces in a project.

    Args:
      project: the project to list namespaces from.

    Returns:
      A ListNamespaceResponse (list of namespaces and next page token)

    Raises:
      apitools.base.py.HttpError: if the request returns an HTTP error
    r   r   
namespacesNr   )r   ,GkehubProjectsLocationsNamespacesListRequestr   r  r   r   r   r   r   s      r"   ListNamespaceszFleetClient.ListNamespacesl  sY     --
D
DT55g> E C ##11!	 r$   c                     | j                   j                  |      }| j                  j                  j	                  |      S )zGets an RBACRoleBinding resource from the GKEHub API.

    Args:
      name: the full rolebinding resource name.

    Returns:
      An RBACRoleBinding resource

    Raises:
      apitools.base.py.HttpError: if the request returns an HTTP error
    r   )r   ;GkehubProjectsLocationsNamespacesRbacrolebindingsGetRequestr   .projects_locations_namespaces_rbacrolebindingsr2   r3   s      r"   GetRBACRoleBindingzFleetClient.GetRBACRoleBinding  s>     --
S
S T C ;;EEII#NNr$   c           	         | j                   j                  || j                   j                  | j                   j                  j                  |j	                                     ||      }t
        j                  j                  |dd      }| j                   j                  ||j                         |j                         j                               }| j                  j                  j                  |      S )a  Creates an RBACRoleBinding resource from the GKEHub API.

    Args:
      name: the full rbacrolebinding resource name.
      role: the role.
      user: the user.
      group: the group.

    Returns:
      An RBACRoleBinding resource

    Raises:
      apitools.base.py.HttpError: if the request returns an HTTP error
      calliope_exceptions.RequiredArgumentException: if a required field is
        missing
    predefinedRoler/   roleusergroupz5gkehub.projects.locations.namespaces.rbacrolebindingsv1alphaapi_versionrBACRoleBindingrbacrolebindingIdr(   )r   RBACRoleBindingRolePredefinedRoleValueValuesEnumupperr   rM   rN   >GkehubProjectsLocationsNamespacesRbacrolebindingsCreateRequestNameParentRelativeNamer   r  r*   r!   r/   r  r  r  rolebindingr   r,   s           r"   CreateRBACRoleBindingz!FleetClient.CreateRBACRoleBinding  s    " --//]]==--KK

   

  0 	K !!33? 4 H
 --
V
V#"--/ --/ W C
 ;;EELL r$   c                     | j                   j                  |      }| j                  j                  j	                  |      S )zDeletes an RBACRoleBinding resource from the fleet.

    Args:
      name: the resource name of the rolebinding.

    Returns:
      An operation

    Raises:
      apitools.base.py.HttpError: if the request returns an HTTP error
    r   )r   >GkehubProjectsLocationsNamespacesRbacrolebindingsDeleteRequestr   r  rE   r3   s      r"   DeleteRBACRoleBindingz!FleetClient.DeleteRBACRoleBinding  sC     --
V
V W C ;;EELL r$   c                 p   | j                   j                  |||| j                   j                  | j                   j                  j                  |j	                                           }| j                   j                  ||j                  |      }| j                  j                  j                  |      S )aH  Updates an RBACRoleBinding resource in the fleet.

    Args:
      name: the rolebinding name.
      user: the user.
      group: the group.
      role: the role.
      mask: a mask of the fields to update.

    Returns:
      An operation

    Raises:
      apitools.base.py.HttpError: if the request returns an HTTP error
    r  )r/   r  r  r  r  r/   r<   )
r   r!  r"  r#  r$  =GkehubProjectsLocationsNamespacesRbacrolebindingsPatchRequestr/   r   r  r?   )r!   r/   r  r  r  r@   r*  r,   s           r"   UpdateRBACRoleBindingz!FleetClient.UpdateRBACRoleBinding  s    " --//]]==--KK

   
	 0 	K --
U
U#+*:*:t V C ;;EEKKCPPr$   c                     | j                   j                  dt        j                  ||            }t	        j
                  | j                  j                  |dd      S )af  Lists rolebindings in a namespace.

    Args:
      project: the project containing the namespace to list rolebindings from.
      namespace: the namespace to list rolebindings from.

    Returns:
      A ListNamespaceResponse (list of rolebindings and next page token)

    Raises:
      apitools.base.py.HttpError: if the request returns an HTTP error
    r   r   rbacrolebindingsNr   )r   <GkehubProjectsLocationsNamespacesRbacrolebindingsListRequestr   RBACRoleBindingParentNamer   r   r   r  )r!   r   r   r,   s       r"   ListRBACRoleBindingsz FleetClient.ListRBACRoleBindings  s[     --
T
TT;;GYO U C ##BB !	 r$   c                     | j                   j                  |      }| j                  j                  j	                  |      S )a  Gets an ScopeRBACRoleBinding resource from the GKEHub API.

    Args:
      name: the full rolebinding resource name.

    Returns:
      An ScopeRBACRoleBinding resource

    Raises:
      apitools.base.py.HttpError: if the request returns an HTTP error
    r   )r   7GkehubProjectsLocationsScopesRbacrolebindingsGetRequestr   *projects_locations_scopes_rbacrolebindingsr2   r3   s      r"   GetScopeRBACRoleBindingz#FleetClient.GetScopeRBACRoleBinding  s>     --
O
O P C ;;AAEEcJJr$   c                 4   |r| j                   j                  |      }nM| j                   j                  | j                   j                  j                  |j                                     }| j                   j	                  |||||      }t
        j                  j                  |dd      }	| j                   j                  ||	j                         |	j                         j                               }
| j                  j                  j                  |
      }t
        j                  j                  |j                  d	      }t!        j"                  t!        j$                  | j                  j                  | j                  j&                        |d
      S )a
  Creates an ScopeRBACRoleBinding resource from the GKEHub API.

    Args:
      name: the full Scoperbacrolebinding resource name.
      role: the role.
      custom_role: the custom role.
      user: the user.
      group: the group.
      labels: labels for the RBACRoleBinding resource.

    Returns:
      An ScopeRBACRoleBinding resource

    Raises:
      apitools.base.py.HttpError: if the request returns an HTTP error
      calliope_exceptions.RequiredArgumentException: if a required field is
        missing
    
customRoler  )r/   r  r  r  r   z1gkehub.projects.locations.scopes.rbacrolebindingsr  r  r  rJ   rK   z)Waiting for rbacrolebinding to be created)r   r"  r#  r$  r!  r   rM   rN   :GkehubProjectsLocationsScopesRbacrolebindingsCreateRequestr&  r'  r(  r   r:  r*   r/   r   r   r~   r   )r!   r/   r  custom_roler  r  r   roledefr*  r   r,   rG   r   s                r"   CreateScopeRBACRoleBindingz&FleetClient.CreateScopeRBACRoleBinding  sg   * ""k":g""++IIjjl # g
 --// 0 K !!33; 4 H
 --
R
R#"--/ --/ S C
 
	?	?	F	Fs	KB$$66
B 7 K >>##KKBBKK55	
 	3 r$   c                 V   | j                   j                  |      }| j                  j                  j	                  |      }t
        j                  j                  |j                  d      }t        j                  t        j                  | j                  j                        |d      S )zDeletes an ScopeRBACRoleBinding resource from the fleet.

    Args:
      name: the resource name of the rolebinding.

    Returns:
      An operation

    Raises:
      apitools.base.py.HttpError: if the request returns an HTTP error
    r   rJ   rK   z)Waiting for rbacrolebinding to be deleted)r   :GkehubProjectsLocationsScopesRbacrolebindingsDeleteRequestr   r:  rE   r   rM   rN   r/   r   r   r   r   r!   r/   r,   rG   r   s        r"   DeleteScopeRBACRoleBindingz&FleetClient.DeleteScopeRBACRoleBindingR  s     --
R
R S C 
	?	?	F	Fs	KB$$66
B 7 K >>..KK55	
 	3 r$   c                    d}|r| j                   j                  |      }|rM| j                   j                  | j                   j                  j                  |j                                     }| j                   j	                  |||||      }	| j                   j                  |	|	j                  |      }
| j                  j                  j                  |
      }t        j                  j                  |j                  d      }t        j                  t        j                  | j                  j                  | j                  j                         |d      S )	a  Updates an ScopeRBACRoleBinding resource in the fleet.

    Args:
      name: the rolebinding name.
      user: the user.
      group: the group.
      role: the predefined role.
      custom_role: the custom role.
      labels: labels for the RBACRoleBinding resource.
      mask: a mask of the fields to update.

    Returns:
      An operation

    Raises:
      apitools.base.py.HttpError: if the request returns an HTTP error
    Nr=  r  )r/   r  r  r  r   r0  rJ   rK   z)Waiting for rbacrolebinding to be updated)r   r"  r#  r$  r!  9GkehubProjectsLocationsScopesRbacrolebindingsPatchRequestr/   r   r:  r?   r   rM   rN   r   r   r~   r   )r!   r/   r  r  r  r@  r   r@   rA  r*  r,   rG   r   s                r"   UpdateScopeRBACRoleBindingz&FleetClient.UpdateScopeRBACRoleBindingm  s:   ( G""k":g""++IIjjl # g --// 0 K 	OO'k.>.>4 	P 	
 
 
	?	?	E	Ec	JB$$66
B 7 K >>##KKBBKK55	
 	3 r$   c                     | j                   j                  dt        j                  ||            }t	        j
                  | j                  j                  |dd      S )aR  Lists rolebindings in a scope.

    Args:
      project: the project containing the scope to list rolebindings from.
      scope: the scope to list rolebindings from.

    Returns:
      A ListscopeResponse (list of rolebindings and next page token)

    Raises:
      apitools.base.py.HttpError: if the request returns an HTTP error
    r   r   r4  Nr   )r   8GkehubProjectsLocationsScopesRbacrolebindingsListRequestr   ScopeRBACRoleBindingParentNamer   r   r   r:  )r!   r   r   r,   s       r"   ListScopeRBACRoleBindingsz%FleetClient.ListScopeRBACRoleBindings  s_     	NN66wF 	O 	
  ##>> !	 r$   c                     | j                   j                  |      }| j                  j                  j	                  |      S )a  Gets a Membership-Binding resource from the GKEHub API.

    Args:
      name: the full membership-binding resource name.

    Returns:
      A Membership-Binding resource

    Raises:
      apitools.base.py.HttpError: if the request returns an HTTP error
    r   )r   4GkehubProjectsLocationsMembershipsBindingsGetRequestr   'projects_locations_memberships_bindingsr2   r3   s      r"   GetMembershipBindingz FleetClient.GetMembershipBinding  s>     --
L
L M C ;;>>BB3GGr$   c                 X   | j                   j                  |||      }t        j                  j	                  |dd      }| j                   j                  ||j                         |j                         j                               }| j                  j                  j                  |      }t        j                  j	                  |j                  d      }t        j                  t        j                  | j                  j                  | j                  j                         |d      S )	a  Creates a Membership-Binding resource from the GKEHub API.

    Args:
      name: the full binding resource name.
      scope: the Scope to be associated with Binding.
      labels: labels for the membership binding resource

    Returns:
      A Membership-Binding resource

    Raises:
      apitools.base.py.HttpError: if the request returns an HTTP error
      calliope_exceptions.RequiredArgumentException: if a required field is
        missing
    r/   r   r   z.gkehub.projects.locations.memberships.bindingsr  r  )membershipBindingmembershipBindingIdr(   rJ   rK   z,Waiting for membership binding to be created)r   MembershipBindingr   rM   rN   7GkehubProjectsLocationsMembershipsBindingsCreateRequestr&  r'  r(  r   rP  r*   r/   r   r   r~   r   )	r!   r/   r   r   bindingr   r,   rG   r   s	            r"   CreateMembershipBindingz#FleetClient.CreateMembershipBinding  s	     mm--v . G !!338 4 H
 --
O
O!$MMO --/ P C
 
	<	<	C	CC	HB$$66
B 7 K >>##KK??KK55	
 	6 r$   c           	          | j                   j                  dt        j                  |||| j                              }t        j                  | j                  j                  |dd      S )a  Lists Bindings in a Membership.

    Args:
      project: the project containing the Membership to list Bindings from.
      membership: the Membership to list Bindings from.
      location: the Membrship location to list Bindings

    Returns:
      A ListMembershipBindingResponse (list of bindings and next page token)

    Raises:
      apitools.base.py.HttpError: if the request returns an HTTP error
    r   r   membershipBindingsNr   )	r   5GkehubProjectsLocationsMembershipsBindingsListRequestr   MembershipBindingParentNamer   r   r   r   rP  )r!   r   
membershiplocationr,   s        r"   ListMembershipBindingsz"FleetClient.ListMembershipBindings  si     --
M
M//Z4+=+=
 N C ##;;"!	 r$   c                    | j                   j                  |||      }| j                   j                  ||j                  |      }| j                  j
                  j                  |      }t        j                  j                  |j                  d      }t        j                  t        j                  | j                  j
                  | j                  j                        |d      S )ac  Updates a Membership-Binding resource.

    Args:
      name: the Binding name.
      scope: the Scope associated with binding.
      labels: the labels for the Membership Binding resource.
      mask: a mask of the fields to update.

    Returns:
      An operation

    Raises:
      apitools.base.py.HttpError: if the request returns an HTTP error
    rS  )rT  r/   r<   rJ   rK   z,Waiting for membership binding to be updated)r   rV  6GkehubProjectsLocationsMembershipsBindingsPatchRequestr/   r   rP  r?   r   rM   rN   r   r   r~   r   )	r!   r/   r   r   r@   rX  r,   rG   r   s	            r"   UpdateMembershipBindingz#FleetClient.UpdateMembershipBinding  s      mm-- . G
 --
N
N! O C 
	<	<	B	B3	GB$$66
B 7 K >>##KK??KK55	
 	6 r$   c                 V   | j                   j                  |      }| j                  j                  j	                  |      }t
        j                  j                  |j                  d      }t        j                  t        j                  | j                  j                        |d      S )zDeletes a Membership-Binding resource.

    Args:
      name: the resource name of the Binding.

    Returns:
      An operation

    Raises:
      apitools.base.py.HttpError: if the request returns an HTTP error
    r   rJ   rK   z,Waiting for membership binding to be deleted)r   7GkehubProjectsLocationsMembershipsBindingsDeleteRequestr   rP  rE   r   rM   rN   r/   r   r   r   r   rE  s        r"   DeleteMembershipBindingz#FleetClient.DeleteMembershipBinding9  s     --
O
O P C 
	<	<	C	CC	HB$$66
B 7 K >>..KK55	
 	6 r$   c                     | j                   j                  |      }| j                  j                  j	                  |      S )a"  Gets a Membership RBAC RoleBinding resource from the GKEHub API.

    Args:
      name: the full Membership RBAC RoleBinding resource name.

    Returns:
      A Membership RBAC Role Binding resource.

    Raises:
      apitools.base.py.HttpError: if the request returns an HTTP error.
    r   )r   <GkehubProjectsLocationsMembershipsRbacrolebindingsGetRequestr   /projects_locations_memberships_rbacrolebindingsr2   r3   s      r"   GetMembershipRbacRoleBindingz(FleetClient.GetMembershipRbacRoleBindingT  s>     --
T
T U C ;;FFJJ3OOr$   c           	         | j                   j                  || j                   j                  | j                   j                  j                  |j	                                     ||      }t
        j                  j                  |dd      }| j                   j                  ||j                         |j                         j                               }| j                  j                  j                  |      S )a  Creates a Membership RBAC RoleBinding resource from the GKEHub API.

    Args:
      name: the full Membership RBAC Role Binding resource name.
      role: the role for the RBAC policies.
      user: the user to apply the RBAC policies for.
      group: the group to apply the RBAC policies for.

    Returns:
      A Membership RBAC Role Binding resource.

    Raises:
      apitools.base.py.HttpError: if the request returns an HTTP error.
    r  r  6gkehub.projects.locations.memberships.rbacrolebindingsr  r  r  )r   r!  r"  r#  r$  r   rM   rN   ?GkehubProjectsLocationsMembershipsRbacrolebindingsCreateRequestr&  r'  r(  r   ri  r*   r)  s           r"   CreateMembershipRbacRoleBindingz+FleetClient.CreateMembershipRbacRoleBindinge  s     --//]]==--KK

   

  0 	K !!33@ 4 H
 --
W
W#"--/ --/ X C
 ;;FFMM r$   c                     | j                   j                  |      }| j                  j                  j	                  |      S )a  Deletes a Membership RBAC RoleBinding resource.

    Args:
      name: the resource name of the Membership RBAC RoleBinding.

    Returns:
      A long running operation for the deletion.

    Raises:
      apitools.base.py.HttpError: if the request returns an HTTP error.
    r   )r   ?GkehubProjectsLocationsMembershipsRbacrolebindingsDeleteRequestr   ri  rE   r3   s      r"   DeleteMembershipRbacRoleBindingz+FleetClient.DeleteMembershipRbacRoleBinding  sC     --
W
W X C ;;FFMM r$   c           	         | j                   j                  || j                   j                  | j                   j                  j                  |j	                                     ||      }t
        j                  j                  |dd      }| j                   j                  ||j                         |j                         j                               }| j                  j                  j                  |      S )a  Gets YAML containing RBAC policies for a membership RBAC role binding.

    Args:
      name: the full Membership RBAC Role Binding resource name.
      role: the role for the RBAC policies.
      user: the user to apply the RBAC policies for.
      group: the group to apply the RBAC policies for.

    Returns:
      YAML text containing RBAC policies for a membership RBAC rolebinding.

    Raises:
      apitools.base.py.HttpError: if the request returns an HTTP error.
    r  r  rl  r  r  r  )r   r!  r"  r#  r$  r   rM   rN   ^GkehubProjectsLocationsMembershipsRbacrolebindingsGenerateMembershipRBACRoleBindingYAMLRequestr&  r'  r(  r   ri  %GenerateMembershipRBACRoleBindingYAMLr)  s           r"   %GenerateMembershipRbacRoleBindingYamlz1FleetClient.GenerateMembershipRbacRoleBindingYaml  s     --//]]==--KK

   

  0 	K !!33@ 4 H
 --
v
v#"--/ --/ w C
 ;;FFll r$   c                 L    | j                   j                  j                  |      S )a  Creates a rollout resource from the Fleet rollout API.

    Args:
      req: An HTTP create rollout request to be sent to the API server.

    Returns:
      A long-running operation.

    Raises:
      apitools.base.py.HttpError: if the request returns an HTTP error
    )r   projects_locations_rolloutsr*   r   s     r"   CreateRolloutzFleetClient.CreateRollout  s     ;;2299#>>r$   c                 L    | j                   j                  j                  |      S )zDescribes a fleet rollout.)r   rw  r2   r   s     r"   DescribeRolloutzFleetClient.DescribeRollout  s     ;;2266s;;r$   c                 `    t        j                  | j                  j                  |d||d      S )zLists fleet rollouts.rolloutspageSizer   
batch_sizelimitr   )r   r   r   rw  r!   r,   	page_sizer  s       r"   ListRolloutszFleetClient.ListRollouts  s3     ##//' r$   c                 L    | j                   j                  j                  |      S )zPause a fleet rollout.)r   rw  Pauser   s     r"   PauseRolloutzFleetClient.PauseRollout  s     ;;2288==r$   c                 L    | j                   j                  j                  |      S )zResume a fleet rollout.)r   rw  Resumer   s     r"   ResumeRolloutzFleetClient.ResumeRollout       ;;2299#>>r$   c                 L    | j                   j                  j                  |      S )zDelete a fleet rollout.)r   rw  rE   r   s     r"   DeleteRolloutzFleetClient.DeleteRollout  r  r$   c                 L    | j                   j                  j                  |      S )a  Creates a rollout sequence resource.

    Args:
      req: An HTTP create rollout sequence request to be sent to the API server.

    Returns:
      A long-running operation.

    Raises:
      apitools.base.py.HttpError: if the request returns an HTTP error
    )r   #projects_locations_rolloutSequencesr*   r   s     r"   CreateRolloutSequencez!FleetClient.CreateRolloutSequence  s     ;;::AA#FFr$   c                 L    | j                   j                  j                  |      S )zDescribes a rollout sequence.)r   r  r2   r   s     r"   DescribeRolloutSequencez#FleetClient.DescribeRolloutSequence  s     ;;::>>sCCr$   c                 `    t        j                  | j                  j                  |d||d      S )zLists rollout sequences.rolloutSequencesr}  r~  )r   r   r   r  r  s       r"   ListRolloutSequencesz FleetClient.ListRolloutSequences  s3     ##77 ' r$   c                 L    | j                   j                  j                  |      S )zIUpdates a RolloutSequence and returns the long-running operation message.)r   r  r?   r   s     r"   UpdateRolloutSequencez!FleetClient.UpdateRolloutSequence$  s     ;;::@@EEr$   c                 L    | j                   j                  j                  |      S )zDeletes a rollout sequence.)r   r  rE   r   s     r"   DeleteRolloutSequencez!FleetClient.DeleteRolloutSequence*  s     ;;::AA#FFr$   )NNr   NNrR   )global)Pro   rp   rq   rr   r   rs   rt   r#   r   r
   *GkehubProjectsLocationsFleetsCreateRequestr   *GkehubProjectsLocationsFleetsDeleteRequestrv   r   )GkehubProjectsLocationsFleetsPatchRequestr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r+  r.  r2  r7  r;  rB  rF  rI  rM  rQ  rY  r`  rc  rf  rj  rn  rq  ru  ,GkehubProjectsLocationsRolloutsCreateRequestrx  )GkehubProjectsLocationsRolloutsGetRequestRolloutrz  *GkehubProjectsLocationsRolloutsListRequestRolloutGeneratorr  +GkehubProjectsLocationsRolloutsPauseRequestr  ,GkehubProjectsLocationsRolloutsResumeRequestr  ,GkehubProjectsLocationsRolloutsDeleteRequestr  4GkehubProjectsLocationsRolloutSequencesCreateRequestr  1GkehubProjectsLocationsRolloutSequencesGetRequestRolloutSequencer  2GkehubProjectsLocationsRolloutSequencesListRequestRolloutSequenceGeneratorr  3GkehubProjectsLocationsRolloutSequencesPatchRequestr  4GkehubProjectsLocationsRolloutSequencesDeleteRequestr  rx   r$   r"   r   r   F  s~    $(#4#4#7#7 :"=UMM ==AA=="<@@<<"8:C"C,.20 BD#JE$ IM&P8 FH'R,>$!F8#J,O"'R&Q@.K$ :>9v65n4H"(T6#J6P"%N&%N?CC? <@@<}}< 	;;
  >BB>?CC??CC?GKKG DHHDD 	CC
 %% FJJFGKKGr$   r   c                       e Zd ZdZdej
                  fdZdej                  fdZ	de
j                  fdZ	 	 dde
j                  d	ee
j                  ddf   fd
Zy)OperationClientz3Client for the GKE Hub API long-running operations.r   c                     t        j                  |      | _        t        j                  |      | _        | j                  j
                  | _        y )N)r   )r   r   r   r   r   r   servicer    s     r"   r#   zOperationClient.__init__4  s7    **=9DM((}EDK;;<<DLr$   operation_refc                     t        j                  t        j                  | j                        |dj	                  |j                               dd      S )a4  Waits for a long-running operation to complete.

    Polling message is printed to the terminal periodically, until the operation
    completes or times out.

    Args:
      operation_ref: Long-running peration in the format of resource argument.

    Returns:
      A completed long-running operation.
    z&Waiting for operation [{}] to completei'  i .)wait_ceiling_msmax_wait_ms)r   r   r   r  formatr(  )r!   r  s     r"   WaitzOperationClient.Wait9  sL     >>..t||<077&&(	
  r$   r,   c                 L    | j                   j                  j                  |      S )z#Describes a long-running operation.)r   r   r2   r   s     r"   DescribezOperationClient.DescribeO  s    ;;4488==r$   NrH   c                 `    t        j                  | j                  j                  |d||d      S )aA  Lists long-running operations.

    Currently gcloud implements client-side filtering and limiting behavior.

    Args:
      req: List request to pass to the server.
      page_size: Maximum number of resources per page.
      limit: Client-side limit control.

    Returns:
      A list of long-running operations.
    
operationsr}  r~  )r   r   r   r   r  s       r"   r7   zOperationClient.ListS  s3    $ ##11' r$   r  )ro   rp   rq   rr   r   rs   r#   r   rw   r  r
   +GkehubProjectsLocationsOperationsGetRequestr  ,GkehubProjectsLocationsOperationsListRequestr   rv   r7   rx   r$   r"   r  r  1  sp    ;=D$5$5 =
	 2 2 ,>%KK > 	==
 $,-r$   r  )rr   
__future__r   r   r   rY   typingr   apitools.base.pyr   r   &googlecloudsdk.api_lib.container.fleetr	   r
   r   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper   googlecloudsdk.corer   objectr   rz   r   r  rx   r$   r"   <module>r     sn    ) &  '   % ' B 8 7 . ( )uL uLpiK& iKXhG& hGV'; ;r$   