|
38 | 38 | from google.cloud.dialogflowcx_v3.types import agent
|
39 | 39 | from google.cloud.dialogflowcx_v3.types import agent as gcdc_agent
|
40 | 40 | from google.cloud.dialogflowcx_v3.types import flow
|
| 41 | +from google.cloud.location import locations_pb2 # type: ignore |
| 42 | +from google.longrunning import operations_pb2 |
41 | 43 | from google.protobuf import empty_pb2 # type: ignore
|
42 | 44 | from google.protobuf import field_mask_pb2 # type: ignore
|
43 | 45 | from google.protobuf import struct_pb2 # type: ignore
|
@@ -1157,6 +1159,276 @@ async def sample_get_agent_validation_result():
|
1157 | 1159 | # Done; return the response.
|
1158 | 1160 | return response
|
1159 | 1161 |
|
| 1162 | + async def list_operations( |
| 1163 | + self, |
| 1164 | + request: operations_pb2.ListOperationsRequest = None, |
| 1165 | + *, |
| 1166 | + retry: OptionalRetry = gapic_v1.method.DEFAULT, |
| 1167 | + timeout: float = None, |
| 1168 | + metadata: Sequence[Tuple[str, str]] = (), |
| 1169 | + ) -> operations_pb2.ListOperationsResponse: |
| 1170 | + r"""Lists operations that match the specified filter in the request. |
| 1171 | +
|
| 1172 | + Args: |
| 1173 | + request (:class:`~.operations_pb2.ListOperationsRequest`): |
| 1174 | + The request object. Request message for |
| 1175 | + `ListOperations` method. |
| 1176 | + retry (google.api_core.retry.Retry): Designation of what errors, |
| 1177 | + if any, should be retried. |
| 1178 | + timeout (float): The timeout for this request. |
| 1179 | + metadata (Sequence[Tuple[str, str]]): Strings which should be |
| 1180 | + sent along with the request as metadata. |
| 1181 | + Returns: |
| 1182 | + ~.operations_pb2.ListOperationsResponse: |
| 1183 | + Response message for ``ListOperations`` method. |
| 1184 | + """ |
| 1185 | + # Create or coerce a protobuf request object. |
| 1186 | + # The request isn't a proto-plus wrapped type, |
| 1187 | + # so it must be constructed via keyword expansion. |
| 1188 | + if isinstance(request, dict): |
| 1189 | + request = operations_pb2.ListOperationsRequest(**request) |
| 1190 | + |
| 1191 | + # Wrap the RPC method; this adds retry and timeout information, |
| 1192 | + # and friendly error handling. |
| 1193 | + rpc = gapic_v1.method.wrap_method( |
| 1194 | + self._client._transport.list_operations, |
| 1195 | + default_timeout=None, |
| 1196 | + client_info=DEFAULT_CLIENT_INFO, |
| 1197 | + ) |
| 1198 | + |
| 1199 | + # Certain fields should be provided within the metadata header; |
| 1200 | + # add these here. |
| 1201 | + metadata = tuple(metadata) + ( |
| 1202 | + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), |
| 1203 | + ) |
| 1204 | + |
| 1205 | + # Send the request. |
| 1206 | + response = await rpc( |
| 1207 | + request, |
| 1208 | + retry=retry, |
| 1209 | + timeout=timeout, |
| 1210 | + metadata=metadata, |
| 1211 | + ) |
| 1212 | + |
| 1213 | + # Done; return the response. |
| 1214 | + return response |
| 1215 | + |
| 1216 | + async def get_operation( |
| 1217 | + self, |
| 1218 | + request: operations_pb2.GetOperationRequest = None, |
| 1219 | + *, |
| 1220 | + retry: OptionalRetry = gapic_v1.method.DEFAULT, |
| 1221 | + timeout: float = None, |
| 1222 | + metadata: Sequence[Tuple[str, str]] = (), |
| 1223 | + ) -> operations_pb2.Operation: |
| 1224 | + r"""Gets the latest state of a long-running operation. |
| 1225 | +
|
| 1226 | + Args: |
| 1227 | + request (:class:`~.operations_pb2.GetOperationRequest`): |
| 1228 | + The request object. Request message for |
| 1229 | + `GetOperation` method. |
| 1230 | + retry (google.api_core.retry.Retry): Designation of what errors, |
| 1231 | + if any, should be retried. |
| 1232 | + timeout (float): The timeout for this request. |
| 1233 | + metadata (Sequence[Tuple[str, str]]): Strings which should be |
| 1234 | + sent along with the request as metadata. |
| 1235 | + Returns: |
| 1236 | + ~.operations_pb2.Operation: |
| 1237 | + An ``Operation`` object. |
| 1238 | + """ |
| 1239 | + # Create or coerce a protobuf request object. |
| 1240 | + # The request isn't a proto-plus wrapped type, |
| 1241 | + # so it must be constructed via keyword expansion. |
| 1242 | + if isinstance(request, dict): |
| 1243 | + request = operations_pb2.GetOperationRequest(**request) |
| 1244 | + |
| 1245 | + # Wrap the RPC method; this adds retry and timeout information, |
| 1246 | + # and friendly error handling. |
| 1247 | + rpc = gapic_v1.method.wrap_method( |
| 1248 | + self._client._transport.get_operation, |
| 1249 | + default_timeout=None, |
| 1250 | + client_info=DEFAULT_CLIENT_INFO, |
| 1251 | + ) |
| 1252 | + |
| 1253 | + # Certain fields should be provided within the metadata header; |
| 1254 | + # add these here. |
| 1255 | + metadata = tuple(metadata) + ( |
| 1256 | + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), |
| 1257 | + ) |
| 1258 | + |
| 1259 | + # Send the request. |
| 1260 | + response = await rpc( |
| 1261 | + request, |
| 1262 | + retry=retry, |
| 1263 | + timeout=timeout, |
| 1264 | + metadata=metadata, |
| 1265 | + ) |
| 1266 | + |
| 1267 | + # Done; return the response. |
| 1268 | + return response |
| 1269 | + |
| 1270 | + async def cancel_operation( |
| 1271 | + self, |
| 1272 | + request: operations_pb2.CancelOperationRequest = None, |
| 1273 | + *, |
| 1274 | + retry: OptionalRetry = gapic_v1.method.DEFAULT, |
| 1275 | + timeout: float = None, |
| 1276 | + metadata: Sequence[Tuple[str, str]] = (), |
| 1277 | + ) -> None: |
| 1278 | + r"""Starts asynchronous cancellation on a long-running operation. |
| 1279 | +
|
| 1280 | + The server makes a best effort to cancel the operation, but success |
| 1281 | + is not guaranteed. If the server doesn't support this method, it returns |
| 1282 | + `google.rpc.Code.UNIMPLEMENTED`. |
| 1283 | +
|
| 1284 | + Args: |
| 1285 | + request (:class:`~.operations_pb2.CancelOperationRequest`): |
| 1286 | + The request object. Request message for |
| 1287 | + `CancelOperation` method. |
| 1288 | + retry (google.api_core.retry.Retry): Designation of what errors, |
| 1289 | + if any, should be retried. |
| 1290 | + timeout (float): The timeout for this request. |
| 1291 | + metadata (Sequence[Tuple[str, str]]): Strings which should be |
| 1292 | + sent along with the request as metadata. |
| 1293 | + Returns: |
| 1294 | + None |
| 1295 | + """ |
| 1296 | + # Create or coerce a protobuf request object. |
| 1297 | + # The request isn't a proto-plus wrapped type, |
| 1298 | + # so it must be constructed via keyword expansion. |
| 1299 | + if isinstance(request, dict): |
| 1300 | + request = operations_pb2.CancelOperationRequest(**request) |
| 1301 | + |
| 1302 | + # Wrap the RPC method; this adds retry and timeout information, |
| 1303 | + # and friendly error handling. |
| 1304 | + rpc = gapic_v1.method.wrap_method( |
| 1305 | + self._client._transport.cancel_operation, |
| 1306 | + default_timeout=None, |
| 1307 | + client_info=DEFAULT_CLIENT_INFO, |
| 1308 | + ) |
| 1309 | + |
| 1310 | + # Certain fields should be provided within the metadata header; |
| 1311 | + # add these here. |
| 1312 | + metadata = tuple(metadata) + ( |
| 1313 | + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), |
| 1314 | + ) |
| 1315 | + |
| 1316 | + # Send the request. |
| 1317 | + await rpc( |
| 1318 | + request, |
| 1319 | + retry=retry, |
| 1320 | + timeout=timeout, |
| 1321 | + metadata=metadata, |
| 1322 | + ) |
| 1323 | + |
| 1324 | + async def get_location( |
| 1325 | + self, |
| 1326 | + request: locations_pb2.GetLocationRequest = None, |
| 1327 | + *, |
| 1328 | + retry: OptionalRetry = gapic_v1.method.DEFAULT, |
| 1329 | + timeout: float = None, |
| 1330 | + metadata: Sequence[Tuple[str, str]] = (), |
| 1331 | + ) -> locations_pb2.Location: |
| 1332 | + r"""Gets information about a location. |
| 1333 | +
|
| 1334 | + Args: |
| 1335 | + request (:class:`~.location_pb2.GetLocationRequest`): |
| 1336 | + The request object. Request message for |
| 1337 | + `GetLocation` method. |
| 1338 | + retry (google.api_core.retry.Retry): Designation of what errors, |
| 1339 | + if any, should be retried. |
| 1340 | + timeout (float): The timeout for this request. |
| 1341 | + metadata (Sequence[Tuple[str, str]]): Strings which should be |
| 1342 | + sent along with the request as metadata. |
| 1343 | + Returns: |
| 1344 | + ~.location_pb2.Location: |
| 1345 | + Location object. |
| 1346 | + """ |
| 1347 | + # Create or coerce a protobuf request object. |
| 1348 | + # The request isn't a proto-plus wrapped type, |
| 1349 | + # so it must be constructed via keyword expansion. |
| 1350 | + if isinstance(request, dict): |
| 1351 | + request = locations_pb2.GetLocationRequest(**request) |
| 1352 | + |
| 1353 | + # Wrap the RPC method; this adds retry and timeout information, |
| 1354 | + # and friendly error handling. |
| 1355 | + rpc = gapic_v1.method.wrap_method( |
| 1356 | + self._client._transport.get_location, |
| 1357 | + default_timeout=None, |
| 1358 | + client_info=DEFAULT_CLIENT_INFO, |
| 1359 | + ) |
| 1360 | + |
| 1361 | + # Certain fields should be provided within the metadata header; |
| 1362 | + # add these here. |
| 1363 | + metadata = tuple(metadata) + ( |
| 1364 | + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), |
| 1365 | + ) |
| 1366 | + |
| 1367 | + # Send the request. |
| 1368 | + response = await rpc( |
| 1369 | + request, |
| 1370 | + retry=retry, |
| 1371 | + timeout=timeout, |
| 1372 | + metadata=metadata, |
| 1373 | + ) |
| 1374 | + |
| 1375 | + # Done; return the response. |
| 1376 | + return response |
| 1377 | + |
| 1378 | + async def list_locations( |
| 1379 | + self, |
| 1380 | + request: locations_pb2.ListLocationsRequest = None, |
| 1381 | + *, |
| 1382 | + retry: OptionalRetry = gapic_v1.method.DEFAULT, |
| 1383 | + timeout: float = None, |
| 1384 | + metadata: Sequence[Tuple[str, str]] = (), |
| 1385 | + ) -> locations_pb2.ListLocationsResponse: |
| 1386 | + r"""Lists information about the supported locations for this service. |
| 1387 | +
|
| 1388 | + Args: |
| 1389 | + request (:class:`~.location_pb2.ListLocationsRequest`): |
| 1390 | + The request object. Request message for |
| 1391 | + `ListLocations` method. |
| 1392 | + retry (google.api_core.retry.Retry): Designation of what errors, |
| 1393 | + if any, should be retried. |
| 1394 | + timeout (float): The timeout for this request. |
| 1395 | + metadata (Sequence[Tuple[str, str]]): Strings which should be |
| 1396 | + sent along with the request as metadata. |
| 1397 | + Returns: |
| 1398 | + ~.location_pb2.ListLocationsResponse: |
| 1399 | + Response message for ``ListLocations`` method. |
| 1400 | + """ |
| 1401 | + # Create or coerce a protobuf request object. |
| 1402 | + # The request isn't a proto-plus wrapped type, |
| 1403 | + # so it must be constructed via keyword expansion. |
| 1404 | + if isinstance(request, dict): |
| 1405 | + request = locations_pb2.ListLocationsRequest(**request) |
| 1406 | + |
| 1407 | + # Wrap the RPC method; this adds retry and timeout information, |
| 1408 | + # and friendly error handling. |
| 1409 | + rpc = gapic_v1.method.wrap_method( |
| 1410 | + self._client._transport.list_locations, |
| 1411 | + default_timeout=None, |
| 1412 | + client_info=DEFAULT_CLIENT_INFO, |
| 1413 | + ) |
| 1414 | + |
| 1415 | + # Certain fields should be provided within the metadata header; |
| 1416 | + # add these here. |
| 1417 | + metadata = tuple(metadata) + ( |
| 1418 | + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), |
| 1419 | + ) |
| 1420 | + |
| 1421 | + # Send the request. |
| 1422 | + response = await rpc( |
| 1423 | + request, |
| 1424 | + retry=retry, |
| 1425 | + timeout=timeout, |
| 1426 | + metadata=metadata, |
| 1427 | + ) |
| 1428 | + |
| 1429 | + # Done; return the response. |
| 1430 | + return response |
| 1431 | + |
1160 | 1432 | async def __aenter__(self):
|
1161 | 1433 | return self
|
1162 | 1434 |
|
|
0 commit comments