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.



15894
15895
15896
15897
15898
15899
15900
15901
15902
15903
15904
15905
15906
15907
15908
15909
15910
# File 'lib/models/porcelain.rb', line 15894

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



15880
15881
15882
# File 'lib/models/porcelain.rb', line 15880

def access
  @access
end

#authenticationObject

The type of authentication for the resource



15882
15883
15884
# File 'lib/models/porcelain.rb', line 15882

def authentication
  @authentication
end

#healthyObject

The health check status of the reasource



15884
15885
15886
# File 'lib/models/porcelain.rb', line 15884

def healthy
  @healthy
end

#idObject

The resource id.



15886
15887
15888
# File 'lib/models/porcelain.rb', line 15886

def id
  @id
end

#nameObject

The resource name.



15888
15889
15890
# File 'lib/models/porcelain.rb', line 15888

def name
  @name
end

#tagsObject

Any tags attached to this resource



15890
15891
15892
# File 'lib/models/porcelain.rb', line 15890

def tags
  @tags
end

#typeObject

The resource type



15892
15893
15894
# File 'lib/models/porcelain.rb', line 15892

def type
  @type
end

Instance Method Details

#to_json(options = {}) ⇒ Object



15912
15913
15914
15915
15916
15917
15918
# File 'lib/models/porcelain.rb', line 15912

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