Class: Io::Flow::V0::Models::AbandonedOrderSettings

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

Returns a new instance of AbandonedOrderSettings.



28816
28817
28818
28819
28820
28821
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28816

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:email_settings, :status], 'AbandonedOrderSettings')
  @email_settings = (x = opts.delete(:email_settings); x.is_a?(::Io::Flow::V0::Models::AbandonedOrderEmailSettings) ? x : ::Io::Flow::V0::Models::AbandonedOrderEmailSettings.new(x))
  @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::AbandonedOrderSettingStatus) ? x : ::Io::Flow::V0::Models::AbandonedOrderSettingStatus.apply(x))
end

Instance Attribute Details

#email_settingsObject (readonly)

Returns the value of attribute email_settings.



28814
28815
28816
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28814

def email_settings
  @email_settings
end

#statusObject (readonly)

Returns the value of attribute status.



28814
28815
28816
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28814

def status
  @status
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



28827
28828
28829
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28827

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

#to_hashObject



28831
28832
28833
28834
28835
28836
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28831

def to_hash
  {
    :email_settings => email_settings.to_hash,
    :status => status.value
  }
end

#to_jsonObject



28823
28824
28825
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28823

def to_json
  JSON.dump(to_hash)
end