Class: ApolloDeploySignalSdkRails::TopicSubscriptionBody

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

Overview

Schema type: TopicSubscriptionBody

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, subscription:) ⇒ TopicSubscriptionBody

Returns a new instance of TopicSubscriptionBody.

Parameters:

  • id (String)

    , subscription [String]



2721
2722
2723
2724
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2721

def initialize(id: , subscription: )
  @id = id
  @subscription = subscription
end

Instance Attribute Details

#idString

Returns:

  • (String)


2716
2717
2718
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2716

def id
  @id
end

#subscriptionString

Returns:

  • (String)


2718
2719
2720
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2718

def subscription
  @subscription
end

Class Method Details

.from_json(attributes) ⇒ TopicSubscriptionBody

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



2737
2738
2739
2740
2741
2742
2743
2744
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2737

def self.from_json(attributes)
  return nil unless attributes.is_a?(Hash)

  new(
    id: attributes.key?("id") ? attributes["id"] : attributes[: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



2727
2728
2729
2730
2731
2732
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2727

def to_h
  {
    id: @id,
    subscription: @subscription,
  }.compact
end