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.



10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
# File 'lib/models/porcelain.rb', line 10559

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



10545
10546
10547
# File 'lib/models/porcelain.rb', line 10545

def access
  @access
end

#authenticationObject

The type of authentication for the resource



10547
10548
10549
# File 'lib/models/porcelain.rb', line 10547

def authentication
  @authentication
end

#healthyObject

The health check status of the reasource



10549
10550
10551
# File 'lib/models/porcelain.rb', line 10549

def healthy
  @healthy
end

#idObject

The resource id.



10551
10552
10553
# File 'lib/models/porcelain.rb', line 10551

def id
  @id
end

#nameObject

The resource name.



10553
10554
10555
# File 'lib/models/porcelain.rb', line 10553

def name
  @name
end

#tagsObject

Any tags attached to this resource



10555
10556
10557
# File 'lib/models/porcelain.rb', line 10555

def tags
  @tags
end

#typeObject

The resource type



10557
10558
10559
# File 'lib/models/porcelain.rb', line 10557

def type
  @type
end

Instance Method Details

#to_json(options = {}) ⇒ Object



10577
10578
10579
10580
10581
10582
10583
# File 'lib/models/porcelain.rb', line 10577

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