Class: Verizon::AccountLevelFilter
- Defined in:
- lib/verizon/models/account_level_filter.rb
Overview
AccountLevelFilter Model.
Instance Attribute Summary collapse
-
#account_names ⇒ Accountnames
Determines whether or not to aggregate usage of multiple accounts together, or separate by account.
-
#separate_or_combined ⇒ String
Determines whether or not to aggregate usage of multiple accounts together, or separate by 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.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(separate_or_combined: SKIP, account_names: SKIP, additional_properties: nil) ⇒ AccountLevelFilter
constructor
A new instance of AccountLevelFilter.
-
#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(separate_or_combined: SKIP, account_names: SKIP, additional_properties: nil) ⇒ AccountLevelFilter
Returns a new instance of AccountLevelFilter.
45 46 47 48 49 50 51 52 53 |
# File 'lib/verizon/models/account_level_filter.rb', line 45 def initialize(separate_or_combined: SKIP, account_names: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @separate_or_combined = separate_or_combined unless separate_or_combined == SKIP @account_names = account_names unless account_names == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#account_names ⇒ Accountnames
Determines whether or not to aggregate usage of multiple accounts together, or separate by account. If this is null or not present, then the trigger will be for an individual line.
22 23 24 |
# File 'lib/verizon/models/account_level_filter.rb', line 22 def account_names @account_names end |
#separate_or_combined ⇒ String
Determines whether or not to aggregate usage of multiple accounts together, or separate by account. If this is null or not present, then the trigger will be for an individual line.
16 17 18 |
# File 'lib/verizon/models/account_level_filter.rb', line 16 def separate_or_combined @separate_or_combined end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/verizon/models/account_level_filter.rb', line 56 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. separate_or_combined = hash.key?('separateOrCombined') ? hash['separateOrCombined'] : SKIP account_names = Accountnames.from_hash(hash['accountNames']) if hash['accountNames'] # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. AccountLevelFilter.new(separate_or_combined: separate_or_combined, account_names: account_names, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
25 26 27 28 29 30 |
# File 'lib/verizon/models/account_level_filter.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['separate_or_combined'] = 'separateOrCombined' @_hash['account_names'] = 'accountNames' @_hash end |
.nullables ⇒ Object
An array for nullable fields
41 42 43 |
# File 'lib/verizon/models/account_level_filter.rb', line 41 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
33 34 35 36 37 38 |
# File 'lib/verizon/models/account_level_filter.rb', line 33 def self.optionals %w[ separate_or_combined account_names ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
79 80 81 82 83 84 85 |
# File 'lib/verizon/models/account_level_filter.rb', line 79 def self.validate(value) return true if value.instance_of? self return false unless value.instance_of? Hash true end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
95 96 97 98 99 |
# File 'lib/verizon/models/account_level_filter.rb', line 95 def inspect class_name = self.class.name.split('::').last "<#{class_name} separate_or_combined: #{@separate_or_combined.inspect}, account_names:"\ " #{@account_names.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
88 89 90 91 92 |
# File 'lib/verizon/models/account_level_filter.rb', line 88 def to_s class_name = self.class.name.split('::').last "<#{class_name} separate_or_combined: #{@separate_or_combined}, account_names:"\ " #{@account_names}, additional_properties: #{@additional_properties}>" end |