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.



15520
15521
15522
15523
15524
15525
15526
15527
15528
15529
15530
15531
15532
15533
15534
15535
15536
# File 'lib/models/porcelain.rb', line 15520

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



15506
15507
15508
# File 'lib/models/porcelain.rb', line 15506

def access
  @access
end

#authenticationObject

The type of authentication for the resource



15508
15509
15510
# File 'lib/models/porcelain.rb', line 15508

def authentication
  @authentication
end

#healthyObject

The health check status of the reasource



15510
15511
15512
# File 'lib/models/porcelain.rb', line 15510

def healthy
  @healthy
end

#idObject

The resource id.



15512
15513
15514
# File 'lib/models/porcelain.rb', line 15512

def id
  @id
end

#nameObject

The resource name.



15514
15515
15516
# File 'lib/models/porcelain.rb', line 15514

def name
  @name
end

#tagsObject

Any tags attached to this resource



15516
15517
15518
# File 'lib/models/porcelain.rb', line 15516

def tags
  @tags
end

#typeObject

The resource type



15518
15519
15520
# File 'lib/models/porcelain.rb', line 15518

def type
  @type
end

Instance Method Details

#to_json(options = {}) ⇒ Object



15538
15539
15540
15541
15542
15543
15544
# File 'lib/models/porcelain.rb', line 15538

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