strongdm 6.8.0 → 7.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/.git/ORIG_HEAD +1 -1
  3. data/.git/index +0 -0
  4. data/.git/logs/HEAD +3 -3
  5. data/.git/logs/refs/heads/master +2 -2
  6. data/.git/logs/refs/remotes/origin/HEAD +1 -1
  7. data/.git/objects/pack/{pack-8e713d387f255f0ec0181dce3e2a505478deb064.idx → pack-35100f17336a9a56e777373870676ef90dc420dc.idx} +0 -0
  8. data/.git/objects/pack/{pack-8e713d387f255f0ec0181dce3e2a505478deb064.pack → pack-35100f17336a9a56e777373870676ef90dc420dc.pack} +0 -0
  9. data/.git/packed-refs +4 -2
  10. data/.git/refs/heads/master +1 -1
  11. data/lib/constants.rb +1 -0
  12. data/lib/grpc/accounts_pb.rb +2 -0
  13. data/lib/grpc/approval_workflow_approvers_history_pb.rb +49 -0
  14. data/lib/grpc/approval_workflow_approvers_history_services_pb.rb +37 -0
  15. data/lib/grpc/approval_workflow_approvers_pb.rb +81 -0
  16. data/lib/grpc/approval_workflow_approvers_services_pb.rb +43 -0
  17. data/lib/grpc/approval_workflow_steps_history_pb.rb +49 -0
  18. data/lib/grpc/approval_workflow_steps_history_services_pb.rb +37 -0
  19. data/lib/grpc/approval_workflow_steps_pb.rb +78 -0
  20. data/lib/grpc/approval_workflow_steps_services_pb.rb +43 -0
  21. data/lib/grpc/approval_workflows_history_pb.rb +49 -0
  22. data/lib/grpc/approval_workflows_history_services_pb.rb +37 -0
  23. data/lib/grpc/approval_workflows_pb.rb +91 -0
  24. data/lib/grpc/approval_workflows_services_pb.rb +46 -0
  25. data/lib/grpc/plumbing.rb +716 -62
  26. data/lib/models/porcelain.rb +516 -2
  27. data/lib/strongdm.rb +55 -2
  28. data/lib/svc.rb +738 -0
  29. data/lib/version +1 -1
  30. data/lib/version.rb +1 -1
  31. metadata +16 -4
data/lib/svc.rb CHANGED
@@ -1265,6 +1265,744 @@ module SDM #:nodoc:
1265
1265
  end
1266
1266
  end
1267
1267
 
