Class: ApolloDeploySignalSdkRails::TopicSubscriptionResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/apollo_deploy_signal_sdk_rails/types.rb

Overview

Schema type: TopicSubscriptionResponse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(topic_id:, subscription:) ⇒ TopicSubscriptionResponse

Returns a new instance of TopicSubscriptionResponse.

Parameters:

  • topic_id (String)

    , subscription [String]



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

#subscriptionString

Returns:

  • (String)


2527
2528
2529
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2527

def subscription
  @subscription
end

#topic_idString

Returns:

  • (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.

Parameters:

  • attributes (Hash)

Returns:



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_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    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