Class: SDM::NodeCreateResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/models/porcelain.rb

Overview

NodeCreateResponse reports how the Nodes were created in the system.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(meta: nil, node: nil, rate_limit: nil, token: nil) ⇒ NodeCreateResponse

Returns a new instance of NodeCreateResponse.



4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
# File 'lib/models/porcelain.rb', line 4373

def initialize(
  meta: nil,
  node: nil,
  rate_limit: nil,
  token: nil
)
  if meta != nil
    @meta = meta
  end
  if node != nil
    @node = node
  end
  if rate_limit != nil
    @rate_limit = rate_limit
  end
  if token != nil
    @token = token
  end
end

Instance Attribute Details

#metaObject

Reserved for future use.



4364
4365
4366
# File 'lib/models/porcelain.rb', line 4364

def meta
  @meta
end

#nodeObject

The created Node.



4366
4367
4368
# File 'lib/models/porcelain.rb', line 4366

def node
  @node
end

#rate_limitObject

Rate limit information.



4368
4369
4370
# File 'lib/models/porcelain.rb', line 4368

def rate_limit
  @rate_limit
end

#tokenObject

The auth token generated for the Node. The Node will use this token to authenticate with the strongDM API.



4371
4372
4373
# File 'lib/models/porcelain.rb', line 4371

def token
  @token
end

Instance Method Details

#to_json(options = {}) ⇒ Object



4393
4394
4395
4396
4397
4398
4399
# File 'lib/models/porcelain.rb', line 4393

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