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, 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.



1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
# File 'lib/models/porcelain.rb', line 1260

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

The account that initiated the request.



1232
1233
1234
# File 'lib/models/porcelain.rb', line 1232

def 
  @account_id
end

#durationObject

Duration of the access request. Deprecated: use requested/result duration instead



1235
1236
1237
# File 'lib/models/porcelain.rb', line 1235

def duration
  @duration
end

#grant_idObject

The account grant created, if it exists.



1237
1238
1239
# File 'lib/models/porcelain.rb', line 1237

def grant_id
  @grant_id
end

#idObject

The access request id.



1239
1240
1241
# File 'lib/models/porcelain.rb', line 1239

def id
  @id
end

#reasonObject

The reason the access was requested.



1241
1242
1243
# File 'lib/models/porcelain.rb', line 1241

def reason
  @reason
end

#requesteddurationObject

The duration that access was requested for, if any.



1243
1244
1245
# File 'lib/models/porcelain.rb', line 1243

def requestedduration
  @requestedduration
end

#resource_idObject

The resource id.



1245
1246
1247
# File 'lib/models/porcelain.rb', line 1245

def resource_id
  @resource_id
end

#resultdurationObject

The duration that results from an approved request.



1247
1248
1249
# File 'lib/models/porcelain.rb', line 1247

def resultduration
  @resultduration
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.



1250
1251
1252
# File 'lib/models/porcelain.rb', line 1250

def start_from
  @start_from
end

#statusObject

The status of the access request.



1252
1253
1254
# File 'lib/models/porcelain.rb', line 1252

def status
  @status
end

#status_atObject

The timestamp when the status changed.



1254
1255
1256
# File 'lib/models/porcelain.rb', line 1254

def status_at
  @status_at
end

#valid_untilObject

The timestamp when the requested access will expire.



1256
1257
1258
# File 'lib/models/porcelain.rb', line 1256

def valid_until
  @valid_until
end

#workflow_idObject

The workflow the request bound to.



1258
1259
1260
# File 'lib/models/porcelain.rb', line 1258

def workflow_id
  @workflow_id
end

Instance Method Details

#to_json(options = {}) ⇒ Object



1290
1291
1292
1293
1294
1295
1296
# File 'lib/models/porcelain.rb', line 1290

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