Class: Io::Flow::V0::Models::ProductRestrictionResultDeleted

Inherits:
Event
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Attributes inherited from Event

#discriminator

Instance Method Summary collapse

Methods inherited from Event

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ ProductRestrictionResultDeleted

Returns a new instance of ProductRestrictionResultDeleted.



60910
60911
60912
60913
60914
60915
60916
60917
60918
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60910

def initialize(incoming={})
  super(:discriminator => Event::Types::PRODUCT_RESTRICTION_RESULT_DELETED)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :product_restriction_result], 'ProductRestrictionResultDeleted')
  @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_idObject (readonly)

Returns the value of attribute event_id.



60908
60909
60910
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60908

def event_id
  @event_id
end

#organizationObject (readonly)

Returns the value of attribute organization.



60908
60909
60910
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60908

def organization
  @organization
end

#product_restriction_resultObject (readonly)

Returns the value of attribute product_restriction_result.



60908
60909
60910
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60908

def product_restriction_result
  @product_restriction_result
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



60908
60909
60910
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60908

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



60924
60925
60926
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60924

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

#subtype_to_hashObject



60928
60929
60930
60931
60932
60933
60934
60935
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60928

def subtype_to_hash
  {
    :event_id => event_id,
    :timestamp => timestamp,
    :organization => organization,
    :product_restriction_result => product_restriction_result.to_hash
  }
end

#to_jsonObject



60920
60921
60922
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60920

def to_json
  JSON.dump(to_hash)
end