google-cloud-privilegedaccessmanager 0.2.0__tar.gz → 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {google_cloud_privilegedaccessmanager-0.2.0/google_cloud_privilegedaccessmanager.egg-info → google_cloud_privilegedaccessmanager-0.4.0}/PKG-INFO +6 -8
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/README.rst +2 -2
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/google/cloud/privilegedaccessmanager/gapic_version.py +1 -1
- google_cloud_privilegedaccessmanager-0.4.0/google/cloud/privilegedaccessmanager_v1/__init__.py +190 -0
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/google/cloud/privilegedaccessmanager_v1/gapic_version.py +1 -1
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/google/cloud/privilegedaccessmanager_v1/services/privileged_access_manager/async_client.py +67 -37
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/google/cloud/privilegedaccessmanager_v1/services/privileged_access_manager/client.py +101 -64
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/google/cloud/privilegedaccessmanager_v1/services/privileged_access_manager/pagers.py +8 -8
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/google/cloud/privilegedaccessmanager_v1/services/privileged_access_manager/transports/__init__.py +1 -3
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/google/cloud/privilegedaccessmanager_v1/services/privileged_access_manager/transports/base.py +19 -7
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/google/cloud/privilegedaccessmanager_v1/services/privileged_access_manager/transports/grpc.py +11 -7
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/google/cloud/privilegedaccessmanager_v1/services/privileged_access_manager/transports/grpc_asyncio.py +10 -6
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/google/cloud/privilegedaccessmanager_v1/services/privileged_access_manager/transports/rest.py +32 -64
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/google/cloud/privilegedaccessmanager_v1/types/privilegedaccessmanager.py +14 -10
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0/google_cloud_privilegedaccessmanager.egg-info}/PKG-INFO +6 -8
- google_cloud_privilegedaccessmanager-0.4.0/google_cloud_privilegedaccessmanager.egg-info/requires.txt +11 -0
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/setup.py +3 -5
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/tests/unit/gapic/privilegedaccessmanager_v1/test_privileged_access_manager.py +730 -309
- google_cloud_privilegedaccessmanager-0.2.0/google/cloud/privilegedaccessmanager_v1/__init__.py +0 -85
- google_cloud_privilegedaccessmanager-0.2.0/google_cloud_privilegedaccessmanager.egg-info/requires.txt +0 -11
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/LICENSE +0 -0
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/MANIFEST.in +0 -0
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/google/cloud/privilegedaccessmanager/__init__.py +0 -0
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/google/cloud/privilegedaccessmanager/py.typed +0 -0
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/google/cloud/privilegedaccessmanager_v1/gapic_metadata.json +0 -0
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/google/cloud/privilegedaccessmanager_v1/py.typed +0 -0
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/google/cloud/privilegedaccessmanager_v1/services/__init__.py +0 -0
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/google/cloud/privilegedaccessmanager_v1/services/privileged_access_manager/__init__.py +0 -0
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/google/cloud/privilegedaccessmanager_v1/services/privileged_access_manager/transports/rest_base.py +0 -0
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/google/cloud/privilegedaccessmanager_v1/types/__init__.py +0 -0
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/google_cloud_privilegedaccessmanager.egg-info/SOURCES.txt +0 -0
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/google_cloud_privilegedaccessmanager.egg-info/dependency_links.txt +0 -0
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/google_cloud_privilegedaccessmanager.egg-info/not-zip-safe +0 -0
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/google_cloud_privilegedaccessmanager.egg-info/top_level.txt +0 -0
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/setup.cfg +0 -0
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/tests/__init__.py +0 -0
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/tests/unit/__init__.py +0 -0
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/tests/unit/gapic/__init__.py +0 -0
- {google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/tests/unit/gapic/privilegedaccessmanager_v1/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: google-cloud-privilegedaccessmanager
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: Google Cloud Privilegedaccessmanager API client library
|
|
5
5
|
Home-page: https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-privilegedaccessmanager
|
|
6
6
|
Author: Google LLC
|
|
@@ -12,8 +12,6 @@ Classifier: Intended Audience :: Developers
|
|
|
12
12
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
13
13
|
Classifier: Programming Language :: Python
|
|
14
14
|
Classifier: Programming Language :: Python :: 3
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
17
15
|
Classifier: Programming Language :: Python :: 3.9
|
|
18
16
|
Classifier: Programming Language :: Python :: 3.10
|
|
19
17
|
Classifier: Programming Language :: Python :: 3.11
|
|
@@ -22,15 +20,15 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
22
20
|
Classifier: Programming Language :: Python :: 3.14
|
|
23
21
|
Classifier: Operating System :: OS Independent
|
|
24
22
|
Classifier: Topic :: Internet
|
|
25
|
-
Requires-Python: >=3.
|
|
23
|
+
Requires-Python: >=3.9
|
|
26
24
|
License-File: LICENSE
|
|
27
|
-
Requires-Dist: google-api-core[grpc]
|
|
25
|
+
Requires-Dist: google-api-core[grpc]<3.0.0,>=2.11.0
|
|
28
26
|
Requires-Dist: google-auth!=2.24.0,!=2.25.0,<3.0.0,>=2.14.1
|
|
29
27
|
Requires-Dist: grpcio<2.0.0,>=1.33.2
|
|
30
28
|
Requires-Dist: grpcio<2.0.0,>=1.75.1; python_version >= "3.14"
|
|
31
29
|
Requires-Dist: proto-plus<2.0.0,>=1.22.3
|
|
32
30
|
Requires-Dist: proto-plus<2.0.0,>=1.25.0; python_version >= "3.13"
|
|
33
|
-
Requires-Dist: protobuf
|
|
31
|
+
Requires-Dist: protobuf<8.0.0,>=4.25.8
|
|
34
32
|
Dynamic: author
|
|
35
33
|
Dynamic: author-email
|
|
36
34
|
Dynamic: classifier
|
|
@@ -106,14 +104,14 @@ Supported Python Versions
|
|
|
106
104
|
Our client libraries are compatible with all current `active`_ and `maintenance`_ versions of
|
|
107
105
|
Python.
|
|
108
106
|
|
|
109
|
-
Python >= 3.
|
|
107
|
+
Python >= 3.9, including 3.14
|
|
110
108
|
|
|
111
109
|
.. _active: https://devguide.python.org/devcycle/#in-development-main-branch
|
|
112
110
|
.. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches
|
|
113
111
|
|
|
114
112
|
Unsupported Python Versions
|
|
115
113
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
116
|
-
Python <= 3.
|
|
114
|
+
Python <= 3.8
|
|
117
115
|
|
|
118
116
|
If you are using an `end-of-life`_
|
|
119
117
|
version of Python, we recommend that you update as soon as possible to an actively supported version.
|
{google_cloud_privilegedaccessmanager-0.2.0 → google_cloud_privilegedaccessmanager-0.4.0}/README.rst
RENAMED
|
@@ -61,14 +61,14 @@ Supported Python Versions
|
|
|
61
61
|
Our client libraries are compatible with all current `active`_ and `maintenance`_ versions of
|
|
62
62
|
Python.
|
|
63
63
|
|
|
64
|
-
Python >= 3.
|
|
64
|
+
Python >= 3.9, including 3.14
|
|
65
65
|
|
|
66
66
|
.. _active: https://devguide.python.org/devcycle/#in-development-main-branch
|
|
67
67
|
.. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches
|
|
68
68
|
|
|
69
69
|
Unsupported Python Versions
|
|
70
70
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
71
|
-
Python <= 3.
|
|
71
|
+
Python <= 3.8
|
|
72
72
|
|
|
73
73
|
If you are using an `end-of-life`_
|
|
74
74
|
version of Python, we recommend that you update as soon as possible to an actively supported version.
|
google_cloud_privilegedaccessmanager-0.4.0/google/cloud/privilegedaccessmanager_v1/__init__.py
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Copyright 2025 Google LLC
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
#
|
|
16
|
+
import sys
|
|
17
|
+
|
|
18
|
+
import google.api_core as api_core
|
|
19
|
+
|
|
20
|
+
from google.cloud.privilegedaccessmanager_v1 import gapic_version as package_version
|
|
21
|
+
|
|
22
|
+
__version__ = package_version.__version__
|
|
23
|
+
|
|
24
|
+
if sys.version_info >= (3, 8): # pragma: NO COVER
|
|
25
|
+
from importlib import metadata
|
|
26
|
+
else: # pragma: NO COVER
|
|
27
|
+
# TODO(https://github.com/googleapis/python-api-core/issues/835): Remove
|
|
28
|
+
# this code path once we drop support for Python 3.7
|
|
29
|
+
import importlib_metadata as metadata
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
from .services.privileged_access_manager import (
|
|
33
|
+
PrivilegedAccessManagerAsyncClient,
|
|
34
|
+
PrivilegedAccessManagerClient,
|
|
35
|
+
)
|
|
36
|
+
from .types.privilegedaccessmanager import (
|
|
37
|
+
AccessControlEntry,
|
|
38
|
+
ApprovalWorkflow,
|
|
39
|
+
ApproveGrantRequest,
|
|
40
|
+
CheckOnboardingStatusRequest,
|
|
41
|
+
CheckOnboardingStatusResponse,
|
|
42
|
+
CreateEntitlementRequest,
|
|
43
|
+
CreateGrantRequest,
|
|
44
|
+
DeleteEntitlementRequest,
|
|
45
|
+
DenyGrantRequest,
|
|
46
|
+
Entitlement,
|
|
47
|
+
GetEntitlementRequest,
|
|
48
|
+
GetGrantRequest,
|
|
49
|
+
Grant,
|
|
50
|
+
Justification,
|
|
51
|
+
ListEntitlementsRequest,
|
|
52
|
+
ListEntitlementsResponse,
|
|
53
|
+
ListGrantsRequest,
|
|
54
|
+
ListGrantsResponse,
|
|
55
|
+
ManualApprovals,
|
|
56
|
+
OperationMetadata,
|
|
57
|
+
PrivilegedAccess,
|
|
58
|
+
RevokeGrantRequest,
|
|
59
|
+
SearchEntitlementsRequest,
|
|
60
|
+
SearchEntitlementsResponse,
|
|
61
|
+
SearchGrantsRequest,
|
|
62
|
+
SearchGrantsResponse,
|
|
63
|
+
UpdateEntitlementRequest,
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
if hasattr(api_core, "check_python_version") and hasattr(
|
|
67
|
+
api_core, "check_dependency_versions"
|
|
68
|
+
): # pragma: NO COVER
|
|
69
|
+
api_core.check_python_version("google.cloud.privilegedaccessmanager_v1") # type: ignore
|
|
70
|
+
api_core.check_dependency_versions("google.cloud.privilegedaccessmanager_v1") # type: ignore
|
|
71
|
+
else: # pragma: NO COVER
|
|
72
|
+
# An older version of api_core is installed which does not define the
|
|
73
|
+
# functions above. We do equivalent checks manually.
|
|
74
|
+
try:
|
|
75
|
+
import sys
|
|
76
|
+
import warnings
|
|
77
|
+
|
|
78
|
+
_py_version_str = sys.version.split()[0]
|
|
79
|
+
_package_label = "google.cloud.privilegedaccessmanager_v1"
|
|
80
|
+
if sys.version_info < (3, 9):
|
|
81
|
+
warnings.warn(
|
|
82
|
+
"You are using a non-supported Python version "
|
|
83
|
+
+ f"({_py_version_str}). Google will not post any further "
|
|
84
|
+
+ f"updates to {_package_label} supporting this Python version. "
|
|
85
|
+
+ "Please upgrade to the latest Python version, or at "
|
|
86
|
+
+ f"least to Python 3.9, and then update {_package_label}.",
|
|
87
|
+
FutureWarning,
|
|
88
|
+
)
|
|
89
|
+
if sys.version_info[:2] == (3, 9):
|
|
90
|
+
warnings.warn(
|
|
91
|
+
f"You are using a Python version ({_py_version_str}) "
|
|
92
|
+
+ f"which Google will stop supporting in {_package_label} in "
|
|
93
|
+
+ "January 2026. Please "
|
|
94
|
+
+ "upgrade to the latest Python version, or at "
|
|
95
|
+
+ "least to Python 3.10, before then, and "
|
|
96
|
+
+ f"then update {_package_label}.",
|
|
97
|
+
FutureWarning,
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
def parse_version_to_tuple(version_string: str):
|
|
101
|
+
"""Safely converts a semantic version string to a comparable tuple of integers.
|
|
102
|
+
Example: "4.25.8" -> (4, 25, 8)
|
|
103
|
+
Ignores non-numeric parts and handles common version formats.
|
|
104
|
+
Args:
|
|
105
|
+
version_string: Version string in the format "x.y.z" or "x.y.z<suffix>"
|
|
106
|
+
Returns:
|
|
107
|
+
Tuple of integers for the parsed version string.
|
|
108
|
+
"""
|
|
109
|
+
parts = []
|
|
110
|
+
for part in version_string.split("."):
|
|
111
|
+
try:
|
|
112
|
+
parts.append(int(part))
|
|
113
|
+
except ValueError:
|
|
114
|
+
# If it's a non-numeric part (e.g., '1.0.0b1' -> 'b1'), stop here.
|
|
115
|
+
# This is a simplification compared to 'packaging.parse_version', but sufficient
|
|
116
|
+
# for comparing strictly numeric semantic versions.
|
|
117
|
+
break
|
|
118
|
+
return tuple(parts)
|
|
119
|
+
|
|
120
|
+
def _get_version(dependency_name):
|
|
121
|
+
try:
|
|
122
|
+
version_string: str = metadata.version(dependency_name)
|
|
123
|
+
parsed_version = parse_version_to_tuple(version_string)
|
|
124
|
+
return (parsed_version, version_string)
|
|
125
|
+
except Exception:
|
|
126
|
+
# Catch exceptions from metadata.version() (e.g., PackageNotFoundError)
|
|
127
|
+
# or errors during parse_version_to_tuple
|
|
128
|
+
return (None, "--")
|
|
129
|
+
|
|
130
|
+
_dependency_package = "google.protobuf"
|
|
131
|
+
_next_supported_version = "4.25.8"
|
|
132
|
+
_next_supported_version_tuple = (4, 25, 8)
|
|
133
|
+
_recommendation = " (we recommend 6.x)"
|
|
134
|
+
(_version_used, _version_used_string) = _get_version(_dependency_package)
|
|
135
|
+
if _version_used and _version_used < _next_supported_version_tuple:
|
|
136
|
+
warnings.warn(
|
|
137
|
+
f"Package {_package_label} depends on "
|
|
138
|
+
+ f"{_dependency_package}, currently installed at version "
|
|
139
|
+
+ f"{_version_used_string}. Future updates to "
|
|
140
|
+
+ f"{_package_label} will require {_dependency_package} at "
|
|
141
|
+
+ f"version {_next_supported_version} or higher{_recommendation}."
|
|
142
|
+
+ " Please ensure "
|
|
143
|
+
+ "that either (a) your Python environment doesn't pin the "
|
|
144
|
+
+ f"version of {_dependency_package}, so that updates to "
|
|
145
|
+
+ f"{_package_label} can require the higher version, or "
|
|
146
|
+
+ "(b) you manually update your Python environment to use at "
|
|
147
|
+
+ f"least version {_next_supported_version} of "
|
|
148
|
+
+ f"{_dependency_package}.",
|
|
149
|
+
FutureWarning,
|
|
150
|
+
)
|
|
151
|
+
except Exception:
|
|
152
|
+
warnings.warn(
|
|
153
|
+
"Could not determine the version of Python "
|
|
154
|
+
+ "currently being used. To continue receiving "
|
|
155
|
+
+ "updates for {_package_label}, ensure you are "
|
|
156
|
+
+ "using a supported version of Python; see "
|
|
157
|
+
+ "https://devguide.python.org/versions/"
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
__all__ = (
|
|
161
|
+
"PrivilegedAccessManagerAsyncClient",
|
|
162
|
+
"AccessControlEntry",
|
|
163
|
+
"ApprovalWorkflow",
|
|
164
|
+
"ApproveGrantRequest",
|
|
165
|
+
"CheckOnboardingStatusRequest",
|
|
166
|
+
"CheckOnboardingStatusResponse",
|
|
167
|
+
"CreateEntitlementRequest",
|
|
168
|
+
"CreateGrantRequest",
|
|
169
|
+
"DeleteEntitlementRequest",
|
|
170
|
+
"DenyGrantRequest",
|
|
171
|
+
"Entitlement",
|
|
172
|
+
"GetEntitlementRequest",
|
|
173
|
+
"GetGrantRequest",
|
|
174
|
+
"Grant",
|
|
175
|
+
"Justification",
|
|
176
|
+
"ListEntitlementsRequest",
|
|
177
|
+
"ListEntitlementsResponse",
|
|
178
|
+
"ListGrantsRequest",
|
|
179
|
+
"ListGrantsResponse",
|
|
180
|
+
"ManualApprovals",
|
|
181
|
+
"OperationMetadata",
|
|
182
|
+
"PrivilegedAccess",
|
|
183
|
+
"PrivilegedAccessManagerClient",
|
|
184
|
+
"RevokeGrantRequest",
|
|
185
|
+
"SearchEntitlementsRequest",
|
|
186
|
+
"SearchEntitlementsResponse",
|
|
187
|
+
"SearchGrantsRequest",
|
|
188
|
+
"SearchGrantsResponse",
|
|
189
|
+
"UpdateEntitlementRequest",
|
|
190
|
+
)
|
|
@@ -13,9 +13,10 @@
|
|
|
13
13
|
# See the License for the specific language governing permissions and
|
|
14
14
|
# limitations under the License.
|
|
15
15
|
#
|
|
16
|
-
from collections import OrderedDict
|
|
17
16
|
import logging as std_logging
|
|
18
17
|
import re
|
|
18
|
+
import uuid
|
|
19
|
+
from collections import OrderedDict
|
|
19
20
|
from typing import (
|
|
20
21
|
Callable,
|
|
21
22
|
Dict,
|
|
@@ -28,15 +29,14 @@ from typing import (
|
|
|
28
29
|
Type,
|
|
29
30
|
Union,
|
|
30
31
|
)
|
|
31
|
-
import uuid
|
|
32
32
|
|
|
33
|
+
import google.protobuf
|
|
33
34
|
from google.api_core import exceptions as core_exceptions
|
|
34
35
|
from google.api_core import gapic_v1
|
|
35
36
|
from google.api_core import retry_async as retries
|
|
36
37
|
from google.api_core.client_options import ClientOptions
|
|
37
38
|
from google.auth import credentials as ga_credentials # type: ignore
|
|
38
39
|
from google.oauth2 import service_account # type: ignore
|
|
39
|
-
import google.protobuf
|
|
40
40
|
|
|
41
41
|
from google.cloud.privilegedaccessmanager_v1 import gapic_version as package_version
|
|
42
42
|
|
|
@@ -45,13 +45,13 @@ try:
|
|
|
45
45
|
except AttributeError: # pragma: NO COVER
|
|
46
46
|
OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
import google.api_core.operation as operation # type: ignore
|
|
49
|
+
import google.api_core.operation_async as operation_async # type: ignore
|
|
50
|
+
import google.protobuf.duration_pb2 as duration_pb2 # type: ignore
|
|
51
|
+
import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore
|
|
52
|
+
import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore
|
|
50
53
|
from google.cloud.location import locations_pb2 # type: ignore
|
|
51
54
|
from google.longrunning import operations_pb2 # type: ignore
|
|
52
|
-
from google.protobuf import duration_pb2 # type: ignore
|
|
53
|
-
from google.protobuf import field_mask_pb2 # type: ignore
|
|
54
|
-
from google.protobuf import timestamp_pb2 # type: ignore
|
|
55
55
|
|
|
56
56
|
from google.cloud.privilegedaccessmanager_v1.services.privileged_access_manager import (
|
|
57
57
|
pagers,
|
|
@@ -156,7 +156,10 @@ class PrivilegedAccessManagerAsyncClient:
|
|
|
156
156
|
Returns:
|
|
157
157
|
PrivilegedAccessManagerAsyncClient: The constructed client.
|
|
158
158
|
"""
|
|
159
|
-
|
|
159
|
+
sa_info_func = (
|
|
160
|
+
PrivilegedAccessManagerClient.from_service_account_info.__func__ # type: ignore
|
|
161
|
+
)
|
|
162
|
+
return sa_info_func(PrivilegedAccessManagerAsyncClient, info, *args, **kwargs)
|
|
160
163
|
|
|
161
164
|
@classmethod
|
|
162
165
|
def from_service_account_file(cls, filename: str, *args, **kwargs):
|
|
@@ -172,7 +175,12 @@ class PrivilegedAccessManagerAsyncClient:
|
|
|
172
175
|
Returns:
|
|
173
176
|
PrivilegedAccessManagerAsyncClient: The constructed client.
|
|
174
177
|
"""
|
|
175
|
-
|
|
178
|
+
sa_file_func = (
|
|
179
|
+
PrivilegedAccessManagerClient.from_service_account_file.__func__ # type: ignore
|
|
180
|
+
)
|
|
181
|
+
return sa_file_func(
|
|
182
|
+
PrivilegedAccessManagerAsyncClient, filename, *args, **kwargs
|
|
183
|
+
)
|
|
176
184
|
|
|
177
185
|
from_service_account_json = from_service_account_file
|
|
178
186
|
|
|
@@ -210,7 +218,9 @@ class PrivilegedAccessManagerAsyncClient:
|
|
|
210
218
|
Raises:
|
|
211
219
|
google.auth.exceptions.MutualTLSChannelError: If any errors happen.
|
|
212
220
|
"""
|
|
213
|
-
return PrivilegedAccessManagerClient.get_mtls_endpoint_and_cert_source(
|
|
221
|
+
return PrivilegedAccessManagerClient.get_mtls_endpoint_and_cert_source(
|
|
222
|
+
client_options
|
|
223
|
+
) # type: ignore
|
|
214
224
|
|
|
215
225
|
@property
|
|
216
226
|
def transport(self) -> PrivilegedAccessManagerTransport:
|
|
@@ -222,7 +232,7 @@ class PrivilegedAccessManagerAsyncClient:
|
|
|
222
232
|
return self._client.transport
|
|
223
233
|
|
|
224
234
|
@property
|
|
225
|
-
def api_endpoint(self):
|
|
235
|
+
def api_endpoint(self) -> str:
|
|
226
236
|
"""Return the API endpoint used by the client instance.
|
|
227
237
|
|
|
228
238
|
Returns:
|
|
@@ -1968,7 +1978,7 @@ class PrivilegedAccessManagerAsyncClient:
|
|
|
1968
1978
|
|
|
1969
1979
|
async def list_operations(
|
|
1970
1980
|
self,
|
|
1971
|
-
request: Optional[operations_pb2.ListOperationsRequest] = None,
|
|
1981
|
+
request: Optional[Union[operations_pb2.ListOperationsRequest, dict]] = None,
|
|
1972
1982
|
*,
|
|
1973
1983
|
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
1974
1984
|
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
@@ -1994,8 +2004,12 @@ class PrivilegedAccessManagerAsyncClient:
|
|
|
1994
2004
|
# Create or coerce a protobuf request object.
|
|
1995
2005
|
# The request isn't a proto-plus wrapped type,
|
|
1996
2006
|
# so it must be constructed via keyword expansion.
|
|
1997
|
-
if
|
|
1998
|
-
|
|
2007
|
+
if request is None:
|
|
2008
|
+
request_pb = operations_pb2.ListOperationsRequest()
|
|
2009
|
+
elif isinstance(request, dict):
|
|
2010
|
+
request_pb = operations_pb2.ListOperationsRequest(**request)
|
|
2011
|
+
else:
|
|
2012
|
+
request_pb = request
|
|
1999
2013
|
|
|
2000
2014
|
# Wrap the RPC method; this adds retry and timeout information,
|
|
2001
2015
|
# and friendly error handling.
|
|
@@ -2004,7 +2018,7 @@ class PrivilegedAccessManagerAsyncClient:
|
|
|
2004
2018
|
# Certain fields should be provided within the metadata header;
|
|
2005
2019
|
# add these here.
|
|
2006
2020
|
metadata = tuple(metadata) + (
|
|
2007
|
-
gapic_v1.routing_header.to_grpc_metadata((("name",
|
|
2021
|
+
gapic_v1.routing_header.to_grpc_metadata((("name", request_pb.name),)),
|
|
2008
2022
|
)
|
|
2009
2023
|
|
|
2010
2024
|
# Validate the universe domain.
|
|
@@ -2012,7 +2026,7 @@ class PrivilegedAccessManagerAsyncClient:
|
|
|
2012
2026
|
|
|
2013
2027
|
# Send the request.
|
|
2014
2028
|
response = await rpc(
|
|
2015
|
-
|
|
2029
|
+
request_pb,
|
|
2016
2030
|
retry=retry,
|
|
2017
2031
|
timeout=timeout,
|
|
2018
2032
|
metadata=metadata,
|
|
@@ -2023,7 +2037,7 @@ class PrivilegedAccessManagerAsyncClient:
|
|
|
2023
2037
|
|
|
2024
2038
|
async def get_operation(
|
|
2025
2039
|
self,
|
|
2026
|
-
request: Optional[operations_pb2.GetOperationRequest] = None,
|
|
2040
|
+
request: Optional[Union[operations_pb2.GetOperationRequest, dict]] = None,
|
|
2027
2041
|
*,
|
|
2028
2042
|
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
2029
2043
|
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
@@ -2049,8 +2063,12 @@ class PrivilegedAccessManagerAsyncClient:
|
|
|
2049
2063
|
# Create or coerce a protobuf request object.
|
|
2050
2064
|
# The request isn't a proto-plus wrapped type,
|
|
2051
2065
|
# so it must be constructed via keyword expansion.
|
|
2052
|
-
if
|
|
2053
|
-
|
|
2066
|
+
if request is None:
|
|
2067
|
+
request_pb = operations_pb2.GetOperationRequest()
|
|
2068
|
+
elif isinstance(request, dict):
|
|
2069
|
+
request_pb = operations_pb2.GetOperationRequest(**request)
|
|
2070
|
+
else:
|
|
2071
|
+
request_pb = request
|
|
2054
2072
|
|
|
2055
2073
|
# Wrap the RPC method; this adds retry and timeout information,
|
|
2056
2074
|
# and friendly error handling.
|
|
@@ -2059,7 +2077,7 @@ class PrivilegedAccessManagerAsyncClient:
|
|
|
2059
2077
|
# Certain fields should be provided within the metadata header;
|
|
2060
2078
|
# add these here.
|
|
2061
2079
|
metadata = tuple(metadata) + (
|
|
2062
|
-
gapic_v1.routing_header.to_grpc_metadata((("name",
|
|
2080
|
+
gapic_v1.routing_header.to_grpc_metadata((("name", request_pb.name),)),
|
|
2063
2081
|
)
|
|
2064
2082
|
|
|
2065
2083
|
# Validate the universe domain.
|
|
@@ -2067,7 +2085,7 @@ class PrivilegedAccessManagerAsyncClient:
|
|
|
2067
2085
|
|
|
2068
2086
|
# Send the request.
|
|
2069
2087
|
response = await rpc(
|
|
2070
|
-
|
|
2088
|
+
request_pb,
|
|
2071
2089
|
retry=retry,
|
|
2072
2090
|
timeout=timeout,
|
|
2073
2091
|
metadata=metadata,
|
|
@@ -2078,7 +2096,7 @@ class PrivilegedAccessManagerAsyncClient:
|
|
|
2078
2096
|
|
|
2079
2097
|
async def delete_operation(
|
|
2080
2098
|
self,
|
|
2081
|
-
request: Optional[operations_pb2.DeleteOperationRequest] = None,
|
|
2099
|
+
request: Optional[Union[operations_pb2.DeleteOperationRequest, dict]] = None,
|
|
2082
2100
|
*,
|
|
2083
2101
|
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
2084
2102
|
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
@@ -2108,8 +2126,12 @@ class PrivilegedAccessManagerAsyncClient:
|
|
|
2108
2126
|
# Create or coerce a protobuf request object.
|
|
2109
2127
|
# The request isn't a proto-plus wrapped type,
|
|
2110
2128
|
# so it must be constructed via keyword expansion.
|
|
2111
|
-
if
|
|
2112
|
-
|
|
2129
|
+
if request is None:
|
|
2130
|
+
request_pb = operations_pb2.DeleteOperationRequest()
|
|
2131
|
+
elif isinstance(request, dict):
|
|
2132
|
+
request_pb = operations_pb2.DeleteOperationRequest(**request)
|
|
2133
|
+
else:
|
|
2134
|
+
request_pb = request
|
|
2113
2135
|
|
|
2114
2136
|
# Wrap the RPC method; this adds retry and timeout information,
|
|
2115
2137
|
# and friendly error handling.
|
|
@@ -2118,7 +2140,7 @@ class PrivilegedAccessManagerAsyncClient:
|
|
|
2118
2140
|
# Certain fields should be provided within the metadata header;
|
|
2119
2141
|
# add these here.
|
|
2120
2142
|
metadata = tuple(metadata) + (
|
|
2121
|
-
gapic_v1.routing_header.to_grpc_metadata((("name",
|
|
2143
|
+
gapic_v1.routing_header.to_grpc_metadata((("name", request_pb.name),)),
|
|
2122
2144
|
)
|
|
2123
2145
|
|
|
2124
2146
|
# Validate the universe domain.
|
|
@@ -2126,7 +2148,7 @@ class PrivilegedAccessManagerAsyncClient:
|
|
|
2126
2148
|
|
|
2127
2149
|
# Send the request.
|
|
2128
2150
|
await rpc(
|
|
2129
|
-
|
|
2151
|
+
request_pb,
|
|
2130
2152
|
retry=retry,
|
|
2131
2153
|
timeout=timeout,
|
|
2132
2154
|
metadata=metadata,
|
|
@@ -2134,7 +2156,7 @@ class PrivilegedAccessManagerAsyncClient:
|
|
|
2134
2156
|
|
|
2135
2157
|
async def get_location(
|
|
2136
2158
|
self,
|
|
2137
|
-
request: Optional[locations_pb2.GetLocationRequest] = None,
|
|
2159
|
+
request: Optional[Union[locations_pb2.GetLocationRequest, dict]] = None,
|
|
2138
2160
|
*,
|
|
2139
2161
|
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
2140
2162
|
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
@@ -2160,8 +2182,12 @@ class PrivilegedAccessManagerAsyncClient:
|
|
|
2160
2182
|
# Create or coerce a protobuf request object.
|
|
2161
2183
|
# The request isn't a proto-plus wrapped type,
|
|
2162
2184
|
# so it must be constructed via keyword expansion.
|
|
2163
|
-
if
|
|
2164
|
-
|
|
2185
|
+
if request is None:
|
|
2186
|
+
request_pb = locations_pb2.GetLocationRequest()
|
|
2187
|
+
elif isinstance(request, dict):
|
|
2188
|
+
request_pb = locations_pb2.GetLocationRequest(**request)
|
|
2189
|
+
else:
|
|
2190
|
+
request_pb = request
|
|
2165
2191
|
|
|
2166
2192
|
# Wrap the RPC method; this adds retry and timeout information,
|
|
2167
2193
|
# and friendly error handling.
|
|
@@ -2170,7 +2196,7 @@ class PrivilegedAccessManagerAsyncClient:
|
|
|
2170
2196
|
# Certain fields should be provided within the metadata header;
|
|
2171
2197
|
# add these here.
|
|
2172
2198
|
metadata = tuple(metadata) + (
|
|
2173
|
-
gapic_v1.routing_header.to_grpc_metadata((("name",
|
|
2199
|
+
gapic_v1.routing_header.to_grpc_metadata((("name", request_pb.name),)),
|
|
2174
2200
|
)
|
|
2175
2201
|
|
|
2176
2202
|
# Validate the universe domain.
|
|
@@ -2178,7 +2204,7 @@ class PrivilegedAccessManagerAsyncClient:
|
|
|
2178
2204
|
|
|
2179
2205
|
# Send the request.
|
|
2180
2206
|
response = await rpc(
|
|
2181
|
-
|
|
2207
|
+
request_pb,
|
|
2182
2208
|
retry=retry,
|
|
2183
2209
|
timeout=timeout,
|
|
2184
2210
|
metadata=metadata,
|
|
@@ -2189,7 +2215,7 @@ class PrivilegedAccessManagerAsyncClient:
|
|
|
2189
2215
|
|
|
2190
2216
|
async def list_locations(
|
|
2191
2217
|
self,
|
|
2192
|
-
request: Optional[locations_pb2.ListLocationsRequest] = None,
|
|
2218
|
+
request: Optional[Union[locations_pb2.ListLocationsRequest, dict]] = None,
|
|
2193
2219
|
*,
|
|
2194
2220
|
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
2195
2221
|
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
@@ -2215,8 +2241,12 @@ class PrivilegedAccessManagerAsyncClient:
|
|
|
2215
2241
|
# Create or coerce a protobuf request object.
|
|
2216
2242
|
# The request isn't a proto-plus wrapped type,
|
|
2217
2243
|
# so it must be constructed via keyword expansion.
|
|
2218
|
-
if
|
|
2219
|
-
|
|
2244
|
+
if request is None:
|
|
2245
|
+
request_pb = locations_pb2.ListLocationsRequest()
|
|
2246
|
+
elif isinstance(request, dict):
|
|
2247
|
+
request_pb = locations_pb2.ListLocationsRequest(**request)
|
|
2248
|
+
else:
|
|
2249
|
+
request_pb = request
|
|
2220
2250
|
|
|
2221
2251
|
# Wrap the RPC method; this adds retry and timeout information,
|
|
2222
2252
|
# and friendly error handling.
|
|
@@ -2225,7 +2255,7 @@ class PrivilegedAccessManagerAsyncClient:
|
|
|
2225
2255
|
# Certain fields should be provided within the metadata header;
|
|
2226
2256
|
# add these here.
|
|
2227
2257
|
metadata = tuple(metadata) + (
|
|
2228
|
-
gapic_v1.routing_header.to_grpc_metadata((("name",
|
|
2258
|
+
gapic_v1.routing_header.to_grpc_metadata((("name", request_pb.name),)),
|
|
2229
2259
|
)
|
|
2230
2260
|
|
|
2231
2261
|
# Validate the universe domain.
|
|
@@ -2233,7 +2263,7 @@ class PrivilegedAccessManagerAsyncClient:
|
|
|
2233
2263
|
|
|
2234
2264
|
# Send the request.
|
|
2235
2265
|
response = await rpc(
|
|
2236
|
-
|
|
2266
|
+
request_pb,
|
|
2237
2267
|
retry=retry,
|
|
2238
2268
|
timeout=timeout,
|
|
2239
2269
|
metadata=metadata,
|