|
45 | 45 | from google.api_core import operation # type: ignore
|
46 | 46 | from google.api_core import operation_async # type: ignore
|
47 | 47 | from google.cloud.location import locations_pb2 # type: ignore
|
48 |
| -from google.iam.v1 import iam_policy_pb2 # type: ignore |
49 |
| -from google.iam.v1 import policy_pb2 # type: ignore |
50 | 48 | from google.longrunning import operations_pb2
|
51 | 49 | from google.protobuf import empty_pb2 # type: ignore
|
52 | 50 | from google.protobuf import timestamp_pb2 # type: ignore
|
@@ -1146,306 +1144,6 @@ async def cancel_operation(
|
1146 | 1144 | metadata=metadata,
|
1147 | 1145 | )
|
1148 | 1146 |
|
1149 |
| - async def set_iam_policy( |
1150 |
| - self, |
1151 |
| - request: Optional[iam_policy_pb2.SetIamPolicyRequest] = None, |
1152 |
| - *, |
1153 |
| - retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1154 |
| - timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1155 |
| - metadata: Sequence[Tuple[str, str]] = (), |
1156 |
| - ) -> policy_pb2.Policy: |
1157 |
| - r"""Sets the IAM access control policy on the specified function. |
1158 |
| -
|
1159 |
| - Replaces any existing policy. |
1160 |
| -
|
1161 |
| - Args: |
1162 |
| - request (:class:`~.iam_policy_pb2.SetIamPolicyRequest`): |
1163 |
| - The request object. Request message for `SetIamPolicy` |
1164 |
| - method. |
1165 |
| - retry (google.api_core.retry.Retry): Designation of what errors, if any, |
1166 |
| - should be retried. |
1167 |
| - timeout (float): The timeout for this request. |
1168 |
| - metadata (Sequence[Tuple[str, str]]): Strings which should be |
1169 |
| - sent along with the request as metadata. |
1170 |
| - Returns: |
1171 |
| - ~.policy_pb2.Policy: |
1172 |
| - Defines an Identity and Access Management (IAM) policy. |
1173 |
| - It is used to specify access control policies for Cloud |
1174 |
| - Platform resources. |
1175 |
| - A ``Policy`` is a collection of ``bindings``. A |
1176 |
| - ``binding`` binds one or more ``members`` to a single |
1177 |
| - ``role``. Members can be user accounts, service |
1178 |
| - accounts, Google groups, and domains (such as G Suite). |
1179 |
| - A ``role`` is a named list of permissions (defined by |
1180 |
| - IAM or configured by users). A ``binding`` can |
1181 |
| - optionally specify a ``condition``, which is a logic |
1182 |
| - expression that further constrains the role binding |
1183 |
| - based on attributes about the request and/or target |
1184 |
| - resource. |
1185 |
| -
|
1186 |
| - **JSON Example** |
1187 |
| -
|
1188 |
| - :: |
1189 |
| -
|
1190 |
| - { |
1191 |
| - "bindings": [ |
1192 |
| - { |
1193 |
| - "role": "roles/resourcemanager.organizationAdmin", |
1194 |
| - "members": [ |
1195 |
| - |
1196 |
| - |
1197 |
| - "domain:google.com", |
1198 |
| - "serviceAccount:[email protected]" |
1199 |
| - ] |
1200 |
| - }, |
1201 |
| - { |
1202 |
| - "role": "roles/resourcemanager.organizationViewer", |
1203 |
| - "members": ["user:[email protected]"], |
1204 |
| - "condition": { |
1205 |
| - "title": "expirable access", |
1206 |
| - "description": "Does not grant access after Sep 2020", |
1207 |
| - "expression": "request.time < |
1208 |
| - timestamp('2020-10-01T00:00:00.000Z')", |
1209 |
| - } |
1210 |
| - } |
1211 |
| - ] |
1212 |
| - } |
1213 |
| -
|
1214 |
| - **YAML Example** |
1215 |
| -
|
1216 |
| - :: |
1217 |
| -
|
1218 |
| - bindings: |
1219 |
| - - members: |
1220 |
| - |
1221 |
| - |
1222 |
| - - domain:google.com |
1223 |
| - - serviceAccount:[email protected] |
1224 |
| - role: roles/resourcemanager.organizationAdmin |
1225 |
| - - members: |
1226 |
| - |
1227 |
| - role: roles/resourcemanager.organizationViewer |
1228 |
| - condition: |
1229 |
| - title: expirable access |
1230 |
| - description: Does not grant access after Sep 2020 |
1231 |
| - expression: request.time < timestamp('2020-10-01T00:00:00.000Z') |
1232 |
| -
|
1233 |
| - For a description of IAM and its features, see the `IAM |
1234 |
| - developer's |
1235 |
| - guide <https://cloud.google.com/iam/docs>`__. |
1236 |
| - """ |
1237 |
| - # Create or coerce a protobuf request object. |
1238 |
| - |
1239 |
| - # The request isn't a proto-plus wrapped type, |
1240 |
| - # so it must be constructed via keyword expansion. |
1241 |
| - if isinstance(request, dict): |
1242 |
| - request = iam_policy_pb2.SetIamPolicyRequest(**request) |
1243 |
| - |
1244 |
| - # Wrap the RPC method; this adds retry and timeout information, |
1245 |
| - # and friendly error handling. |
1246 |
| - rpc = gapic_v1.method.wrap_method( |
1247 |
| - self._client._transport.set_iam_policy, |
1248 |
| - default_timeout=None, |
1249 |
| - client_info=DEFAULT_CLIENT_INFO, |
1250 |
| - ) |
1251 |
| - |
1252 |
| - # Certain fields should be provided within the metadata header; |
1253 |
| - # add these here. |
1254 |
| - metadata = tuple(metadata) + ( |
1255 |
| - gapic_v1.routing_header.to_grpc_metadata((("resource", request.resource),)), |
1256 |
| - ) |
1257 |
| - |
1258 |
| - # Send the request. |
1259 |
| - response = await rpc( |
1260 |
| - request, |
1261 |
| - retry=retry, |
1262 |
| - timeout=timeout, |
1263 |
| - metadata=metadata, |
1264 |
| - ) |
1265 |
| - |
1266 |
| - # Done; return the response. |
1267 |
| - return response |
1268 |
| - |
1269 |
| - async def get_iam_policy( |
1270 |
| - self, |
1271 |
| - request: Optional[iam_policy_pb2.GetIamPolicyRequest] = None, |
1272 |
| - *, |
1273 |
| - retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1274 |
| - timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1275 |
| - metadata: Sequence[Tuple[str, str]] = (), |
1276 |
| - ) -> policy_pb2.Policy: |
1277 |
| - r"""Gets the IAM access control policy for a function. |
1278 |
| -
|
1279 |
| - Returns an empty policy if the function exists and does not have a |
1280 |
| - policy set. |
1281 |
| -
|
1282 |
| - Args: |
1283 |
| - request (:class:`~.iam_policy_pb2.GetIamPolicyRequest`): |
1284 |
| - The request object. Request message for `GetIamPolicy` |
1285 |
| - method. |
1286 |
| - retry (google.api_core.retry.Retry): Designation of what errors, if |
1287 |
| - any, should be retried. |
1288 |
| - timeout (float): The timeout for this request. |
1289 |
| - metadata (Sequence[Tuple[str, str]]): Strings which should be |
1290 |
| - sent along with the request as metadata. |
1291 |
| - Returns: |
1292 |
| - ~.policy_pb2.Policy: |
1293 |
| - Defines an Identity and Access Management (IAM) policy. |
1294 |
| - It is used to specify access control policies for Cloud |
1295 |
| - Platform resources. |
1296 |
| - A ``Policy`` is a collection of ``bindings``. A |
1297 |
| - ``binding`` binds one or more ``members`` to a single |
1298 |
| - ``role``. Members can be user accounts, service |
1299 |
| - accounts, Google groups, and domains (such as G Suite). |
1300 |
| - A ``role`` is a named list of permissions (defined by |
1301 |
| - IAM or configured by users). A ``binding`` can |
1302 |
| - optionally specify a ``condition``, which is a logic |
1303 |
| - expression that further constrains the role binding |
1304 |
| - based on attributes about the request and/or target |
1305 |
| - resource. |
1306 |
| -
|
1307 |
| - **JSON Example** |
1308 |
| -
|
1309 |
| - :: |
1310 |
| -
|
1311 |
| - { |
1312 |
| - "bindings": [ |
1313 |
| - { |
1314 |
| - "role": "roles/resourcemanager.organizationAdmin", |
1315 |
| - "members": [ |
1316 |
| - |
1317 |
| - |
1318 |
| - "domain:google.com", |
1319 |
| - "serviceAccount:[email protected]" |
1320 |
| - ] |
1321 |
| - }, |
1322 |
| - { |
1323 |
| - "role": "roles/resourcemanager.organizationViewer", |
1324 |
| - "members": ["user:[email protected]"], |
1325 |
| - "condition": { |
1326 |
| - "title": "expirable access", |
1327 |
| - "description": "Does not grant access after Sep 2020", |
1328 |
| - "expression": "request.time < |
1329 |
| - timestamp('2020-10-01T00:00:00.000Z')", |
1330 |
| - } |
1331 |
| - } |
1332 |
| - ] |
1333 |
| - } |
1334 |
| -
|
1335 |
| - **YAML Example** |
1336 |
| -
|
1337 |
| - :: |
1338 |
| -
|
1339 |
| - bindings: |
1340 |
| - - members: |
1341 |
| - |
1342 |
| - |
1343 |
| - - domain:google.com |
1344 |
| - - serviceAccount:[email protected] |
1345 |
| - role: roles/resourcemanager.organizationAdmin |
1346 |
| - - members: |
1347 |
| - |
1348 |
| - role: roles/resourcemanager.organizationViewer |
1349 |
| - condition: |
1350 |
| - title: expirable access |
1351 |
| - description: Does not grant access after Sep 2020 |
1352 |
| - expression: request.time < timestamp('2020-10-01T00:00:00.000Z') |
1353 |
| -
|
1354 |
| - For a description of IAM and its features, see the `IAM |
1355 |
| - developer's |
1356 |
| - guide <https://cloud.google.com/iam/docs>`__. |
1357 |
| - """ |
1358 |
| - # Create or coerce a protobuf request object. |
1359 |
| - |
1360 |
| - # The request isn't a proto-plus wrapped type, |
1361 |
| - # so it must be constructed via keyword expansion. |
1362 |
| - if isinstance(request, dict): |
1363 |
| - request = iam_policy_pb2.GetIamPolicyRequest(**request) |
1364 |
| - |
1365 |
| - # Wrap the RPC method; this adds retry and timeout information, |
1366 |
| - # and friendly error handling. |
1367 |
| - rpc = gapic_v1.method.wrap_method( |
1368 |
| - self._client._transport.get_iam_policy, |
1369 |
| - default_timeout=None, |
1370 |
| - client_info=DEFAULT_CLIENT_INFO, |
1371 |
| - ) |
1372 |
| - |
1373 |
| - # Certain fields should be provided within the metadata header; |
1374 |
| - # add these here. |
1375 |
| - metadata = tuple(metadata) + ( |
1376 |
| - gapic_v1.routing_header.to_grpc_metadata((("resource", request.resource),)), |
1377 |
| - ) |
1378 |
| - |
1379 |
| - # Send the request. |
1380 |
| - response = await rpc( |
1381 |
| - request, |
1382 |
| - retry=retry, |
1383 |
| - timeout=timeout, |
1384 |
| - metadata=metadata, |
1385 |
| - ) |
1386 |
| - |
1387 |
| - # Done; return the response. |
1388 |
| - return response |
1389 |
| - |
1390 |
| - async def test_iam_permissions( |
1391 |
| - self, |
1392 |
| - request: Optional[iam_policy_pb2.TestIamPermissionsRequest] = None, |
1393 |
| - *, |
1394 |
| - retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1395 |
| - timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1396 |
| - metadata: Sequence[Tuple[str, str]] = (), |
1397 |
| - ) -> iam_policy_pb2.TestIamPermissionsResponse: |
1398 |
| - r"""Tests the specified IAM permissions against the IAM access control |
1399 |
| - policy for a function. |
1400 |
| -
|
1401 |
| - If the function does not exist, this will return an empty set |
1402 |
| - of permissions, not a NOT_FOUND error. |
1403 |
| -
|
1404 |
| - Args: |
1405 |
| - request (:class:`~.iam_policy_pb2.TestIamPermissionsRequest`): |
1406 |
| - The request object. Request message for |
1407 |
| - `TestIamPermissions` method. |
1408 |
| - retry (google.api_core.retry.Retry): Designation of what errors, |
1409 |
| - if any, should be retried. |
1410 |
| - timeout (float): The timeout for this request. |
1411 |
| - metadata (Sequence[Tuple[str, str]]): Strings which should be |
1412 |
| - sent along with the request as metadata. |
1413 |
| - Returns: |
1414 |
| - ~.iam_policy_pb2.TestIamPermissionsResponse: |
1415 |
| - Response message for ``TestIamPermissions`` method. |
1416 |
| - """ |
1417 |
| - # Create or coerce a protobuf request object. |
1418 |
| - |
1419 |
| - # The request isn't a proto-plus wrapped type, |
1420 |
| - # so it must be constructed via keyword expansion. |
1421 |
| - if isinstance(request, dict): |
1422 |
| - request = iam_policy_pb2.TestIamPermissionsRequest(**request) |
1423 |
| - |
1424 |
| - # Wrap the RPC method; this adds retry and timeout information, |
1425 |
| - # and friendly error handling. |
1426 |
| - rpc = gapic_v1.method.wrap_method( |
1427 |
| - self._client._transport.test_iam_permissions, |
1428 |
| - default_timeout=None, |
1429 |
| - client_info=DEFAULT_CLIENT_INFO, |
1430 |
| - ) |
1431 |
| - |
1432 |
| - # Certain fields should be provided within the metadata header; |
1433 |
| - # add these here. |
1434 |
| - metadata = tuple(metadata) + ( |
1435 |
| - gapic_v1.routing_header.to_grpc_metadata((("resource", request.resource),)), |
1436 |
| - ) |
1437 |
| - |
1438 |
| - # Send the request. |
1439 |
| - response = await rpc( |
1440 |
| - request, |
1441 |
| - retry=retry, |
1442 |
| - timeout=timeout, |
1443 |
| - metadata=metadata, |
1444 |
| - ) |
1445 |
| - |
1446 |
| - # Done; return the response. |
1447 |
| - return response |
1448 |
| - |
1449 | 1147 | async def get_location(
|
1450 | 1148 | self,
|
1451 | 1149 | request: Optional[locations_pb2.GetLocationRequest] = None,
|
|
0 commit comments