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.



4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
# File 'lib/models/porcelain.rb', line 4695

def initialize(
  meta: nil,
  node: nil,
  rate_limit: nil,
  token: nil
)
  @meta = meta == nil ? nil : meta
  @node = node == nil ? nil : node
  @rate_limit = rate_limit == nil ? nil : rate_limit
  @token = token == nil ? "" : token
end

Instance Attribute Details

#metaObject

Reserved for future use.



4686
4687
4688
# File 'lib/models/porcelain.rb', line 4686

def meta
  @meta
end

#nodeObject

The created Node.



4688
4689
4690
# File 'lib/models/porcelain.rb', line 4688

def node
  @node
end

#rate_limitObject

Rate limit information.



4690
4691
4692
# File 'lib/models/porcelain.rb', line 4690

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.



4693
4694
4695
# File 'lib/models/porcelain.rb', line 4693

def token
  @token
end

Instance Method Details

#to_json(options = {}) ⇒ Object



4707
4708
4709
4710
4711
4712
4713
# File 'lib/models/porcelain.rb', line 4707

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