1268
+ # ApprovalWorkflowApprovers link approval workflow approvers to an ApprovalWorkflowStep
1269
+ #
1270
+ # See {ApprovalWorkflowApprover}.
1271
+ class ApprovalWorkflowApprovers
1272
+ extend Gem::Deprecate
1273
+
1274
+ def initialize(channel, parent)
1275
+ begin
1276
+ @stub = V1::ApprovalWorkflowApprovers::Stub.new(nil, nil, channel_override: channel)
1277
+ rescue => exception
1278
+ raise Plumbing::convert_error_to_porcelain(exception)
1279
+ end
1280
+ @parent = parent
1281
+ end
1282
+
1283
+ # Create creates a new approval workflow approver.
1284
+ def create(
1285
+ approval_workflow_approver,
1286
+ deadline: nil
1287
+ )
1288
+ req = V1::ApprovalWorkflowApproverCreateRequest.new()
1289
+
1290
+ req.approval_workflow_approver = Plumbing::convert_approval_workflow_approver_to_plumbing(approval_workflow_approver)
1291
+ tries = 0
1292
+ plumbing_response = nil
1293
+ loop do
1294
+ begin
1295
+ plumbing_response = @stub.create(req, metadata: @parent.get_metadata("ApprovalWorkflowApprovers.Create", req), deadline: deadline)
1296
+ rescue => exception
1297
+ if (@parent.shouldRetry(tries, exception))
1298
+ tries + +@parent.jitterSleep(tries)
1299
+ next
1300
+ end
1301
+ raise Plumbing::convert_error_to_porcelain(exception)
1302
+ end
1303
+ break
1304
+ end
1305
+
1306
+ resp = ApprovalWorkflowApproverCreateResponse.new()
1307
+ resp.approval_workflow_approver = Plumbing::convert_approval_workflow_approver_to_porcelain(plumbing_response.approval_workflow_approver)
1308
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1309
+ resp
1310
+ end
1311
+
1312
+ # Get reads one approval workflow approver by ID.
1313
+ def get(
1314
+ id,
1315
+ deadline: nil
1316
+ )
1317
+ req = V1::ApprovalWorkflowApproverGetRequest.new()
1318
+ if not @parent.snapshot_time.nil?
1319
+ req.meta = V1::GetRequestMetadata.new()
1320
+ req.meta.snapshot_at = @parent.snapshot_time
1321
+ end
1322
+
1323
+ req.id = (id)
1324
+ tries = 0
1325
+ plumbing_response = nil
1326
+ loop do
1327
+ begin
1328
+ plumbing_response = @stub.get(req, metadata: @parent.get_metadata("ApprovalWorkflowApprovers.Get", req), deadline: deadline)
1329
+ rescue => exception
1330
+ if (@parent.shouldRetry(tries, exception))
1331
+ tries + +@parent.jitterSleep(tries)
1332
+ next
1333
+ end
1334
+ raise Plumbing::convert_error_to_porcelain(exception)
1335
+ end
1336
+ break
1337
+ end
1338
+
1339
+ resp = ApprovalWorkflowApproverGetResponse.new()
1340
+ resp.approval_workflow_approver = Plumbing::convert_approval_workflow_approver_to_porcelain(plumbing_response.approval_workflow_approver)
1341
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
1342
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1343
+ resp
1344
+ end
1345
+
1346
+ # Delete deletes an existing approval workflow approver.
1347
+ def delete(
1348
+ id,
1349
+ deadline: nil
1350
+ )
1351
+ req = V1::ApprovalWorkflowApproverDeleteRequest.new()
1352
+
1353
+ req.id = (id)
1354
+ tries = 0
1355
+ plumbing_response = nil
1356
+ loop do
1357
+ begin
1358
+ plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("ApprovalWorkflowApprovers.Delete", req), deadline: deadline)
1359
+ rescue => exception
1360
+ if (@parent.shouldRetry(tries, exception))
1361
+ tries + +@parent.jitterSleep(tries)
1362
+ next
1363
+ end
1364
+ raise Plumbing::convert_error_to_porcelain(exception)
1365
+ end
1366
+ break
1367
+ end
1368
+
1369
+ resp = ApprovalWorkflowApproverDeleteResponse.new()
1370
+ resp.id = (plumbing_response.id)
1371
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1372
+ resp
1373
+ end
1374
+
1375
+ # Lists existing approval workflow approvers.
1376
+ def list(
1377
+ filter,
1378
+ *args,
1379
+ deadline: nil
1380
+ )
1381
+ req = V1::ApprovalWorkflowApproverListRequest.new()
1382
+ req.meta = V1::ListRequestMetadata.new()
1383
+ if @parent.page_limit > 0
1384
+ req.meta.limit = @parent.page_limit
1385
+ end
1386
+ if not @parent.snapshot_time.nil?
1387
+ req.meta.snapshot_at = @parent.snapshot_time
1388
+ end
1389
+
1390
+ req.filter = Plumbing::quote_filter_args(filter, *args)
1391
+ resp = Enumerator::Generator.new { |g|
1392
+ tries = 0
1393
+ loop do
1394
+ begin
1395
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata("ApprovalWorkflowApprovers.List", req), deadline: deadline)
1396
+ rescue => exception
1397
+ if (@parent.shouldRetry(tries, exception))
1398
+ tries + +@parent.jitterSleep(tries)
1399
+ next
1400
+ end
1401
+ raise Plumbing::convert_error_to_porcelain(exception)
1402
+ end
1403
+ tries = 0
1404
+ plumbing_response.approval_workflow_approvers.each do |plumbing_item|
1405
+ g.yield Plumbing::convert_approval_workflow_approver_to_porcelain(plumbing_item)
1406
+ end
1407
+ break if plumbing_response.meta.next_cursor == ""
1408
+ req.meta.cursor = plumbing_response.meta.next_cursor
1409
+ end
1410
+ }
1411
+ resp
1412
+ end
1413
+ end
1414
+
1415
+ # SnapshotApprovalWorkflowApprovers exposes the read only methods of the ApprovalWorkflowApprovers
1416
+ # service for historical queries.
1417
+ class SnapshotApprovalWorkflowApprovers
1418
+ extend Gem::Deprecate
1419
+
1420
+ def initialize(approval_workflow_approvers)
1421
+ @approval_workflow_approvers = approval_workflow_approvers
1422
+ end
1423
+
1424
+ # Get reads one approval workflow approver by ID.
1425
+ def get(
1426
+ id,
1427
+ deadline: nil
1428
+ )
1429
+ return @approval_workflow_approvers.get(
1430
+ id,
1431
+ deadline: deadline,
1432
+ )
1433
+ end
1434
+
1435
+ # Lists existing approval workflow approvers.
1436
+ def list(
1437
+ filter,
1438
+ *args,
1439
+ deadline: nil
1440
+ )
1441
+ return @approval_workflow_approvers.list(
1442
+ filter,
1443
+ *args,
1444
+ deadline: deadline,
1445
+ )
1446
+ end
1447
+ end
1448
+
1449
+ # ApprovalWorkflowApproversHistory records all changes to the state of an ApprovalWorkflowApprover.
1450
+ #
1451
+ # See {ApprovalWorkflowApproverHistory}.
1452
+ class ApprovalWorkflowApproversHistory
1453
+ extend Gem::Deprecate
1454
+
1455
+ def initialize(channel, parent)
1456
+ begin
1457
+ @stub = V1::ApprovalWorkflowApproversHistory::Stub.new(nil, nil, channel_override: channel)
1458
+ rescue => exception
1459
+ raise Plumbing::convert_error_to_porcelain(exception)
1460
+ end
1461
+ @parent = parent
1462
+ end
1463
+
1464
+ # List gets a list of ApprovalWorkflowApproverHistory records matching a given set of criteria.
1465
+ def list(
1466
+ filter,
1467
+ *args,
1468
+ deadline: nil
1469
+ )
1470
+ req = V1::ApprovalWorkflowApproverHistoryListRequest.new()
1471
+ req.meta = V1::ListRequestMetadata.new()
1472
+ if @parent.page_limit > 0
1473
+ req.meta.limit = @parent.page_limit
1474
+ end
1475
+ if not @parent.snapshot_time.nil?
1476
+ req.meta.snapshot_at = @parent.snapshot_time
1477
+ end
1478
+
1479
+ req.filter = Plumbing::quote_filter_args(filter, *args)
1480
+ resp = Enumerator::Generator.new { |g|
1481
+ tries = 0
1482
+ loop do
1483
+ begin
1484
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata("ApprovalWorkflowApproversHistory.List", req), deadline: deadline)
1485
+ rescue => exception
1486
+ if (@parent.shouldRetry(tries, exception))
1487
+ tries + +@parent.jitterSleep(tries)
1488
+ next
1489
+ end
1490
+ raise Plumbing::convert_error_to_porcelain(exception)
1491
+ end
1492
+ tries = 0
1493
+ plumbing_response.history.each do |plumbing_item|
1494
+ g.yield Plumbing::convert_approval_workflow_approver_history_to_porcelain(plumbing_item)
1495
+ end
1496
+ break if plumbing_response.meta.next_cursor == ""
1497
+ req.meta.cursor = plumbing_response.meta.next_cursor
1498
+ end
1499
+ }
1500
+ resp
1501
+ end
1502
+ end
1503
+
1504
+ # ApprovalWorkflowSteps link approval workflow steps to an ApprovalWorkflow
1505
+ #
1506
+ # See {ApprovalWorkflowStep}.
1507
+ class ApprovalWorkflowSteps
1508
+ extend Gem::Deprecate
1509
+
1510
+ def initialize(channel, parent)
1511
+ begin
1512
+ @stub = V1::ApprovalWorkflowSteps::Stub.new(nil, nil, channel_override: channel)
1513
+ rescue => exception
1514
+ raise Plumbing::convert_error_to_porcelain(exception)
1515
+ end
1516
+ @parent = parent
1517
+ end
1518
+
1519
+ # Create creates a new approval workflow step.
1520
+ def create(
1521
+ approval_workflow_step,
1522
+ deadline: nil
1523
+ )
1524
+ req = V1::ApprovalWorkflowStepCreateRequest.new()
1525
+
1526
+ req.approval_workflow_step = Plumbing::convert_approval_workflow_step_to_plumbing(approval_workflow_step)
1527
+ tries = 0
1528
+ plumbing_response = nil
1529
+ loop do
1530
+ begin
1531
+ plumbing_response = @stub.create(req, metadata: @parent.get_metadata("ApprovalWorkflowSteps.Create", req), deadline: deadline)
1532
+ rescue => exception
1533
+ if (@parent.shouldRetry(tries, exception))
1534
+ tries + +@parent.jitterSleep(tries)
1535
+ next
1536
+ end
1537
+ raise Plumbing::convert_error_to_porcelain(exception)
1538
+ end
1539
+ break
1540
+ end
1541
+
1542
+ resp = ApprovalWorkflowStepCreateResponse.new()
1543
+ resp.approval_workflow_step = Plumbing::convert_approval_workflow_step_to_porcelain(plumbing_response.approval_workflow_step)
1544
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1545
+ resp
1546
+ end
1547
+
1548
+ # Get reads one approval workflow step by ID.
1549
+ def get(
1550
+ id,
1551
+ deadline: nil
1552
+ )
1553
+ req = V1::ApprovalWorkflowStepGetRequest.new()
1554
+ if not @parent.snapshot_time.nil?
1555
+ req.meta = V1::GetRequestMetadata.new()
1556
+ req.meta.snapshot_at = @parent.snapshot_time
1557
+ end
1558
+
1559
+ req.id = (id)
1560
+ tries = 0
1561
+ plumbing_response = nil
1562
+ loop do
1563
+ begin
1564
+ plumbing_response = @stub.get(req, metadata: @parent.get_metadata("ApprovalWorkflowSteps.Get", req), deadline: deadline)
1565
+ rescue => exception
1566
+ if (@parent.shouldRetry(tries, exception))
1567
+ tries + +@parent.jitterSleep(tries)
1568
+ next
1569
+ end
1570
+ raise Plumbing::convert_error_to_porcelain(exception)
1571
+ end
1572
+ break
1573
+ end
1574
+
1575
+ resp = ApprovalWorkflowStepGetResponse.new()
1576
+ resp.approval_workflow_step = Plumbing::convert_approval_workflow_step_to_porcelain(plumbing_response.approval_workflow_step)
1577
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
1578
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1579
+ resp
1580
+ end
1581
+
1582
+ # Delete deletes an existing approval workflow step.
1583
+ def delete(
1584
+ id,
1585
+ deadline: nil
1586
+ )
1587
+ req = V1::ApprovalWorkflowStepDeleteRequest.new()
1588
+
1589
+ req.id = (id)
1590
+ tries = 0
1591
+ plumbing_response = nil
1592
+ loop do
1593
+ begin
1594
+ plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("ApprovalWorkflowSteps.Delete", req), deadline: deadline)
1595
+ rescue => exception
1596
+ if (@parent.shouldRetry(tries, exception))
1597
+ tries + +@parent.jitterSleep(tries)
1598
+ next
1599
+ end
1600
+ raise Plumbing::convert_error_to_porcelain(exception)
1601
+ end
1602
+ break
1603
+ end
1604
+
1605
+ resp = ApprovalWorkflowStepDeleteResponse.new()
1606
+ resp.id = (plumbing_response.id)
1607
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1608
+ resp
1609
+ end
1610
+
1611
+ # Lists existing approval workflow steps.
1612
+ def list(
1613
+ filter,
1614
+ *args,
1615
+ deadline: nil
1616
+ )
1617
+ req = V1::ApprovalWorkflowStepListRequest.new()
1618
+ req.meta = V1::ListRequestMetadata.new()
1619
+ if @parent.page_limit > 0
1620
+ req.meta.limit = @parent.page_limit
1621
+ end
1622
+ if not @parent.snapshot_time.nil?
1623
+ req.meta.snapshot_at = @parent.snapshot_time
1624
+ end
1625
+
1626
+ req.filter = Plumbing::quote_filter_args(filter, *args)
1627
+ resp = Enumerator::Generator.new { |g|
1628
+ tries = 0
1629
+ loop do
1630
+ begin
1631
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata("ApprovalWorkflowSteps.List", req), deadline: deadline)
1632
+ rescue => exception
1633
+ if (@parent.shouldRetry(tries, exception))
1634
+ tries + +@parent.jitterSleep(tries)
1635
+ next
1636
+ end
1637
+ raise Plumbing::convert_error_to_porcelain(exception)
1638
+ end
1639
+ tries = 0
1640
+ plumbing_response.approval_workflow_steps.each do |plumbing_item|
1641
+ g.yield Plumbing::convert_approval_workflow_step_to_porcelain(plumbing_item)
1642
+ end
1643
+ break if plumbing_response.meta.next_cursor == ""
1644
+ req.meta.cursor = plumbing_response.meta.next_cursor
1645
+ end
1646
+ }
1647
+ resp
1648
+ end
1649
+ end
1650
+
1651
+ # SnapshotApprovalWorkflowSteps exposes the read only methods of the ApprovalWorkflowSteps
1652
+ # service for historical queries.
1653
+ class SnapshotApprovalWorkflowSteps
1654
+ extend Gem::Deprecate
1655
+
1656
+ def initialize(approval_workflow_steps)
1657
+ @approval_workflow_steps = approval_workflow_steps
1658
+ end
1659
+
1660
+ # Get reads one approval workflow step by ID.
1661
+ def get(
1662
+ id,
1663
+ deadline: nil
1664
+ )
1665
+ return @approval_workflow_steps.get(
1666
+ id,
1667
+ deadline: deadline,
1668
+ )
1669
+ end
1670
+
1671
+ # Lists existing approval workflow steps.
1672
+ def list(
1673
+ filter,
1674
+ *args,
1675
+ deadline: nil
1676
+ )
1677
+ return @approval_workflow_steps.list(
1678
+ filter,
1679
+ *args,
1680
+ deadline: deadline,
1681
+ )
1682
+ end
1683
+ end
1684
+
1685
+ # ApprovalWorkflowStepsHistory records all changes to the state of an ApprovalWorkflowStep.
1686
+ #
1687
+ # See {ApprovalWorkflowStepHistory}.
1688
+ class ApprovalWorkflowStepsHistory
1689
+ extend Gem::Deprecate
1690
+
1691
+ def initialize(channel, parent)
1692
+ begin
1693
+ @stub = V1::ApprovalWorkflowStepsHistory::Stub.new(nil, nil, channel_override: channel)
1694
+ rescue => exception
1695
+ raise Plumbing::convert_error_to_porcelain(exception)
1696
+ end
1697
+ @parent = parent
1698
+ end
1699
+
1700
+ # List gets a list of ApprovalWorkflowStepHistory records matching a given set of criteria.
1701
+ def list(
1702
+ filter,
1703
+ *args,
1704
+ deadline: nil
1705
+ )
1706
+ req = V1::ApprovalWorkflowStepHistoryListRequest.new()
1707
+ req.meta = V1::ListRequestMetadata.new()
1708
+ if @parent.page_limit > 0
1709
+ req.meta.limit = @parent.page_limit
1710
+ end
1711
+ if not @parent.snapshot_time.nil?
1712
+ req.meta.snapshot_at = @parent.snapshot_time
1713
+ end
1714
+
1715
+ req.filter = Plumbing::quote_filter_args(filter, *args)
1716
+ resp = Enumerator::Generator.new { |g|
1717
+ tries = 0
1718
+ loop do
1719
+ begin
1720
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata("ApprovalWorkflowStepsHistory.List", req), deadline: deadline)
1721
+ rescue => exception
1722
+ if (@parent.shouldRetry(tries, exception))
1723
+ tries + +@parent.jitterSleep(tries)
1724
+ next
1725
+ end
1726
+ raise Plumbing::convert_error_to_porcelain(exception)
1727
+ end
1728
+ tries = 0
1729
+ plumbing_response.history.each do |plumbing_item|
1730
+ g.yield Plumbing::convert_approval_workflow_step_history_to_porcelain(plumbing_item)
1731
+ end
1732
+ break if plumbing_response.meta.next_cursor == ""
1733
+ req.meta.cursor = plumbing_response.meta.next_cursor
1734
+ end
1735
+ }
1736
+ resp
1737
+ end
1738
+ end
1739
+
1740
+ # ApprovalWorkflows are the mechanism by which requests for access can be viewed by authorized
1741
+ # approvers and be approved or denied.
1742
+ #
1743
+ # See {ApprovalWorkflow}.
1744
+ class ApprovalWorkflows
1745
+ extend Gem::Deprecate
1746
+
1747
+ def initialize(channel, parent)
1748
+ begin
1749
+ @stub = V1::ApprovalWorkflows::Stub.new(nil, nil, channel_override: channel)
1750
+ rescue => exception
1751
+ raise Plumbing::convert_error_to_porcelain(exception)
1752
+ end
1753
+ @parent = parent
1754
+ end
1755
+
1756
+ # Create creates a new approval workflow and requires a name and approval mode for the approval workflow.
1757
+ def create(
1758
+ approval_workflow,
1759
+ deadline: nil
1760
+ )
1761
+ req = V1::ApprovalWorkflowCreateRequest.new()
1762
+
1763
+ req.approval_workflow = Plumbing::convert_approval_workflow_to_plumbing(approval_workflow)
1764
+ tries = 0
1765
+ plumbing_response = nil
1766
+ loop do
1767
+ begin
1768
+ plumbing_response = @stub.create(req, metadata: @parent.get_metadata("ApprovalWorkflows.Create", req), deadline: deadline)
1769
+ rescue => exception
1770
+ if (@parent.shouldRetry(tries, exception))
1771
+ tries + +@parent.jitterSleep(tries)
1772
+ next
1773
+ end
1774
+ raise Plumbing::convert_error_to_porcelain(exception)
1775
+ end
1776
+ break
1777
+ end
1778
+
1779
+ resp = ApprovalWorkflowCreateResponse.new()
1780
+ resp.approval_workflow = Plumbing::convert_approval_workflow_to_porcelain(plumbing_response.approval_workflow)
1781
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1782
+ resp
1783
+ end
1784
+
1785
+ # Get reads one approval workflow by ID.
1786
+ def get(
1787
+ id,
1788
+ deadline: nil
1789
+ )
1790
+ req = V1::ApprovalWorkflowGetRequest.new()
1791
+ if not @parent.snapshot_time.nil?
1792
+ req.meta = V1::GetRequestMetadata.new()
1793
+ req.meta.snapshot_at = @parent.snapshot_time
1794
+ end
1795
+
1796
+ req.id = (id)
1797
+ tries = 0
1798
+ plumbing_response = nil
1799
+ loop do
1800
+ begin
1801
+ plumbing_response = @stub.get(req, metadata: @parent.get_metadata("ApprovalWorkflows.Get", req), deadline: deadline)
1802
+ rescue => exception
1803
+ if (@parent.shouldRetry(tries, exception))
1804
+ tries + +@parent.jitterSleep(tries)
1805
+ next
1806
+ end
1807
+ raise Plumbing::convert_error_to_porcelain(exception)
1808
+ end
1809
+ break
1810
+ end
1811
+
1812
+ resp = ApprovalWorkflowGetResponse.new()
1813
+ resp.approval_workflow = Plumbing::convert_approval_workflow_to_porcelain(plumbing_response.approval_workflow)
1814
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
1815
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1816
+ resp
1817
+ end
1818
+
1819
+ # Delete deletes an existing approval workflow.
1820
+ def delete(
1821
+ id,
1822
+ deadline: nil
1823
+ )
1824
+ req = V1::ApprovalWorkflowDeleteRequest.new()
1825
+
1826
+ req.id = (id)
1827
+ tries = 0
1828
+ plumbing_response = nil
1829
+ loop do
1830
+ begin
1831
+ plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("ApprovalWorkflows.Delete", req), deadline: deadline)
1832
+ rescue => exception
1833
+ if (@parent.shouldRetry(tries, exception))
1834
+ tries + +@parent.jitterSleep(tries)
1835
+ next
1836
+ end
1837
+ raise Plumbing::convert_error_to_porcelain(exception)
1838
+ end
1839
+ break
1840
+ end
1841
+
1842
+ resp = ApprovalWorkflowDeleteResponse.new()
1843
+ resp.id = (plumbing_response.id)
1844
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1845
+ resp
1846
+ end
1847
+
1848
+ # Update updates an existing approval workflow.
1849
+ def update(
1850
+ approval_workflow,
1851
+ deadline: nil
1852
+ )
1853
+ req = V1::ApprovalWorkflowUpdateRequest.new()
1854
+
1855
+ req.approval_workflow = Plumbing::convert_approval_workflow_to_plumbing(approval_workflow)
1856
+ tries = 0
1857
+ plumbing_response = nil
1858
+ loop do
1859
+ begin
1860
+ plumbing_response = @stub.update(req, metadata: @parent.get_metadata("ApprovalWorkflows.Update", req), deadline: deadline)
1861
+ rescue => exception
1862
+ if (@parent.shouldRetry(tries, exception))
1863
+ tries + +@parent.jitterSleep(tries)
1864
+ next
1865
+ end
1866
+ raise Plumbing::convert_error_to_porcelain(exception)
1867
+ end
1868
+ break
1869
+ end
1870
+
1871
+ resp = ApprovalWorkflowUpdateResponse.new()
1872
+ resp.approval_workflow = Plumbing::convert_approval_workflow_to_porcelain(plumbing_response.approval_workflow)
1873
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1874
+ resp
1875
+ end
1876
+
1877
+ # Lists existing approval workflows.
1878
+ def list(
1879
+ filter,
1880
+ *args,
1881
+ deadline: nil
1882
+ )
1883
+ req = V1::ApprovalWorkflowListRequest.new()
1884
+ req.meta = V1::ListRequestMetadata.new()
1885
+ if @parent.page_limit > 0
1886
+ req.meta.limit = @parent.page_limit
1887
+ end
1888
+ if not @parent.snapshot_time.nil?
1889
+ req.meta.snapshot_at = @parent.snapshot_time
1890
+ end
1891
+
1892
+ req.filter = Plumbing::quote_filter_args(filter, *args)
1893
+ resp = Enumerator::Generator.new { |g|
1894
+ tries = 0
1895
+ loop do
1896
+ begin
1897
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata("ApprovalWorkflows.List", req), deadline: deadline)
1898
+ rescue => exception
1899
+ if (@parent.shouldRetry(tries, exception))
1900
+ tries + +@parent.jitterSleep(tries)
1901
+ next
1902
+ end
1903
+ raise Plumbing::convert_error_to_porcelain(exception)
1904
+ end
1905
+ tries = 0
1906
+ plumbing_response.approval_workflows.each do |plumbing_item|
1907
+ g.yield Plumbing::convert_approval_workflow_to_porcelain(plumbing_item)
1908
+ end
1909
+ break if plumbing_response.meta.next_cursor == ""
1910
+ req.meta.cursor = plumbing_response.meta.next_cursor
1911
+ end
1912
+ }
1913
+ resp
1914
+ end
1915
+ end
1916
+
1917
+ # SnapshotApprovalWorkflows exposes the read only methods of the ApprovalWorkflows
1918
+ # service for historical queries.
1919
+ class SnapshotApprovalWorkflows
1920
+ extend Gem::Deprecate
1921
+
1922
+ def initialize(approval_workflows)
1923
+ @approval_workflows = approval_workflows
1924
+ end
1925
+
1926
+ # Get reads one approval workflow by ID.
1927
+ def get(
1928
+ id,
1929
+ deadline: nil
1930
+ )
1931
+ return @approval_workflows.get(
1932
+ id,
1933
+ deadline: deadline,
1934
+ )
1935
+ end
1936
+
1937
+ # Lists existing approval workflows.
1938
+ def list(
1939
+ filter,
1940
+ *args,
1941
+ deadline: nil
1942
+ )
1943
+ return @approval_workflows.list(
1944
+ filter,
1945
+ *args,
1946
+ deadline: deadline,
1947
+ )
1948
+ end
1949
+ end
1950
+
1951
+ # ApprovalWorkflowsHistory records all changes to the state of an ApprovalWorkflow.
1952
+ #
1953
+ # See {ApprovalWorkflowHistory}.
1954
+ class ApprovalWorkflowsHistory
1955
+ extend Gem::Deprecate
1956
+
1957
+ def initialize(channel, parent)
1958
+ begin
1959
+ @stub = V1::ApprovalWorkflowsHistory::Stub.new(nil, nil, channel_override: channel)
1960
+ rescue => exception
1961
+ raise Plumbing::convert_error_to_porcelain(exception)
1962
+ end
1963
+ @parent = parent
1964
+ end
1965
+
1966
+ # List gets a list of ApprovalWorkflowHistory records matching a given set of criteria.
1967
+ def list(
1968
+ filter,
1969
+ *args,
1970
+ deadline: nil
1971
+ )
1972
+ req = V1::ApprovalWorkflowHistoryListRequest.new()
1973
+ req.meta = V1::ListRequestMetadata.new()
1974
+ if @parent.page_limit > 0
1975
+ req.meta.limit = @parent.page_limit
1976
+ end
1977
+ if not @parent.snapshot_time.nil?
1978
+ req.meta.snapshot_at = @parent.snapshot_time
1979
+ end
1980
+
1981
+ req.filter = Plumbing::quote_filter_args(filter, *args)
1982
+ resp = Enumerator::Generator.new { |g|
1983
+ tries = 0
1984
+ loop do
1985
+ begin
1986
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata("ApprovalWorkflowsHistory.List", req), deadline: deadline)
1987
+ rescue => exception
1988
+ if (@parent.shouldRetry(tries, exception))
1989
+ tries + +@parent.jitterSleep(tries)
1990
+ next
1991
+ end
1992
+ raise Plumbing::convert_error_to_porcelain(exception)
1993
+ end
1994
+ tries = 0
1995
+ plumbing_response.history.each do |plumbing_item|
1996
+ g.yield Plumbing::convert_approval_workflow_history_to_porcelain(plumbing_item)
1997
+ end
1998
+ break if plumbing_response.meta.next_cursor == ""
1999
+ req.meta.cursor = plumbing_response.meta.next_cursor
2000
+ end
2001
+ }
2002
+ resp
2003
+ end
2004
+ end
2005
+
1268
2006
  # ControlPanel contains all administrative controls.
1269
2007
  class ControlPanel
1270
2008
  extend Gem::Deprecate