Class: Verizon::LogInRequest
- Defined in:
- lib/verizon/models/log_in_request.rb
Overview
Request to initiate a Connectivity Management session and returns a VZ-M2M session token that is required in subsequent API requests.
Instance Attribute Summary collapse
-
#password ⇒ String
The password for authentication.
-
#username ⇒ String
The username for authentication.
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(username = nil, password = nil) ⇒ LogInRequest
constructor
A new instance of LogInRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(username = nil, password = nil) ⇒ LogInRequest
Returns a new instance of LogInRequest.
39 40 41 42 |
# File 'lib/verizon/models/log_in_request.rb', line 39 def initialize(username = nil, password = nil) @username = username @password = password end |
Instance Attribute Details
#password ⇒ String
The password for authentication.
19 20 21 |
# File 'lib/verizon/models/log_in_request.rb', line 19 def password @password end |
#username ⇒ String
The username for authentication.
15 16 17 |
# File 'lib/verizon/models/log_in_request.rb', line 15 def username @username end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/verizon/models/log_in_request.rb', line 45 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. username = hash.key?('username') ? hash['username'] : nil password = hash.key?('password') ? hash['password'] : nil # Create object from extracted values. LogInRequest.new(username, password) end |
.names ⇒ Object
A mapping from model property names to API property names.
22 23 24 25 26 27 |
# File 'lib/verizon/models/log_in_request.rb', line 22 def self.names @_hash = {} if @_hash.nil? @_hash['username'] = 'username' @_hash['password'] = 'password' @_hash end |
.nullables ⇒ Object
An array for nullable fields
35 36 37 |
# File 'lib/verizon/models/log_in_request.rb', line 35 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
30 31 32 |
# File 'lib/verizon/models/log_in_request.rb', line 30 def self.optionals [] end |