@@ -228,6 +228,32 @@ def parse_crypto_key_path(path: str) -> Dict[str, str]:
228
228
)
229
229
return m .groupdict () if m else {}
230
230
231
+ @staticmethod
232
+ def crypto_key_version_path (
233
+ project : str ,
234
+ location : str ,
235
+ keyRing : str ,
236
+ cryptoKey : str ,
237
+ cryptoKeyVersion : str ,
238
+ ) -> str :
239
+ """Returns a fully-qualified crypto_key_version string."""
240
+ return "projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey}/cryptoKeyVersions/{cryptoKeyVersion}" .format (
241
+ project = project ,
242
+ location = location ,
243
+ keyRing = keyRing ,
244
+ cryptoKey = cryptoKey ,
245
+ cryptoKeyVersion = cryptoKeyVersion ,
246
+ )
247
+
248
+ @staticmethod
249
+ def parse_crypto_key_version_path (path : str ) -> Dict [str , str ]:
250
+ """Parses a crypto_key_version path into its component segments."""
251
+ m = re .match (
252
+ r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/keyRings/(?P<keyRing>.+?)/cryptoKeys/(?P<cryptoKey>.+?)/cryptoKeyVersions/(?P<cryptoKeyVersion>.+?)$" ,
253
+ path ,
254
+ )
255
+ return m .groupdict () if m else {}
256
+
231
257
@staticmethod
232
258
def workflow_path (
233
259
project : str ,
@@ -1415,6 +1441,107 @@ def sample_update_workflow():
1415
1441
# Done; return the response.
1416
1442
return response
1417
1443
1444
+ def list_workflow_revisions (
1445
+ self ,
1446
+ request : Optional [Union [workflows .ListWorkflowRevisionsRequest , dict ]] = None ,
1447
+ * ,
1448
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
1449
+ timeout : Union [float , object ] = gapic_v1 .method .DEFAULT ,
1450
+ metadata : Sequence [Tuple [str , Union [str , bytes ]]] = (),
1451
+ ) -> pagers .ListWorkflowRevisionsPager :
1452
+ r"""Lists revisions for a given workflow.
1453
+
1454
+ .. code-block:: python
1455
+
1456
+ # This snippet has been automatically generated and should be regarded as a
1457
+ # code template only.
1458
+ # It will require modifications to work:
1459
+ # - It may require correct/in-range values for request initialization.
1460
+ # - It may require specifying regional endpoints when creating the service
1461
+ # client as shown in:
1462
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
1463
+ from google.cloud import workflows_v1
1464
+
1465
+ def sample_list_workflow_revisions():
1466
+ # Create a client
1467
+ client = workflows_v1.WorkflowsClient()
1468
+
1469
+ # Initialize request argument(s)
1470
+ request = workflows_v1.ListWorkflowRevisionsRequest(
1471
+ name="name_value",
1472
+ )
1473
+
1474
+ # Make the request
1475
+ page_result = client.list_workflow_revisions(request=request)
1476
+
1477
+ # Handle the response
1478
+ for response in page_result:
1479
+ print(response)
1480
+
1481
+ Args:
1482
+ request (Union[google.cloud.workflows_v1.types.ListWorkflowRevisionsRequest, dict]):
1483
+ The request object. Request for the
1484
+ [ListWorkflowRevisions][google.cloud.workflows.v1.Workflows.ListWorkflowRevisions]
1485
+ method.
1486
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
1487
+ should be retried.
1488
+ timeout (float): The timeout for this request.
1489
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
1490
+ sent along with the request as metadata. Normally, each value must be of type `str`,
1491
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
1492
+ be of type `bytes`.
1493
+
1494
+ Returns:
1495
+ google.cloud.workflows_v1.services.workflows.pagers.ListWorkflowRevisionsPager:
1496
+ Response for the
1497
+ [ListWorkflowRevisions][google.cloud.workflows.v1.Workflows.ListWorkflowRevisions]
1498
+ method.
1499
+
1500
+ Iterating over this object will yield results and
1501
+ resolve additional pages automatically.
1502
+
1503
+ """
1504
+ # Create or coerce a protobuf request object.
1505
+ # - Use the request object if provided (there's no risk of modifying the input as
1506
+ # there are no flattened fields), or create one.
1507
+ if not isinstance (request , workflows .ListWorkflowRevisionsRequest ):
1508
+ request = workflows .ListWorkflowRevisionsRequest (request )
1509
+
1510
+ # Wrap the RPC method; this adds retry and timeout information,
1511
+ # and friendly error handling.
1512
+ rpc = self ._transport ._wrapped_methods [self ._transport .list_workflow_revisions ]
1513
+
1514
+ # Certain fields should be provided within the metadata header;
1515
+ # add these here.
1516
+ metadata = tuple (metadata ) + (
1517
+ gapic_v1 .routing_header .to_grpc_metadata ((("name" , request .name ),)),
1518
+ )
1519
+
1520
+ # Validate the universe domain.
1521
+ self ._validate_universe_domain ()
1522
+
1523
+ # Send the request.
1524
+ response = rpc (
1525
+ request ,
1526
+ retry = retry ,
1527
+ timeout = timeout ,
1528
+ metadata = metadata ,
1529
+ )
1530
+
1531
+ # This method is paged; wrap the response in a pager, which provides
1532
+ # an `__iter__` convenience method.
1533
+ response = pagers .ListWorkflowRevisionsPager (
1534
+ method = rpc ,
1535
+ request = request ,
1536
+ response = response ,
1537
+ retry = retry ,
1538
+ timeout = timeout ,
1539
+ metadata = metadata ,
1540
+ )
1541
+
1542
+ # Done; return the response.
1543
+ return response
1544
+
1418
1545
def __enter__ (self ) -> "WorkflowsClient" :
1419
1546
return self
1420
1547
0 commit comments