
    <                         S r SSKrSSKJr  SSKJr  SSKJr  SSKJ	r	  SSKJ
r
  SSKJr  SS	KJr  \R                  " S
S9rSrSrS rS rS rS rS rg)z1Spanner instance partition operations API helper.    N)
list_pager)timestamp_pb2)response_util)apis)waiter)
properties)	resources   )secondsspannerv1c                    [         R                  " [        [        5      n[        R
                  " UR                  UR                  5      n[        R                  R                  U R                  SS9n[        R                  " X4U5      $ )z!Wait for the specified operation.8spanner.projects.instances.instancePartitions.operations)
collection)r   GetClientInstance	_API_NAME_API_VERSIONr   CloudOperationPoller%projects_instances_instancePartitions0projects_instances_instancePartitions_operationsr	   REGISTRYParseRelativeNamenameWaitFor)	operationmessageclientpollerrefs        Clib/googlecloudsdk/api_lib/spanner/instance_partition_operations.pyAwaitr!   #   sp    !!)\:&&&22==& 	,,nnK 	- 	# 
W	--    c                    [         R                  " [        [        5      n[         R                  " [        [        5      n[
        R                  R                  U[        R                  R                  R                  R                  U S.SS9nUR                  UR                  5       S-   S9n[        R                   " UR"                  USSS9$ )	z>List operations on an instance partition with generic LRO API.)
projectsIdinstancesIdz-spanner.projects.instances.instancePartitionsparamsr   z/operationsr   
operationspageSize)fieldbatch_size_attribute)r   r   r   r   GetMessagesModuler	   r   Parser   VALUEScoreproject	GetOrFail?SpannerProjectsInstancesInstancePartitionsOperationsListRequestRelativeNamer   YieldFromListr   )instanceinstance_partitionr   msgsr   reqs         r    ListGenericr:   1   s    !!)\:&				<	8$  "))..66@@! A 	! 	# 	LL- 	M 	# 
	!	!==	%	
 r"   c                    [         R                  " [        [        5      n[         R                  " [        [        5      n[
        R                  " 5       nUR                  [        R                  R                  [        R                  R                  S9[        -   5        [        R                  R                  U S[         R"                  R$                  R&                  R(                  0SS9nUR+                  UR-                  5       UR/                  5       S9n[0        R2                  " UR4                  USS[6        R8                  S9$ )	z@List operations on instance partitions under the given instance.)tzr$   zspanner.projects.instancesr&   )parentinstancePartitionDeadliner)   r*   )r+   r,   get_field_func)r   r   r   r   r-   r   	TimestampFromDatetimedatetimenowtimezoneutc&UNREACHABLE_INSTANCE_PARTITION_TIMEOUTr	   r   r.   r   r/   r0   r1   r2   >SpannerProjectsInstancesInstancePartitionOperationsListRequestr4   ToJsonStringr   r5   .projects_instances_instancePartitionOperationsr   +GetFieldAndLogUnreachableInstancePartitions)r6   r   r8   tp_protor   r9   s         r    ListrL   H   s   !!)\:&				<	8$$$&(
x00445./ 	  

))..66@@ . 	! 	# 	KK ( 5 5 7 	L 	# 
	!	!;;	%"NN
 r"   c                    [         R                  " [        [        5      n[         R                  " [        [        5      n[
        R                  R                  U[        R                  R                  R                  R                  UU S.SS9nUR                  UR                  5       S9nUR                  R!                  U5      $ )zCancel the specified operation.r$   instancePartitionsIdr%   r   r&   r(   )r   r   r   r   r-   r	   r   r.   r   r/   r0   r1   r2   ASpannerProjectsInstancesInstancePartitionsOperationsCancelRequestr4   r   Cancelr6   r7   r   r   r8   r   r9   s          r    rQ   rQ   e   s    !!)\:&				<	8$  "))..66@@"4!
 L 	! 	# 	NN 	O 	# 
	@	@	G	G	LLr"   c                    [         R                  " [        [        5      n[         R                  " [        [        5      n[
        R                  R                  U[        R                  R                  R                  R                  UU S.SS9nUR                  UR                  5       S9nUR                  R!                  U5      $ )zGet the specified operation.rN   r   r&   r(   )r   r   r   r   r-   r	   r   r.   r   r/   r0   r1   r2   >SpannerProjectsInstancesInstancePartitionsOperationsGetRequestr4   r   GetrR   s          r    rU   rU   x   s    !!)\:&				<	8$  "))..66@@"4!
 L 	! 	# 	KK 	L 	# 
	@	@	D	DS	IIr"   )__doc__rB   apitools.base.pyr   cloudsdk.google.protobufr   googlecloudsdk.api_lib.spannerr   googlecloudsdk.api_lib.utilr   r   googlecloudsdk.corer   r	   	timedeltarF   r   r   r!   r:   rL   rQ   rU    r"   r    <module>r^      sZ    8  ' 2 8 , . * ) *2););B)G &	..:M&Jr"   