Class: Sendmux::Management::Generated::ProviderUpdateBody
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Sendmux::Management::Generated::ProviderUpdateBody
- Defined in:
- lib/sendmux_management_generated/models/provider_update_body.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#from_email ⇒ Object
Returns the value of attribute from_email.
-
#from_name ⇒ Object
Returns the value of attribute from_name.
-
#name ⇒ Object
Returns the value of attribute name.
-
#percentage ⇒ Object
Returns the value of attribute percentage.
-
#quotas ⇒ Object
Returns the value of attribute quotas.
-
#reply_to_email ⇒ Object
Returns the value of attribute reply_to_email.
-
#reply_to_name ⇒ Object
Returns the value of attribute reply_to_name.
-
#smtp_host ⇒ Object
Returns the value of attribute smtp_host.
-
#smtp_password ⇒ Object
Returns the value of attribute smtp_password.
-
#smtp_port ⇒ Object
Returns the value of attribute smtp_port.
-
#smtp_protocol ⇒ Object
Returns the value of attribute smtp_protocol.
-
#smtp_username ⇒ Object
Returns the value of attribute smtp_username.
-
#tracking_domain ⇒ Object
Returns the value of attribute tracking_domain.
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 = {}) ⇒ ProviderUpdateBody
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 = {}) ⇒ ProviderUpdateBody
Initializes the object
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 |
# File 'lib/sendmux_management_generated/models/provider_update_body.rb', line 127 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Management::Generated::ProviderUpdateBody` 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::ProviderUpdateBody`. 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?(:'from_email') self.from_email = attributes[:'from_email'] end if attributes.key?(:'from_name') self.from_name = attributes[:'from_name'] end if attributes.key?(:'name') self.name = attributes[:'name'] end if attributes.key?(:'percentage') self.percentage = attributes[:'percentage'] end if attributes.key?(:'quotas') self.quotas = attributes[:'quotas'] end if attributes.key?(:'reply_to_email') self.reply_to_email = attributes[:'reply_to_email'] end if attributes.key?(:'reply_to_name') self.reply_to_name = attributes[:'reply_to_name'] end if attributes.key?(:'smtp_host') self.smtp_host = attributes[:'smtp_host'] end if attributes.key?(:'smtp_password') self.smtp_password = attributes[:'smtp_password'] end if attributes.key?(:'smtp_port') self.smtp_port = attributes[:'smtp_port'] end if attributes.key?(:'smtp_protocol') self.smtp_protocol = attributes[:'smtp_protocol'] end if attributes.key?(:'smtp_username') self.smtp_username = attributes[:'smtp_username'] end if attributes.key?(:'tracking_domain') self.tracking_domain = attributes[:'tracking_domain'] end end |
Instance Attribute Details
#from_email ⇒ Object
Returns the value of attribute from_email.
18 19 20 |
# File 'lib/sendmux_management_generated/models/provider_update_body.rb', line 18 def from_email @from_email end |
#from_name ⇒ Object
Returns the value of attribute from_name.
20 21 22 |
# File 'lib/sendmux_management_generated/models/provider_update_body.rb', line 20 def from_name @from_name end |
#name ⇒ Object
Returns the value of attribute name.
22 23 24 |
# File 'lib/sendmux_management_generated/models/provider_update_body.rb', line 22 def name @name end |
#percentage ⇒ Object
Returns the value of attribute percentage.
24 25 26 |
# File 'lib/sendmux_management_generated/models/provider_update_body.rb', line 24 def percentage @percentage end |
#quotas ⇒ Object
Returns the value of attribute quotas.
26 27 28 |
# File 'lib/sendmux_management_generated/models/provider_update_body.rb', line 26 def quotas @quotas end |
#reply_to_email ⇒ Object
Returns the value of attribute reply_to_email.
28 29 30 |
# File 'lib/sendmux_management_generated/models/provider_update_body.rb', line 28 def reply_to_email @reply_to_email end |
#reply_to_name ⇒ Object
Returns the value of attribute reply_to_name.
30 31 32 |
# File 'lib/sendmux_management_generated/models/provider_update_body.rb', line 30 def reply_to_name @reply_to_name end |
#smtp_host ⇒ Object
Returns the value of attribute smtp_host.
32 33 34 |
# File 'lib/sendmux_management_generated/models/provider_update_body.rb', line 32 def smtp_host @smtp_host end |
#smtp_password ⇒ Object
Returns the value of attribute smtp_password.
34 35 36 |
# File 'lib/sendmux_management_generated/models/provider_update_body.rb', line 34 def smtp_password @smtp_password end |
#smtp_port ⇒ Object
Returns the value of attribute smtp_port.
36 37 38 |
# File 'lib/sendmux_management_generated/models/provider_update_body.rb', line 36 def smtp_port @smtp_port end |
#smtp_protocol ⇒ Object
Returns the value of attribute smtp_protocol.
38 39 40 |
# File 'lib/sendmux_management_generated/models/provider_update_body.rb', line 38 def smtp_protocol @smtp_protocol end |
#smtp_username ⇒ Object
Returns the value of attribute smtp_username.
40 41 42 |
# File 'lib/sendmux_management_generated/models/provider_update_body.rb', line 40 def smtp_username @smtp_username end |
#tracking_domain ⇒ Object
Returns the value of attribute tracking_domain.
42 43 44 |
# File 'lib/sendmux_management_generated/models/provider_update_body.rb', line 42 def tracking_domain @tracking_domain end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
86 87 88 |
# File 'lib/sendmux_management_generated/models/provider_update_body.rb', line 86 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
91 92 93 |
# File 'lib/sendmux_management_generated/models/provider_update_body.rb', line 91 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/sendmux_management_generated/models/provider_update_body.rb', line 67 def self.attribute_map { :'from_email' => :'from_email', :'from_name' => :'from_name', :'name' => :'name', :'percentage' => :'percentage', :'quotas' => :'quotas', :'reply_to_email' => :'reply_to_email', :'reply_to_name' => :'reply_to_name', :'smtp_host' => :'smtp_host', :'smtp_password' => :'smtp_password', :'smtp_port' => :'smtp_port', :'smtp_protocol' => :'smtp_protocol', :'smtp_username' => :'smtp_username', :'tracking_domain' => :'tracking_domain' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 |
# File 'lib/sendmux_management_generated/models/provider_update_body.rb', line 499 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
115 116 117 118 119 120 121 122 123 |
# File 'lib/sendmux_management_generated/models/provider_update_body.rb', line 115 def self.openapi_nullable Set.new([ :'from_email', :'from_name', :'reply_to_email', :'reply_to_name', :'tracking_domain' ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/sendmux_management_generated/models/provider_update_body.rb', line 96 def self.openapi_types { :'from_email' => :'String', :'from_name' => :'String', :'name' => :'String', :'percentage' => :'Integer', :'quotas' => :'ProviderCreateBodyQuotas', :'reply_to_email' => :'String', :'reply_to_name' => :'String', :'smtp_host' => :'String', :'smtp_password' => :'String', :'smtp_port' => :'Integer', :'smtp_protocol' => :'String', :'smtp_username' => :'String', :'tracking_domain' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 |
# File 'lib/sendmux_management_generated/models/provider_update_body.rb', line 466 def ==(o) return true if self.equal?(o) self.class == o.class && from_email == o.from_email && from_name == o.from_name && name == o.name && percentage == o.percentage && quotas == o.quotas && reply_to_email == o.reply_to_email && reply_to_name == o.reply_to_name && smtp_host == o.smtp_host && smtp_password == o.smtp_password && smtp_port == o.smtp_port && smtp_protocol == o.smtp_protocol && smtp_username == o.smtp_username && tracking_domain == o.tracking_domain end |
#eql?(o) ⇒ Boolean
486 487 488 |
# File 'lib/sendmux_management_generated/models/provider_update_body.rb', line 486 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
492 493 494 |
# File 'lib/sendmux_management_generated/models/provider_update_body.rb', line 492 def hash [from_email, from_name, name, percentage, quotas, reply_to_email, reply_to_name, smtp_host, smtp_password, smtp_port, smtp_protocol, smtp_username, tracking_domain].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
# File 'lib/sendmux_management_generated/models/provider_update_body.rb', line 196 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if !@from_email.nil? && @from_email.to_s.length > 255 invalid_properties.push('invalid value for "from_email", the character length must be smaller than or equal to 255.') end if !@from_name.nil? && @from_name.to_s.length > 255 invalid_properties.push('invalid value for "from_name", the character length must be smaller than or equal to 255.') end if !@name.nil? && @name.to_s.length > 255 invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.') end if !@name.nil? && @name.to_s.length < 1 invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 1.') end if !@percentage.nil? && @percentage > 100 invalid_properties.push('invalid value for "percentage", must be smaller than or equal to 100.') end if !@percentage.nil? && @percentage < 0 invalid_properties.push('invalid value for "percentage", must be greater than or equal to 0.') end if !@reply_to_email.nil? && @reply_to_email.to_s.length > 255 invalid_properties.push('invalid value for "reply_to_email", the character length must be smaller than or equal to 255.') end if !@reply_to_name.nil? && @reply_to_name.to_s.length > 255 invalid_properties.push('invalid value for "reply_to_name", the character length must be smaller than or equal to 255.') end if !@smtp_host.nil? && @smtp_host.to_s.length > 255 invalid_properties.push('invalid value for "smtp_host", the character length must be smaller than or equal to 255.') end if !@smtp_host.nil? && @smtp_host.to_s.length < 1 invalid_properties.push('invalid value for "smtp_host", the character length must be greater than or equal to 1.') end if !@smtp_password.nil? && @smtp_password.to_s.length > 500 invalid_properties.push('invalid value for "smtp_password", the character length must be smaller than or equal to 500.') end if !@smtp_password.nil? && @smtp_password.to_s.length < 1 invalid_properties.push('invalid value for "smtp_password", the character length must be greater than or equal to 1.') end if !@smtp_port.nil? && @smtp_port > 65535 invalid_properties.push('invalid value for "smtp_port", must be smaller than or equal to 65535.') end if !@smtp_port.nil? && @smtp_port < 1 invalid_properties.push('invalid value for "smtp_port", must be greater than or equal to 1.') end if !@smtp_username.nil? && @smtp_username.to_s.length > 255 invalid_properties.push('invalid value for "smtp_username", the character length must be smaller than or equal to 255.') end if !@smtp_username.nil? && @smtp_username.to_s.length < 1 invalid_properties.push('invalid value for "smtp_username", the character length must be greater than or equal to 1.') end if !@tracking_domain.nil? && @tracking_domain.to_s.length > 255 invalid_properties.push('invalid value for "tracking_domain", the character length must be smaller than or equal to 255.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
521 522 523 524 525 526 527 528 529 530 531 532 533 |
# File 'lib/sendmux_management_generated/models/provider_update_body.rb', line 521 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
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 |
# File 'lib/sendmux_management_generated/models/provider_update_body.rb', line 272 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if !@from_email.nil? && @from_email.to_s.length > 255 return false if !@from_name.nil? && @from_name.to_s.length > 255 return false if !@name.nil? && @name.to_s.length > 255 return false if !@name.nil? && @name.to_s.length < 1 return false if !@percentage.nil? && @percentage > 100 return false if !@percentage.nil? && @percentage < 0 return false if !@reply_to_email.nil? && @reply_to_email.to_s.length > 255 return false if !@reply_to_name.nil? && @reply_to_name.to_s.length > 255 return false if !@smtp_host.nil? && @smtp_host.to_s.length > 255 return false if !@smtp_host.nil? && @smtp_host.to_s.length < 1 return false if !@smtp_password.nil? && @smtp_password.to_s.length > 500 return false if !@smtp_password.nil? && @smtp_password.to_s.length < 1 return false if !@smtp_port.nil? && @smtp_port > 65535 return false if !@smtp_port.nil? && @smtp_port < 1 smtp_protocol_validator = EnumAttributeValidator.new('String', ["tls", "ssl", "none", "starttls", "unknown_default_open_api"]) return false unless smtp_protocol_validator.valid?(@smtp_protocol) return false if !@smtp_username.nil? && @smtp_username.to_s.length > 255 return false if !@smtp_username.nil? && @smtp_username.to_s.length < 1 return false if !@tracking_domain.nil? && @tracking_domain.to_s.length > 255 true end |