Class: Verizon::Triggervalues2
- Defined in:
- lib/verizon/models/triggervalues2.rb
Overview
Triggervalues2 Model.
Instance Attribute Summary collapse
-
#account_name ⇒ String
TODO: Write general description for this method.
-
#active ⇒ TrueClass | FalseClass
TODO: Write general description for this method.
-
#created_at ⇒ DateTime
TODO: Write general description for this method.
-
#modified_at ⇒ DateTime
TODO: Write general description for this method.
-
#organization_name ⇒ String
TODO: Write general description for this method.
-
#promo_alerts ⇒ Array[PromoAlert]
TODO: Write general description for this method.
-
#trigger_category ⇒ String
TODO: Write general description for this method.
-
#trigger_id ⇒ String
TODO: Write general description for this method.
-
#trigger_name ⇒ String
TODO: Write general description for this method.
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(trigger_id: SKIP, trigger_name: SKIP, account_name: SKIP, organization_name: SKIP, trigger_category: SKIP, promo_alerts: SKIP, active: SKIP, created_at: SKIP, modified_at: SKIP, additional_properties: nil) ⇒ Triggervalues2
constructor
A new instance of Triggervalues2.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_created_at ⇒ Object
- #to_custom_modified_at ⇒ Object
-
#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(trigger_id: SKIP, trigger_name: SKIP, account_name: SKIP, organization_name: SKIP, trigger_category: SKIP, promo_alerts: SKIP, active: SKIP, created_at: SKIP, modified_at: SKIP, additional_properties: nil) ⇒ Triggervalues2
Returns a new instance of Triggervalues2.
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/verizon/models/triggervalues2.rb', line 84 def initialize(trigger_id: SKIP, trigger_name: SKIP, account_name: SKIP, organization_name: SKIP, trigger_category: SKIP, promo_alerts: SKIP, active: SKIP, created_at: SKIP, modified_at: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @trigger_id = trigger_id unless trigger_id == SKIP @trigger_name = trigger_name unless trigger_name == SKIP @account_name = account_name unless account_name == SKIP @organization_name = organization_name unless organization_name == SKIP @trigger_category = trigger_category unless trigger_category == SKIP @promo_alerts = promo_alerts unless promo_alerts == SKIP @active = active unless active == SKIP @created_at = created_at unless created_at == SKIP @modified_at = modified_at unless modified_at == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#account_name ⇒ String
TODO: Write general description for this method
23 24 25 |
# File 'lib/verizon/models/triggervalues2.rb', line 23 def account_name @account_name end |
#active ⇒ TrueClass | FalseClass
TODO: Write general description for this method
39 40 41 |
# File 'lib/verizon/models/triggervalues2.rb', line 39 def active @active end |
#created_at ⇒ DateTime
TODO: Write general description for this method
43 44 45 |
# File 'lib/verizon/models/triggervalues2.rb', line 43 def created_at @created_at end |
#modified_at ⇒ DateTime
TODO: Write general description for this method
47 48 49 |
# File 'lib/verizon/models/triggervalues2.rb', line 47 def modified_at @modified_at end |
#organization_name ⇒ String
TODO: Write general description for this method
27 28 29 |
# File 'lib/verizon/models/triggervalues2.rb', line 27 def organization_name @organization_name end |
#promo_alerts ⇒ Array[PromoAlert]
TODO: Write general description for this method
35 36 37 |
# File 'lib/verizon/models/triggervalues2.rb', line 35 def promo_alerts @promo_alerts end |
#trigger_category ⇒ String
TODO: Write general description for this method
31 32 33 |
# File 'lib/verizon/models/triggervalues2.rb', line 31 def trigger_category @trigger_category end |
#trigger_id ⇒ String
TODO: Write general description for this method
15 16 17 |
# File 'lib/verizon/models/triggervalues2.rb', line 15 def trigger_id @trigger_id end |
#trigger_name ⇒ String
TODO: Write general description for this method
19 20 21 |
# File 'lib/verizon/models/triggervalues2.rb', line 19 def trigger_name @trigger_name end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
# File 'lib/verizon/models/triggervalues2.rb', line 104 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. trigger_id = hash.key?('triggerId') ? hash['triggerId'] : SKIP trigger_name = hash.key?('triggerName') ? hash['triggerName'] : SKIP account_name = hash.key?('accountName') ? hash['accountName'] : SKIP organization_name = hash.key?('organizationName') ? hash['organizationName'] : SKIP trigger_category = hash.key?('triggerCategory') ? hash['triggerCategory'] : SKIP # Parameter is an array, so we need to iterate through it promo_alerts = nil unless hash['promoAlerts'].nil? promo_alerts = [] hash['promoAlerts'].each do |structure| promo_alerts << (PromoAlert.from_hash(structure) if structure) end end promo_alerts = SKIP unless hash.key?('promoAlerts') active = hash.key?('active') ? hash['active'] : SKIP created_at = if hash.key?('createdAt') (DateTimeHelper.from_rfc3339(hash['createdAt']) if hash['createdAt']) else SKIP end modified_at = if hash.key?('modifiedAt') (DateTimeHelper.from_rfc3339(hash['modifiedAt']) if hash['modifiedAt']) else SKIP end # 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. Triggervalues2.new(trigger_id: trigger_id, trigger_name: trigger_name, account_name: account_name, organization_name: organization_name, trigger_category: trigger_category, promo_alerts: promo_alerts, active: active, created_at: created_at, modified_at: modified_at, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/verizon/models/triggervalues2.rb', line 50 def self.names @_hash = {} if @_hash.nil? @_hash['trigger_id'] = 'triggerId' @_hash['trigger_name'] = 'triggerName' @_hash['account_name'] = 'accountName' @_hash['organization_name'] = 'organizationName' @_hash['trigger_category'] = 'triggerCategory' @_hash['promo_alerts'] = 'promoAlerts' @_hash['active'] = 'active' @_hash['created_at'] = 'createdAt' @_hash['modified_at'] = 'modifiedAt' @_hash end |
.nullables ⇒ Object
An array for nullable fields
80 81 82 |
# File 'lib/verizon/models/triggervalues2.rb', line 80 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/verizon/models/triggervalues2.rb', line 65 def self.optionals %w[ trigger_id trigger_name account_name organization_name trigger_category promo_alerts active created_at modified_at ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
176 177 178 179 180 181 182 183 |
# File 'lib/verizon/models/triggervalues2.rb', line 176 def inspect class_name = self.class.name.split('::').last "<#{class_name} trigger_id: #{@trigger_id.inspect}, trigger_name: #{@trigger_name.inspect},"\ " account_name: #{@account_name.inspect}, organization_name: #{@organization_name.inspect},"\ " trigger_category: #{@trigger_category.inspect}, promo_alerts: #{@promo_alerts.inspect},"\ " active: #{@active.inspect}, created_at: #{@created_at.inspect}, modified_at:"\ " #{@modified_at.inspect}, additional_properties: #{@additional_properties}>" end |
#to_custom_created_at ⇒ Object
157 158 159 |
# File 'lib/verizon/models/triggervalues2.rb', line 157 def to_custom_created_at DateTimeHelper.to_rfc3339(created_at) end |
#to_custom_modified_at ⇒ Object
161 162 163 |
# File 'lib/verizon/models/triggervalues2.rb', line 161 def to_custom_modified_at DateTimeHelper.to_rfc3339(modified_at) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
166 167 168 169 170 171 172 173 |
# File 'lib/verizon/models/triggervalues2.rb', line 166 def to_s class_name = self.class.name.split('::').last "<#{class_name} trigger_id: #{@trigger_id}, trigger_name: #{@trigger_name}, account_name:"\ " #{@account_name}, organization_name: #{@organization_name}, trigger_category:"\ " #{@trigger_category}, promo_alerts: #{@promo_alerts}, active: #{@active}, created_at:"\ " #{@created_at}, modified_at: #{@modified_at}, additional_properties:"\ " #{@additional_properties}>" end |