Class: ApolloDeploySignalSdkRails::StreamEventResponse
- Inherits:
-
Object
- Object
- ApolloDeploySignalSdkRails::StreamEventResponse
- Defined in:
- lib/apollo_deploy_signal_sdk_rails/types.rb
Overview
Schema type: StreamEventResponse
Instance Attribute Summary collapse
Class Method Summary collapse
-
.from_json(attributes) ⇒ StreamEventResponse
Create an instance from a parsed JSON hash.
Instance Method Summary collapse
-
#initialize(type:, email_id:, occurred_at:, data: nil) ⇒ StreamEventResponse
constructor
A new instance of StreamEventResponse.
-
#to_h ⇒ Hash
A hash representation of this object.
Constructor Details
#initialize(type:, email_id:, occurred_at:, data: nil) ⇒ StreamEventResponse
Returns a new instance of StreamEventResponse.
639 640 641 642 643 644 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 639 def initialize(type: , email_id: , occurred_at: , data: nil) @type = type @email_id = email_id @occurred_at = occurred_at @data = data end |
Instance Attribute Details
#data ⇒ Hash{String => String}
636 637 638 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 636 def data @data end |
#email_id ⇒ String
632 633 634 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 632 def email_id @email_id end |
#occurred_at ⇒ String
634 635 636 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 634 def occurred_at @occurred_at end |
#type ⇒ String
630 631 632 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 630 def type @type end |
Class Method Details
.from_json(attributes) ⇒ StreamEventResponse
Create an instance from a parsed JSON hash.
659 660 661 662 663 664 665 666 667 668 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 659 def self.from_json(attributes) return nil unless attributes.is_a?(Hash) new( type: attributes.key?("type") ? attributes["type"] : attributes[:type], email_id: attributes.key?("emailId") ? attributes["emailId"] : attributes[:email_id], occurred_at: attributes.key?("occurredAt") ? attributes["occurredAt"] : attributes[:occurred_at], data: attributes.key?("data") ? attributes["data"] : attributes[:data], ) end |
Instance Method Details
#to_h ⇒ Hash
Returns a hash representation of this object.
647 648 649 650 651 652 653 654 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 647 def to_h { type: @type, email_id: @email_id, occurred_at: @occurred_at, data: @data, }.compact end |