Class: ApolloDeploySignalSdkRails::TopicResponse

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

Overview

Schema type: TopicResponse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object: nil, id:, name:, default_subscription:, description:, visibility:, project_id:, opt_in_count:, opt_out_count:, created_at:, updated_at:) ⇒ TopicResponse

Returns a new instance of TopicResponse.

Parameters:

  • object (String) (defaults to: nil)

    , id [String], name [String], default_subscription [String], description [String, nil], visibility [String], project_id [String], opt_in_count [Integer], opt_out_count [Integer], created_at [String], updated_at [String]



2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2186

def initialize(object: nil, id: , name: , default_subscription: , description: , visibility: , project_id: , opt_in_count: , opt_out_count: , created_at: , updated_at: )
  @object = object
  @id = id
  @name = name
  @default_subscription = default_subscription
  @description = description
  @visibility = visibility
  @project_id = project_id
  @opt_in_count = opt_in_count
  @opt_out_count = opt_out_count
  @created_at = created_at
  @updated_at = updated_at
end

Instance Attribute Details

#created_atString

Returns:

  • (String)


2181
2182
2183
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2181

def created_at
  @created_at
end

#default_subscriptionString

Returns:

  • (String)


2169
2170
2171
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2169

def default_subscription
  @default_subscription
end

#descriptionString?

Returns:

  • (String, nil)


2171
2172
2173
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2171

def description
  @description
end

#idString

Returns:

  • (String)


2165
2166
2167
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2165

def id
  @id
end

#nameString

Returns:

  • (String)


2167
2168
2169
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2167

def name
  @name
end

#objectString

Returns:

  • (String)


2163
2164
2165
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2163

def object
  @object
end

#opt_in_countInteger

Returns:

  • (Integer)


2177
2178
2179
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2177

def opt_in_count
  @opt_in_count
end

#opt_out_countInteger

Returns:

  • (Integer)


2179
2180
2181
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2179

def opt_out_count
  @opt_out_count
end

#project_idString

Returns:

  • (String)


2175
2176
2177
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2175

def project_id
  @project_id
end

#updated_atString

Returns:

  • (String)


2183
2184
2185
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2183

def updated_at
  @updated_at
end

#visibilityString

Returns:

  • (String)


2173
2174
2175
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2173

def visibility
  @visibility
end

Class Method Details

.from_json(attributes) ⇒ TopicResponse

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2220

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

  new(
    object: attributes.key?("object") ? attributes["object"] : attributes[:object],
    id: attributes.key?("id") ? attributes["id"] : attributes[:id],
    name: attributes.key?("name") ? attributes["name"] : attributes[:name],
    default_subscription: attributes.key?("defaultSubscription") ? attributes["defaultSubscription"] : attributes[:default_subscription],
    description: attributes.key?("description") ? attributes["description"] : attributes[:description],
    visibility: attributes.key?("visibility") ? attributes["visibility"] : attributes[:visibility],
    project_id: attributes.key?("projectId") ? attributes["projectId"] : attributes[:project_id],
    opt_in_count: attributes.key?("optInCount") ? attributes["optInCount"] : attributes[:opt_in_count],
    opt_out_count: attributes.key?("optOutCount") ? attributes["optOutCount"] : attributes[:opt_out_count],
    created_at: attributes.key?("createdAt") ? attributes["createdAt"] : attributes[:created_at],
    updated_at: attributes.key?("updatedAt") ? attributes["updatedAt"] : attributes[:updated_at],
  )
end

Instance Method Details

#to_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    a hash representation of this object



2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2201

def to_h
  {
    object: @object,
    id: @id,
    name: @name,
    default_subscription: @default_subscription,
    description: @description,
    visibility: @visibility,
    project_id: @project_id,
    opt_in_count: @opt_in_count,
    opt_out_count: @opt_out_count,
    created_at: @created_at,
    updated_at: @updated_at,
  }.compact
end