Skip to content
This repository was archived by the owner on Jul 6, 2023. It is now read-only.

Commit 8b69869

Browse files
feat: Adds support for configuring scaling settings (#132)
* feat: Adds support for configuring scaling settings Clients can now specify machine type and min/max instances when creating a connector. PiperOrigin-RevId: 469463049 Source-Link: googleapis/googleapis@17b39f1 Source-Link: https://github.com/googleapis/googleapis-gen/commit/88b74ac69e76791a020cb543747c090655ee7144 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiODhiNzRhYzY5ZTc2NzkxYTAyMGNiNTQzNzQ3YzA5MDY1NWVlNzE0NCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 93740fd commit 8b69869

File tree

7 files changed

+947
-1
lines changed

7 files changed

+947
-1
lines changed

google/cloud/vpcaccess_v1/services/vpc_access_service/async_client.py

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333

3434
from google.api_core import operation # type: ignore
3535
from google.api_core import operation_async # type: ignore
36+
from google.cloud.location import locations_pb2 # type: ignore
37+
from google.longrunning import operations_pb2
3638
from google.protobuf import empty_pb2 # type: ignore
3739

3840
from google.cloud.vpcaccess_v1.services.vpc_access_service import pagers
@@ -663,6 +665,168 @@ async def sample_delete_connector():
663665
# Done; return the response.
664666
return response
665667

668+
async def list_operations(
669+
self,
670+
request: operations_pb2.ListOperationsRequest = None,
671+
*,
672+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
673+
timeout: float = None,
674+
metadata: Sequence[Tuple[str, str]] = (),
675+
) -> operations_pb2.ListOperationsResponse:
676+
r"""Lists operations that match the specified filter in the request.
677+
678+
Args:
679+
request (:class:`~.operations_pb2.ListOperationsRequest`):
680+
The request object. Request message for
681+
`ListOperations` method.
682+
retry (google.api_core.retry.Retry): Designation of what errors,
683+
if any, should be retried.
684+
timeout (float): The timeout for this request.
685+
metadata (Sequence[Tuple[str, str]]): Strings which should be
686+
sent along with the request as metadata.
687+
Returns:
688+
~.operations_pb2.ListOperationsResponse:
689+
Response message for ``ListOperations`` method.
690+
"""
691+
# Create or coerce a protobuf request object.
692+
# The request isn't a proto-plus wrapped type,
693+
# so it must be constructed via keyword expansion.
694+
if isinstance(request, dict):
695+
request = operations_pb2.ListOperationsRequest(**request)
696+
697+
# Wrap the RPC method; this adds retry and timeout information,
698+
# and friendly error handling.
699+
rpc = gapic_v1.method.wrap_method(
700+
self._client._transport.list_operations,
701+
default_timeout=None,
702+
client_info=DEFAULT_CLIENT_INFO,
703+
)
704+
705+
# Certain fields should be provided within the metadata header;
706+
# add these here.
707+
metadata = tuple(metadata) + (
708+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
709+
)
710+
711+
# Send the request.
712+
response = await rpc(
713+
request,
714+
retry=retry,
715+
timeout=timeout,
716+
metadata=metadata,
717+
)
718+
719+
# Done; return the response.
720+
return response
721+
722+
async def get_operation(
723+
self,
724+
request: operations_pb2.GetOperationRequest = None,
725+
*,
726+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
727+
timeout: float = None,
728+
metadata: Sequence[Tuple[str, str]] = (),
729+
) -> operations_pb2.Operation:
730+
r"""Gets the latest state of a long-running operation.
731+
732+
Args:
733+
request (:class:`~.operations_pb2.GetOperationRequest`):
734+
The request object. Request message for
735+
`GetOperation` method.
736+
retry (google.api_core.retry.Retry): Designation of what errors,
737+
if any, should be retried.
738+
timeout (float): The timeout for this request.
739+
metadata (Sequence[Tuple[str, str]]): Strings which should be
740+
sent along with the request as metadata.
741+
Returns:
742+
~.operations_pb2.Operation:
743+
An ``Operation`` object.
744+
"""
745+
# Create or coerce a protobuf request object.
746+
# The request isn't a proto-plus wrapped type,
747+
# so it must be constructed via keyword expansion.
748+
if isinstance(request, dict):
749+
request = operations_pb2.GetOperationRequest(**request)
750+
751+
# Wrap the RPC method; this adds retry and timeout information,
752+
# and friendly error handling.
753+
rpc = gapic_v1.method.wrap_method(
754+
self._client._transport.get_operation,
755+
default_timeout=None,
756+
client_info=DEFAULT_CLIENT_INFO,
757+
)
758+
759+
# Certain fields should be provided within the metadata header;
760+
# add these here.
761+
metadata = tuple(metadata) + (
762+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
763+
)
764+
765+
# Send the request.
766+
response = await rpc(
767+
request,
768+
retry=retry,
769+
timeout=timeout,
770+
metadata=metadata,
771+
)
772+
773+
# Done; return the response.
774+
return response
775+
776+
async def list_locations(
777+
self,
778+
request: locations_pb2.ListLocationsRequest = None,
779+
*,
780+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
781+
timeout: float = None,
782+
metadata: Sequence[Tuple[str, str]] = (),
783+
) -> locations_pb2.ListLocationsResponse:
784+
r"""Lists information about the supported locations for this service.
785+
786+
Args:
787+
request (:class:`~.location_pb2.ListLocationsRequest`):
788+
The request object. Request message for
789+
`ListLocations` method.
790+
retry (google.api_core.retry.Retry): Designation of what errors,
791+
if any, should be retried.
792+
timeout (float): The timeout for this request.
793+
metadata (Sequence[Tuple[str, str]]): Strings which should be
794+
sent along with the request as metadata.
795+
Returns:
796+
~.location_pb2.ListLocationsResponse:
797+
Response message for ``ListLocations`` method.
798+
"""
799+
# Create or coerce a protobuf request object.
800+
# The request isn't a proto-plus wrapped type,
801+
# so it must be constructed via keyword expansion.
802+
if isinstance(request, dict):
803+
request = locations_pb2.ListLocationsRequest(**request)
804+
805+
# Wrap the RPC method; this adds retry and timeout information,
806+
# and friendly error handling.
807+
rpc = gapic_v1.method.wrap_method(
808+
self._client._transport.list_locations,
809+
default_timeout=None,
810+
client_info=DEFAULT_CLIENT_INFO,
811+
)
812+
813+
# Certain fields should be provided within the metadata header;
814+
# add these here.
815+
metadata = tuple(metadata) + (
816+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
817+
)
818+
819+
# Send the request.
820+
response = await rpc(
821+
request,
822+
retry=retry,
823+
timeout=timeout,
824+
metadata=metadata,
825+
)
826+
827+
# Done; return the response.
828+
return response
829+
666830
async def __aenter__(self):
667831
return self
668832

google/cloud/vpcaccess_v1/services/vpc_access_service/client.py

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636

3737
from google.api_core import operation # type: ignore
3838
from google.api_core import operation_async # type: ignore
39+
from google.cloud.location import locations_pb2 # type: ignore
40+
from google.longrunning import operations_pb2
3941
from google.protobuf import empty_pb2 # type: ignore
4042

4143
from google.cloud.vpcaccess_v1.services.vpc_access_service import pagers
@@ -901,6 +903,168 @@ def __exit__(self, type, value, traceback):
901903
"""
902904
self.transport.close()
903905

906+
def list_operations(
907+
self,
908+
request: operations_pb2.ListOperationsRequest = None,
909+
*,
910+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
911+
timeout: float = None,
912+
metadata: Sequence[Tuple[str, str]] = (),
913+
) -> operations_pb2.ListOperationsResponse:
914+
r"""Lists operations that match the specified filter in the request.
915+
916+
Args:
917+
request (:class:`~.operations_pb2.ListOperationsRequest`):
918+
The request object. Request message for
919+
`ListOperations` method.
920+
retry (google.api_core.retry.Retry): Designation of what errors,
921+
if any, should be retried.
922+
timeout (float): The timeout for this request.
923+
metadata (Sequence[Tuple[str, str]]): Strings which should be
924+
sent along with the request as metadata.
925+
Returns:
926+
~.operations_pb2.ListOperationsResponse:
927+
Response message for ``ListOperations`` method.
928+
"""
929+
# Create or coerce a protobuf request object.
930+
# The request isn't a proto-plus wrapped type,
931+
# so it must be constructed via keyword expansion.
932+
if isinstance(request, dict):
933+
request = operations_pb2.ListOperationsRequest(**request)
934+
935+
# Wrap the RPC method; this adds retry and timeout information,
936+
# and friendly error handling.
937+
rpc = gapic_v1.method.wrap_method(
938+
self._transport.list_operations,
939+
default_timeout=None,
940+
client_info=DEFAULT_CLIENT_INFO,
941+
)
942+
943+
# Certain fields should be provided within the metadata header;
944+
# add these here.
945+
metadata = tuple(metadata) + (
946+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
947+
)
948+
949+
# Send the request.
950+
response = rpc(
951+
request,
952+
retry=retry,
953+
timeout=timeout,
954+
metadata=metadata,
955+
)
956+
957+
# Done; return the response.
958+
return response
959+
960+
def get_operation(
961+
self,
962+
request: operations_pb2.GetOperationRequest = None,
963+
*,
964+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
965+
timeout: float = None,
966+
metadata: Sequence[Tuple[str, str]] = (),
967+
) -> operations_pb2.Operation:
968+
r"""Gets the latest state of a long-running operation.
969+
970+
Args:
971+
request (:class:`~.operations_pb2.GetOperationRequest`):
972+
The request object. Request message for
973+
`GetOperation` method.
974+
retry (google.api_core.retry.Retry): Designation of what errors,
975+
if any, should be retried.
976+
timeout (float): The timeout for this request.
977+
metadata (Sequence[Tuple[str, str]]): Strings which should be
978+
sent along with the request as metadata.
979+
Returns:
980+
~.operations_pb2.Operation:
981+
An ``Operation`` object.
982+
"""
983+
# Create or coerce a protobuf request object.
984+
# The request isn't a proto-plus wrapped type,
985+
# so it must be constructed via keyword expansion.
986+
if isinstance(request, dict):
987+
request = operations_pb2.GetOperationRequest(**request)
988+
989+
# Wrap the RPC method; this adds retry and timeout information,
990+
# and friendly error handling.
991+
rpc = gapic_v1.method.wrap_method(
992+
self._transport.get_operation,
993+
default_timeout=None,
994+
client_info=DEFAULT_CLIENT_INFO,
995+
)
996+
997+
# Certain fields should be provided within the metadata header;
998+
# add these here.
999+
metadata = tuple(metadata) + (
1000+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
1001+
)
1002+
1003+
# Send the request.
1004+
response = rpc(
1005+
request,
1006+
retry=retry,
1007+
timeout=timeout,
1008+
metadata=metadata,
1009+
)
1010+
1011+
# Done; return the response.
1012+
return response
1013+
1014+
def list_locations(
1015+
self,
1016+
request: locations_pb2.ListLocationsRequest = None,
1017+
*,
1018+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1019+
timeout: float = None,
1020+
metadata: Sequence[Tuple[str, str]] = (),
1021+
) -> locations_pb2.ListLocationsResponse:
1022+
r"""Lists information about the supported locations for this service.
1023+
1024+
Args:
1025+
request (:class:`~.location_pb2.ListLocationsRequest`):
1026+
The request object. Request message for
1027+
`ListLocations` method.
1028+
retry (google.api_core.retry.Retry): Designation of what errors,
1029+
if any, should be retried.
1030+
timeout (float): The timeout for this request.
1031+
metadata (Sequence[Tuple[str, str]]): Strings which should be
1032+
sent along with the request as metadata.
1033+
Returns:
1034+
~.location_pb2.ListLocationsResponse:
1035+
Response message for ``ListLocations`` method.
1036+
"""
1037+
# Create or coerce a protobuf request object.
1038+
# The request isn't a proto-plus wrapped type,
1039+
# so it must be constructed via keyword expansion.
1040+
if isinstance(request, dict):
1041+
request = locations_pb2.ListLocationsRequest(**request)
1042+
1043+
# Wrap the RPC method; this adds retry and timeout information,
1044+
# and friendly error handling.
1045+
rpc = gapic_v1.method.wrap_method(
1046+
self._transport.list_locations,
1047+
default_timeout=None,
1048+
client_info=DEFAULT_CLIENT_INFO,
1049+
)
1050+
1051+
# Certain fields should be provided within the metadata header;
1052+
# add these here.
1053+
metadata = tuple(metadata) + (
1054+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
1055+
)
1056+
1057+
# Send the request.
1058+
response = rpc(
1059+
request,
1060+
retry=retry,
1061+
timeout=timeout,
1062+
metadata=metadata,
1063+
)
1064+
1065+
# Done; return the response.
1066+
return response
1067+
9041068

9051069
try:
9061070
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy