Class: ApolloDeploySignalSdkRails::TopicResponse
- Inherits:
-
Object
- Object
- ApolloDeploySignalSdkRails::TopicResponse
- Defined in:
- lib/apollo_deploy_signal_sdk_rails/types.rb
Overview
Schema type: TopicResponse
Instance Attribute Summary collapse
- #created_at ⇒ String
- #default_subscription ⇒ String
- #description ⇒ String?
- #id ⇒ String
- #name ⇒ String
- #object ⇒ String
- #opt_in_count ⇒ Integer
- #opt_out_count ⇒ Integer
- #project_id ⇒ String
- #updated_at ⇒ String
- #visibility ⇒ String
Class Method Summary collapse
-
.from_json(attributes) ⇒ TopicResponse
Create an instance from a parsed JSON hash.
Instance Method Summary collapse
-
#initialize(object: nil, id:, name:, default_subscription:, description:, visibility:, project_id:, opt_in_count:, opt_out_count:, created_at:, updated_at:) ⇒ TopicResponse
constructor
A new instance of TopicResponse.
-
#to_h ⇒ Hash
A hash representation of this object.
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.
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_at ⇒ String
2181 2182 2183 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2181 def created_at @created_at end |
#default_subscription ⇒ String
2169 2170 2171 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2169 def default_subscription @default_subscription end |
#description ⇒ String?
2171 2172 2173 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2171 def description @description end |
#id ⇒ String
2165 2166 2167 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2165 def id @id end |
#name ⇒ String
2167 2168 2169 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2167 def name @name end |
#object ⇒ String
2163 2164 2165 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2163 def object @object end |
#opt_in_count ⇒ 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_count ⇒ Integer
2179 2180 2181 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2179 def opt_out_count @opt_out_count end |
#project_id ⇒ String
2175 2176 2177 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2175 def project_id @project_id end |
#updated_at ⇒ String
2183 2184 2185 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2183 def updated_at @updated_at end |
#visibility ⇒ 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.
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_h ⇒ Hash
Returns 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 |