Class: Io::Flow::V0::Models::LabelTrackingSummaryUpdate

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ LabelTrackingSummaryUpdate

Returns a new instance of LabelTrackingSummaryUpdate.



48170
48171
48172
48173
48174
48175
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48170

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:timestamp], 'LabelTrackingSummaryUpdate')
  @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
  @created_at = (x = opts.delete(:created_at); x.nil? ? nil : HttpClient::Preconditions.assert_class('created_at', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
end

Instance Attribute Details

#created_atObject (readonly)

Returns the value of attribute created_at.



48168
48169
48170
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48168

def created_at
  @created_at
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



48168
48169
48170
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48168

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



48181
48182
48183
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48181

def copy(incoming={})
  LabelTrackingSummaryUpdate.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



48185
48186
48187
48188
48189
48190
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48185

def to_hash
  {
    :timestamp => timestamp,
    :created_at => created_at
  }
end

#to_jsonObject



48177
48178
48179
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48177

def to_json
  JSON.dump(to_hash)
end