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.



12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
# File 'lib/models/porcelain.rb', line 12385

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



12371
12372
12373
# File 'lib/models/porcelain.rb', line 12371

def access
  @access
end

#authenticationObject

The type of authentication for the resource



12373
12374
12375
# File 'lib/models/porcelain.rb', line 12373

def authentication
  @authentication
end

#healthyObject

The health check status of the reasource



12375
12376
12377
# File 'lib/models/porcelain.rb', line 12375

def healthy
  @healthy
end

#idObject

The resource id.



12377
12378
12379
# File 'lib/models/porcelain.rb', line 12377

def id
  @id
end

#nameObject

The resource name.



12379
12380
12381
# File 'lib/models/porcelain.rb', line 12379

def name
  @name
end

#tagsObject

Any tags attached to this resource



12381
12382
12383
# File 'lib/models/porcelain.rb', line 12381

def tags
  @tags
end

#typeObject

The resource type



12383
12384
12385
# File 'lib/models/porcelain.rb', line 12383

def type
  @type
end

Instance Method Details

#to_json(options = {}) ⇒ Object



12403
12404
12405
12406
12407
12408
12409
# File 'lib/models/porcelain.rb', line 12403

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