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.



13927
13928
13929
13930
13931
13932
13933
13934
13935
13936
13937
13938
13939
13940
13941
13942
13943
# File 'lib/models/porcelain.rb', line 13927

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



13913
13914
13915
# File 'lib/models/porcelain.rb', line 13913

def access
  @access
end

#authenticationObject

The type of authentication for the resource



13915
13916
13917
# File 'lib/models/porcelain.rb', line 13915

def authentication
  @authentication
end

#healthyObject

The health check status of the reasource



13917
13918
13919
# File 'lib/models/porcelain.rb', line 13917

def healthy
  @healthy
end

#idObject

The resource id.



13919
13920
13921
# File 'lib/models/porcelain.rb', line 13919

def id
  @id
end

#nameObject

The resource name.



13921
13922
13923
# File 'lib/models/porcelain.rb', line 13921

def name
  @name
end

#tagsObject

Any tags attached to this resource



13923
13924
13925
# File 'lib/models/porcelain.rb', line 13923

def tags
  @tags
end

#typeObject

The resource type



13925
13926
13927
# File 'lib/models/porcelain.rb', line 13925

def type
  @type
end

Instance Method Details

#to_json(options = {}) ⇒ Object



13945
13946
13947
13948
13949
13950
13951
# File 'lib/models/porcelain.rb', line 13945

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