Class: Sendmux::Management::Generated::IncomingLogItem
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Sendmux::Management::Generated::IncomingLogItem
- Defined in:
- lib/sendmux_management_generated/models/incoming_log_item.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#amount ⇒ Object
Billable amount for this message in USD.
-
#billing_bucket_start ⇒ Object
ISO 8601 usage bucket start.
-
#event_type ⇒ Object
Returns the value of attribute event_type.
-
#from_email ⇒ Object
Returns the value of attribute from_email.
-
#id ⇒ Object
Incoming log public ID.
-
#is_spam ⇒ Object
Returns the value of attribute is_spam.
-
#mailbox_email ⇒ Object
Mailbox email address.
-
#mailbox_id ⇒ Object
Mailbox public ID.
-
#message_id ⇒ Object
Message identifier when available.
-
#message_id_kind ⇒ Object
Identifier source when available.
-
#received_at ⇒ Object
ISO 8601 received timestamp.
-
#size_bytes ⇒ Object
Returns the value of attribute size_bytes.
-
#subject ⇒ Object
Returns the value of attribute subject.
-
#to_emails ⇒ Object
Returns the value of attribute to_emails.
-
#unit_amount ⇒ Object
Per-message unit amount in USD.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.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.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ IncomingLogItem
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ IncomingLogItem
Initializes the object
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 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
# File 'lib/sendmux_management_generated/models/incoming_log_item.rb', line 146 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Management::Generated::IncomingLogItem` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Sendmux::Management::Generated::IncomingLogItem`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'amount') self.amount = attributes[:'amount'] else self.amount = nil end if attributes.key?(:'billing_bucket_start') self.billing_bucket_start = attributes[:'billing_bucket_start'] else self.billing_bucket_start = nil end if attributes.key?(:'event_type') self.event_type = attributes[:'event_type'] else self.event_type = nil end if attributes.key?(:'from_email') self.from_email = attributes[:'from_email'] else self.from_email = nil end if attributes.key?(:'id') self.id = attributes[:'id'] else self.id = nil end if attributes.key?(:'is_spam') self.is_spam = attributes[:'is_spam'] else self.is_spam = nil end if attributes.key?(:'mailbox_email') self.mailbox_email = attributes[:'mailbox_email'] else self.mailbox_email = nil end if attributes.key?(:'mailbox_id') self.mailbox_id = attributes[:'mailbox_id'] else self.mailbox_id = nil end if attributes.key?(:'message_id') self. = attributes[:'message_id'] else self. = nil end if attributes.key?(:'message_id_kind') self. = attributes[:'message_id_kind'] else self. = nil end if attributes.key?(:'received_at') self.received_at = attributes[:'received_at'] else self.received_at = nil end if attributes.key?(:'size_bytes') self.size_bytes = attributes[:'size_bytes'] else self.size_bytes = nil end if attributes.key?(:'subject') self.subject = attributes[:'subject'] else self.subject = nil end if attributes.key?(:'to_emails') if (value = attributes[:'to_emails']).is_a?(Array) self.to_emails = value end else self.to_emails = nil end if attributes.key?(:'unit_amount') self.unit_amount = attributes[:'unit_amount'] else self.unit_amount = nil end end |
Instance Attribute Details
#amount ⇒ Object
Billable amount for this message in USD
19 20 21 |
# File 'lib/sendmux_management_generated/models/incoming_log_item.rb', line 19 def amount @amount end |
#billing_bucket_start ⇒ Object
ISO 8601 usage bucket start
22 23 24 |
# File 'lib/sendmux_management_generated/models/incoming_log_item.rb', line 22 def billing_bucket_start @billing_bucket_start end |
#event_type ⇒ Object
Returns the value of attribute event_type.
24 25 26 |
# File 'lib/sendmux_management_generated/models/incoming_log_item.rb', line 24 def event_type @event_type end |
#from_email ⇒ Object
Returns the value of attribute from_email.
26 27 28 |
# File 'lib/sendmux_management_generated/models/incoming_log_item.rb', line 26 def from_email @from_email end |
#id ⇒ Object
Incoming log public ID
29 30 31 |
# File 'lib/sendmux_management_generated/models/incoming_log_item.rb', line 29 def id @id end |
#is_spam ⇒ Object
Returns the value of attribute is_spam.
31 32 33 |
# File 'lib/sendmux_management_generated/models/incoming_log_item.rb', line 31 def is_spam @is_spam end |
#mailbox_email ⇒ Object
Mailbox email address
34 35 36 |
# File 'lib/sendmux_management_generated/models/incoming_log_item.rb', line 34 def mailbox_email @mailbox_email end |
#mailbox_id ⇒ Object
Mailbox public ID
37 38 39 |
# File 'lib/sendmux_management_generated/models/incoming_log_item.rb', line 37 def mailbox_id @mailbox_id end |
#message_id ⇒ Object
Message identifier when available
40 41 42 |
# File 'lib/sendmux_management_generated/models/incoming_log_item.rb', line 40 def @message_id end |
#message_id_kind ⇒ Object
Identifier source when available
43 44 45 |
# File 'lib/sendmux_management_generated/models/incoming_log_item.rb', line 43 def @message_id_kind end |
#received_at ⇒ Object
ISO 8601 received timestamp
46 47 48 |
# File 'lib/sendmux_management_generated/models/incoming_log_item.rb', line 46 def received_at @received_at end |
#size_bytes ⇒ Object
Returns the value of attribute size_bytes.
48 49 50 |
# File 'lib/sendmux_management_generated/models/incoming_log_item.rb', line 48 def size_bytes @size_bytes end |
#subject ⇒ Object
Returns the value of attribute subject.
50 51 52 |
# File 'lib/sendmux_management_generated/models/incoming_log_item.rb', line 50 def subject @subject end |
#to_emails ⇒ Object
Returns the value of attribute to_emails.
52 53 54 |
# File 'lib/sendmux_management_generated/models/incoming_log_item.rb', line 52 def to_emails @to_emails end |
#unit_amount ⇒ Object
Per-message unit amount in USD
55 56 57 |
# File 'lib/sendmux_management_generated/models/incoming_log_item.rb', line 55 def unit_amount @unit_amount end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
101 102 103 |
# File 'lib/sendmux_management_generated/models/incoming_log_item.rb', line 101 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
106 107 108 |
# File 'lib/sendmux_management_generated/models/incoming_log_item.rb', line 106 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/sendmux_management_generated/models/incoming_log_item.rb', line 80 def self.attribute_map { :'amount' => :'amount', :'billing_bucket_start' => :'billing_bucket_start', :'event_type' => :'event_type', :'from_email' => :'from_email', :'id' => :'id', :'is_spam' => :'is_spam', :'mailbox_email' => :'mailbox_email', :'mailbox_id' => :'mailbox_id', :'message_id' => :'message_id', :'message_id_kind' => :'message_id_kind', :'received_at' => :'received_at', :'size_bytes' => :'size_bytes', :'subject' => :'subject', :'to_emails' => :'to_emails', :'unit_amount' => :'unit_amount' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 |
# File 'lib/sendmux_management_generated/models/incoming_log_item.rb', line 427 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{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[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/sendmux_management_generated/models/incoming_log_item.rb', line 132 def self.openapi_nullable Set.new([ :'from_email', :'mailbox_email', :'mailbox_id', :'message_id', :'message_id_kind', :'size_bytes', :'subject', ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/sendmux_management_generated/models/incoming_log_item.rb', line 111 def self.openapi_types { :'amount' => :'String', :'billing_bucket_start' => :'String', :'event_type' => :'String', :'from_email' => :'String', :'id' => :'String', :'is_spam' => :'Boolean', :'mailbox_email' => :'String', :'mailbox_id' => :'String', :'message_id' => :'String', :'message_id_kind' => :'String', :'received_at' => :'String', :'size_bytes' => :'Float', :'subject' => :'String', :'to_emails' => :'Array<String>', :'unit_amount' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 |
# File 'lib/sendmux_management_generated/models/incoming_log_item.rb', line 392 def ==(o) return true if self.equal?(o) self.class == o.class && amount == o.amount && billing_bucket_start == o.billing_bucket_start && event_type == o.event_type && from_email == o.from_email && id == o.id && is_spam == o.is_spam && mailbox_email == o.mailbox_email && mailbox_id == o.mailbox_id && == o. && == o. && received_at == o.received_at && size_bytes == o.size_bytes && subject == o.subject && to_emails == o.to_emails && unit_amount == o.unit_amount end |
#eql?(o) ⇒ Boolean
414 415 416 |
# File 'lib/sendmux_management_generated/models/incoming_log_item.rb', line 414 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
420 421 422 |
# File 'lib/sendmux_management_generated/models/incoming_log_item.rb', line 420 def hash [amount, billing_bucket_start, event_type, from_email, id, is_spam, mailbox_email, mailbox_id, , , received_at, size_bytes, subject, to_emails, unit_amount].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 |
# File 'lib/sendmux_management_generated/models/incoming_log_item.rb', line 255 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @amount.nil? invalid_properties.push('invalid value for "amount", amount cannot be nil.') end if @billing_bucket_start.nil? invalid_properties.push('invalid value for "billing_bucket_start", billing_bucket_start cannot be nil.') end if @event_type.nil? invalid_properties.push('invalid value for "event_type", event_type cannot be nil.') end if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') end if @is_spam.nil? invalid_properties.push('invalid value for "is_spam", is_spam cannot be nil.') end if @received_at.nil? invalid_properties.push('invalid value for "received_at", received_at cannot be nil.') end if @to_emails.nil? invalid_properties.push('invalid value for "to_emails", to_emails cannot be nil.') end if @unit_amount.nil? invalid_properties.push('invalid value for "unit_amount", unit_amount cannot be nil.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
449 450 451 452 453 454 455 456 457 458 459 460 461 |
# File 'lib/sendmux_management_generated/models/incoming_log_item.rb', line 449 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 |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
295 296 297 298 299 300 301 302 303 304 305 306 307 308 |
# File 'lib/sendmux_management_generated/models/incoming_log_item.rb', line 295 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @amount.nil? return false if @billing_bucket_start.nil? return false if @event_type.nil? event_type_validator = EnumAttributeValidator.new('String', ["message.received", "message.received.spam", "unknown_default_open_api"]) return false unless event_type_validator.valid?(@event_type) return false if @id.nil? return false if @is_spam.nil? return false if @received_at.nil? return false if @to_emails.nil? return false if @unit_amount.nil? true end |