Class: SDM::AccessRequest
- Inherits:
-
Object
- Object
- SDM::AccessRequest
- Defined in:
- lib/models/porcelain.rb
Overview
AccessRequests are requests for access to a resource that may match a Workflow.
Instance Attribute Summary collapse
-
#account_id ⇒ Object
The account that initiated the request.
-
#grant_id ⇒ Object
The account grant created, if it exists.
-
#id ⇒ Object
The access request id.
-
#reason ⇒ Object
The reason the access was requested.
-
#resource_id ⇒ Object
The resource id.
-
#start_from ⇒ Object
The timestamp when the requested access will be granted.
-
#status ⇒ Object
The status of the access request.
-
#status_at ⇒ Object
The timestamp when the status changed.
-
#valid_until ⇒ Object
The timestamp when the requested access will expire.
-
#workflow_id ⇒ Object
The workflow the request bound to.
Instance Method Summary collapse
-
#initialize(account_id: nil, grant_id: nil, id: nil, reason: nil, resource_id: nil, start_from: nil, status: nil, status_at: nil, valid_until: nil, workflow_id: nil) ⇒ AccessRequest
constructor
A new instance of AccessRequest.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(account_id: nil, grant_id: nil, id: nil, reason: nil, resource_id: nil, start_from: nil, status: nil, status_at: nil, valid_until: nil, workflow_id: nil) ⇒ AccessRequest
Returns a new instance of AccessRequest.
726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 |
# File 'lib/models/porcelain.rb', line 726 def initialize( account_id: nil, grant_id: nil, id: nil, reason: nil, resource_id: nil, start_from: nil, status: nil, status_at: nil, valid_until: nil, workflow_id: nil ) @account_id = account_id == nil ? "" : account_id @grant_id = grant_id == nil ? "" : grant_id @id = id == nil ? "" : id @reason = reason == nil ? "" : reason @resource_id = resource_id == nil ? "" : resource_id @start_from = start_from == nil ? nil : start_from @status = status == nil ? "" : status @status_at = status_at == nil ? nil : status_at @valid_until = valid_until == nil ? nil : valid_until @workflow_id = workflow_id == nil ? "" : workflow_id end |
Instance Attribute Details
#account_id ⇒ Object
The account that initiated the request.
705 706 707 |
# File 'lib/models/porcelain.rb', line 705 def account_id @account_id end |
#grant_id ⇒ Object
The account grant created, if it exists.
707 708 709 |
# File 'lib/models/porcelain.rb', line 707 def grant_id @grant_id end |
#id ⇒ Object
The access request id.
709 710 711 |
# File 'lib/models/porcelain.rb', line 709 def id @id end |
#reason ⇒ Object
The reason the access was requested.
711 712 713 |
# File 'lib/models/porcelain.rb', line 711 def reason @reason end |
#resource_id ⇒ Object
The resource id.
713 714 715 |
# File 'lib/models/porcelain.rb', line 713 def resource_id @resource_id end |
#start_from ⇒ Object
The timestamp when the requested access will be granted. If this field is not specified it will default to the current time.
716 717 718 |
# File 'lib/models/porcelain.rb', line 716 def start_from @start_from end |
#status ⇒ Object
The status of the access request.
718 719 720 |
# File 'lib/models/porcelain.rb', line 718 def status @status end |
#status_at ⇒ Object
The timestamp when the status changed.
720 721 722 |
# File 'lib/models/porcelain.rb', line 720 def status_at @status_at end |
#valid_until ⇒ Object
The timestamp when the requested access will expire.
722 723 724 |
# File 'lib/models/porcelain.rb', line 722 def valid_until @valid_until end |
#workflow_id ⇒ Object
The workflow the request bound to.
724 725 726 |
# File 'lib/models/porcelain.rb', line 724 def workflow_id @workflow_id end |
Instance Method Details
#to_json(options = {}) ⇒ Object
750 751 752 753 754 755 756 |
# File 'lib/models/porcelain.rb', line 750 def to_json( = {}) hash = {} self.instance_variables.each do |var| hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var end hash.to_json end |