Class: NewStoreApi::SubscriptionRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::SubscriptionRequest
- Defined in:
- lib/new_store_api/models/subscription_request.rb
Overview
SubscriptionRequest Model.
Instance Attribute Summary collapse
-
#app_name ⇒ String
Identifier of the app name where this topic makes sense.
-
#topic_name ⇒ String
Identifier topic name for this subscription.
-
#topic_value ⇒ String
Identifier topic value for this subscription which can be 'True' or 'False'.
-
#user_id ⇒ String
Identifier of the user who wants to subscribe to a new topic.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(app_name = nil, topic_name = nil, topic_value = nil, user_id = nil) ⇒ SubscriptionRequest
constructor
A new instance of SubscriptionRequest.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(app_name = nil, topic_name = nil, topic_value = nil, user_id = nil) ⇒ SubscriptionRequest
Returns a new instance of SubscriptionRequest.
49 50 51 52 53 54 55 |
# File 'lib/new_store_api/models/subscription_request.rb', line 49 def initialize(app_name = nil, topic_name = nil, topic_value = nil, user_id = nil) @app_name = app_name @topic_name = topic_name @topic_value = topic_value @user_id = user_id end |
Instance Attribute Details
#app_name ⇒ String
Identifier of the app name where this topic makes sense.
14 15 16 |
# File 'lib/new_store_api/models/subscription_request.rb', line 14 def app_name @app_name end |
#topic_name ⇒ String
Identifier topic name for this subscription
18 19 20 |
# File 'lib/new_store_api/models/subscription_request.rb', line 18 def topic_name @topic_name end |
#topic_value ⇒ String
Identifier topic value for this subscription which can be 'True' or 'False'
23 24 25 |
# File 'lib/new_store_api/models/subscription_request.rb', line 23 def topic_value @topic_value end |
#user_id ⇒ String
Identifier of the user who wants to subscribe to a new topic.
27 28 29 |
# File 'lib/new_store_api/models/subscription_request.rb', line 27 def user_id @user_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/new_store_api/models/subscription_request.rb', line 58 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. app_name = hash.key?('app_name') ? hash['app_name'] : nil topic_name = hash.key?('topic_name') ? hash['topic_name'] : nil topic_value = hash.key?('topic_value') ? hash['topic_value'] : nil user_id = hash.key?('user_id') ? hash['user_id'] : nil # Create object from extracted values. SubscriptionRequest.new(app_name, topic_name, topic_value, user_id) end |
.names ⇒ Object
A mapping from model property names to API property names.
30 31 32 33 34 35 36 37 |
# File 'lib/new_store_api/models/subscription_request.rb', line 30 def self.names @_hash = {} if @_hash.nil? @_hash['app_name'] = 'app_name' @_hash['topic_name'] = 'topic_name' @_hash['topic_value'] = 'topic_value' @_hash['user_id'] = 'user_id' @_hash end |
.nullables ⇒ Object
An array for nullable fields
45 46 47 |
# File 'lib/new_store_api/models/subscription_request.rb', line 45 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
40 41 42 |
# File 'lib/new_store_api/models/subscription_request.rb', line 40 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
82 83 84 85 86 |
# File 'lib/new_store_api/models/subscription_request.rb', line 82 def inspect class_name = self.class.name.split('::').last "<#{class_name} app_name: #{@app_name.inspect}, topic_name: #{@topic_name.inspect},"\ " topic_value: #{@topic_value.inspect}, user_id: #{@user_id.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
75 76 77 78 79 |
# File 'lib/new_store_api/models/subscription_request.rb', line 75 def to_s class_name = self.class.name.split('::').last "<#{class_name} app_name: #{@app_name}, topic_name: #{@topic_name}, topic_value:"\ " #{@topic_value}, user_id: #{@user_id}>" end |