Class: Io::Flow::V0::Models::LabelEventForm

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 = {}) ⇒ LabelEventForm

Returns a new instance of LabelEventForm.



10539
10540
10541
10542
10543
10544
10545
10546
10547
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10539

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:label_id, :timestamp, :status], 'LabelEventForm')
  @label_id = HttpClient::Preconditions.assert_class('label_id', opts.delete(: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

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



10537
10538
10539
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10537

def address
  @address
end

#descriptionObject (readonly)

Returns the value of attribute description.



10537
10538
10539
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10537

def description
  @description
end

#label_idObject (readonly)

Returns the value of attribute label_id.



10537
10538
10539
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10537

def label_id
  @label_id
end

#statusObject (readonly)

Returns the value of attribute status.



10537
10538
10539
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10537

def status
  @status
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



10537
10538
10539
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10537

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



10553
10554
10555
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10553

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

#to_hashObject



10557
10558
10559
10560
10561
10562
10563
10564
10565
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10557

def to_hash
  {
    :label_id => label_id,
    :timestamp => timestamp,
    :status => status.value,
    :description => description,
    :address => address
  }
end

#to_jsonObject



10549
10550
10551
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10549

def to_json
  JSON.dump(to_hash)
end