| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent bf378f7 commit 47d994c
36 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,7 +16,7 @@ | |||
| 16 | 16 | from collections import OrderedDict | |
| 17 | 17 | import functools | |
| 18 | 18 | import re | |
| 19 | - from typing import Dict, Optional, Sequence, Tuple, Type, Union | ||
| 19 | + from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union | ||
| 20 | 20 | import pkg_resources | |
| 21 | 21 | ||
| 22 | 22 | from google.api_core.client_options import ClientOptions | |
@@ -279,7 +279,6 @@ async def bulk_mute_findings( | |||
| 279 | 279 | organization, folder or project. The findings matched by | |
| 280 | 280 | the filter will be muted after the LRO is done. | |
| 281 | 281 | ||
| 282 | - | ||
| 283 | 282 | .. code-block:: python | |
| 284 | 283 | ||
| 285 | 284 | from google.cloud import securitycenter_v1 | |
@@ -512,7 +511,6 @@ async def create_finding( | |||
| 512 | 511 | r"""Creates a finding. The corresponding source must | |
| 513 | 512 | exist for finding creation to succeed. | |
| 514 | 513 | ||
| 515 | - | ||
| 516 | 514 | .. code-block:: python | |
| 517 | 515 | ||
| 518 | 516 | from google.cloud import securitycenter_v1 | |
@@ -1163,17 +1161,17 @@ async def get_iam_policy( | |||
| 1163 | 1161 | r"""Gets the access control policy on the specified | |
| 1164 | 1162 | Source. | |
| 1165 | 1163 | ||
| 1166 | - | ||
| 1167 | 1164 | .. code-block:: python | |
| 1168 | 1165 | ||
| 1169 | 1166 | from google.cloud import securitycenter_v1 | |
| 1167 | + from google.iam.v1 import iam_policy_pb2 # type: ignore | ||
| 1170 | 1168 | ||
| 1171 | 1169 | def sample_get_iam_policy(): | |
| 1172 | 1170 | # Create a client | |
| 1173 | 1171 | client = securitycenter_v1.SecurityCenterClient() | |
| 1174 | 1172 | ||
| 1175 | 1173 | # Initialize request argument(s) | |
| 1176 | - request = securitycenter_v1.GetIamPolicyRequest( | ||
| 1174 | + request = iam_policy_pb2.GetIamPolicyRequest( | ||
| 1177 | 1175 | resource="resource_value", | |
| 1178 | 1176 | ) | |
| 1179 | 1177 | ||
@@ -1762,7 +1760,6 @@ async def group_assets( | |||
| 1762 | 1760 | r"""Filters an organization's assets and groups them by | |
| 1763 | 1761 | their specified properties. | |
| 1764 | 1762 | ||
| 1765 | - | ||
| 1766 | 1763 | .. code-block:: python | |
| 1767 | 1764 | ||
| 1768 | 1765 | from google.cloud import securitycenter_v1 | |
@@ -1868,7 +1865,6 @@ async def group_findings( | |||
| 1868 | 1865 | /v1/folders/{folder_id}/sources/-/findings, | |
| 1869 | 1866 | /v1/projects/{project_id}/sources/-/findings | |
| 1870 | 1867 | ||
| 1871 | - | ||
| 1872 | 1868 | .. code-block:: python | |
| 1873 | 1869 | ||
| 1874 | 1870 | from google.cloud import securitycenter_v1 | |
@@ -2114,7 +2110,6 @@ async def list_findings( | |||
| 2114 | 2110 | To list across all sources provide a ``-`` as the source id. | |
| 2115 | 2111 | Example: /v1/organizations/{organization_id}/sources/-/findings | |
| 2116 | 2112 | ||
| 2117 | - | ||
| 2118 | 2113 | .. code-block:: python | |
| 2119 | 2114 | ||
| 2120 | 2115 | from google.cloud import securitycenter_v1 | |
@@ -2567,7 +2562,6 @@ async def run_asset_discovery( | |||
| 2567 | 2562 | organization. If it is called too frequently the caller will | |
| 2568 | 2563 | receive a TOO_MANY_REQUESTS error. | |
| 2569 | 2564 | ||
| 2570 | - | ||
| 2571 | 2565 | .. code-block:: python | |
| 2572 | 2566 | ||
| 2573 | 2567 | from google.cloud import securitycenter_v1 | |
@@ -2924,17 +2918,17 @@ async def set_iam_policy( | |||
| 2924 | 2918 | r"""Sets the access control policy on the specified | |
| 2925 | 2919 | Source. | |
| 2926 | 2920 | ||
| 2927 | - | ||
| 2928 | 2921 | .. code-block:: python | |
| 2929 | 2922 | ||
| 2930 | 2923 | from google.cloud import securitycenter_v1 | |
| 2924 | + from google.iam.v1 import iam_policy_pb2 # type: ignore | ||
| 2931 | 2925 | ||
| 2932 | 2926 | def sample_set_iam_policy(): | |
| 2933 | 2927 | # Create a client | |
| 2934 | 2928 | client = securitycenter_v1.SecurityCenterClient() | |
| 2935 | 2929 | ||
| 2936 | 2930 | # Initialize request argument(s) | |
| 2937 | - request = securitycenter_v1.SetIamPolicyRequest( | ||
| 2931 | + request = iam_policy_pb2.SetIamPolicyRequest( | ||
| 2938 | 2932 | resource="resource_value", | |
| 2939 | 2933 | ) | |
| 2940 | 2934 | ||
@@ -3085,17 +3079,17 @@ async def test_iam_permissions( | |||
| 3085 | 3079 | r"""Returns the permissions that a caller has on the | |
| 3086 | 3080 | specified source. | |
| 3087 | 3081 | ||
| 3088 | - | ||
| 3089 | 3082 | .. code-block:: python | |
| 3090 | 3083 | ||
| 3091 | 3084 | from google.cloud import securitycenter_v1 | |
| 3085 | + from google.iam.v1 import iam_policy_pb2 # type: ignore | ||
| 3092 | 3086 | ||
| 3093 | 3087 | def sample_test_iam_permissions(): | |
| 3094 | 3088 | # Create a client | |
| 3095 | 3089 | client = securitycenter_v1.SecurityCenterClient() | |
| 3096 | 3090 | ||
| 3097 | 3091 | # Initialize request argument(s) | |
| 3098 | - request = securitycenter_v1.TestIamPermissionsRequest( | ||
| 3092 | + request = iam_policy_pb2.TestIamPermissionsRequest( | ||
| 3099 | 3093 | resource="resource_value", | |
| 3100 | 3094 | permissions=['permissions_value_1', 'permissions_value_2'], | |
| 3101 | 3095 | ) | |
@@ -3313,7 +3307,6 @@ async def update_finding( | |||
| 3313 | 3307 | r"""Creates or updates a finding. The corresponding | |
| 3314 | 3308 | source must exist for a finding creation to succeed. | |
| 3315 | 3309 | ||
| 3316 | - | ||
| 3317 | 3310 | .. code-block:: python | |
| 3318 | 3311 | ||
| 3319 | 3312 | from google.cloud import securitycenter_v1 | |
@@ -3538,7 +3531,6 @@ async def update_notification_config( | |||
| 3538 | 3531 | r"""Updates a notification config. The following update fields are | |
| 3539 | 3532 | allowed: description, pubsub_topic, streaming_config.filter | |
| 3540 | 3533 | ||
| 3541 | - | ||
| 3542 | 3534 | .. code-block:: python | |
| 3543 | 3535 | ||
| 3544 | 3536 | from google.cloud import securitycenter_v1 | |
@@ -4270,7 +4262,6 @@ async def list_big_query_exports( | |||
| 4270 | 4262 | immediately under the folder plus the ones created under | |
| 4271 | 4263 | the projects within the folder are returned. | |
| 4272 | 4264 | ||
| 4273 | - | ||
| 4274 | 4265 | .. code-block:: python | |
| 4275 | 4266 | ||
| 4276 | 4267 | from google.cloud import securitycenter_v1 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,7 +16,7 @@ | |||
| 16 | 16 | from collections import OrderedDict | |
| 17 | 17 | import os | |
| 18 | 18 | import re | |
| 19 | - from typing import Dict, Optional, Sequence, Tuple, Type, Union | ||
| 19 | + from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union | ||
| 20 | 20 | import pkg_resources | |
| 21 | 21 | ||
| 22 | 22 | from google.api_core import client_options as client_options_lib | |
@@ -649,7 +649,6 @@ def bulk_mute_findings( | |||
| 649 | 649 | organization, folder or project. The findings matched by | |
| 650 | 650 | the filter will be muted after the LRO is done. | |
| 651 | 651 | ||
| 652 | - | ||
| 653 | 652 | .. code-block:: python | |
| 654 | 653 | ||
| 655 | 654 | from google.cloud import securitycenter_v1 | |
@@ -882,7 +881,6 @@ def create_finding( | |||
| 882 | 881 | r"""Creates a finding. The corresponding source must | |
| 883 | 882 | exist for finding creation to succeed. | |
| 884 | 883 | ||
| 885 | - | ||
| 886 | 884 | .. code-block:: python | |
| 887 | 885 | ||
| 888 | 886 | from google.cloud import securitycenter_v1 | |
@@ -1541,17 +1539,17 @@ def get_iam_policy( | |||
| 1541 | 1539 | r"""Gets the access control policy on the specified | |
| 1542 | 1540 | Source. | |
| 1543 | 1541 | ||
| 1544 | - | ||
| 1545 | 1542 | .. code-block:: python | |
| 1546 | 1543 | ||
| 1547 | 1544 | from google.cloud import securitycenter_v1 | |
| 1545 | + from google.iam.v1 import iam_policy_pb2 # type: ignore | ||
| 1548 | 1546 | ||
| 1549 | 1547 | def sample_get_iam_policy(): | |
| 1550 | 1548 | # Create a client | |
| 1551 | 1549 | client = securitycenter_v1.SecurityCenterClient() | |
| 1552 | 1550 | ||
| 1553 | 1551 | # Initialize request argument(s) | |
| 1554 | - request = securitycenter_v1.GetIamPolicyRequest( | ||
| 1552 | + request = iam_policy_pb2.GetIamPolicyRequest( | ||
| 1555 | 1553 | resource="resource_value", | |
| 1556 | 1554 | ) | |
| 1557 | 1555 | ||
@@ -2101,7 +2099,6 @@ def group_assets( | |||
| 2101 | 2099 | r"""Filters an organization's assets and groups them by | |
| 2102 | 2100 | their specified properties. | |
| 2103 | 2101 | ||
| 2104 | - | ||
| 2105 | 2102 | .. code-block:: python | |
| 2106 | 2103 | ||
| 2107 | 2104 | from google.cloud import securitycenter_v1 | |
@@ -2198,7 +2195,6 @@ def group_findings( | |||
| 2198 | 2195 | /v1/folders/{folder_id}/sources/-/findings, | |
| 2199 | 2196 | /v1/projects/{project_id}/sources/-/findings | |
| 2200 | 2197 | ||
| 2201 | - | ||
| 2202 | 2198 | .. code-block:: python | |
| 2203 | 2199 | ||
| 2204 | 2200 | from google.cloud import securitycenter_v1 | |
@@ -2425,7 +2421,6 @@ def list_findings( | |||
| 2425 | 2421 | To list across all sources provide a ``-`` as the source id. | |
| 2426 | 2422 | Example: /v1/organizations/{organization_id}/sources/-/findings | |
| 2427 | 2423 | ||
| 2428 | - | ||
| 2429 | 2424 | .. code-block:: python | |
| 2430 | 2425 | ||
| 2431 | 2426 | from google.cloud import securitycenter_v1 | |
@@ -2853,7 +2848,6 @@ def run_asset_discovery( | |||
| 2853 | 2848 | organization. If it is called too frequently the caller will | |
| 2854 | 2849 | receive a TOO_MANY_REQUESTS error. | |
| 2855 | 2850 | ||
| 2856 | - | ||
| 2857 | 2851 | .. code-block:: python | |
| 2858 | 2852 | ||
| 2859 | 2853 | from google.cloud import securitycenter_v1 | |
@@ -3210,17 +3204,17 @@ def set_iam_policy( | |||
| 3210 | 3204 | r"""Sets the access control policy on the specified | |
| 3211 | 3205 | Source. | |
| 3212 | 3206 | ||
| 3213 | - | ||
| 3214 | 3207 | .. code-block:: python | |
| 3215 | 3208 | ||
| 3216 | 3209 | from google.cloud import securitycenter_v1 | |
| 3210 | + from google.iam.v1 import iam_policy_pb2 # type: ignore | ||
| 3217 | 3211 | ||
| 3218 | 3212 | def sample_set_iam_policy(): | |
| 3219 | 3213 | # Create a client | |
| 3220 | 3214 | client = securitycenter_v1.SecurityCenterClient() | |
| 3221 | 3215 | ||
| 3222 | 3216 | # Initialize request argument(s) | |
| 3223 | - request = securitycenter_v1.SetIamPolicyRequest( | ||
| 3217 | + request = iam_policy_pb2.SetIamPolicyRequest( | ||
| 3224 | 3218 | resource="resource_value", | |
| 3225 | 3219 | ) | |
| 3226 | 3220 | ||
@@ -3368,17 +3362,17 @@ def test_iam_permissions( | |||
| 3368 | 3362 | r"""Returns the permissions that a caller has on the | |
| 3369 | 3363 | specified source. | |
| 3370 | 3364 | ||
| 3371 | - | ||
| 3372 | 3365 | .. code-block:: python | |
| 3373 | 3366 | ||
| 3374 | 3367 | from google.cloud import securitycenter_v1 | |
| 3368 | + from google.iam.v1 import iam_policy_pb2 # type: ignore | ||
| 3375 | 3369 | ||
| 3376 | 3370 | def sample_test_iam_permissions(): | |
| 3377 | 3371 | # Create a client | |
| 3378 | 3372 | client = securitycenter_v1.SecurityCenterClient() | |
| 3379 | 3373 | ||
| 3380 | 3374 | # Initialize request argument(s) | |
| 3381 | - request = securitycenter_v1.TestIamPermissionsRequest( | ||
| 3375 | + request = iam_policy_pb2.TestIamPermissionsRequest( | ||
| 3382 | 3376 | resource="resource_value", | |
| 3383 | 3377 | permissions=['permissions_value_1', 'permissions_value_2'], | |
| 3384 | 3378 | ) | |
@@ -3584,7 +3578,6 @@ def update_finding( | |||
| 3584 | 3578 | r"""Creates or updates a finding. The corresponding | |
| 3585 | 3579 | source must exist for a finding creation to succeed. | |
| 3586 | 3580 | ||
| 3587 | - | ||
| 3588 | 3581 | .. code-block:: python | |
| 3589 | 3582 | ||
| 3590 | 3583 | from google.cloud import securitycenter_v1 | |
@@ -3809,7 +3802,6 @@ def update_notification_config( | |||
| 3809 | 3802 | r"""Updates a notification config. The following update fields are | |
| 3810 | 3803 | allowed: description, pubsub_topic, streaming_config.filter | |
| 3811 | 3804 | ||
| 3812 | - | ||
| 3813 | 3805 | .. code-block:: python | |
| 3814 | 3806 | ||
| 3815 | 3807 | from google.cloud import securitycenter_v1 | |
@@ -4549,7 +4541,6 @@ def list_big_query_exports( | |||
| 4549 | 4541 | immediately under the folder plus the ones created under | |
| 4550 | 4542 | the projects within the folder are returned. | |
| 4551 | 4543 | ||
| 4552 | - | ||
| 4553 | 4544 | .. code-block:: python | |
| 4554 | 4545 | ||
| 4555 | 4546 | from google.cloud import securitycenter_v1 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -102,6 +102,7 @@ def __init__( | |||
| 102 | 102 | always_use_jwt_access (Optional[bool]): Whether self signed JWT should | |
| 103 | 103 | be used for service account credentials. | |
| 104 | 104 | """ | |
| 105 | + | ||
| 105 | 106 | # Save the hostname. Default to port 443 (HTTPS) if none is specified. | |
| 106 | 107 | if ":" not in host: | |
| 107 | 108 | host += ":443" | |
@@ -826,5 +827,9 @@ def list_big_query_exports( | |||
| 826 | 827 | ]: | |
| 827 | 828 | raise NotImplementedError() | |
| 828 | 829 | ||
| 830 | + @property | ||
| 831 | + def kind(self) -> str: | ||
| 832 | + raise NotImplementedError() | ||
| 833 | + | ||
| 829 | 834 | ||
| 830 | 835 | __all__ = ("SecurityCenterTransport",) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1303,5 +1303,9 @@ def list_big_query_exports( | |||
| 1303 | 1303 | def close(self): | |
| 1304 | 1304 | self.grpc_channel.close() | |
| 1305 | 1305 | ||
| 1306 | + @property | ||
| 1307 | + def kind(self) -> str: | ||
| 1308 | + return "grpc" | ||
| 1309 | + | ||
| 1306 | 1310 | ||
| 1307 | 1311 | __all__ = ("SecurityCenterGrpcTransport",) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments