Class: Io::Flow::V0::Models::MembershipUpserted
- 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.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#role ⇒ Object
readonly
Returns the value of attribute role.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#user_id ⇒ Object
readonly
Returns the value of attribute user_id.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ MembershipUpserted
constructor
A new instance of MembershipUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ MembershipUpserted
Returns a new instance of MembershipUpserted.
23842 23843 23844 23845 23846 23847 23848 23849 23850 23851 23852 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23842 def initialize(incoming={}) super(:discriminator => Event::Types::MEMBERSHIP_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :id, :organization, :user_id, :role], 'MembershipUpserted') @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) @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String) @user_id = HttpClient::Preconditions.assert_class('user_id', opts.delete(:user_id), String) @role = HttpClient::Preconditions.assert_class('role', opts.delete(:role), String) end |
Instance Attribute Details
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
23840 23841 23842 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23840 def event_id @event_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
23840 23841 23842 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23840 def id @id end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
23840 23841 23842 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23840 def organization @organization end |
#role ⇒ Object (readonly)
Returns the value of attribute role.
23840 23841 23842 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23840 def role @role end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
23840 23841 23842 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23840 def end |
#user_id ⇒ Object (readonly)
Returns the value of attribute user_id.
23840 23841 23842 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23840 def user_id @user_id end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
23858 23859 23860 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23858 def copy(incoming={}) MembershipUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
23862 23863 23864 23865 23866 23867 23868 23869 23870 23871 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23862 def subtype_to_hash { :event_id => event_id, :timestamp => , :id => id, :organization => organization, :user_id => user_id, :role => role } end |
#to_json ⇒ Object
23854 23855 23856 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23854 def to_json JSON.dump(to_hash) end |