class Io::Flow::V0::Models::TrackingEventForm

Attributes

address[R]
description[R]
status[R]
timestamp[R]
tracking_label_id[R]

Public Class Methods

new(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 71342
def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:tracking_label_id, :timestamp, :status], 'TrackingEventForm')
  @tracking_label_id = HttpClient::Preconditions.assert_class('tracking_label_id', opts.delete(:tracking_label_id), String)
  @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
  @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::TrackingStatus) ? x : ::Io::Flow::V0::Models::TrackingStatus.apply(x))
  @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
  @address = (x = opts.delete(:address); x.nil? ? nil : HttpClient::Preconditions.assert_class('address', x, String))
end

Public Instance Methods

copy(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 71356
def copy(incoming={})
  TrackingEventForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end
to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 71360
def to_hash
  {
    :tracking_label_id => tracking_label_id,
    :timestamp => timestamp,
    :status => status.value,
    :description => description,
    :address => address
  }
end
to_json() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 71352
def to_json
  JSON.dump(to_hash)
end