Class: Pipedrive::BaseMailThreadAllOf
- Inherits:
-
Object
- Object
- Pipedrive::BaseMailThreadAllOf
- Defined in:
- lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb
Instance Attribute Summary collapse
-
#add_time ⇒ Object
The time when the mail thread was inserted to database.
-
#all_messages_sent_flag ⇒ Object
Whether all the mail thread messages have been sent.
-
#archived_flag ⇒ Object
Returns the value of attribute archived_flag.
-
#deal_id ⇒ Object
ID of the deal.
-
#deal_status ⇒ Object
Status of the deal.
-
#drafts_parties ⇒ Object
Parties of the drafted mail thread.
-
#external_deleted_flag ⇒ Object
Whether the mail thread has been deleted externally.
-
#first_message_timestamp ⇒ Object
The time when the mail thread has had the first message received or created.
-
#first_message_to_me_flag ⇒ Object
Whether the mail thread was initialized by others.
-
#folders ⇒ Object
Folders in which messages from thread are being stored.
-
#has_draft_flag ⇒ Object
Whether the mail thread has any drafts.
-
#has_sent_flag ⇒ Object
Whether the mail thread has messages sent.
-
#last_message_received_timestamp ⇒ Object
The last time when the mail thread has had a message received.
-
#last_message_sent_timestamp ⇒ Object
The last time when the mail thread has had a message sent.
-
#last_message_timestamp ⇒ Object
Last message timestamp.
-
#message_count ⇒ Object
An amount of messages.
-
#parties ⇒ Object
Returns the value of attribute parties.
-
#shared_flag ⇒ Object
Whether the mail thread is shared.
-
#snippet_draft ⇒ Object
A snippet from a draft.
-
#snippet_sent ⇒ Object
A snippet from a message sent.
-
#update_time ⇒ Object
The time when the mail thread was updated in database received.
-
#version ⇒ Object
Version.
Class Method Summary collapse
-
.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 = {}) ⇒ BaseMailThreadAllOf
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 = {}) ⇒ BaseMailThreadAllOf
Initializes the object
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 252 253 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 149 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Pipedrive::BaseMailThreadAllOf` 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 `Pipedrive::BaseMailThreadAllOf`. 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?(:'parties') self.parties = attributes[:'parties'] end if attributes.key?(:'drafts_parties') if (value = attributes[:'drafts_parties']).is_a?(Array) self.drafts_parties = value end end if attributes.key?(:'folders') if (value = attributes[:'folders']).is_a?(Array) self.folders = value end end if attributes.key?(:'version') self.version = attributes[:'version'] end if attributes.key?(:'snippet_draft') self.snippet_draft = attributes[:'snippet_draft'] end if attributes.key?(:'snippet_sent') self.snippet_sent = attributes[:'snippet_sent'] end if attributes.key?(:'message_count') self. = attributes[:'message_count'] end if attributes.key?(:'has_draft_flag') self.has_draft_flag = attributes[:'has_draft_flag'] end if attributes.key?(:'has_sent_flag') self.has_sent_flag = attributes[:'has_sent_flag'] end if attributes.key?(:'archived_flag') self.archived_flag = attributes[:'archived_flag'] end if attributes.key?(:'shared_flag') self.shared_flag = attributes[:'shared_flag'] end if attributes.key?(:'external_deleted_flag') self.external_deleted_flag = attributes[:'external_deleted_flag'] end if attributes.key?(:'first_message_to_me_flag') self. = attributes[:'first_message_to_me_flag'] end if attributes.key?(:'last_message_timestamp') self. = attributes[:'last_message_timestamp'] end if attributes.key?(:'first_message_timestamp') self. = attributes[:'first_message_timestamp'] end if attributes.key?(:'last_message_sent_timestamp') self. = attributes[:'last_message_sent_timestamp'] end if attributes.key?(:'last_message_received_timestamp') self. = attributes[:'last_message_received_timestamp'] end if attributes.key?(:'add_time') self.add_time = attributes[:'add_time'] end if attributes.key?(:'update_time') self.update_time = attributes[:'update_time'] end if attributes.key?(:'deal_id') self.deal_id = attributes[:'deal_id'] end if attributes.key?(:'deal_status') self.deal_status = attributes[:'deal_status'] end if attributes.key?(:'all_messages_sent_flag') self. = attributes[:'all_messages_sent_flag'] end end |
Instance Attribute Details
#add_time ⇒ Object
The time when the mail thread was inserted to database
67 68 69 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 67 def add_time @add_time end |
#all_messages_sent_flag ⇒ Object
Whether all the mail thread messages have been sent
79 80 81 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 79 def @all_messages_sent_flag end |
#archived_flag ⇒ Object
Returns the value of attribute archived_flag.
43 44 45 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 43 def archived_flag @archived_flag end |
#deal_id ⇒ Object
ID of the deal
73 74 75 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 73 def deal_id @deal_id end |
#deal_status ⇒ Object
Status of the deal
76 77 78 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 76 def deal_status @deal_status end |
#drafts_parties ⇒ Object
Parties of the drafted mail thread
20 21 22 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 20 def drafts_parties @drafts_parties end |
#external_deleted_flag ⇒ Object
Whether the mail thread has been deleted externally
49 50 51 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 49 def external_deleted_flag @external_deleted_flag end |
#first_message_timestamp ⇒ Object
The time when the mail thread has had the first message received or created
58 59 60 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 58 def @first_message_timestamp end |
#first_message_to_me_flag ⇒ Object
Whether the mail thread was initialized by others
52 53 54 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 52 def @first_message_to_me_flag end |
#folders ⇒ Object
Folders in which messages from thread are being stored
23 24 25 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 23 def folders @folders end |
#has_draft_flag ⇒ Object
Whether the mail thread has any drafts
38 39 40 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 38 def has_draft_flag @has_draft_flag end |
#has_sent_flag ⇒ Object
Whether the mail thread has messages sent
41 42 43 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 41 def has_sent_flag @has_sent_flag end |
#last_message_received_timestamp ⇒ Object
The last time when the mail thread has had a message received
64 65 66 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 64 def @last_message_received_timestamp end |
#last_message_sent_timestamp ⇒ Object
The last time when the mail thread has had a message sent
61 62 63 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 61 def @last_message_sent_timestamp end |
#last_message_timestamp ⇒ Object
Last message timestamp
55 56 57 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 55 def @last_message_timestamp end |
#message_count ⇒ Object
An amount of messages
35 36 37 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 35 def @message_count end |
#parties ⇒ Object
Returns the value of attribute parties.
17 18 19 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 17 def parties @parties end |
#shared_flag ⇒ Object
Whether the mail thread is shared
46 47 48 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 46 def shared_flag @shared_flag end |
#snippet_draft ⇒ Object
A snippet from a draft
29 30 31 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 29 def snippet_draft @snippet_draft end |
#snippet_sent ⇒ Object
A snippet from a message sent
32 33 34 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 32 def snippet_sent @snippet_sent end |
#update_time ⇒ Object
The time when the mail thread was updated in database received
70 71 72 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 70 def update_time @update_time end |
#version ⇒ Object
Version
26 27 28 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 26 def version @version end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 82 def self.attribute_map { :'parties' => :'parties', :'drafts_parties' => :'drafts_parties', :'folders' => :'folders', :'version' => :'version', :'snippet_draft' => :'snippet_draft', :'snippet_sent' => :'snippet_sent', :'message_count' => :'message_count', :'has_draft_flag' => :'has_draft_flag', :'has_sent_flag' => :'has_sent_flag', :'archived_flag' => :'archived_flag', :'shared_flag' => :'shared_flag', :'external_deleted_flag' => :'external_deleted_flag', :'first_message_to_me_flag' => :'first_message_to_me_flag', :'last_message_timestamp' => :'last_message_timestamp', :'first_message_timestamp' => :'first_message_timestamp', :'last_message_sent_timestamp' => :'last_message_sent_timestamp', :'last_message_received_timestamp' => :'last_message_received_timestamp', :'add_time' => :'add_time', :'update_time' => :'update_time', :'deal_id' => :'deal_id', :'deal_status' => :'deal_status', :'all_messages_sent_flag' => :'all_messages_sent_flag' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
312 313 314 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 312 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
138 139 140 141 142 143 144 145 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 138 def self.openapi_nullable Set.new([ :'snippet_draft', :'last_message_sent_timestamp', :'deal_id', :'deal_status', ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 110 def self.openapi_types { :'parties' => :'BaseMailThreadAllOfParties', :'drafts_parties' => :'Array<Object>', :'folders' => :'Array<String>', :'version' => :'Float', :'snippet_draft' => :'String', :'snippet_sent' => :'String', :'message_count' => :'Integer', :'has_draft_flag' => :'NumberBooleanDefault0', :'has_sent_flag' => :'NumberBooleanDefault0', :'archived_flag' => :'NumberBoolean', :'shared_flag' => :'NumberBooleanDefault0', :'external_deleted_flag' => :'NumberBooleanDefault0', :'first_message_to_me_flag' => :'NumberBooleanDefault0', :'last_message_timestamp' => :'DateTime', :'first_message_timestamp' => :'DateTime', :'last_message_sent_timestamp' => :'DateTime', :'last_message_received_timestamp' => :'DateTime', :'add_time' => :'DateTime', :'update_time' => :'DateTime', :'deal_id' => :'Integer', :'deal_status' => :'String', :'all_messages_sent_flag' => :'NumberBooleanDefault0' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 270 def ==(o) return true if self.equal?(o) self.class == o.class && parties == o.parties && drafts_parties == o.drafts_parties && folders == o.folders && version == o.version && snippet_draft == o.snippet_draft && snippet_sent == o.snippet_sent && == o. && has_draft_flag == o.has_draft_flag && has_sent_flag == o.has_sent_flag && archived_flag == o.archived_flag && shared_flag == o.shared_flag && external_deleted_flag == o.external_deleted_flag && == o. && == o. && == o. && == o. && == o. && add_time == o.add_time && update_time == o.update_time && deal_id == o.deal_id && deal_status == o.deal_status && == o. end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 340 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.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 Pipedrive.const_get(type).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
409 410 411 412 413 414 415 416 417 418 419 420 421 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 409 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
319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 319 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.openapi_types.each_pair do |key, type| if 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 # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(o) ⇒ Boolean
299 300 301 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 299 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
305 306 307 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 305 def hash [parties, drafts_parties, folders, version, snippet_draft, snippet_sent, , has_draft_flag, has_sent_flag, archived_flag, shared_flag, external_deleted_flag, , , , , , add_time, update_time, deal_id, deal_status, ].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
257 258 259 260 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 257 def list_invalid_properties invalid_properties = Array.new invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
385 386 387 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 385 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
391 392 393 394 395 396 397 398 399 400 401 402 403 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 391 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
379 380 381 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 379 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
264 265 266 |
# File 'lib/pipedrive-openapi-client/models/base_mail_thread_all_of.rb', line 264 def valid? true end |