@@ -202,7 +202,7 @@ def transport(self) -> ConfigManagementServiceTransport:
202202 return self ._client .transport
203203
204204 @property
205- def api_endpoint (self ):
205+ def api_endpoint (self ) -> str :
206206 """Return the API endpoint used by the client instance.
207207
208208 Returns:
@@ -546,7 +546,7 @@ async def sample_update_config():
546546
547547 async def list_operations (
548548 self ,
549- request : Optional [operations_pb2 .ListOperationsRequest ] = None ,
549+ request : Optional [Union [ operations_pb2 .ListOperationsRequest , dict ] ] = None ,
550550 * ,
551551 retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
552552 timeout : Union [float , object ] = gapic_v1 .method .DEFAULT ,
@@ -572,8 +572,12 @@ async def list_operations(
572572 # Create or coerce a protobuf request object.
573573 # The request isn't a proto-plus wrapped type,
574574 # so it must be constructed via keyword expansion.
575- if isinstance (request , dict ):
576- request = operations_pb2 .ListOperationsRequest (** request )
575+ if request is None :
576+ request_pb = operations_pb2 .ListOperationsRequest ()
577+ elif isinstance (request , dict ):
578+ request_pb = operations_pb2 .ListOperationsRequest (** request )
579+ else :
580+ request_pb = request
577581
578582 # Wrap the RPC method; this adds retry and timeout information,
579583 # and friendly error handling.
@@ -582,15 +586,15 @@ async def list_operations(
582586 # Certain fields should be provided within the metadata header;
583587 # add these here.
584588 metadata = tuple (metadata ) + (
585- gapic_v1 .routing_header .to_grpc_metadata ((("name" , request .name ),)),
589+ gapic_v1 .routing_header .to_grpc_metadata ((("name" , request_pb .name ),)),
586590 )
587591
588592 # Validate the universe domain.
589593 self ._client ._validate_universe_domain ()
590594
591595 # Send the request.
592596 response = await rpc (
593- request ,
597+ request_pb ,
594598 retry = retry ,
595599 timeout = timeout ,
596600 metadata = metadata ,
@@ -601,7 +605,7 @@ async def list_operations(
601605
602606 async def get_operation (
603607 self ,
604- request : Optional [operations_pb2 .GetOperationRequest ] = None ,
608+ request : Optional [Union [ operations_pb2 .GetOperationRequest , dict ] ] = None ,
605609 * ,
606610 retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
607611 timeout : Union [float , object ] = gapic_v1 .method .DEFAULT ,
@@ -627,8 +631,12 @@ async def get_operation(
627631 # Create or coerce a protobuf request object.
628632 # The request isn't a proto-plus wrapped type,
629633 # so it must be constructed via keyword expansion.
630- if isinstance (request , dict ):
631- request = operations_pb2 .GetOperationRequest (** request )
634+ if request is None :
635+ request_pb = operations_pb2 .GetOperationRequest ()
636+ elif isinstance (request , dict ):
637+ request_pb = operations_pb2 .GetOperationRequest (** request )
638+ else :
639+ request_pb = request
632640
633641 # Wrap the RPC method; this adds retry and timeout information,
634642 # and friendly error handling.
@@ -637,15 +645,15 @@ async def get_operation(
637645 # Certain fields should be provided within the metadata header;
638646 # add these here.
639647 metadata = tuple (metadata ) + (
640- gapic_v1 .routing_header .to_grpc_metadata ((("name" , request .name ),)),
648+ gapic_v1 .routing_header .to_grpc_metadata ((("name" , request_pb .name ),)),
641649 )
642650
643651 # Validate the universe domain.
644652 self ._client ._validate_universe_domain ()
645653
646654 # Send the request.
647655 response = await rpc (
648- request ,
656+ request_pb ,
649657 retry = retry ,
650658 timeout = timeout ,
651659 metadata = metadata ,
@@ -656,7 +664,7 @@ async def get_operation(
656664
657665 async def delete_operation (
658666 self ,
659- request : Optional [operations_pb2 .DeleteOperationRequest ] = None ,
667+ request : Optional [Union [ operations_pb2 .DeleteOperationRequest , dict ] ] = None ,
660668 * ,
661669 retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
662670 timeout : Union [float , object ] = gapic_v1 .method .DEFAULT ,
@@ -686,8 +694,12 @@ async def delete_operation(
686694 # Create or coerce a protobuf request object.
687695 # The request isn't a proto-plus wrapped type,
688696 # so it must be constructed via keyword expansion.
689- if isinstance (request , dict ):
690- request = operations_pb2 .DeleteOperationRequest (** request )
697+ if request is None :
698+ request_pb = operations_pb2 .DeleteOperationRequest ()
699+ elif isinstance (request , dict ):
700+ request_pb = operations_pb2 .DeleteOperationRequest (** request )
701+ else :
702+ request_pb = request
691703
692704 # Wrap the RPC method; this adds retry and timeout information,
693705 # and friendly error handling.
@@ -696,23 +708,23 @@ async def delete_operation(
696708 # Certain fields should be provided within the metadata header;
697709 # add these here.
698710 metadata = tuple (metadata ) + (
699- gapic_v1 .routing_header .to_grpc_metadata ((("name" , request .name ),)),
711+ gapic_v1 .routing_header .to_grpc_metadata ((("name" , request_pb .name ),)),
700712 )
701713
702714 # Validate the universe domain.
703715 self ._client ._validate_universe_domain ()
704716
705717 # Send the request.
706718 await rpc (
707- request ,
719+ request_pb ,
708720 retry = retry ,
709721 timeout = timeout ,
710722 metadata = metadata ,
711723 )
712724
713725 async def cancel_operation (
714726 self ,
715- request : Optional [operations_pb2 .CancelOperationRequest ] = None ,
727+ request : Optional [Union [ operations_pb2 .CancelOperationRequest , dict ] ] = None ,
716728 * ,
717729 retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
718730 timeout : Union [float , object ] = gapic_v1 .method .DEFAULT ,
@@ -741,8 +753,12 @@ async def cancel_operation(
741753 # Create or coerce a protobuf request object.
742754 # The request isn't a proto-plus wrapped type,
743755 # so it must be constructed via keyword expansion.
744- if isinstance (request , dict ):
745- request = operations_pb2 .CancelOperationRequest (** request )
756+ if request is None :
757+ request_pb = operations_pb2 .CancelOperationRequest ()
758+ elif isinstance (request , dict ):
759+ request_pb = operations_pb2 .CancelOperationRequest (** request )
760+ else :
761+ request_pb = request
746762
747763 # Wrap the RPC method; this adds retry and timeout information,
748764 # and friendly error handling.
@@ -751,15 +767,15 @@ async def cancel_operation(
751767 # Certain fields should be provided within the metadata header;
752768 # add these here.
753769 metadata = tuple (metadata ) + (
754- gapic_v1 .routing_header .to_grpc_metadata ((("name" , request .name ),)),
770+ gapic_v1 .routing_header .to_grpc_metadata ((("name" , request_pb .name ),)),
755771 )
756772
757773 # Validate the universe domain.
758774 self ._client ._validate_universe_domain ()
759775
760776 # Send the request.
761777 await rpc (
762- request ,
778+ request_pb ,
763779 retry = retry ,
764780 timeout = timeout ,
765781 metadata = metadata ,
0 commit comments