|
16 | 16 | from collections import OrderedDict |
17 | 17 | import functools |
18 | 18 | import re |
19 | | -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union |
| 19 | +from typing import ( |
| 20 | + Dict, |
| 21 | + Mapping, |
| 22 | + MutableMapping, |
| 23 | + MutableSequence, |
| 24 | + Optional, |
| 25 | + Sequence, |
| 26 | + Tuple, |
| 27 | + Type, |
| 28 | + Union, |
| 29 | +) |
20 | 30 |
|
21 | 31 | from google.api_core import exceptions as core_exceptions |
22 | 32 | from google.api_core import gapic_v1 |
@@ -170,9 +180,9 @@ def transport(self) -> ContentServiceTransport: |
170 | 180 | def __init__( |
171 | 181 | self, |
172 | 182 | *, |
173 | | - credentials: ga_credentials.Credentials = None, |
| 183 | + credentials: Optional[ga_credentials.Credentials] = None, |
174 | 184 | transport: Union[str, ContentServiceTransport] = "grpc_asyncio", |
175 | | - client_options: ClientOptions = None, |
| 185 | + client_options: Optional[ClientOptions] = None, |
176 | 186 | client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, |
177 | 187 | ) -> None: |
178 | 188 | """Instantiates the content service client. |
@@ -216,12 +226,12 @@ def __init__( |
216 | 226 |
|
217 | 227 | async def create_content( |
218 | 228 | self, |
219 | | - request: Union[gcd_content.CreateContentRequest, dict] = None, |
| 229 | + request: Optional[Union[gcd_content.CreateContentRequest, dict]] = None, |
220 | 230 | *, |
221 | | - parent: str = None, |
222 | | - content: analyze.Content = None, |
| 231 | + parent: Optional[str] = None, |
| 232 | + content: Optional[analyze.Content] = None, |
223 | 233 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
224 | | - timeout: float = None, |
| 234 | + timeout: Optional[float] = None, |
225 | 235 | metadata: Sequence[Tuple[str, str]] = (), |
226 | 236 | ) -> analyze.Content: |
227 | 237 | r"""Create a content. |
@@ -259,7 +269,7 @@ async def sample_create_content(): |
259 | 269 | print(response) |
260 | 270 |
|
261 | 271 | Args: |
262 | | - request (Union[google.cloud.dataplex_v1.types.CreateContentRequest, dict]): |
| 272 | + request (Optional[Union[google.cloud.dataplex_v1.types.CreateContentRequest, dict]]): |
263 | 273 | The request object. Create content request. |
264 | 274 | parent (:class:`str`): |
265 | 275 | Required. The resource name of the parent lake: |
@@ -331,12 +341,12 @@ async def sample_create_content(): |
331 | 341 |
|
332 | 342 | async def update_content( |
333 | 343 | self, |
334 | | - request: Union[gcd_content.UpdateContentRequest, dict] = None, |
| 344 | + request: Optional[Union[gcd_content.UpdateContentRequest, dict]] = None, |
335 | 345 | *, |
336 | | - content: analyze.Content = None, |
337 | | - update_mask: field_mask_pb2.FieldMask = None, |
| 346 | + content: Optional[analyze.Content] = None, |
| 347 | + update_mask: Optional[field_mask_pb2.FieldMask] = None, |
338 | 348 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
339 | | - timeout: float = None, |
| 349 | + timeout: Optional[float] = None, |
340 | 350 | metadata: Sequence[Tuple[str, str]] = (), |
341 | 351 | ) -> analyze.Content: |
342 | 352 | r"""Update a content. Only supports full resource update. |
@@ -373,7 +383,7 @@ async def sample_update_content(): |
373 | 383 | print(response) |
374 | 384 |
|
375 | 385 | Args: |
376 | | - request (Union[google.cloud.dataplex_v1.types.UpdateContentRequest, dict]): |
| 386 | + request (Optional[Union[google.cloud.dataplex_v1.types.UpdateContentRequest, dict]]): |
377 | 387 | The request object. Update content request. |
378 | 388 | content (:class:`google.cloud.dataplex_v1.types.Content`): |
379 | 389 | Required. Update description. Only fields specified in |
@@ -447,11 +457,11 @@ async def sample_update_content(): |
447 | 457 |
|
448 | 458 | async def delete_content( |
449 | 459 | self, |
450 | | - request: Union[content.DeleteContentRequest, dict] = None, |
| 460 | + request: Optional[Union[content.DeleteContentRequest, dict]] = None, |
451 | 461 | *, |
452 | | - name: str = None, |
| 462 | + name: Optional[str] = None, |
453 | 463 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
454 | | - timeout: float = None, |
| 464 | + timeout: Optional[float] = None, |
455 | 465 | metadata: Sequence[Tuple[str, str]] = (), |
456 | 466 | ) -> None: |
457 | 467 | r"""Delete a content. |
@@ -480,7 +490,7 @@ async def sample_delete_content(): |
480 | 490 | await client.delete_content(request=request) |
481 | 491 |
|
482 | 492 | Args: |
483 | | - request (Union[google.cloud.dataplex_v1.types.DeleteContentRequest, dict]): |
| 493 | + request (Optional[Union[google.cloud.dataplex_v1.types.DeleteContentRequest, dict]]): |
484 | 494 | The request object. Delete content request. |
485 | 495 | name (:class:`str`): |
486 | 496 | Required. The resource name of the content: |
@@ -536,11 +546,11 @@ async def sample_delete_content(): |
536 | 546 |
|
537 | 547 | async def get_content( |
538 | 548 | self, |
539 | | - request: Union[content.GetContentRequest, dict] = None, |
| 549 | + request: Optional[Union[content.GetContentRequest, dict]] = None, |
540 | 550 | *, |
541 | | - name: str = None, |
| 551 | + name: Optional[str] = None, |
542 | 552 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
543 | | - timeout: float = None, |
| 553 | + timeout: Optional[float] = None, |
544 | 554 | metadata: Sequence[Tuple[str, str]] = (), |
545 | 555 | ) -> analyze.Content: |
546 | 556 | r"""Get a content resource. |
@@ -572,7 +582,7 @@ async def sample_get_content(): |
572 | 582 | print(response) |
573 | 583 |
|
574 | 584 | Args: |
575 | | - request (Union[google.cloud.dataplex_v1.types.GetContentRequest, dict]): |
| 585 | + request (Optional[Union[google.cloud.dataplex_v1.types.GetContentRequest, dict]]): |
576 | 586 | The request object. Get content request. |
577 | 587 | name (:class:`str`): |
578 | 588 | Required. The resource name of the content: |
@@ -646,11 +656,11 @@ async def sample_get_content(): |
646 | 656 |
|
647 | 657 | async def get_iam_policy( |
648 | 658 | self, |
649 | | - request: Union[iam_policy_pb2.GetIamPolicyRequest, dict] = None, |
| 659 | + request: Optional[Union[iam_policy_pb2.GetIamPolicyRequest, dict]] = None, |
650 | 660 | *, |
651 | | - resource: str = None, |
| 661 | + resource: Optional[str] = None, |
652 | 662 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
653 | | - timeout: float = None, |
| 663 | + timeout: Optional[float] = None, |
654 | 664 | metadata: Sequence[Tuple[str, str]] = (), |
655 | 665 | ) -> policy_pb2.Policy: |
656 | 666 | r"""Gets the access control policy for a contentitem resource. A |
@@ -689,7 +699,7 @@ async def sample_get_iam_policy(): |
689 | 699 | print(response) |
690 | 700 |
|
691 | 701 | Args: |
692 | | - request (Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]): |
| 702 | + request (Optional[Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]]): |
693 | 703 | The request object. Request message for `GetIamPolicy` |
694 | 704 | method. |
695 | 705 | resource (:class:`str`): |
@@ -827,10 +837,10 @@ async def sample_get_iam_policy(): |
827 | 837 |
|
828 | 838 | async def set_iam_policy( |
829 | 839 | self, |
830 | | - request: Union[iam_policy_pb2.SetIamPolicyRequest, dict] = None, |
| 840 | + request: Optional[Union[iam_policy_pb2.SetIamPolicyRequest, dict]] = None, |
831 | 841 | *, |
832 | 842 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
833 | | - timeout: float = None, |
| 843 | + timeout: Optional[float] = None, |
834 | 844 | metadata: Sequence[Tuple[str, str]] = (), |
835 | 845 | ) -> policy_pb2.Policy: |
836 | 846 | r"""Sets the access control policy on the specified contentitem |
@@ -867,7 +877,7 @@ async def sample_set_iam_policy(): |
867 | 877 | print(response) |
868 | 878 |
|
869 | 879 | Args: |
870 | | - request (Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]): |
| 880 | + request (Optional[Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]]): |
871 | 881 | The request object. Request message for `SetIamPolicy` |
872 | 882 | method. |
873 | 883 | retry (google.api_core.retry.Retry): Designation of what errors, if any, |
@@ -974,10 +984,10 @@ async def sample_set_iam_policy(): |
974 | 984 |
|
975 | 985 | async def test_iam_permissions( |
976 | 986 | self, |
977 | | - request: Union[iam_policy_pb2.TestIamPermissionsRequest, dict] = None, |
| 987 | + request: Optional[Union[iam_policy_pb2.TestIamPermissionsRequest, dict]] = None, |
978 | 988 | *, |
979 | 989 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
980 | | - timeout: float = None, |
| 990 | + timeout: Optional[float] = None, |
981 | 991 | metadata: Sequence[Tuple[str, str]] = (), |
982 | 992 | ) -> iam_policy_pb2.TestIamPermissionsResponse: |
983 | 993 | r"""Returns the caller's permissions on a resource. If the resource |
@@ -1021,7 +1031,7 @@ async def sample_test_iam_permissions(): |
1021 | 1031 | print(response) |
1022 | 1032 |
|
1023 | 1033 | Args: |
1024 | | - request (Union[google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict]): |
| 1034 | + request (Optional[Union[google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict]]): |
1025 | 1035 | The request object. Request message for |
1026 | 1036 | `TestIamPermissions` method. |
1027 | 1037 | retry (google.api_core.retry.Retry): Designation of what errors, if any, |
@@ -1076,11 +1086,11 @@ async def sample_test_iam_permissions(): |
1076 | 1086 |
|
1077 | 1087 | async def list_content( |
1078 | 1088 | self, |
1079 | | - request: Union[content.ListContentRequest, dict] = None, |
| 1089 | + request: Optional[Union[content.ListContentRequest, dict]] = None, |
1080 | 1090 | *, |
1081 | | - parent: str = None, |
| 1091 | + parent: Optional[str] = None, |
1082 | 1092 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1083 | | - timeout: float = None, |
| 1093 | + timeout: Optional[float] = None, |
1084 | 1094 | metadata: Sequence[Tuple[str, str]] = (), |
1085 | 1095 | ) -> pagers.ListContentAsyncPager: |
1086 | 1096 | r"""List content. |
@@ -1113,7 +1123,7 @@ async def sample_list_content(): |
1113 | 1123 | print(response) |
1114 | 1124 |
|
1115 | 1125 | Args: |
1116 | | - request (Union[google.cloud.dataplex_v1.types.ListContentRequest, dict]): |
| 1126 | + request (Optional[Union[google.cloud.dataplex_v1.types.ListContentRequest, dict]]): |
1117 | 1127 | The request object. List content request. Returns the |
1118 | 1128 | BASIC Content view. |
1119 | 1129 | parent (:class:`str`): |
@@ -1199,10 +1209,10 @@ async def sample_list_content(): |
1199 | 1209 |
|
1200 | 1210 | async def list_operations( |
1201 | 1211 | self, |
1202 | | - request: operations_pb2.ListOperationsRequest = None, |
| 1212 | + request: Optional[operations_pb2.ListOperationsRequest] = None, |
1203 | 1213 | *, |
1204 | 1214 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1205 | | - timeout: float = None, |
| 1215 | + timeout: Optional[float] = None, |
1206 | 1216 | metadata: Sequence[Tuple[str, str]] = (), |
1207 | 1217 | ) -> operations_pb2.ListOperationsResponse: |
1208 | 1218 | r"""Lists operations that match the specified filter in the request. |
@@ -1253,10 +1263,10 @@ async def list_operations( |
1253 | 1263 |
|
1254 | 1264 | async def get_operation( |
1255 | 1265 | self, |
1256 | | - request: operations_pb2.GetOperationRequest = None, |
| 1266 | + request: Optional[operations_pb2.GetOperationRequest] = None, |
1257 | 1267 | *, |
1258 | 1268 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1259 | | - timeout: float = None, |
| 1269 | + timeout: Optional[float] = None, |
1260 | 1270 | metadata: Sequence[Tuple[str, str]] = (), |
1261 | 1271 | ) -> operations_pb2.Operation: |
1262 | 1272 | r"""Gets the latest state of a long-running operation. |
@@ -1307,10 +1317,10 @@ async def get_operation( |
1307 | 1317 |
|
1308 | 1318 | async def delete_operation( |
1309 | 1319 | self, |
1310 | | - request: operations_pb2.DeleteOperationRequest = None, |
| 1320 | + request: Optional[operations_pb2.DeleteOperationRequest] = None, |
1311 | 1321 | *, |
1312 | 1322 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1313 | | - timeout: float = None, |
| 1323 | + timeout: Optional[float] = None, |
1314 | 1324 | metadata: Sequence[Tuple[str, str]] = (), |
1315 | 1325 | ) -> None: |
1316 | 1326 | r"""Deletes a long-running operation. |
@@ -1362,10 +1372,10 @@ async def delete_operation( |
1362 | 1372 |
|
1363 | 1373 | async def cancel_operation( |
1364 | 1374 | self, |
1365 | | - request: operations_pb2.CancelOperationRequest = None, |
| 1375 | + request: Optional[operations_pb2.CancelOperationRequest] = None, |
1366 | 1376 | *, |
1367 | 1377 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1368 | | - timeout: float = None, |
| 1378 | + timeout: Optional[float] = None, |
1369 | 1379 | metadata: Sequence[Tuple[str, str]] = (), |
1370 | 1380 | ) -> None: |
1371 | 1381 | r"""Starts asynchronous cancellation on a long-running operation. |
@@ -1416,10 +1426,10 @@ async def cancel_operation( |
1416 | 1426 |
|
1417 | 1427 | async def get_location( |
1418 | 1428 | self, |
1419 | | - request: locations_pb2.GetLocationRequest = None, |
| 1429 | + request: Optional[locations_pb2.GetLocationRequest] = None, |
1420 | 1430 | *, |
1421 | 1431 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1422 | | - timeout: float = None, |
| 1432 | + timeout: Optional[float] = None, |
1423 | 1433 | metadata: Sequence[Tuple[str, str]] = (), |
1424 | 1434 | ) -> locations_pb2.Location: |
1425 | 1435 | r"""Gets information about a location. |
@@ -1470,10 +1480,10 @@ async def get_location( |
1470 | 1480 |
|
1471 | 1481 | async def list_locations( |
1472 | 1482 | self, |
1473 | | - request: locations_pb2.ListLocationsRequest = None, |
| 1483 | + request: Optional[locations_pb2.ListLocationsRequest] = None, |
1474 | 1484 | *, |
1475 | 1485 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1476 | | - timeout: float = None, |
| 1486 | + timeout: Optional[float] = None, |
1477 | 1487 | metadata: Sequence[Tuple[str, str]] = (), |
1478 | 1488 | ) -> locations_pb2.ListLocationsResponse: |
1479 | 1489 | r"""Lists information about the supported locations for this service. |
|
0 commit comments