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.



5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
# File 'lib/models/porcelain.rb', line 5134

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.



5125
5126
5127
# File 'lib/models/porcelain.rb', line 5125

def meta
  @meta
end

#nodeObject

The created Node.



5127
5128
5129
# File 'lib/models/porcelain.rb', line 5127

def node
  @node
end

#rate_limitObject

Rate limit information.



5129
5130
5131
# File 'lib/models/porcelain.rb', line 5129

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.



5132
5133
5134
# File 'lib/models/porcelain.rb', line 5132

def token
  @token
end

Instance Method Details

#to_json(options = {}) ⇒ Object



5154
5155
5156
5157
5158
5159
5160
# File 'lib/models/porcelain.rb', line 5154

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