Class: Verizon::AccountStatesAndServices
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- Verizon::AccountStatesAndServices
- Defined in:
- lib/verizon/models/account_states_and_services.rb
Overview
Returns a list and details of all custom services and states defined for a specified account.
Instance Attribute Summary collapse
-
#engagement ⇒ Array[Engagement]
The engagements associated with the account.
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(engagement = nil) ⇒ AccountStatesAndServices
constructor
A new instance of AccountStatesAndServices.
Methods inherited from BaseModel
Constructor Details
#initialize(engagement = nil) ⇒ AccountStatesAndServices
Returns a new instance of AccountStatesAndServices.
34 35 36 |
# File 'lib/verizon/models/account_states_and_services.rb', line 34 def initialize(engagement = nil) @engagement = engagement end |
Instance Attribute Details
#engagement ⇒ Array[Engagement]
The engagements associated with the account.
15 16 17 |
# File 'lib/verizon/models/account_states_and_services.rb', line 15 def engagement @engagement end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/verizon/models/account_states_and_services.rb', line 39 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. # Parameter is an array, so we need to iterate through it engagement = nil unless hash['engagement'].nil? engagement = [] hash['engagement'].each do |structure| engagement << (Engagement.from_hash(structure) if structure) end end engagement = nil unless hash.key?('engagement') # Create object from extracted values. AccountStatesAndServices.new(engagement) end |
.names ⇒ Object
A mapping from model property names to API property names.
18 19 20 21 22 |
# File 'lib/verizon/models/account_states_and_services.rb', line 18 def self.names @_hash = {} if @_hash.nil? @_hash['engagement'] = 'engagement' @_hash end |
.nullables ⇒ Object
An array for nullable fields
30 31 32 |
# File 'lib/verizon/models/account_states_and_services.rb', line 30 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
25 26 27 |
# File 'lib/verizon/models/account_states_and_services.rb', line 25 def self.optionals [] end |