Class: MailSlurpClient::ConnectorDto
- Inherits:
-
Object
- Object
- MailSlurpClient::ConnectorDto
- Defined in:
- lib/mailslurp_client/models/connector_dto.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#connector_auth_type ⇒ Object
Returns the value of attribute connector_auth_type.
-
#connector_type ⇒ Object
Returns the value of attribute connector_type.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#id ⇒ Object
Returns the value of attribute id.
-
#imap_host ⇒ Object
Returns the value of attribute imap_host.
-
#imap_password ⇒ Object
Returns the value of attribute imap_password.
-
#imap_port ⇒ Object
Returns the value of attribute imap_port.
-
#imap_ssl ⇒ Object
Returns the value of attribute imap_ssl.
-
#imap_username ⇒ Object
Returns the value of attribute imap_username.
-
#search_terms ⇒ Object
Returns the value of attribute search_terms.
-
#select_folder ⇒ Object
Returns the value of attribute select_folder.
-
#sync_enabled ⇒ Object
Returns the value of attribute sync_enabled.
-
#sync_interval ⇒ Object
Returns the value of attribute sync_interval.
-
#sync_schedule_type ⇒ Object
Returns the value of attribute sync_schedule_type.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
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 = {}) ⇒ ConnectorDto
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 = {}) ⇒ ConnectorDto
Initializes the object
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 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 |
# File 'lib/mailslurp_client/models/connector_dto.rb', line 123 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::ConnectorDto` 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 `MailSlurpClient::ConnectorDto`. 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?(:'id') self.id = attributes[:'id'] end if attributes.key?(:'enabled') self.enabled = attributes[:'enabled'] end if attributes.key?(:'user_id') self.user_id = attributes[:'user_id'] end if attributes.key?(:'connector_type') self.connector_type = attributes[:'connector_type'] end if attributes.key?(:'connector_auth_type') self.connector_auth_type = attributes[:'connector_auth_type'] end if attributes.key?(:'sync_enabled') self.sync_enabled = attributes[:'sync_enabled'] end if attributes.key?(:'sync_schedule_type') self.sync_schedule_type = attributes[:'sync_schedule_type'] end if attributes.key?(:'sync_interval') self.sync_interval = attributes[:'sync_interval'] end if attributes.key?(:'imap_host') self.imap_host = attributes[:'imap_host'] end if attributes.key?(:'imap_port') self.imap_port = attributes[:'imap_port'] end if attributes.key?(:'imap_username') self.imap_username = attributes[:'imap_username'] end if attributes.key?(:'imap_password') self.imap_password = attributes[:'imap_password'] end if attributes.key?(:'imap_ssl') self.imap_ssl = attributes[:'imap_ssl'] end if attributes.key?(:'select_folder') self.select_folder = attributes[:'select_folder'] end if attributes.key?(:'search_terms') self.search_terms = attributes[:'search_terms'] end if attributes.key?(:'created_at') self.created_at = attributes[:'created_at'] end end |
Instance Attribute Details
#connector_auth_type ⇒ Object
Returns the value of attribute connector_auth_type.
25 26 27 |
# File 'lib/mailslurp_client/models/connector_dto.rb', line 25 def connector_auth_type @connector_auth_type end |
#connector_type ⇒ Object
Returns the value of attribute connector_type.
23 24 25 |
# File 'lib/mailslurp_client/models/connector_dto.rb', line 23 def connector_type @connector_type end |
#created_at ⇒ Object
Returns the value of attribute created_at.
47 48 49 |
# File 'lib/mailslurp_client/models/connector_dto.rb', line 47 def created_at @created_at end |
#enabled ⇒ Object
Returns the value of attribute enabled.
19 20 21 |
# File 'lib/mailslurp_client/models/connector_dto.rb', line 19 def enabled @enabled end |
#id ⇒ Object
Returns the value of attribute id.
17 18 19 |
# File 'lib/mailslurp_client/models/connector_dto.rb', line 17 def id @id end |
#imap_host ⇒ Object
Returns the value of attribute imap_host.
33 34 35 |
# File 'lib/mailslurp_client/models/connector_dto.rb', line 33 def imap_host @imap_host end |
#imap_password ⇒ Object
Returns the value of attribute imap_password.
39 40 41 |
# File 'lib/mailslurp_client/models/connector_dto.rb', line 39 def imap_password @imap_password end |
#imap_port ⇒ Object
Returns the value of attribute imap_port.
35 36 37 |
# File 'lib/mailslurp_client/models/connector_dto.rb', line 35 def imap_port @imap_port end |
#imap_ssl ⇒ Object
Returns the value of attribute imap_ssl.
41 42 43 |
# File 'lib/mailslurp_client/models/connector_dto.rb', line 41 def imap_ssl @imap_ssl end |
#imap_username ⇒ Object
Returns the value of attribute imap_username.
37 38 39 |
# File 'lib/mailslurp_client/models/connector_dto.rb', line 37 def imap_username @imap_username end |
#search_terms ⇒ Object
Returns the value of attribute search_terms.
45 46 47 |
# File 'lib/mailslurp_client/models/connector_dto.rb', line 45 def search_terms @search_terms end |
#select_folder ⇒ Object
Returns the value of attribute select_folder.
43 44 45 |
# File 'lib/mailslurp_client/models/connector_dto.rb', line 43 def select_folder @select_folder end |
#sync_enabled ⇒ Object
Returns the value of attribute sync_enabled.
27 28 29 |
# File 'lib/mailslurp_client/models/connector_dto.rb', line 27 def sync_enabled @sync_enabled end |
#sync_interval ⇒ Object
Returns the value of attribute sync_interval.
31 32 33 |
# File 'lib/mailslurp_client/models/connector_dto.rb', line 31 def sync_interval @sync_interval end |
#sync_schedule_type ⇒ Object
Returns the value of attribute sync_schedule_type.
29 30 31 |
# File 'lib/mailslurp_client/models/connector_dto.rb', line 29 def sync_schedule_type @sync_schedule_type end |
#user_id ⇒ Object
Returns the value of attribute user_id.
21 22 23 |
# File 'lib/mailslurp_client/models/connector_dto.rb', line 21 def user_id @user_id end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/mailslurp_client/models/connector_dto.rb', line 72 def self.attribute_map { :'id' => :'id', :'enabled' => :'enabled', :'user_id' => :'userId', :'connector_type' => :'connectorType', :'connector_auth_type' => :'connectorAuthType', :'sync_enabled' => :'syncEnabled', :'sync_schedule_type' => :'syncScheduleType', :'sync_interval' => :'syncInterval', :'imap_host' => :'imapHost', :'imap_port' => :'imapPort', :'imap_username' => :'imapUsername', :'imap_password' => :'imapPassword', :'imap_ssl' => :'imapSsl', :'select_folder' => :'selectFolder', :'search_terms' => :'searchTerms', :'created_at' => :'createdAt' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
328 329 330 |
# File 'lib/mailslurp_client/models/connector_dto.rb', line 328 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
116 117 118 119 |
# File 'lib/mailslurp_client/models/connector_dto.rb', line 116 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/mailslurp_client/models/connector_dto.rb', line 94 def self.openapi_types { :'id' => :'String', :'enabled' => :'Boolean', :'user_id' => :'String', :'connector_type' => :'String', :'connector_auth_type' => :'String', :'sync_enabled' => :'Boolean', :'sync_schedule_type' => :'String', :'sync_interval' => :'Integer', :'imap_host' => :'String', :'imap_port' => :'Integer', :'imap_username' => :'String', :'imap_password' => :'String', :'imap_ssl' => :'Boolean', :'select_folder' => :'String', :'search_terms' => :'String', :'created_at' => :'DateTime' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 |
# File 'lib/mailslurp_client/models/connector_dto.rb', line 292 def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && enabled == o.enabled && user_id == o.user_id && connector_type == o.connector_type && connector_auth_type == o.connector_auth_type && sync_enabled == o.sync_enabled && sync_schedule_type == o.sync_schedule_type && sync_interval == o.sync_interval && imap_host == o.imap_host && imap_port == o.imap_port && imap_username == o.imap_username && imap_password == o.imap_password && imap_ssl == o.imap_ssl && select_folder == o.select_folder && search_terms == o.search_terms && created_at == o.created_at end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 |
# File 'lib/mailslurp_client/models/connector_dto.rb', line 356 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 MailSlurpClient.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
425 426 427 428 429 430 431 432 433 434 435 436 437 |
# File 'lib/mailslurp_client/models/connector_dto.rb', line 425 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
335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 |
# File 'lib/mailslurp_client/models/connector_dto.rb', line 335 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
315 316 317 |
# File 'lib/mailslurp_client/models/connector_dto.rb', line 315 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
321 322 323 |
# File 'lib/mailslurp_client/models/connector_dto.rb', line 321 def hash [id, enabled, user_id, connector_type, connector_auth_type, sync_enabled, sync_schedule_type, sync_interval, imap_host, imap_port, imap_username, imap_password, imap_ssl, select_folder, search_terms, created_at].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 |
# File 'lib/mailslurp_client/models/connector_dto.rb', line 203 def list_invalid_properties invalid_properties = Array.new if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') end if @enabled.nil? invalid_properties.push('invalid value for "enabled", enabled cannot be nil.') end if @user_id.nil? invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') end if @connector_type.nil? invalid_properties.push('invalid value for "connector_type", connector_type cannot be nil.') end if @connector_auth_type.nil? invalid_properties.push('invalid value for "connector_auth_type", connector_auth_type cannot be nil.') end if @sync_enabled.nil? invalid_properties.push('invalid value for "sync_enabled", sync_enabled cannot be nil.') end if @sync_schedule_type.nil? invalid_properties.push('invalid value for "sync_schedule_type", sync_schedule_type cannot be nil.') end if @created_at.nil? invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
401 402 403 |
# File 'lib/mailslurp_client/models/connector_dto.rb', line 401 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
407 408 409 410 411 412 413 414 415 416 417 418 419 |
# File 'lib/mailslurp_client/models/connector_dto.rb', line 407 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
395 396 397 |
# File 'lib/mailslurp_client/models/connector_dto.rb', line 395 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
# File 'lib/mailslurp_client/models/connector_dto.rb', line 242 def valid? return false if @id.nil? return false if @enabled.nil? return false if @user_id.nil? return false if @connector_type.nil? connector_type_validator = EnumAttributeValidator.new('String', ["IMAP"]) return false unless connector_type_validator.valid?(@connector_type) return false if @connector_auth_type.nil? connector_auth_type_validator = EnumAttributeValidator.new('String', ["PLAIN_TEXT"]) return false unless connector_auth_type_validator.valid?(@connector_auth_type) return false if @sync_enabled.nil? return false if @sync_schedule_type.nil? sync_schedule_type_validator = EnumAttributeValidator.new('String', ["INTERVAL"]) return false unless sync_schedule_type_validator.valid?(@sync_schedule_type) return false if @created_at.nil? true end |