Class: Sendmux::Mailbox::Generated::MailboxMessageContentBody
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Sendmux::Mailbox::Generated::MailboxMessageContentBody
- Defined in:
- lib/sendmux_mailbox_generated/models/mailbox_message_content_body.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#extracted_links ⇒ Object
Returns the value of attribute extracted_links.
-
#format ⇒ Object
Returns the value of attribute format.
-
#html ⇒ Object
HTML body when requested.
-
#is_truncated ⇒ Object
Returns the value of attribute is_truncated.
-
#quotes_stripped ⇒ Object
Returns the value of attribute quotes_stripped.
-
#signature_stripped ⇒ Object
Returns the value of attribute signature_stripped.
-
#text ⇒ Object
Returns the value of attribute text.
-
#truncated_at_chars ⇒ Object
Returns the value of attribute truncated_at_chars.
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 = {}) ⇒ MailboxMessageContentBody
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 = {}) ⇒ MailboxMessageContentBody
Initializes the object
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 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
# File 'lib/sendmux_mailbox_generated/models/mailbox_message_content_body.rb', line 107 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Mailbox::Generated::MailboxMessageContentBody` 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::Mailbox::Generated::MailboxMessageContentBody`. 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?(:'extracted_links') if (value = attributes[:'extracted_links']).is_a?(Array) self.extracted_links = value end else self.extracted_links = nil end if attributes.key?(:'format') self.format = attributes[:'format'] else self.format = nil end if attributes.key?(:'html') self.html = attributes[:'html'] else self.html = nil end if attributes.key?(:'is_truncated') self.is_truncated = attributes[:'is_truncated'] else self.is_truncated = nil end if attributes.key?(:'quotes_stripped') self.quotes_stripped = attributes[:'quotes_stripped'] else self.quotes_stripped = nil end if attributes.key?(:'signature_stripped') self.signature_stripped = attributes[:'signature_stripped'] else self.signature_stripped = nil end if attributes.key?(:'text') self.text = attributes[:'text'] else self.text = nil end if attributes.key?(:'truncated_at_chars') self.truncated_at_chars = attributes[:'truncated_at_chars'] else self.truncated_at_chars = nil end end |
Instance Attribute Details
#extracted_links ⇒ Object
Returns the value of attribute extracted_links.
18 19 20 |
# File 'lib/sendmux_mailbox_generated/models/mailbox_message_content_body.rb', line 18 def extracted_links @extracted_links end |
#format ⇒ Object
Returns the value of attribute format.
20 21 22 |
# File 'lib/sendmux_mailbox_generated/models/mailbox_message_content_body.rb', line 20 def format @format end |
#html ⇒ Object
HTML body when requested. Returned as a JSON string and not as rendered content.
23 24 25 |
# File 'lib/sendmux_mailbox_generated/models/mailbox_message_content_body.rb', line 23 def html @html end |
#is_truncated ⇒ Object
Returns the value of attribute is_truncated.
25 26 27 |
# File 'lib/sendmux_mailbox_generated/models/mailbox_message_content_body.rb', line 25 def is_truncated @is_truncated end |
#quotes_stripped ⇒ Object
Returns the value of attribute quotes_stripped.
27 28 29 |
# File 'lib/sendmux_mailbox_generated/models/mailbox_message_content_body.rb', line 27 def quotes_stripped @quotes_stripped end |
#signature_stripped ⇒ Object
Returns the value of attribute signature_stripped.
29 30 31 |
# File 'lib/sendmux_mailbox_generated/models/mailbox_message_content_body.rb', line 29 def signature_stripped @signature_stripped end |
#text ⇒ Object
Returns the value of attribute text.
31 32 33 |
# File 'lib/sendmux_mailbox_generated/models/mailbox_message_content_body.rb', line 31 def text @text end |
#truncated_at_chars ⇒ Object
Returns the value of attribute truncated_at_chars.
33 34 35 |
# File 'lib/sendmux_mailbox_generated/models/mailbox_message_content_body.rb', line 33 def truncated_at_chars @truncated_at_chars end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
72 73 74 |
# File 'lib/sendmux_mailbox_generated/models/mailbox_message_content_body.rb', line 72 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
77 78 79 |
# File 'lib/sendmux_mailbox_generated/models/mailbox_message_content_body.rb', line 77 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/sendmux_mailbox_generated/models/mailbox_message_content_body.rb', line 58 def self.attribute_map { :'extracted_links' => :'extracted_links', :'format' => :'format', :'html' => :'html', :'is_truncated' => :'is_truncated', :'quotes_stripped' => :'quotes_stripped', :'signature_stripped' => :'signature_stripped', :'text' => :'text', :'truncated_at_chars' => :'truncated_at_chars' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 |
# File 'lib/sendmux_mailbox_generated/models/mailbox_message_content_body.rb', line 289 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
96 97 98 99 100 101 102 103 |
# File 'lib/sendmux_mailbox_generated/models/mailbox_message_content_body.rb', line 96 def self.openapi_nullable Set.new([ :'format', :'html', :'text', :'truncated_at_chars' ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/sendmux_mailbox_generated/models/mailbox_message_content_body.rb', line 82 def self.openapi_types { :'extracted_links' => :'Array<String>', :'format' => :'String', :'html' => :'String', :'is_truncated' => :'Boolean', :'quotes_stripped' => :'Boolean', :'signature_stripped' => :'Boolean', :'text' => :'String', :'truncated_at_chars' => :'Integer' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
261 262 263 264 265 266 267 268 269 270 271 272 |
# File 'lib/sendmux_mailbox_generated/models/mailbox_message_content_body.rb', line 261 def ==(o) return true if self.equal?(o) self.class == o.class && extracted_links == o.extracted_links && format == o.format && html == o.html && is_truncated == o.is_truncated && quotes_stripped == o.quotes_stripped && signature_stripped == o.signature_stripped && text == o.text && truncated_at_chars == o.truncated_at_chars end |
#eql?(o) ⇒ Boolean
276 277 278 |
# File 'lib/sendmux_mailbox_generated/models/mailbox_message_content_body.rb', line 276 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
282 283 284 |
# File 'lib/sendmux_mailbox_generated/models/mailbox_message_content_body.rb', line 282 def hash [extracted_links, format, html, is_truncated, quotes_stripped, signature_stripped, text, truncated_at_chars].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
# File 'lib/sendmux_mailbox_generated/models/mailbox_message_content_body.rb', line 174 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @extracted_links.nil? invalid_properties.push('invalid value for "extracted_links", extracted_links cannot be nil.') end if @is_truncated.nil? invalid_properties.push('invalid value for "is_truncated", is_truncated cannot be nil.') end if @quotes_stripped.nil? invalid_properties.push('invalid value for "quotes_stripped", quotes_stripped cannot be nil.') end if @signature_stripped.nil? invalid_properties.push('invalid value for "signature_stripped", signature_stripped cannot be nil.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
311 312 313 314 315 316 317 318 319 320 321 322 323 |
# File 'lib/sendmux_mailbox_generated/models/mailbox_message_content_body.rb', line 311 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
198 199 200 201 202 203 204 205 206 207 |
# File 'lib/sendmux_mailbox_generated/models/mailbox_message_content_body.rb', line 198 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @extracted_links.nil? format_validator = EnumAttributeValidator.new('String', ["text", "html", "unknown_default_open_api"]) return false unless format_validator.valid?(@format) return false if @is_truncated.nil? return false if @quotes_stripped.nil? return false if @signature_stripped.nil? true end |