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.



16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
# File 'lib/models/porcelain.rb', line 16007

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

#access ⇒ Object

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



15993
15994
15995
# File 'lib/models/porcelain.rb', line 15993

def access
  @access
end

#authentication ⇒ Object

The type of authentication for the resource



15995
15996
15997
# File 'lib/models/porcelain.rb', line 15995

def authentication
  @authentication
end

#healthy ⇒ Object

The health check status of the reasource



15997
15998
15999
# File 'lib/models/porcelain.rb', line 15997

def healthy
  @healthy
end

#id ⇒ Object

The resource id.



15999
16000
16001
# File 'lib/models/porcelain.rb', line 15999

def id
  @id
end

#name ⇒ Object

The resource name.



16001
16002
16003
# File 'lib/models/porcelain.rb', line 16001

def name
  @name
end

#tags ⇒ Object

Any tags attached to this resource



16003
16004
16005
# File 'lib/models/porcelain.rb', line 16003

def tags
  @tags
end

#type ⇒ Object

The resource type



16005
16006
16007
# File 'lib/models/porcelain.rb', line 16005

def type
  @type
end

Instance Method Details

#to_json(options = {}) ⇒ Object



16025
16026
16027
16028
16029
16030
16031
# File 'lib/models/porcelain.rb', line 16025

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