Class: UltracartClient::OrderEmail
- Inherits:
-
Object
- Object
- UltracartClient::OrderEmail
- Defined in:
- lib/ultracart_api/models/order_email.rb
Instance Attribute Summary collapse
-
#bounce_diagnostic_code ⇒ Object
Returns the value of attribute bounce_diagnostic_code.
-
#bounce_dts ⇒ Object
Date/time that the email was bounced.
-
#bounce_sub_type ⇒ Object
Returns the value of attribute bounce_sub_type.
-
#bounce_type ⇒ Object
Returns the value of attribute bounce_type.
-
#clicked ⇒ Object
Returns the value of attribute clicked.
-
#clicked_dts ⇒ Object
Date/time that the email was clicked.
-
#delivered ⇒ Object
Returns the value of attribute delivered.
-
#delivery_dts ⇒ Object
Date/time that the email was delivered.
-
#email ⇒ Object
Email.
-
#internal ⇒ Object
Returns the value of attribute internal.
-
#message_id ⇒ Object
Returns the value of attribute message_id.
-
#opened ⇒ Object
Returns the value of attribute opened.
-
#opened_dts ⇒ Object
Date/time that the email was opened.
-
#reporting_mta ⇒ Object
Returns the value of attribute reporting_mta.
-
#send_dts ⇒ Object
Date/time that the email was sent.
-
#skip_reason ⇒ Object
Returns the value of attribute skip_reason.
-
#skipped ⇒ Object
Returns the value of attribute skipped.
-
#smtp_response ⇒ Object
Returns the value of attribute smtp_response.
-
#subject ⇒ Object
Returns the value of attribute subject.
Class Method Summary collapse
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ OrderEmail
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ OrderEmail
Initializes the object
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 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
# File 'lib/ultracart_api/models/order_email.rb', line 125 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::OrderEmail` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::OrderEmail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'bounce_diagnostic_code') self.bounce_diagnostic_code = attributes[:'bounce_diagnostic_code'] end if attributes.key?(:'bounce_dts') self.bounce_dts = attributes[:'bounce_dts'] end if attributes.key?(:'bounce_sub_type') self.bounce_sub_type = attributes[:'bounce_sub_type'] end if attributes.key?(:'bounce_type') self.bounce_type = attributes[:'bounce_type'] end if attributes.key?(:'clicked') self.clicked = attributes[:'clicked'] end if attributes.key?(:'clicked_dts') self.clicked_dts = attributes[:'clicked_dts'] end if attributes.key?(:'delivered') self.delivered = attributes[:'delivered'] end if attributes.key?(:'delivery_dts') self.delivery_dts = attributes[:'delivery_dts'] end if attributes.key?(:'email') self.email = attributes[:'email'] end if attributes.key?(:'internal') self.internal = attributes[:'internal'] end if attributes.key?(:'message_id') self. = attributes[:'message_id'] end if attributes.key?(:'opened') self.opened = attributes[:'opened'] end if attributes.key?(:'opened_dts') self.opened_dts = attributes[:'opened_dts'] end if attributes.key?(:'reporting_mta') self.reporting_mta = attributes[:'reporting_mta'] end if attributes.key?(:'send_dts') self.send_dts = attributes[:'send_dts'] end if attributes.key?(:'skip_reason') self.skip_reason = attributes[:'skip_reason'] end if attributes.key?(:'skipped') self.skipped = attributes[:'skipped'] end if attributes.key?(:'smtp_response') self.smtp_response = attributes[:'smtp_response'] end if attributes.key?(:'subject') self.subject = attributes[:'subject'] end end |
Instance Attribute Details
#bounce_diagnostic_code ⇒ Object
Returns the value of attribute bounce_diagnostic_code.
18 19 20 |
# File 'lib/ultracart_api/models/order_email.rb', line 18 def bounce_diagnostic_code @bounce_diagnostic_code end |
#bounce_dts ⇒ Object
Date/time that the email was bounced
21 22 23 |
# File 'lib/ultracart_api/models/order_email.rb', line 21 def bounce_dts @bounce_dts end |
#bounce_sub_type ⇒ Object
Returns the value of attribute bounce_sub_type.
23 24 25 |
# File 'lib/ultracart_api/models/order_email.rb', line 23 def bounce_sub_type @bounce_sub_type end |
#bounce_type ⇒ Object
Returns the value of attribute bounce_type.
25 26 27 |
# File 'lib/ultracart_api/models/order_email.rb', line 25 def bounce_type @bounce_type end |
#clicked ⇒ Object
Returns the value of attribute clicked.
27 28 29 |
# File 'lib/ultracart_api/models/order_email.rb', line 27 def clicked @clicked end |
#clicked_dts ⇒ Object
Date/time that the email was clicked
30 31 32 |
# File 'lib/ultracart_api/models/order_email.rb', line 30 def clicked_dts @clicked_dts end |
#delivered ⇒ Object
Returns the value of attribute delivered.
32 33 34 |
# File 'lib/ultracart_api/models/order_email.rb', line 32 def delivered @delivered end |
#delivery_dts ⇒ Object
Date/time that the email was delivered
35 36 37 |
# File 'lib/ultracart_api/models/order_email.rb', line 35 def delivery_dts @delivery_dts end |
#email ⇒ Object
38 39 40 |
# File 'lib/ultracart_api/models/order_email.rb', line 38 def email @email end |
#internal ⇒ Object
Returns the value of attribute internal.
40 41 42 |
# File 'lib/ultracart_api/models/order_email.rb', line 40 def internal @internal end |
#message_id ⇒ Object
Returns the value of attribute message_id.
42 43 44 |
# File 'lib/ultracart_api/models/order_email.rb', line 42 def @message_id end |
#opened ⇒ Object
Returns the value of attribute opened.
44 45 46 |
# File 'lib/ultracart_api/models/order_email.rb', line 44 def opened @opened end |
#opened_dts ⇒ Object
Date/time that the email was opened
47 48 49 |
# File 'lib/ultracart_api/models/order_email.rb', line 47 def opened_dts @opened_dts end |
#reporting_mta ⇒ Object
Returns the value of attribute reporting_mta.
49 50 51 |
# File 'lib/ultracart_api/models/order_email.rb', line 49 def reporting_mta @reporting_mta end |
#send_dts ⇒ Object
Date/time that the email was sent
52 53 54 |
# File 'lib/ultracart_api/models/order_email.rb', line 52 def send_dts @send_dts end |
#skip_reason ⇒ Object
Returns the value of attribute skip_reason.
54 55 56 |
# File 'lib/ultracart_api/models/order_email.rb', line 54 def skip_reason @skip_reason end |
#skipped ⇒ Object
Returns the value of attribute skipped.
56 57 58 |
# File 'lib/ultracart_api/models/order_email.rb', line 56 def skipped @skipped end |
#smtp_response ⇒ Object
Returns the value of attribute smtp_response.
58 59 60 |
# File 'lib/ultracart_api/models/order_email.rb', line 58 def smtp_response @smtp_response end |
#subject ⇒ Object
Returns the value of attribute subject.
60 61 62 |
# File 'lib/ultracart_api/models/order_email.rb', line 60 def subject @subject end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
88 89 90 |
# File 'lib/ultracart_api/models/order_email.rb', line 88 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/ultracart_api/models/order_email.rb', line 63 def self.attribute_map { :'bounce_diagnostic_code' => :'bounce_diagnostic_code', :'bounce_dts' => :'bounce_dts', :'bounce_sub_type' => :'bounce_sub_type', :'bounce_type' => :'bounce_type', :'clicked' => :'clicked', :'clicked_dts' => :'clicked_dts', :'delivered' => :'delivered', :'delivery_dts' => :'delivery_dts', :'email' => :'email', :'internal' => :'internal', :'message_id' => :'message_id', :'opened' => :'opened', :'opened_dts' => :'opened_dts', :'reporting_mta' => :'reporting_mta', :'send_dts' => :'send_dts', :'skip_reason' => :'skip_reason', :'skipped' => :'skipped', :'smtp_response' => :'smtp_response', :'subject' => :'subject' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
284 285 286 |
# File 'lib/ultracart_api/models/order_email.rb', line 284 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
118 119 120 121 |
# File 'lib/ultracart_api/models/order_email.rb', line 118 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/ultracart_api/models/order_email.rb', line 93 def self.openapi_types { :'bounce_diagnostic_code' => :'String', :'bounce_dts' => :'String', :'bounce_sub_type' => :'String', :'bounce_type' => :'String', :'clicked' => :'Boolean', :'clicked_dts' => :'String', :'delivered' => :'Boolean', :'delivery_dts' => :'String', :'email' => :'String', :'internal' => :'Boolean', :'message_id' => :'String', :'opened' => :'Boolean', :'opened_dts' => :'String', :'reporting_mta' => :'String', :'send_dts' => :'String', :'skip_reason' => :'String', :'skipped' => :'Boolean', :'smtp_response' => :'String', :'subject' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 |
# File 'lib/ultracart_api/models/order_email.rb', line 245 def ==(o) return true if self.equal?(o) self.class == o.class && bounce_diagnostic_code == o.bounce_diagnostic_code && bounce_dts == o.bounce_dts && bounce_sub_type == o.bounce_sub_type && bounce_type == o.bounce_type && clicked == o.clicked && clicked_dts == o.clicked_dts && delivered == o.delivered && delivery_dts == o.delivery_dts && email == o.email && internal == o.internal && == o. && opened == o.opened && opened_dts == o.opened_dts && reporting_mta == o.reporting_mta && send_dts == o.send_dts && skip_reason == o.skip_reason && skipped == o.skipped && smtp_response == o.smtp_response && subject == o.subject end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 |
# File 'lib/ultracart_api/models/order_email.rb', line 315 def _deserialize(type, value) case type.to_sym when :Time Time.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model # models (e.g. Pet) or oneOf klass = UltracartClient.const_get(type) klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
386 387 388 389 390 391 392 393 394 395 396 397 398 |
# File 'lib/ultracart_api/models/order_email.rb', line 386 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 |
# File 'lib/ultracart_api/models/order_email.rb', line 291 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end end self end |
#eql?(o) ⇒ Boolean
271 272 273 |
# File 'lib/ultracart_api/models/order_email.rb', line 271 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
277 278 279 |
# File 'lib/ultracart_api/models/order_email.rb', line 277 def hash [bounce_diagnostic_code, bounce_dts, bounce_sub_type, bounce_type, clicked, clicked_dts, delivered, delivery_dts, email, internal, , opened, opened_dts, reporting_mta, send_dts, skip_reason, skipped, smtp_response, subject].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
217 218 219 220 221 222 223 224 |
# File 'lib/ultracart_api/models/order_email.rb', line 217 def list_invalid_properties invalid_properties = Array.new if !@email.nil? && @email.to_s.length > 100 invalid_properties.push('invalid value for "email", the character length must be smaller than or equal to 100.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
362 363 364 |
# File 'lib/ultracart_api/models/order_email.rb', line 362 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
368 369 370 371 372 373 374 375 376 377 378 379 380 |
# File 'lib/ultracart_api/models/order_email.rb', line 368 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
356 357 358 |
# File 'lib/ultracart_api/models/order_email.rb', line 356 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
228 229 230 231 |
# File 'lib/ultracart_api/models/order_email.rb', line 228 def valid? return false if !@email.nil? && @email.to_s.length > 100 true end |