Class: Verizon::RegisterCallbackRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- Verizon::RegisterCallbackRequest
- Defined in:
- lib/verizon/models/register_callback_request.rb
Overview
Request to register a callback.
Instance Attribute Summary collapse
-
#name ⇒ String
The name of the callback service that you want to subscribe to.
-
#password ⇒ String
The password that the M2M Platform should return in the callback messages.
-
#url ⇒ String
The address on your server where you have enabled a listening service for callback messages.
-
#username ⇒ String
The user name that the M2M Platform should return in the callback messages.
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(name = nil, url = nil, username = SKIP, password = SKIP) ⇒ RegisterCallbackRequest
constructor
A new instance of RegisterCallbackRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(name = nil, url = nil, username = SKIP, password = SKIP) ⇒ RegisterCallbackRequest
Returns a new instance of RegisterCallbackRequest.
53 54 55 56 57 58 |
# File 'lib/verizon/models/register_callback_request.rb', line 53 def initialize(name = nil, url = nil, username = SKIP, password = SKIP) @name = name @url = url @username = username unless username == SKIP @password = password unless password == SKIP end |
Instance Attribute Details
#name ⇒ String
The name of the callback service that you want to subscribe to.
14 15 16 |
# File 'lib/verizon/models/register_callback_request.rb', line 14 def name @name end |
#password ⇒ String
The password that the M2M Platform should return in the callback messages.
28 29 30 |
# File 'lib/verizon/models/register_callback_request.rb', line 28 def password @password end |
#url ⇒ String
The address on your server where you have enabled a listening service for callback messages.
19 20 21 |
# File 'lib/verizon/models/register_callback_request.rb', line 19 def url @url end |
#username ⇒ String
The user name that the M2M Platform should return in the callback messages.
24 25 26 |
# File 'lib/verizon/models/register_callback_request.rb', line 24 def username @username end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/verizon/models/register_callback_request.rb', line 61 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. name = hash.key?('name') ? hash['name'] : nil url = hash.key?('url') ? hash['url'] : nil username = hash.key?('username') ? hash['username'] : SKIP password = hash.key?('password') ? hash['password'] : SKIP # Create object from extracted values. RegisterCallbackRequest.new(name, url, username, password) end |
.names ⇒ Object
A mapping from model property names to API property names.
31 32 33 34 35 36 37 38 |
# File 'lib/verizon/models/register_callback_request.rb', line 31 def self.names @_hash = {} if @_hash.nil? @_hash['name'] = 'name' @_hash['url'] = 'url' @_hash['username'] = 'username' @_hash['password'] = 'password' @_hash end |
.nullables ⇒ Object
An array for nullable fields
49 50 51 |
# File 'lib/verizon/models/register_callback_request.rb', line 49 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
41 42 43 44 45 46 |
# File 'lib/verizon/models/register_callback_request.rb', line 41 def self.optionals %w[ username password ] end |