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.



14813
14814
14815
14816
14817
14818
14819
14820
14821
14822
14823
14824
14825
14826
14827
14828
14829
# File 'lib/models/porcelain.rb', line 14813

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



14799
14800
14801
# File 'lib/models/porcelain.rb', line 14799

def access
  @access
end

#authenticationObject

The type of authentication for the resource



14801
14802
14803
# File 'lib/models/porcelain.rb', line 14801

def authentication
  @authentication
end

#healthyObject

The health check status of the reasource



14803
14804
14805
# File 'lib/models/porcelain.rb', line 14803

def healthy
  @healthy
end

#idObject

The resource id.



14805
14806
14807
# File 'lib/models/porcelain.rb', line 14805

def id
  @id
end

#nameObject

The resource name.



14807
14808
14809
# File 'lib/models/porcelain.rb', line 14807

def name
  @name
end

#tagsObject

Any tags attached to this resource



14809
14810
14811
# File 'lib/models/porcelain.rb', line 14809

def tags
  @tags
end

#typeObject

The resource type



14811
14812
14813
# File 'lib/models/porcelain.rb', line 14811

def type
  @type
end

Instance Method Details

#to_json(options = {}) ⇒ Object



14831
14832
14833
14834
14835
14836
14837
# File 'lib/models/porcelain.rb', line 14831

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