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.
-
#duration ⇒ Object
Duration of the access 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.
-
#requestedduration ⇒ Object
The duration that access was requested for, if any.
-
#resource_id ⇒ Object
The resource id.
-
#resultduration ⇒ Object
The duration that results from an approved request.
-
#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, duration: nil, grant_id: nil, id: nil, reason: nil, requestedduration: nil, resource_id: nil, resultduration: 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, duration: nil, grant_id: nil, id: nil, reason: nil, requestedduration: nil, resource_id: nil, resultduration: nil, start_from: nil, status: nil, status_at: nil, valid_until: nil, workflow_id: nil) ⇒ AccessRequest
Returns a new instance of AccessRequest.
1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 |
# File 'lib/models/porcelain.rb', line 1249 def initialize( account_id: nil, duration: nil, grant_id: nil, id: nil, reason: nil, requestedduration: nil, resource_id: nil, resultduration: nil, start_from: nil, status: nil, status_at: nil, valid_until: nil, workflow_id: nil ) @account_id = account_id == nil ? "" : account_id @duration = duration == nil ? 0 : duration @grant_id = grant_id == nil ? "" : grant_id @id = id == nil ? "" : id @reason = reason == nil ? "" : reason @requestedduration = requestedduration == nil ? nil : requestedduration @resource_id = resource_id == nil ? "" : resource_id @resultduration = resultduration == nil ? nil : resultduration @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.
1221 1222 1223 |
# File 'lib/models/porcelain.rb', line 1221 def account_id @account_id end |
#duration ⇒ Object
Duration of the access request. Deprecated: use requested/result duration instead
1224 1225 1226 |
# File 'lib/models/porcelain.rb', line 1224 def duration @duration end |
#grant_id ⇒ Object
The account grant created, if it exists.
1226 1227 1228 |
# File 'lib/models/porcelain.rb', line 1226 def grant_id @grant_id end |
#id ⇒ Object
The access request id.
1228 1229 1230 |
# File 'lib/models/porcelain.rb', line 1228 def id @id end |
#reason ⇒ Object
The reason the access was requested.
1230 1231 1232 |
# File 'lib/models/porcelain.rb', line 1230 def reason @reason end |
#requestedduration ⇒ Object
The duration that access was requested for, if any.
1232 1233 1234 |
# File 'lib/models/porcelain.rb', line 1232 def requestedduration @requestedduration end |
#resource_id ⇒ Object
The resource id.
1234 1235 1236 |
# File 'lib/models/porcelain.rb', line 1234 def resource_id @resource_id end |
#resultduration ⇒ Object
The duration that results from an approved request.
1236 1237 1238 |
# File 'lib/models/porcelain.rb', line 1236 def resultduration @resultduration 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.
1239 1240 1241 |
# File 'lib/models/porcelain.rb', line 1239 def start_from @start_from end |
#status ⇒ Object
The status of the access request.
1241 1242 1243 |
# File 'lib/models/porcelain.rb', line 1241 def status @status end |
#status_at ⇒ Object
The timestamp when the status changed.
1243 1244 1245 |
# File 'lib/models/porcelain.rb', line 1243 def status_at @status_at end |
#valid_until ⇒ Object
The timestamp when the requested access will expire.
1245 1246 1247 |
# File 'lib/models/porcelain.rb', line 1245 def valid_until @valid_until end |
#workflow_id ⇒ Object
The workflow the request bound to.
1247 1248 1249 |
# File 'lib/models/porcelain.rb', line 1247 def workflow_id @workflow_id end |
Instance Method Details
#to_json(options = {}) ⇒ Object
1279 1280 1281 1282 1283 1284 1285 |
# File 'lib/models/porcelain.rb', line 1279 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 |