Class: SDM::RequestableResource

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

Overview

RequestableResource is a resource that can be requested via an AccessRequestConfig

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(access: nil, authentication: nil, healthy: nil, id: nil, name: nil, tags: nil, type: nil) ⇒ RequestableResource

Returns a new instance of RequestableResource.



11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
# File 'lib/models/porcelain.rb', line 11310

def initialize(
  access: nil,
  authentication: nil,
  healthy: nil,
  id: nil,
  name: nil,
  tags: nil,
  type: nil
)
  @access = access == nil ? "" : access
  @authentication = authentication == nil ? "" : authentication
  @healthy = healthy == nil ? false : healthy
  @id = id == nil ? "" : id
  @name = name == nil ? "" : name
  @tags = tags == nil ? SDM::_porcelain_zero_value_tags() : tags
  @type = type == nil ? "" : type
end

Instance Attribute Details

#accessObject

The current state of the user's access to the resources



11296
11297
11298
# File 'lib/models/porcelain.rb', line 11296

def access
  @access
end

#authenticationObject

The type of authentication for the resource



11298
11299
11300
# File 'lib/models/porcelain.rb', line 11298

def authentication
  @authentication
end

#healthyObject

The health check status of the reasource



11300
11301
11302
# File 'lib/models/porcelain.rb', line 11300

def healthy
  @healthy
end

#idObject

The resource id.



11302
11303
11304
# File 'lib/models/porcelain.rb', line 11302

def id
  @id
end

#nameObject

The resource name.



11304
11305
11306
# File 'lib/models/porcelain.rb', line 11304

def name
  @name
end

#tagsObject

Any tags attached to this resource



11306
11307
11308
# File 'lib/models/porcelain.rb', line 11306

def tags
  @tags
end

#typeObject

The resource type



11308
11309
11310
# File 'lib/models/porcelain.rb', line 11308

def type
  @type
end

Instance Method Details

#to_json(options = {}) ⇒ Object



11328
11329
11330
11331
11332
11333
11334
# File 'lib/models/porcelain.rb', line 11328

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