Class: SDM::AccountResource

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

Overview

AccountResource represents an individual access grant of a Account to a Resource.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account_grant_id: nil, account_id: nil, created_at: nil, expires_at: nil, granted_at: nil, resource_id: nil, role_id: nil) ⇒ AccountResource

Returns a new instance of AccountResource.



2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
# File 'lib/models/porcelain.rb', line 2217

def initialize(
  account_grant_id: nil,
  account_id: nil,
  created_at: nil,
  expires_at: nil,
  granted_at: nil,
  resource_id: nil,
  role_id: nil
)
  @account_grant_id =  == nil ? "" : 
  @account_id =  == nil ? "" : 
  @created_at = created_at == nil ? nil : created_at
  @expires_at = expires_at == nil ? nil : expires_at
  @granted_at = granted_at == nil ? nil : granted_at
  @resource_id = resource_id == nil ? "" : resource_id
  @role_id = role_id == nil ? "" : role_id
end

Instance Attribute Details

#account_grant_id ⇒ Object

The unique identifier of the AccountGrant through which the Account was granted access to the Resource. If empty, access was not granted through an AccountGrant.



2200
2201
2202
# File 'lib/models/porcelain.rb', line 2200

def 
  @account_grant_id
end

#account_id ⇒ Object

The unique identifier of the Account to which access is granted.



2202
2203
2204
# File 'lib/models/porcelain.rb', line 2202

def 
  @account_id
end

#created_at ⇒ Object

The time this grant was created, distinct from 'granted at' in the case where access is scheduled for the future. If access was granted, revoked, and granted again, this will reflect the later creation time.



2205
2206
2207
# File 'lib/models/porcelain.rb', line 2205

def created_at
  @created_at
end

#expires_at ⇒ Object

The time at which access will expire. If empty, this access has no expiration.



2207
2208
2209
# File 'lib/models/porcelain.rb', line 2207

def expires_at
  @expires_at
end

#granted_at ⇒ Object

The most recent time at which access was granted. If access was granted, revoked, and granted again, this will reflect the later time.



2210
2211
2212
# File 'lib/models/porcelain.rb', line 2210

def granted_at
  @granted_at
end

#resource_id ⇒ Object

The unique identifier of the Resource to which access is granted.



2212
2213
2214
# File 'lib/models/porcelain.rb', line 2212

def resource_id
  @resource_id
end

#role_id ⇒ Object

The unique identifier of the Role through which the Account was granted access to the Resource. If empty, access was not granted through an AccountAttachment to a Role.



2215
2216
2217
# File 'lib/models/porcelain.rb', line 2215

def role_id
  @role_id
end

Instance Method Details

#to_json(options = {}) ⇒ Object



2235
2236
2237
2238
2239
2240
2241
# File 'lib/models/porcelain.rb', line 2235

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