Class: ApolloDeploySignalSdkRails::TopicSubscriptionResponse
- Inherits:
-
Object
- Object
- ApolloDeploySignalSdkRails::TopicSubscriptionResponse
- Defined in:
- lib/apollo_deploy_signal_sdk_rails/types.rb
Overview
Schema type: TopicSubscriptionResponse
Instance Attribute Summary collapse
Class Method Summary collapse
-
.from_json(attributes) ⇒ TopicSubscriptionResponse
Create an instance from a parsed JSON hash.
Instance Method Summary collapse
-
#initialize(topic_id:, subscription:) ⇒ TopicSubscriptionResponse
constructor
A new instance of TopicSubscriptionResponse.
-
#to_h ⇒ Hash
A hash representation of this object.
Constructor Details
#initialize(topic_id:, subscription:) ⇒ TopicSubscriptionResponse
Returns a new instance of TopicSubscriptionResponse.
2530 2531 2532 2533 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2530 def initialize(topic_id: , subscription: ) @topic_id = topic_id @subscription = subscription end |
Instance Attribute Details
#subscription ⇒ String
2527 2528 2529 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2527 def subscription @subscription end |
#topic_id ⇒ String
2525 2526 2527 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2525 def topic_id @topic_id end |
Class Method Details
.from_json(attributes) ⇒ TopicSubscriptionResponse
Create an instance from a parsed JSON hash.
2546 2547 2548 2549 2550 2551 2552 2553 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2546 def self.from_json(attributes) return nil unless attributes.is_a?(Hash) new( topic_id: attributes.key?("topicId") ? attributes["topicId"] : attributes[:topic_id], subscription: attributes.key?("subscription") ? attributes["subscription"] : attributes[:subscription], ) end |
Instance Method Details
#to_h ⇒ Hash
Returns a hash representation of this object.
2536 2537 2538 2539 2540 2541 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2536 def to_h { topic_id: @topic_id, subscription: @subscription, }.compact end |