|
42 | 42 | except AttributeError: # pragma: NO COVER
|
43 | 43 | OptionalRetry = Union[retries.Retry, object] # type: ignore
|
44 | 44 |
|
| 45 | +from google.cloud.location import locations_pb2 # type: ignore |
45 | 46 | from google.protobuf import duration_pb2 # type: ignore
|
46 | 47 | from google.protobuf import field_mask_pb2 # type: ignore
|
47 | 48 | from google.protobuf import timestamp_pb2 # type: ignore
|
@@ -285,7 +286,7 @@ async def sample_list_jobs():
|
285 | 286 | Returns:
|
286 | 287 | google.cloud.scheduler_v1beta1.services.cloud_scheduler.pagers.ListJobsAsyncPager:
|
287 | 288 | Response message for listing jobs using
|
288 |
| - [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs]. |
| 289 | + [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs]. |
289 | 290 |
|
290 | 291 | Iterating over this object will yield results and
|
291 | 292 | resolve additional pages automatically.
|
@@ -410,7 +411,7 @@ async def sample_get_job():
|
410 | 411 | google.cloud.scheduler_v1beta1.types.Job:
|
411 | 412 | Configuration for a job.
|
412 | 413 | The maximum allowed size for a job is
|
413 |
| - 100KB. |
| 414 | + 1MB. |
414 | 415 |
|
415 | 416 | """
|
416 | 417 | # Create or coerce a protobuf request object.
|
@@ -538,7 +539,7 @@ async def sample_create_job():
|
538 | 539 | google.cloud.scheduler_v1beta1.types.Job:
|
539 | 540 | Configuration for a job.
|
540 | 541 | The maximum allowed size for a job is
|
541 |
| - 100KB. |
| 542 | + 1MB. |
542 | 543 |
|
543 | 544 | """
|
544 | 545 | # Create or coerce a protobuf request object.
|
@@ -666,7 +667,7 @@ async def sample_update_job():
|
666 | 667 | google.cloud.scheduler_v1beta1.types.Job:
|
667 | 668 | Configuration for a job.
|
668 | 669 | The maximum allowed size for a job is
|
669 |
| - 100KB. |
| 670 | + 1MB. |
670 | 671 |
|
671 | 672 | """
|
672 | 673 | # Create or coerce a protobuf request object.
|
@@ -883,7 +884,7 @@ async def sample_pause_job():
|
883 | 884 | google.cloud.scheduler_v1beta1.types.Job:
|
884 | 885 | Configuration for a job.
|
885 | 886 | The maximum allowed size for a job is
|
886 |
| - 100KB. |
| 887 | + 1MB. |
887 | 888 |
|
888 | 889 | """
|
889 | 890 | # Create or coerce a protobuf request object.
|
@@ -1006,7 +1007,7 @@ async def sample_resume_job():
|
1006 | 1007 | google.cloud.scheduler_v1beta1.types.Job:
|
1007 | 1008 | Configuration for a job.
|
1008 | 1009 | The maximum allowed size for a job is
|
1009 |
| - 100KB. |
| 1010 | + 1MB. |
1010 | 1011 |
|
1011 | 1012 | """
|
1012 | 1013 | # Create or coerce a protobuf request object.
|
@@ -1122,7 +1123,7 @@ async def sample_run_job():
|
1122 | 1123 | google.cloud.scheduler_v1beta1.types.Job:
|
1123 | 1124 | Configuration for a job.
|
1124 | 1125 | The maximum allowed size for a job is
|
1125 |
| - 100KB. |
| 1126 | + 1MB. |
1126 | 1127 |
|
1127 | 1128 | """
|
1128 | 1129 | # Create or coerce a protobuf request object.
|
@@ -1167,6 +1168,114 @@ async def sample_run_job():
|
1167 | 1168 | # Done; return the response.
|
1168 | 1169 | return response
|
1169 | 1170 |
|
| 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 | + |
1170 | 1279 | async def __aenter__(self):
|
1171 | 1280 | return self
|
1172 | 1281 |
|
|
0 commit comments