strongdm 4.7.0 → 4.8.0
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.
- checksums.yaml +4 -4
- data/.git/ORIG_HEAD +1 -1
- data/.git/index +0 -0
- data/.git/logs/HEAD +3 -3
- data/.git/logs/refs/heads/master +2 -2
- data/.git/logs/refs/remotes/origin/HEAD +1 -1
- data/.git/objects/pack/{pack-6d23e6ad791049e78227daefa7417770d86857ca.idx → pack-b1dfafcd7b8c6b715aaf6a4fee0c32ac367fdfef.idx} +0 -0
- data/.git/objects/pack/{pack-6d23e6ad791049e78227daefa7417770d86857ca.pack → pack-b1dfafcd7b8c6b715aaf6a4fee0c32ac367fdfef.pack} +0 -0
- data/.git/packed-refs +3 -2
- data/.git/refs/heads/master +1 -1
- data/lib/grpc/plumbing.rb +796 -83
- data/lib/grpc/workflow_approvers_history_pb.rb +1 -1
- data/lib/grpc/workflow_approvers_pb.rb +77 -0
- data/lib/grpc/workflow_approvers_services_pb.rb +43 -0
- data/lib/grpc/workflow_assignments_history_pb.rb +1 -1
- data/lib/grpc/workflow_assignments_pb.rb +44 -0
- data/lib/grpc/workflow_assignments_services_pb.rb +38 -0
- data/lib/grpc/workflow_roles_history_pb.rb +1 -1
- data/lib/grpc/workflow_roles_pb.rb +77 -0
- data/lib/grpc/workflow_roles_services_pb.rb +44 -0
- data/lib/grpc/workflows_pb.rb +44 -15
- data/lib/grpc/workflows_services_pb.rb +9 -1
- data/lib/models/porcelain.rb +480 -44
- data/lib/strongdm.rb +46 -9
- data/lib/svc.rb +589 -17
- data/lib/version +1 -1
- data/lib/version.rb +1 -1
- metadata +10 -4
data/lib/svc.rb
CHANGED
@@ -4018,30 +4018,119 @@ module SDM #:nodoc:
|
|
4018
4018
|
end
|
4019
4019
|
end
|
4020
4020
|
|
4021
|
-
#
|
4022
|
-
# the users that can request that access, and the mechanism for approving those requests which can either
|
4023
|
-
# but automatic approval or a set of users authorized to approve the requests.
|
4021
|
+
# WorkflowApprovers is an account with the ability to approve requests bound to a workflow.
|
4024
4022
|
#
|
4025
|
-
# See {
|
4026
|
-
class
|
4023
|
+
# See {WorkflowApprover}.
|
4024
|
+
class WorkflowApprovers
|
4027
4025
|
extend Gem::Deprecate
|
4028
4026
|
|
4029
4027
|
def initialize(channel, parent)
|
4030
4028
|
begin
|
4031
|
-
@stub = V1::
|
4029
|
+
@stub = V1::WorkflowApprovers::Stub.new(nil, nil, channel_override: channel)
|
4032
4030
|
rescue => exception
|
4033
4031
|
raise Plumbing::convert_error_to_porcelain(exception)
|
4034
4032
|
end
|
4035
4033
|
@parent = parent
|
4036
4034
|
end
|
4037
4035
|
|
4038
|
-
#
|
4036
|
+
# Create creates a new workflow approver
|
4037
|
+
def create(
|
4038
|
+
workflow_approver,
|
4039
|
+
deadline: nil
|
4040
|
+
)
|
4041
|
+
req = V1::WorkflowApproversCreateRequest.new()
|
4042
|
+
|
4043
|
+
req.workflow_approver = Plumbing::convert_workflow_approver_to_plumbing(workflow_approver)
|
4044
|
+
tries = 0
|
4045
|
+
plumbing_response = nil
|
4046
|
+
loop do
|
4047
|
+
begin
|
4048
|
+
plumbing_response = @stub.create(req, metadata: @parent.get_metadata("WorkflowApprovers.Create", req), deadline: deadline)
|
4049
|
+
rescue => exception
|
4050
|
+
if (@parent.shouldRetry(tries, exception))
|
4051
|
+
tries + +@parent.jitterSleep(tries)
|
4052
|
+
next
|
4053
|
+
end
|
4054
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
4055
|
+
end
|
4056
|
+
break
|
4057
|
+
end
|
4058
|
+
|
4059
|
+
resp = WorkflowApproversCreateResponse.new()
|
4060
|
+
resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
|
4061
|
+
resp.workflow_approver = Plumbing::convert_workflow_approver_to_porcelain(plumbing_response.workflow_approver)
|
4062
|
+
resp
|
4063
|
+
end
|
4064
|
+
|
4065
|
+
# Get reads one workflow approver by ID.
|
4066
|
+
def get(
|
4067
|
+
id,
|
4068
|
+
deadline: nil
|
4069
|
+
)
|
4070
|
+
req = V1::WorkflowApproverGetRequest.new()
|
4071
|
+
if not @parent.snapshot_time.nil?
|
4072
|
+
req.meta = V1::GetRequestMetadata.new()
|
4073
|
+
req.meta.snapshot_at = @parent.snapshot_time
|
4074
|
+
end
|
4075
|
+
|
4076
|
+
req.id = (id)
|
4077
|
+
tries = 0
|
4078
|
+
plumbing_response = nil
|
4079
|
+
loop do
|
4080
|
+
begin
|
4081
|
+
plumbing_response = @stub.get(req, metadata: @parent.get_metadata("WorkflowApprovers.Get", req), deadline: deadline)
|
4082
|
+
rescue => exception
|
4083
|
+
if (@parent.shouldRetry(tries, exception))
|
4084
|
+
tries + +@parent.jitterSleep(tries)
|
4085
|
+
next
|
4086
|
+
end
|
4087
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
4088
|
+
end
|
4089
|
+
break
|
4090
|
+
end
|
4091
|
+
|
4092
|
+
resp = WorkflowApproverGetResponse.new()
|
4093
|
+
resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
|
4094
|
+
resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
|
4095
|
+
resp.workflow_approver = Plumbing::convert_workflow_approver_to_porcelain(plumbing_response.workflow_approver)
|
4096
|
+
resp
|
4097
|
+
end
|
4098
|
+
|
4099
|
+
# Delete deletes a workflow approver
|
4100
|
+
def delete(
|
4101
|
+
id,
|
4102
|
+
deadline: nil
|
4103
|
+
)
|
4104
|
+
req = V1::WorkflowApproversDeleteRequest.new()
|
4105
|
+
|
4106
|
+
req.id = (id)
|
4107
|
+
tries = 0
|
4108
|
+
plumbing_response = nil
|
4109
|
+
loop do
|
4110
|
+
begin
|
4111
|
+
plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("WorkflowApprovers.Delete", req), deadline: deadline)
|
4112
|
+
rescue => exception
|
4113
|
+
if (@parent.shouldRetry(tries, exception))
|
4114
|
+
tries + +@parent.jitterSleep(tries)
|
4115
|
+
next
|
4116
|
+
end
|
4117
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
4118
|
+
end
|
4119
|
+
break
|
4120
|
+
end
|
4121
|
+
|
4122
|
+
resp = WorkflowApproversDeleteResponse.new()
|
4123
|
+
resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
|
4124
|
+
resp
|
4125
|
+
end
|
4126
|
+
|
4127
|
+
# Lists existing workflow approvers.
|
4039
4128
|
def list(
|
4040
4129
|
filter,
|
4041
4130
|
*args,
|
4042
4131
|
deadline: nil
|
4043
4132
|
)
|
4044
|
-
req = V1::
|
4133
|
+
req = V1::WorkflowApproversListRequest.new()
|
4045
4134
|
req.meta = V1::ListRequestMetadata.new()
|
4046
4135
|
if @parent.page_limit > 0
|
4047
4136
|
req.meta.limit = @parent.page_limit
|
@@ -4055,7 +4144,7 @@ module SDM #:nodoc:
|
|
4055
4144
|
tries = 0
|
4056
4145
|
loop do
|
4057
4146
|
begin
|
4058
|
-
plumbing_response = @stub.list(req, metadata: @parent.get_metadata("
|
4147
|
+
plumbing_response = @stub.list(req, metadata: @parent.get_metadata("WorkflowApprovers.List", req), deadline: deadline)
|
4059
4148
|
rescue => exception
|
4060
4149
|
if (@parent.shouldRetry(tries, exception))
|
4061
4150
|
tries + +@parent.jitterSleep(tries)
|
@@ -4064,8 +4153,8 @@ module SDM #:nodoc:
|
|
4064
4153
|
raise Plumbing::convert_error_to_porcelain(exception)
|
4065
4154
|
end
|
4066
4155
|
tries = 0
|
4067
|
-
plumbing_response.
|
4068
|
-
g.yield Plumbing::
|
4156
|
+
plumbing_response.workflow_approvers.each do |plumbing_item|
|
4157
|
+
g.yield Plumbing::convert_workflow_approver_to_porcelain(plumbing_item)
|
4069
4158
|
end
|
4070
4159
|
break if plumbing_response.meta.next_cursor == ""
|
4071
4160
|
req.meta.cursor = plumbing_response.meta.next_cursor
|
@@ -4075,22 +4164,33 @@ module SDM #:nodoc:
|
|
4075
4164
|
end
|
4076
4165
|
end
|
4077
4166
|
|
4078
|
-
#
|
4167
|
+
# SnapshotWorkflowApprovers exposes the read only methods of the WorkflowApprovers
|
4079
4168
|
# service for historical queries.
|
4080
|
-
class
|
4169
|
+
class SnapshotWorkflowApprovers
|
4081
4170
|
extend Gem::Deprecate
|
4082
4171
|
|
4083
|
-
def initialize(
|
4084
|
-
@
|
4172
|
+
def initialize(workflow_approvers)
|
4173
|
+
@workflow_approvers = workflow_approvers
|
4085
4174
|
end
|
4086
4175
|
|
4087
|
-
#
|
4176
|
+
# Get reads one workflow approver by ID.
|
4177
|
+
def get(
|
4178
|
+
id,
|
4179
|
+
deadline: nil
|
4180
|
+
)
|
4181
|
+
return @workflow_approvers.get(
|
4182
|
+
id,
|
4183
|
+
deadline: deadline,
|
4184
|
+
)
|
4185
|
+
end
|
4186
|
+
|
4187
|
+
# Lists existing workflow approvers.
|
4088
4188
|
def list(
|
4089
4189
|
filter,
|
4090
4190
|
*args,
|
4091
4191
|
deadline: nil
|
4092
4192
|
)
|
4093
|
-
return @
|
4193
|
+
return @workflow_approvers.list(
|
4094
4194
|
filter,
|
4095
4195
|
*args,
|
4096
4196
|
deadline: deadline,
|
@@ -4153,6 +4253,85 @@ module SDM #:nodoc:
|
|
4153
4253
|
end
|
4154
4254
|
end
|
4155
4255
|
|
4256
|
+
# WorkflowAssignments links a Resource to a Workflow. The assigned resources are those that a user can request
|
4257
|
+
# access to via the workflow.
|
4258
|
+
#
|
4259
|
+
# See {WorkflowAssignment}.
|
4260
|
+
class WorkflowAssignments
|
4261
|
+
extend Gem::Deprecate
|
4262
|
+
|
4263
|
+
def initialize(channel, parent)
|
4264
|
+
begin
|
4265
|
+
@stub = V1::WorkflowAssignments::Stub.new(nil, nil, channel_override: channel)
|
4266
|
+
rescue => exception
|
4267
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
4268
|
+
end
|
4269
|
+
@parent = parent
|
4270
|
+
end
|
4271
|
+
|
4272
|
+
# Lists existing workflow assignments.
|
4273
|
+
def list(
|
4274
|
+
filter,
|
4275
|
+
*args,
|
4276
|
+
deadline: nil
|
4277
|
+
)
|
4278
|
+
req = V1::WorkflowAssignmentsListRequest.new()
|
4279
|
+
req.meta = V1::ListRequestMetadata.new()
|
4280
|
+
if @parent.page_limit > 0
|
4281
|
+
req.meta.limit = @parent.page_limit
|
4282
|
+
end
|
4283
|
+
if not @parent.snapshot_time.nil?
|
4284
|
+
req.meta.snapshot_at = @parent.snapshot_time
|
4285
|
+
end
|
4286
|
+
|
4287
|
+
req.filter = Plumbing::quote_filter_args(filter, *args)
|
4288
|
+
resp = Enumerator::Generator.new { |g|
|
4289
|
+
tries = 0
|
4290
|
+
loop do
|
4291
|
+
begin
|
4292
|
+
plumbing_response = @stub.list(req, metadata: @parent.get_metadata("WorkflowAssignments.List", req), deadline: deadline)
|
4293
|
+
rescue => exception
|
4294
|
+
if (@parent.shouldRetry(tries, exception))
|
4295
|
+
tries + +@parent.jitterSleep(tries)
|
4296
|
+
next
|
4297
|
+
end
|
4298
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
4299
|
+
end
|
4300
|
+
tries = 0
|
4301
|
+
plumbing_response.workflow_assignments.each do |plumbing_item|
|
4302
|
+
g.yield Plumbing::convert_workflow_assignment_to_porcelain(plumbing_item)
|
4303
|
+
end
|
4304
|
+
break if plumbing_response.meta.next_cursor == ""
|
4305
|
+
req.meta.cursor = plumbing_response.meta.next_cursor
|
4306
|
+
end
|
4307
|
+
}
|
4308
|
+
resp
|
4309
|
+
end
|
4310
|
+
end
|
4311
|
+
|
4312
|
+
# SnapshotWorkflowAssignments exposes the read only methods of the WorkflowAssignments
|
4313
|
+
# service for historical queries.
|
4314
|
+
class SnapshotWorkflowAssignments
|
4315
|
+
extend Gem::Deprecate
|
4316
|
+
|
4317
|
+
def initialize(workflow_assignments)
|
4318
|
+
@workflow_assignments = workflow_assignments
|
4319
|
+
end
|
4320
|
+
|
4321
|
+
# Lists existing workflow assignments.
|
4322
|
+
def list(
|
4323
|
+
filter,
|
4324
|
+
*args,
|
4325
|
+
deadline: nil
|
4326
|
+
)
|
4327
|
+
return @workflow_assignments.list(
|
4328
|
+
filter,
|
4329
|
+
*args,
|
4330
|
+
deadline: deadline,
|
4331
|
+
)
|
4332
|
+
end
|
4333
|
+
end
|
4334
|
+
|
4156
4335
|
# WorkflowAssignmentsHistory provides records of all changes to the state of a WorkflowAssignment.
|
4157
4336
|
#
|
4158
4337
|
# See {WorkflowAssignmentHistory}.
|
@@ -4208,6 +4387,187 @@ module SDM #:nodoc:
|
|
4208
4387
|
end
|
4209
4388
|
end
|
4210
4389
|
|
4390
|
+
# WorkflowRole links a role to a workflow. The linked roles indicate which roles a user must be a part of
|
4391
|
+
# to request access to a resource via the workflow.
|
4392
|
+
#
|
4393
|
+
# See {WorkflowRole}.
|
4394
|
+
class WorkflowRoles
|
4395
|
+
extend Gem::Deprecate
|
4396
|
+
|
4397
|
+
def initialize(channel, parent)
|
4398
|
+
begin
|
4399
|
+
@stub = V1::WorkflowRoles::Stub.new(nil, nil, channel_override: channel)
|
4400
|
+
rescue => exception
|
4401
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
4402
|
+
end
|
4403
|
+
@parent = parent
|
4404
|
+
end
|
4405
|
+
|
4406
|
+
# Create creates a new workflow role
|
4407
|
+
def create(
|
4408
|
+
workflow_role,
|
4409
|
+
deadline: nil
|
4410
|
+
)
|
4411
|
+
req = V1::WorkflowRolesCreateRequest.new()
|
4412
|
+
|
4413
|
+
req.workflow_role = Plumbing::convert_workflow_role_to_plumbing(workflow_role)
|
4414
|
+
tries = 0
|
4415
|
+
plumbing_response = nil
|
4416
|
+
loop do
|
4417
|
+
begin
|
4418
|
+
plumbing_response = @stub.create(req, metadata: @parent.get_metadata("WorkflowRoles.Create", req), deadline: deadline)
|
4419
|
+
rescue => exception
|
4420
|
+
if (@parent.shouldRetry(tries, exception))
|
4421
|
+
tries + +@parent.jitterSleep(tries)
|
4422
|
+
next
|
4423
|
+
end
|
4424
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
4425
|
+
end
|
4426
|
+
break
|
4427
|
+
end
|
4428
|
+
|
4429
|
+
resp = WorkflowRolesCreateResponse.new()
|
4430
|
+
resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
|
4431
|
+
resp.workflow_role = Plumbing::convert_workflow_role_to_porcelain(plumbing_response.workflow_role)
|
4432
|
+
resp
|
4433
|
+
end
|
4434
|
+
|
4435
|
+
# Get reads one workflow role by ID.
|
4436
|
+
def get(
|
4437
|
+
id,
|
4438
|
+
deadline: nil
|
4439
|
+
)
|
4440
|
+
req = V1::WorkflowRoleGetRequest.new()
|
4441
|
+
if not @parent.snapshot_time.nil?
|
4442
|
+
req.meta = V1::GetRequestMetadata.new()
|
4443
|
+
req.meta.snapshot_at = @parent.snapshot_time
|
4444
|
+
end
|
4445
|
+
|
4446
|
+
req.id = (id)
|
4447
|
+
tries = 0
|
4448
|
+
plumbing_response = nil
|
4449
|
+
loop do
|
4450
|
+
begin
|
4451
|
+
plumbing_response = @stub.get(req, metadata: @parent.get_metadata("WorkflowRoles.Get", req), deadline: deadline)
|
4452
|
+
rescue => exception
|
4453
|
+
if (@parent.shouldRetry(tries, exception))
|
4454
|
+
tries + +@parent.jitterSleep(tries)
|
4455
|
+
next
|
4456
|
+
end
|
4457
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
4458
|
+
end
|
4459
|
+
break
|
4460
|
+
end
|
4461
|
+
|
4462
|
+
resp = WorkflowRoleGetResponse.new()
|
4463
|
+
resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
|
4464
|
+
resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
|
4465
|
+
resp.workflow_role = Plumbing::convert_workflow_role_to_porcelain(plumbing_response.workflow_role)
|
4466
|
+
resp
|
4467
|
+
end
|
4468
|
+
|
4469
|
+
# Delete deletes a workflow role
|
4470
|
+
def delete(
|
4471
|
+
id,
|
4472
|
+
deadline: nil
|
4473
|
+
)
|
4474
|
+
req = V1::WorkflowRolesDeleteRequest.new()
|
4475
|
+
|
4476
|
+
req.id = (id)
|
4477
|
+
tries = 0
|
4478
|
+
plumbing_response = nil
|
4479
|
+
loop do
|
4480
|
+
begin
|
4481
|
+
plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("WorkflowRoles.Delete", req), deadline: deadline)
|
4482
|
+
rescue => exception
|
4483
|
+
if (@parent.shouldRetry(tries, exception))
|
4484
|
+
tries + +@parent.jitterSleep(tries)
|
4485
|
+
next
|
4486
|
+
end
|
4487
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
4488
|
+
end
|
4489
|
+
break
|
4490
|
+
end
|
4491
|
+
|
4492
|
+
resp = WorkflowRolesDeleteResponse.new()
|
4493
|
+
resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
|
4494
|
+
resp
|
4495
|
+
end
|
4496
|
+
|
4497
|
+
# Lists existing workflow roles.
|
4498
|
+
def list(
|
4499
|
+
filter,
|
4500
|
+
*args,
|
4501
|
+
deadline: nil
|
4502
|
+
)
|
4503
|
+
req = V1::WorkflowRolesListRequest.new()
|
4504
|
+
req.meta = V1::ListRequestMetadata.new()
|
4505
|
+
if @parent.page_limit > 0
|
4506
|
+
req.meta.limit = @parent.page_limit
|
4507
|
+
end
|
4508
|
+
if not @parent.snapshot_time.nil?
|
4509
|
+
req.meta.snapshot_at = @parent.snapshot_time
|
4510
|
+
end
|
4511
|
+
|
4512
|
+
req.filter = Plumbing::quote_filter_args(filter, *args)
|
4513
|
+
resp = Enumerator::Generator.new { |g|
|
4514
|
+
tries = 0
|
4515
|
+
loop do
|
4516
|
+
begin
|
4517
|
+
plumbing_response = @stub.list(req, metadata: @parent.get_metadata("WorkflowRoles.List", req), deadline: deadline)
|
4518
|
+
rescue => exception
|
4519
|
+
if (@parent.shouldRetry(tries, exception))
|
4520
|
+
tries + +@parent.jitterSleep(tries)
|
4521
|
+
next
|
4522
|
+
end
|
4523
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
4524
|
+
end
|
4525
|
+
tries = 0
|
4526
|
+
plumbing_response.workflow_role.each do |plumbing_item|
|
4527
|
+
g.yield Plumbing::convert_workflow_role_to_porcelain(plumbing_item)
|
4528
|
+
end
|
4529
|
+
break if plumbing_response.meta.next_cursor == ""
|
4530
|
+
req.meta.cursor = plumbing_response.meta.next_cursor
|
4531
|
+
end
|
4532
|
+
}
|
4533
|
+
resp
|
4534
|
+
end
|
4535
|
+
end
|
4536
|
+
|
4537
|
+
# SnapshotWorkflowRoles exposes the read only methods of the WorkflowRoles
|
4538
|
+
# service for historical queries.
|
4539
|
+
class SnapshotWorkflowRoles
|
4540
|
+
extend Gem::Deprecate
|
4541
|
+
|
4542
|
+
def initialize(workflow_roles)
|
4543
|
+
@workflow_roles = workflow_roles
|
4544
|
+
end
|
4545
|
+
|
4546
|
+
# Get reads one workflow role by ID.
|
4547
|
+
def get(
|
4548
|
+
id,
|
4549
|
+
deadline: nil
|
4550
|
+
)
|
4551
|
+
return @workflow_roles.get(
|
4552
|
+
id,
|
4553
|
+
deadline: deadline,
|
4554
|
+
)
|
4555
|
+
end
|
4556
|
+
|
4557
|
+
# Lists existing workflow roles.
|
4558
|
+
def list(
|
4559
|
+
filter,
|
4560
|
+
*args,
|
4561
|
+
deadline: nil
|
4562
|
+
)
|
4563
|
+
return @workflow_roles.list(
|
4564
|
+
filter,
|
4565
|
+
*args,
|
4566
|
+
deadline: deadline,
|
4567
|
+
)
|
4568
|
+
end
|
4569
|
+
end
|
4570
|
+
|
4211
4571
|
# WorkflowRolesHistory provides records of all changes to the state of a WorkflowRole
|
4212
4572
|
#
|
4213
4573
|
# See {WorkflowRoleHistory}.
|
@@ -4263,6 +4623,218 @@ module SDM #:nodoc:
|
|
4263
4623
|
end
|
4264
4624
|
end
|
4265
4625
|
|
4626
|
+
# Workflows are the collection of rules that define the resources to which access can be requested,
|
4627
|
+
# the users that can request that access, and the mechanism for approving those requests which can either
|
4628
|
+
# be automatic approval or a set of users authorized to approve the requests.
|
4629
|
+
#
|
4630
|
+
# See {Workflow}.
|
4631
|
+
class Workflows
|
4632
|
+
extend Gem::Deprecate
|
4633
|
+
|
4634
|
+
def initialize(channel, parent)
|
4635
|
+
begin
|
4636
|
+
@stub = V1::Workflows::Stub.new(nil, nil, channel_override: channel)
|
4637
|
+
rescue => exception
|
4638
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
4639
|
+
end
|
4640
|
+
@parent = parent
|
4641
|
+
end
|
4642
|
+
|
4643
|
+
# Create creates a new workflow and requires a name for the workflow.
|
4644
|
+
def create(
|
4645
|
+
workflow,
|
4646
|
+
deadline: nil
|
4647
|
+
)
|
4648
|
+
req = V1::WorkflowCreateRequest.new()
|
4649
|
+
|
4650
|
+
req.workflow = Plumbing::convert_workflow_to_plumbing(workflow)
|
4651
|
+
tries = 0
|
4652
|
+
plumbing_response = nil
|
4653
|
+
loop do
|
4654
|
+
begin
|
4655
|
+
plumbing_response = @stub.create(req, metadata: @parent.get_metadata("Workflows.Create", req), deadline: deadline)
|
4656
|
+
rescue => exception
|
4657
|
+
if (@parent.shouldRetry(tries, exception))
|
4658
|
+
tries + +@parent.jitterSleep(tries)
|
4659
|
+
next
|
4660
|
+
end
|
4661
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
4662
|
+
end
|
4663
|
+
break
|
4664
|
+
end
|
4665
|
+
|
4666
|
+
resp = WorkflowCreateResponse.new()
|
4667
|
+
resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
|
4668
|
+
resp.workflow = Plumbing::convert_workflow_to_porcelain(plumbing_response.workflow)
|
4669
|
+
resp
|
4670
|
+
end
|
4671
|
+
|
4672
|
+
# Get reads one workflow by ID.
|
4673
|
+
def get(
|
4674
|
+
id,
|
4675
|
+
deadline: nil
|
4676
|
+
)
|
4677
|
+
req = V1::WorkflowGetRequest.new()
|
4678
|
+
if not @parent.snapshot_time.nil?
|
4679
|
+
req.meta = V1::GetRequestMetadata.new()
|
4680
|
+
req.meta.snapshot_at = @parent.snapshot_time
|
4681
|
+
end
|
4682
|
+
|
4683
|
+
req.id = (id)
|
4684
|
+
tries = 0
|
4685
|
+
plumbing_response = nil
|
4686
|
+
loop do
|
4687
|
+
begin
|
4688
|
+
plumbing_response = @stub.get(req, metadata: @parent.get_metadata("Workflows.Get", req), deadline: deadline)
|
4689
|
+
rescue => exception
|
4690
|
+
if (@parent.shouldRetry(tries, exception))
|
4691
|
+
tries + +@parent.jitterSleep(tries)
|
4692
|
+
next
|
4693
|
+
end
|
4694
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
4695
|
+
end
|
4696
|
+
break
|
4697
|
+
end
|
4698
|
+
|
4699
|
+
resp = WorkflowGetResponse.new()
|
4700
|
+
resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
|
4701
|
+
resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
|
4702
|
+
resp.workflow = Plumbing::convert_workflow_to_porcelain(plumbing_response.workflow)
|
4703
|
+
resp
|
4704
|
+
end
|
4705
|
+
|
4706
|
+
# Delete deletes an existing workflow.
|
4707
|
+
def delete(
|
4708
|
+
id,
|
4709
|
+
deadline: nil
|
4710
|
+
)
|
4711
|
+
req = V1::WorkflowDeleteRequest.new()
|
4712
|
+
|
4713
|
+
req.id = (id)
|
4714
|
+
tries = 0
|
4715
|
+
plumbing_response = nil
|
4716
|
+
loop do
|
4717
|
+
begin
|
4718
|
+
plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("Workflows.Delete", req), deadline: deadline)
|
4719
|
+
rescue => exception
|
4720
|
+
if (@parent.shouldRetry(tries, exception))
|
4721
|
+
tries + +@parent.jitterSleep(tries)
|
4722
|
+
next
|
4723
|
+
end
|
4724
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
4725
|
+
end
|
4726
|
+
break
|
4727
|
+
end
|
4728
|
+
|
4729
|
+
resp = WorkflowDeleteResponse.new()
|
4730
|
+
resp.id = (plumbing_response.id)
|
4731
|
+
resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
|
4732
|
+
resp
|
4733
|
+
end
|
4734
|
+
|
4735
|
+
# Update updates an existing workflow.
|
4736
|
+
def update(
|
4737
|
+
workflow,
|
4738
|
+
deadline: nil
|
4739
|
+
)
|
4740
|
+
req = V1::WorkflowUpdateRequest.new()
|
4741
|
+
|
4742
|
+
req.workflow = Plumbing::convert_workflow_to_plumbing(workflow)
|
4743
|
+
tries = 0
|
4744
|
+
plumbing_response = nil
|
4745
|
+
loop do
|
4746
|
+
begin
|
4747
|
+
plumbing_response = @stub.update(req, metadata: @parent.get_metadata("Workflows.Update", req), deadline: deadline)
|
4748
|
+
rescue => exception
|
4749
|
+
if (@parent.shouldRetry(tries, exception))
|
4750
|
+
tries + +@parent.jitterSleep(tries)
|
4751
|
+
next
|
4752
|
+
end
|
4753
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
4754
|
+
end
|
4755
|
+
break
|
4756
|
+
end
|
4757
|
+
|
4758
|
+
resp = WorkflowUpdateResponse.new()
|
4759
|
+
resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
|
4760
|
+
resp.workflow = Plumbing::convert_workflow_to_porcelain(plumbing_response.workflow)
|
4761
|
+
resp
|
4762
|
+
end
|
4763
|
+
|
4764
|
+
# Lists existing workflows.
|
4765
|
+
def list(
|
4766
|
+
filter,
|
4767
|
+
*args,
|
4768
|
+
deadline: nil
|
4769
|
+
)
|
4770
|
+
req = V1::WorkflowListRequest.new()
|
4771
|
+
req.meta = V1::ListRequestMetadata.new()
|
4772
|
+
if @parent.page_limit > 0
|
4773
|
+
req.meta.limit = @parent.page_limit
|
4774
|
+
end
|
4775
|
+
if not @parent.snapshot_time.nil?
|
4776
|
+
req.meta.snapshot_at = @parent.snapshot_time
|
4777
|
+
end
|
4778
|
+
|
4779
|
+
req.filter = Plumbing::quote_filter_args(filter, *args)
|
4780
|
+
resp = Enumerator::Generator.new { |g|
|
4781
|
+
tries = 0
|
4782
|
+
loop do
|
4783
|
+
begin
|
4784
|
+
plumbing_response = @stub.list(req, metadata: @parent.get_metadata("Workflows.List", req), deadline: deadline)
|
4785
|
+
rescue => exception
|
4786
|
+
if (@parent.shouldRetry(tries, exception))
|
4787
|
+
tries + +@parent.jitterSleep(tries)
|
4788
|
+
next
|
4789
|
+
end
|
4790
|
+
raise Plumbing::convert_error_to_porcelain(exception)
|
4791
|
+
end
|
4792
|
+
tries = 0
|
4793
|
+
plumbing_response.workflows.each do |plumbing_item|
|
4794
|
+
g.yield Plumbing::convert_workflow_to_porcelain(plumbing_item)
|
4795
|
+
end
|
4796
|
+
break if plumbing_response.meta.next_cursor == ""
|
4797
|
+
req.meta.cursor = plumbing_response.meta.next_cursor
|
4798
|
+
end
|
4799
|
+
}
|
4800
|
+
resp
|
4801
|
+
end
|
4802
|
+
end
|
4803
|
+
|
4804
|
+
# SnapshotWorkflows exposes the read only methods of the Workflows
|
4805
|
+
# service for historical queries.
|
4806
|
+
class SnapshotWorkflows
|
4807
|
+
extend Gem::Deprecate
|
4808
|
+
|
4809
|
+
def initialize(workflows)
|
4810
|
+
@workflows = workflows
|
4811
|
+
end
|
4812
|
+
|
4813
|
+
# Get reads one workflow by ID.
|
4814
|
+
def get(
|
4815
|
+
id,
|
4816
|
+
deadline: nil
|
4817
|
+
)
|
4818
|
+
return @workflows.get(
|
4819
|
+
id,
|
4820
|
+
deadline: deadline,
|
4821
|
+
)
|
4822
|
+
end
|
4823
|
+
|
4824
|
+
# Lists existing workflows.
|
4825
|
+
def list(
|
4826
|
+
filter,
|
4827
|
+
*args,
|
4828
|
+
deadline: nil
|
4829
|
+
)
|
4830
|
+
return @workflows.list(
|
4831
|
+
filter,
|
4832
|
+
*args,
|
4833
|
+
deadline: deadline,
|
4834
|
+
)
|
4835
|
+
end
|
4836
|
+
end
|
4837
|
+
|
4266
4838
|
# WorkflowsHistory provides records of all changes to the state of a Workflow.
|
4267
4839
|
#
|
4268
4840
|
# See {WorkflowHistory}.
|
data/lib/version
CHANGED
data/lib/version.rb
CHANGED