Class: SDM::WorkflowApprovers
- Inherits:
-
Object
- Object
- SDM::WorkflowApprovers
- Extended by:
- Gem::Deprecate
- Defined in:
- lib/svc.rb
Overview
WorkflowApprovers is an account or a role with the ability to approve requests bound to a workflow.
See WorkflowApprover.
Instance Method Summary collapse
-
#create(workflow_approver, deadline: nil) ⇒ Object
Create creates a new workflow approver.
-
#delete(id, deadline: nil) ⇒ Object
Delete deletes a workflow approver.
-
#get(id, deadline: nil) ⇒ Object
Get reads one workflow approver by ID.
-
#initialize(channel, parent) ⇒ WorkflowApprovers
constructor
A new instance of WorkflowApprovers.
-
#list(filter, *args, deadline: nil) ⇒ Object
Lists existing workflow approvers.
Constructor Details
#initialize(channel, parent) ⇒ WorkflowApprovers
Returns a new instance of WorkflowApprovers.
4790 4791 4792 4793 4794 4795 4796 4797 |
# File 'lib/svc.rb', line 4790 def initialize(channel, parent) begin @stub = V1::WorkflowApprovers::Stub.new(nil, nil, channel_override: channel) rescue => exception raise Plumbing::convert_error_to_porcelain(exception) end @parent = parent end |
Instance Method Details
#create(workflow_approver, deadline: nil) ⇒ Object
Create creates a new workflow approver
4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 |
# File 'lib/svc.rb', line 4800 def create( workflow_approver, deadline: nil ) req = V1::WorkflowApproversCreateRequest.new() req.workflow_approver = Plumbing::convert_workflow_approver_to_plumbing(workflow_approver) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.create(req, metadata: @parent.("WorkflowApprovers.Create", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception)) tries + +@parent.jitterSleep(tries) next end raise Plumbing::convert_error_to_porcelain(exception) end break end resp = WorkflowApproversCreateResponse.new() resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp.workflow_approver = Plumbing::convert_workflow_approver_to_porcelain(plumbing_response.workflow_approver) resp end |
#delete(id, deadline: nil) ⇒ Object
Delete deletes a workflow approver
4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 |
# File 'lib/svc.rb', line 4863 def delete( id, deadline: nil ) req = V1::WorkflowApproversDeleteRequest.new() req.id = (id) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.delete(req, metadata: @parent.("WorkflowApprovers.Delete", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception)) tries + +@parent.jitterSleep(tries) next end raise Plumbing::convert_error_to_porcelain(exception) end break end resp = WorkflowApproversDeleteResponse.new() resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp end |
#get(id, deadline: nil) ⇒ Object
Get reads one workflow approver by ID.
4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 |
# File 'lib/svc.rb', line 4829 def get( id, deadline: nil ) req = V1::WorkflowApproverGetRequest.new() if not @parent.snapshot_time.nil? req. = V1::GetRequestMetadata.new() req..snapshot_at = @parent.snapshot_time end req.id = (id) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.get(req, metadata: @parent.("WorkflowApprovers.Get", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception)) tries + +@parent.jitterSleep(tries) next end raise Plumbing::convert_error_to_porcelain(exception) end break end resp = WorkflowApproverGetResponse.new() resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp.workflow_approver = Plumbing::convert_workflow_approver_to_porcelain(plumbing_response.workflow_approver) resp end |
#list(filter, *args, deadline: nil) ⇒ Object
Lists existing workflow approvers.
4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 |
# File 'lib/svc.rb', line 4891 def list( filter, *args, deadline: nil ) req = V1::WorkflowApproversListRequest.new() req. = V1::ListRequestMetadata.new() if @parent.page_limit > 0 req..limit = @parent.page_limit end if not @parent.snapshot_time.nil? req..snapshot_at = @parent.snapshot_time end req.filter = Plumbing::quote_filter_args(filter, *args) resp = Enumerator::Generator.new { |g| tries = 0 loop do begin plumbing_response = @stub.list(req, metadata: @parent.("WorkflowApprovers.List", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception)) tries + +@parent.jitterSleep(tries) next end raise Plumbing::convert_error_to_porcelain(exception) end tries = 0 plumbing_response.workflow_approvers.each do |plumbing_item| g.yield Plumbing::convert_workflow_approver_to_porcelain(plumbing_item) end break if plumbing_response..next_cursor == "" req..cursor = plumbing_response..next_cursor end } resp end |