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.



10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
# File 'lib/models/porcelain.rb', line 10920

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



10906
10907
10908
# File 'lib/models/porcelain.rb', line 10906

def access
  @access
end

#authenticationObject

The type of authentication for the resource



10908
10909
10910
# File 'lib/models/porcelain.rb', line 10908

def authentication
  @authentication
end

#healthyObject

The health check status of the reasource



10910
10911
10912
# File 'lib/models/porcelain.rb', line 10910

def healthy
  @healthy
end

#idObject

The resource id.



10912
10913
10914
# File 'lib/models/porcelain.rb', line 10912

def id
  @id
end

#nameObject

The resource name.



10914
10915
10916
# File 'lib/models/porcelain.rb', line 10914

def name
  @name
end

#tagsObject

Any tags attached to this resource



10916
10917
10918
# File 'lib/models/porcelain.rb', line 10916

def tags
  @tags
end

#typeObject

The resource type



10918
10919
10920
# File 'lib/models/porcelain.rb', line 10918

def type
  @type
end

Instance Method Details

#to_json(options = {}) ⇒ Object



10938
10939
10940
10941
10942
10943
10944
# File 'lib/models/porcelain.rb', line 10938

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