Class: Io::Flow::V0::Models::ProductRestrictionResultUpserted
- 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.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#product_restriction_result ⇒ Object
readonly
Returns the value of attribute product_restriction_result.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ProductRestrictionResultUpserted
constructor
A new instance of ProductRestrictionResultUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ ProductRestrictionResultUpserted
Returns a new instance of ProductRestrictionResultUpserted.
60943 60944 60945 60946 60947 60948 60949 60950 60951 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60943 def initialize(incoming={}) super(:discriminator => Event::Types::PRODUCT_RESTRICTION_RESULT_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :product_restriction_result], 'ProductRestrictionResultUpserted') @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) @product_restriction_result = (x = opts.delete(:product_restriction_result); x.is_a?(::Io::Flow::V0::Models::ProductRestrictionResult) ? x : ::Io::Flow::V0::Models::ProductRestrictionResult.new(x)) end |
Instance Attribute Details
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
60941 60942 60943 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60941 def event_id @event_id end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
60941 60942 60943 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60941 def organization @organization end |
#product_restriction_result ⇒ Object (readonly)
Returns the value of attribute product_restriction_result.
60941 60942 60943 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60941 def product_restriction_result @product_restriction_result end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
60941 60942 60943 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60941 def @timestamp end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
60957 60958 60959 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60957 def copy(incoming={}) ProductRestrictionResultUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
60961 60962 60963 60964 60965 60966 60967 60968 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60961 def subtype_to_hash { :event_id => event_id, :timestamp => , :organization => organization, :product_restriction_result => product_restriction_result.to_hash } end |
#to_json ⇒ Object
60953 60954 60955 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60953 def to_json JSON.dump(to_hash) end |