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.



10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
# File 'lib/models/porcelain.rb', line 10991

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



10977
10978
10979
# File 'lib/models/porcelain.rb', line 10977

def access
  @access
end

#authenticationObject

The type of authentication for the resource



10979
10980
10981
# File 'lib/models/porcelain.rb', line 10979

def authentication
  @authentication
end

#healthyObject

The health check status of the reasource



10981
10982
10983
# File 'lib/models/porcelain.rb', line 10981

def healthy
  @healthy
end

#idObject

The resource id.



10983
10984
10985
# File 'lib/models/porcelain.rb', line 10983

def id
  @id
end

#nameObject

The resource name.



10985
10986
10987
# File 'lib/models/porcelain.rb', line 10985

def name
  @name
end

#tagsObject

Any tags attached to this resource



10987
10988
10989
# File 'lib/models/porcelain.rb', line 10987

def tags
  @tags
end

#typeObject

The resource type



10989
10990
10991
# File 'lib/models/porcelain.rb', line 10989

def type
  @type
end

Instance Method Details

#to_json(options = {}) ⇒ Object



11009
11010
11011
11012
11013
11014
11015
# File 'lib/models/porcelain.rb', line 11009

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