Class: SDM::AccessRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/models/porcelain.rb

Overview

AccessRequests are requests for access to a resource that may match a Workflow.

Instance Attribute Summary collapse

Instance Method Summary collapse

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.



678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
# File 'lib/models/porcelain.rb', line 678

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 =  == nil ? "" : 
  @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_idObject

The account that initiated the request.



657
658
659
# File 'lib/models/porcelain.rb', line 657

def 
  @account_id
end

#grant_idObject

The account grant created, if it exists.



659
660
661
# File 'lib/models/porcelain.rb', line 659

def grant_id
  @grant_id
end

#idObject

The access request id.



661
662
663
# File 'lib/models/porcelain.rb', line 661

def id
  @id
end

#reasonObject

The reason the access was requested.



663
664
665
# File 'lib/models/porcelain.rb', line 663

def reason
  @reason
end

#resource_idObject

The resource id.



665
666
667
# File 'lib/models/porcelain.rb', line 665

def resource_id
  @resource_id
end

#start_fromObject

The timestamp when the requested access will be granted. If this field is not specified it will default to the current time.



668
669
670
# File 'lib/models/porcelain.rb', line 668

def start_from
  @start_from
end

#statusObject

The status of the access request.



670
671
672
# File 'lib/models/porcelain.rb', line 670

def status
  @status
end

#status_atObject

The timestamp when the status changed.



672
673
674
# File 'lib/models/porcelain.rb', line 672

def status_at
  @status_at
end

#valid_untilObject

The timestamp when the requested access will expire.



674
675
676
# File 'lib/models/porcelain.rb', line 674

def valid_until
  @valid_until
end

#workflow_idObject

The workflow the request bound to.



676
677
678
# File 'lib/models/porcelain.rb', line 676

def workflow_id
  @workflow_id
end

Instance Method Details

#to_json(options = {}) ⇒ Object



702
703
704
705
706
707
708
# File 'lib/models/porcelain.rb', line 702

def to_json(options = {})
  hash = {}
  self.instance_variables.each do |var|
    hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var
  end
  hash.to_json
end