Class: Io::Flow::V0::Models::NotificationDeleted

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

Instance Attribute Summary collapse

Attributes inherited from Event

#discriminator

Instance Method Summary collapse

Methods inherited from Event

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ NotificationDeleted

Returns a new instance of NotificationDeleted.



21105
21106
21107
21108
21109
21110
21111
21112
21113
21114
21115
21116
21117
21118
21119
21120
21121
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21105

def initialize(incoming={})
  super(:discriminator => Event::Types::NOTIFICATION_DELETED)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :notification_id, :carrier_tracking_number, :flow_tracking_number, :destination, :origin, :carrier, :service, :order, :package], 'NotificationDeleted')
  @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
  @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
  @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
  @notification_id = HttpClient::Preconditions.assert_class('notification_id', opts.delete(:notification_id), String)
  @carrier_tracking_number = HttpClient::Preconditions.assert_class('carrier_tracking_number', opts.delete(:carrier_tracking_number), String)
  @flow_tracking_number = HttpClient::Preconditions.assert_class('flow_tracking_number', opts.delete(:flow_tracking_number), String)
  @destination = HttpClient::Preconditions.assert_class('destination', HttpClient::Helper.to_object(opts.delete(:destination)), Hash)
  @origin = HttpClient::Preconditions.assert_class('origin', HttpClient::Helper.to_object(opts.delete(:origin)), Hash)
  @carrier = HttpClient::Preconditions.assert_class('carrier', opts.delete(:carrier), String)
  @service = HttpClient::Preconditions.assert_class('service', opts.delete(:service), String)
  @order = HttpClient::Preconditions.assert_class('order', opts.delete(:order), String)
  @package = HttpClient::Preconditions.assert_class('package', HttpClient::Helper.to_object(opts.delete(:package)), Hash)
end

Instance Attribute Details

#carrierObject (readonly)

Returns the value of attribute carrier.



21103
21104
21105
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21103

def carrier
  @carrier
end

#carrier_tracking_numberObject (readonly)

Returns the value of attribute carrier_tracking_number.



21103
21104
21105
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21103

def carrier_tracking_number
  @carrier_tracking_number
end

#destinationObject (readonly)

Returns the value of attribute destination.



21103
21104
21105
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21103

def destination
  @destination
end

#event_idObject (readonly)

Returns the value of attribute event_id.



21103
21104
21105
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21103

def event_id
  @event_id
end

#flow_tracking_numberObject (readonly)

Returns the value of attribute flow_tracking_number.



21103
21104
21105
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21103

def flow_tracking_number
  @flow_tracking_number
end

#notification_idObject (readonly)

Returns the value of attribute notification_id.



21103
21104
21105
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21103

def notification_id
  @notification_id
end

#orderObject (readonly)

Returns the value of attribute order.



21103
21104
21105
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21103

def order
  @order
end

#organizationObject (readonly)

Returns the value of attribute organization.



21103
21104
21105
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21103

def organization
  @organization
end

#originObject (readonly)

Returns the value of attribute origin.



21103
21104
21105
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21103

def origin
  @origin
end

#packageObject (readonly)

Returns the value of attribute package.



21103
21104
21105
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21103

def package
  @package
end

#serviceObject (readonly)

Returns the value of attribute service.



21103
21104
21105
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21103

def service
  @service
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



21103
21104
21105
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21103

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



21127
21128
21129
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21127

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

#subtype_to_hashObject



21131
21132
21133
21134
21135
21136
21137
21138
21139
21140
21141
21142
21143
21144
21145
21146
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21131

def subtype_to_hash
  {
    :event_id => event_id,
    :timestamp => timestamp,
    :organization => organization,
    :notification_id => notification_id,
    :carrier_tracking_number => carrier_tracking_number,
    :flow_tracking_number => flow_tracking_number,
    :destination => destination,
    :origin => origin,
    :carrier => carrier,
    :service => service,
    :order => order,
    :package => package
  }
end

#to_jsonObject



21123
21124
21125
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21123

def to_json
  JSON.dump(to_hash)
end