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

Commit a6cad2f

Browse files
feat: Updated Client Libraries for Cloud Scheduler (#304)
* feat: Updated Client Libraries for Cloud Scheduler PiperOrigin-RevId: 495092454 Source-Link: googleapis/googleapis@3fbdb93 Source-Link: https://github.com/googleapis/googleapis-gen/commit/ecf0b6c90ee76e53e38cb8ea5f60475f2b4e320c Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWNmMGI2YzkwZWU3NmU1M2UzOGNiOGVhNWY2MDQ3NWYyYjRlMzIwYyJ9 * 🦉 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 3de996c commit a6cad2f

File tree

10 files changed

+729
-26
lines changed

10 files changed

+729
-26
lines changed

google/cloud/scheduler_v1beta1/services/cloud_scheduler/async_client.py

Lines changed: 116 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
except AttributeError: # pragma: NO COVER
4343
OptionalRetry = Union[retries.Retry, object] # type: ignore
4444

45+
from google.cloud.location import locations_pb2 # type: ignore
4546
from google.protobuf import duration_pb2 # type: ignore
4647
from google.protobuf import field_mask_pb2 # type: ignore
4748
from google.protobuf import timestamp_pb2 # type: ignore
@@ -285,7 +286,7 @@ async def sample_list_jobs():
285286
Returns:
286287
google.cloud.scheduler_v1beta1.services.cloud_scheduler.pagers.ListJobsAsyncPager:
287288
Response message for listing jobs using
288-
[ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs].
289+
[ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs].
289290
290291
Iterating over this object will yield results and
291292
resolve additional pages automatically.
@@ -410,7 +411,7 @@ async def sample_get_job():
410411
google.cloud.scheduler_v1beta1.types.Job:
411412
Configuration for a job.
412413
The maximum allowed size for a job is
413-
100KB.
414+
1MB.
414415
415416
"""
416417
# Create or coerce a protobuf request object.
@@ -538,7 +539,7 @@ async def sample_create_job():
538539
google.cloud.scheduler_v1beta1.types.Job:
539540
Configuration for a job.
540541
The maximum allowed size for a job is
541-
100KB.
542+
1MB.
542543
543544
"""
544545
# Create or coerce a protobuf request object.
@@ -666,7 +667,7 @@ async def sample_update_job():
666667
google.cloud.scheduler_v1beta1.types.Job:
667668
Configuration for a job.
668669
The maximum allowed size for a job is
669-
100KB.
670+
1MB.
670671
671672
"""
672673
# Create or coerce a protobuf request object.
@@ -883,7 +884,7 @@ async def sample_pause_job():
883884
google.cloud.scheduler_v1beta1.types.Job:
884885
Configuration for a job.
885886
The maximum allowed size for a job is
886-
100KB.
887+
1MB.
887888
888889
"""
889890
# Create or coerce a protobuf request object.
@@ -1006,7 +1007,7 @@ async def sample_resume_job():
10061007
google.cloud.scheduler_v1beta1.types.Job:
10071008
Configuration for a job.
10081009
The maximum allowed size for a job is
1009-
100KB.
1010+
1MB.
10101011
10111012
"""
10121013
# Create or coerce a protobuf request object.
@@ -1122,7 +1123,7 @@ async def sample_run_job():
11221123
google.cloud.scheduler_v1beta1.types.Job:
11231124
Configuration for a job.
11241125
The maximum allowed size for a job is
1125-
100KB.
1126+
1MB.
11261127
11271128
"""
11281129
# Create or coerce a protobuf request object.
@@ -1167,6 +1168,114 @@ async def sample_run_job():
11671168
# Done; return the response.
11681169
return response
11691170

1171+
async def get_location(
1172+
self,
1173+
request: Optional[locations_pb2.GetLocationRequest] = None,
1174+
*,
1175+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1176+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1177+
metadata: Sequence[Tuple[str, str]] = (),
1178+
) -> locations_pb2.Location:
1179+
r"""Gets information about a location.
1180+
1181+
Args:
1182+
request (:class:`~.location_pb2.GetLocationRequest`):
1183+
The request object. Request message for
1184+
`GetLocation` method.
1185+
retry (google.api_core.retry.Retry): Designation of what errors,
1186+
if any, should be retried.
1187+
timeout (float): The timeout for this request.
1188+
metadata (Sequence[Tuple[str, str]]): Strings which should be
1189+
sent along with the request as metadata.
1190+
Returns:
1191+
~.location_pb2.Location:
1192+
Location object.
1193+
"""
1194+
# Create or coerce a protobuf request object.
1195+
# The request isn't a proto-plus wrapped type,
1196+
# so it must be constructed via keyword expansion.
1197+
if isinstance(request, dict):
1198+
request = locations_pb2.GetLocationRequest(**request)
1199+
1200+
# Wrap the RPC method; this adds retry and timeout information,
1201+
# and friendly error handling.
1202+
rpc = gapic_v1.method.wrap_method(
1203+
self._client._transport.get_location,
1204+
default_timeout=None,
1205+
client_info=DEFAULT_CLIENT_INFO,
1206+
)
1207+
1208+
# Certain fields should be provided within the metadata header;
1209+
# add these here.
1210+
metadata = tuple(metadata) + (
1211+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
1212+
)
1213+
1214+
# Send the request.
1215+
response = await rpc(
1216+
request,
1217+
retry=retry,
1218+
timeout=timeout,
1219+
metadata=metadata,
1220+
)
1221+
1222+
# Done; return the response.
1223+
return response
1224+
1225+
async def list_locations(
1226+
self,
1227+
request: Optional[locations_pb2.ListLocationsRequest] = None,
1228+
*,
1229+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1230+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1231+
metadata: Sequence[Tuple[str, str]] = (),
1232+
) -> locations_pb2.ListLocationsResponse:
1233+
r"""Lists information about the supported locations for this service.
1234+
1235+
Args:
1236+
request (:class:`~.location_pb2.ListLocationsRequest`):
1237+
The request object. Request message for
1238+
`ListLocations` method.
1239+
retry (google.api_core.retry.Retry): Designation of what errors,
1240+
if any, should be retried.
1241+
timeout (float): The timeout for this request.
1242+
metadata (Sequence[Tuple[str, str]]): Strings which should be
1243+
sent along with the request as metadata.
1244+
Returns:
1245+
~.location_pb2.ListLocationsResponse:
1246+
Response message for ``ListLocations`` method.
1247+
"""
1248+
# Create or coerce a protobuf request object.
1249+
# The request isn't a proto-plus wrapped type,
1250+
# so it must be constructed via keyword expansion.
1251+
if isinstance(request, dict):
1252+
request = locations_pb2.ListLocationsRequest(**request)
1253+
1254+
# Wrap the RPC method; this adds retry and timeout information,
1255+
# and friendly error handling.
1256+
rpc = gapic_v1.method.wrap_method(
1257+
self._client._transport.list_locations,
1258+
default_timeout=None,
1259+
client_info=DEFAULT_CLIENT_INFO,
1260+
)
1261+
1262+
# Certain fields should be provided within the metadata header;
1263+
# add these here.
1264+
metadata = tuple(metadata) + (
1265+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
1266+
)
1267+
1268+
# Send the request.
1269+
response = await rpc(
1270+
request,
1271+
retry=retry,
1272+
timeout=timeout,
1273+
metadata=metadata,
1274+
)
1275+
1276+
# Done; return the response.
1277+
return response
1278+
11701279
async def __aenter__(self):
11711280
return self
11721281

google/cloud/scheduler_v1beta1/services/cloud_scheduler/client.py

Lines changed: 116 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
except AttributeError: # pragma: NO COVER
4747
OptionalRetry = Union[retries.Retry, object] # type: ignore
4848

49+
from google.cloud.location import locations_pb2 # type: ignore
4950
from google.protobuf import duration_pb2 # type: ignore
5051
from google.protobuf import field_mask_pb2 # type: ignore
5152
from google.protobuf import timestamp_pb2 # type: ignore
@@ -527,7 +528,7 @@ def sample_list_jobs():
527528
Returns:
528529
google.cloud.scheduler_v1beta1.services.cloud_scheduler.pagers.ListJobsPager:
529530
Response message for listing jobs using
530-
[ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs].
531+
[ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs].
531532
532533
Iterating over this object will yield results and
533534
resolve additional pages automatically.
@@ -642,7 +643,7 @@ def sample_get_job():
642643
google.cloud.scheduler_v1beta1.types.Job:
643644
Configuration for a job.
644645
The maximum allowed size for a job is
645-
100KB.
646+
1MB.
646647
647648
"""
648649
# Create or coerce a protobuf request object.
@@ -760,7 +761,7 @@ def sample_create_job():
760761
google.cloud.scheduler_v1beta1.types.Job:
761762
Configuration for a job.
762763
The maximum allowed size for a job is
763-
100KB.
764+
1MB.
764765
765766
"""
766767
# Create or coerce a protobuf request object.
@@ -888,7 +889,7 @@ def sample_update_job():
888889
google.cloud.scheduler_v1beta1.types.Job:
889890
Configuration for a job.
890891
The maximum allowed size for a job is
891-
100KB.
892+
1MB.
892893
893894
"""
894895
# Create or coerce a protobuf request object.
@@ -1095,7 +1096,7 @@ def sample_pause_job():
10951096
google.cloud.scheduler_v1beta1.types.Job:
10961097
Configuration for a job.
10971098
The maximum allowed size for a job is
1098-
100KB.
1099+
1MB.
10991100
11001101
"""
11011102
# Create or coerce a protobuf request object.
@@ -1208,7 +1209,7 @@ def sample_resume_job():
12081209
google.cloud.scheduler_v1beta1.types.Job:
12091210
Configuration for a job.
12101211
The maximum allowed size for a job is
1211-
100KB.
1212+
1MB.
12121213
12131214
"""
12141215
# Create or coerce a protobuf request object.
@@ -1314,7 +1315,7 @@ def sample_run_job():
13141315
google.cloud.scheduler_v1beta1.types.Job:
13151316
Configuration for a job.
13161317
The maximum allowed size for a job is
1317-
100KB.
1318+
1MB.
13181319
13191320
"""
13201321
# Create or coerce a protobuf request object.
@@ -1372,6 +1373,114 @@ def __exit__(self, type, value, traceback):
13721373
"""
13731374
self.transport.close()
13741375

1376+
def get_location(
1377+
self,
1378+
request: Optional[locations_pb2.GetLocationRequest] = None,
1379+
*,
1380+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1381+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1382+
metadata: Sequence[Tuple[str, str]] = (),
1383+
) -> locations_pb2.Location:
1384+
r"""Gets information about a location.
1385+
1386+
Args:
1387+
request (:class:`~.location_pb2.GetLocationRequest`):
1388+
The request object. Request message for
1389+
`GetLocation` method.
1390+
retry (google.api_core.retry.Retry): Designation of what errors,
1391+
if any, should be retried.
1392+
timeout (float): The timeout for this request.
1393+
metadata (Sequence[Tuple[str, str]]): Strings which should be
1394+
sent along with the request as metadata.
1395+
Returns:
1396+
~.location_pb2.Location:
1397+
Location object.
1398+
"""
1399+
# Create or coerce a protobuf request object.
1400+
# The request isn't a proto-plus wrapped type,
1401+
# so it must be constructed via keyword expansion.
1402+
if isinstance(request, dict):
1403+
request = locations_pb2.GetLocationRequest(**request)
1404+
1405+
# Wrap the RPC method; this adds retry and timeout information,
1406+
# and friendly error handling.
1407+
rpc = gapic_v1.method.wrap_method(
1408+
self._transport.get_location,
1409+
default_timeout=None,
1410+
client_info=DEFAULT_CLIENT_INFO,
1411+
)
1412+
1413+
# Certain fields should be provided within the metadata header;
1414+
# add these here.
1415+
metadata = tuple(metadata) + (
1416+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
1417+
)
1418+
1419+
# Send the request.
1420+
response = rpc(
1421+
request,
1422+
retry=retry,
1423+
timeout=timeout,
1424+
metadata=metadata,
1425+
)
1426+
1427+
# Done; return the response.
1428+
return response
1429+
1430+
def list_locations(
1431+
self,
1432+
request: Optional[locations_pb2.ListLocationsRequest] = None,
1433+
*,
1434+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1435+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1436+
metadata: Sequence[Tuple[str, str]] = (),
1437+
) -> locations_pb2.ListLocationsResponse:
1438+
r"""Lists information about the supported locations for this service.
1439+
1440+
Args:
1441+
request (:class:`~.location_pb2.ListLocationsRequest`):
1442+
The request object. Request message for
1443+
`ListLocations` method.
1444+
retry (google.api_core.retry.Retry): Designation of what errors,
1445+
if any, should be retried.
1446+
timeout (float): The timeout for this request.
1447+
metadata (Sequence[Tuple[str, str]]): Strings which should be
1448+
sent along with the request as metadata.
1449+
Returns:
1450+
~.location_pb2.ListLocationsResponse:
1451+
Response message for ``ListLocations`` method.
1452+
"""
1453+
# Create or coerce a protobuf request object.
1454+
# The request isn't a proto-plus wrapped type,
1455+
# so it must be constructed via keyword expansion.
1456+
if isinstance(request, dict):
1457+
request = locations_pb2.ListLocationsRequest(**request)
1458+
1459+
# Wrap the RPC method; this adds retry and timeout information,
1460+
# and friendly error handling.
1461+
rpc = gapic_v1.method.wrap_method(
1462+
self._transport.list_locations,
1463+
default_timeout=None,
1464+
client_info=DEFAULT_CLIENT_INFO,
1465+
)
1466+
1467+
# Certain fields should be provided within the metadata header;
1468+
# add these here.
1469+
metadata = tuple(metadata) + (
1470+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
1471+
)
1472+
1473+
# Send the request.
1474+
response = rpc(
1475+
request,
1476+
retry=retry,
1477+
timeout=timeout,
1478+
metadata=metadata,
1479+
)
1480+
1481+
# Done; return the response.
1482+
return response
1483+
13751484

13761485
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
13771486
gapic_version=package_version.__version__

0 commit comments

Comments
 (0)