Class: Io::Flow::V0::Models::TierUpserted
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#direction ⇒ Object
readonly
Returns the value of attribute direction.
-
#display ⇒ Object
readonly
Returns the value of attribute display.
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#experience_key ⇒ Object
readonly
Returns the value of attribute experience_key.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#integration ⇒ Object
readonly
Returns the value of attribute integration.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#rules ⇒ Object
readonly
Returns the value of attribute rules.
-
#services ⇒ Object
readonly
Returns the value of attribute services.
-
#strategy ⇒ Object
readonly
Returns the value of attribute strategy.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#visibility ⇒ Object
readonly
Returns the value of attribute visibility.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ TierUpserted
constructor
A new instance of TierUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ TierUpserted
Returns a new instance of TierUpserted.
40789 40790 40791 40792 40793 40794 40795 40796 40797 40798 40799 40800 40801 40802 40803 40804 40805 40806 40807 40808 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40789 def initialize(incoming={}) super(:discriminator => Event::Types::TIER_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :id, :experience_key, :integration, :name, :rules, :services, :strategy, :visibility], 'TierUpserted') @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) @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @experience_key = HttpClient::Preconditions.assert_class('experience_key', opts.delete(:experience_key), String) @integration = HttpClient::Preconditions.assert_class('integration', opts.delete(:integration), String) @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) @rules = HttpClient::Preconditions.assert_class('rules', opts.delete(:rules), Array).map { |v| HttpClient::Preconditions.assert_class('rules', HttpClient::Helper.to_object(v), Hash) } @services = HttpClient::Preconditions.assert_class('services', opts.delete(:services), Array).map { |v| HttpClient::Preconditions.assert_class('services', HttpClient::Helper.to_object(v), Hash) } @strategy = HttpClient::Preconditions.assert_class('strategy', opts.delete(:strategy), String) @visibility = HttpClient::Preconditions.assert_class('visibility', opts.delete(:visibility), String) @currency = (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String)) @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String)) @direction = (x = opts.delete(:direction); x.nil? ? nil : HttpClient::Preconditions.assert_class('direction', x, String)) @display = (x = opts.delete(:display); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::TierDisplay) ? x : ::Io::Flow::V0::Models::TierDisplay.new(x))) end |
Instance Attribute Details
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
40787 40788 40789 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40787 def currency @currency end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
40787 40788 40789 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40787 def description @description end |
#direction ⇒ Object (readonly)
Returns the value of attribute direction.
40787 40788 40789 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40787 def direction @direction end |
#display ⇒ Object (readonly)
Returns the value of attribute display.
40787 40788 40789 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40787 def display @display end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
40787 40788 40789 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40787 def event_id @event_id end |
#experience_key ⇒ Object (readonly)
Returns the value of attribute experience_key.
40787 40788 40789 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40787 def experience_key @experience_key end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
40787 40788 40789 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40787 def id @id end |
#integration ⇒ Object (readonly)
Returns the value of attribute integration.
40787 40788 40789 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40787 def integration @integration end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
40787 40788 40789 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40787 def name @name end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
40787 40788 40789 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40787 def organization @organization end |
#rules ⇒ Object (readonly)
Returns the value of attribute rules.
40787 40788 40789 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40787 def rules @rules end |
#services ⇒ Object (readonly)
Returns the value of attribute services.
40787 40788 40789 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40787 def services @services end |
#strategy ⇒ Object (readonly)
Returns the value of attribute strategy.
40787 40788 40789 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40787 def strategy @strategy end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
40787 40788 40789 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40787 def @timestamp end |
#visibility ⇒ Object (readonly)
Returns the value of attribute visibility.
40787 40788 40789 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40787 def visibility @visibility end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
40814 40815 40816 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40814 def copy(incoming={}) TierUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
40818 40819 40820 40821 40822 40823 40824 40825 40826 40827 40828 40829 40830 40831 40832 40833 40834 40835 40836 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40818 def subtype_to_hash { :event_id => event_id, :timestamp => , :organization => organization, :id => id, :experience_key => experience_key, :integration => integration, :name => name, :rules => rules, :services => services, :strategy => strategy, :visibility => visibility, :currency => currency, :description => description, :direction => direction, :display => display.nil? ? nil : display.to_hash } end |
#to_json ⇒ Object
40810 40811 40812 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40810 def to_json JSON.dump(to_hash) end |