Class: Io::Flow::V0::Models::AttributeUpserted
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#intent ⇒ Object
readonly
Returns the value of attribute intent.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ AttributeUpserted
constructor
A new instance of AttributeUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ AttributeUpserted
Returns a new instance of AttributeUpserted.
11923 11924 11925 11926 11927 11928 11929 11930 11931 11932 11933 11934 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11923 def initialize(incoming={}) super(:discriminator => Event::Types::ATTRIBUTE_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :key, :label, :type], 'AttributeUpserted') @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String) = 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) @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String) @label = HttpClient::Preconditions.assert_class('label', opts.delete(:label), String) @intent = (x = opts.delete(:intent); x.nil? ? nil : HttpClient::Preconditions.assert_class('intent', x, String)) @type = HttpClient::Preconditions.assert_class('type', opts.delete(:type), String) end |
Instance Attribute Details
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
11921 11922 11923 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11921 def event_id @event_id end |
#intent ⇒ Object (readonly)
Returns the value of attribute intent.
11921 11922 11923 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11921 def intent @intent end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
11921 11922 11923 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11921 def key @key end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
11921 11922 11923 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11921 def label @label end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
11921 11922 11923 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11921 def organization @organization end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
11921 11922 11923 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11921 def end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
11921 11922 11923 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11921 def type @type end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
11940 11941 11942 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11940 def copy(incoming={}) AttributeUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
11944 11945 11946 11947 11948 11949 11950 11951 11952 11953 11954 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11944 def subtype_to_hash { :event_id => event_id, :timestamp => , :organization => organization, :key => key, :label => label, :intent => intent, :type => type } end |
#to_json ⇒ Object
11936 11937 11938 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11936 def to_json JSON.dump(to_hash) end |