class Io::Flow::V0::Models::EmailNotificationAbandonedOrder

Data about an abandoned order. Today at Flow, this can be triggered by a consumer initating checkout (without completing)

Attributes

order[R]
promotion[R]
urls[R]

Public Class Methods

new(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 40811
def initialize(incoming={})
  super(:discriminator => EmailNotificationData::Types::EMAIL_NOTIFICATION_ABANDONED_ORDER)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:order, :urls], 'EmailNotificationAbandonedOrder')
  @order = (x = opts.delete(:order); x.is_a?(::Io::Flow::V0::Models::OrderSummary) ? x : ::Io::Flow::V0::Models::OrderSummary.new(x))
  @urls = (x = opts.delete(:urls); x.is_a?(::Io::Flow::V0::Models::EmailAbandonedOrderUrls) ? x : ::Io::Flow::V0::Models::EmailAbandonedOrderUrls.new(x))
  @promotion = (x = opts.delete(:promotion); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::EmailAbandonedOrderPromotion) ? x : ::Io::Flow::V0::Models::EmailAbandonedOrderPromotion.new(x)))
end

Public Instance Methods

copy(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 40824
def copy(incoming={})
  EmailNotificationAbandonedOrder.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end
subtype_to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 40828
def subtype_to_hash
  {
    :order => order.to_hash,
    :urls => urls.to_hash,
    :promotion => promotion.nil? ? nil : promotion.to_hash
  }
end
to_json() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 40820
def to_json
  JSON.dump(to_hash)
end