Class: MailSlurpClient::CreateInboxDto
- Inherits:
-
Object
- Object
- MailSlurpClient::CreateInboxDto
- Defined in:
- lib/mailslurp_client/models/create_inbox_dto.rb
Overview
Options for creating an inbox. An inbox has a real email address that can send and receive emails. Inboxes can be permanent or expire at a given time. Inboxes are either `SMTP` or `HTTP` mailboxes. `SMTP` inboxes are processed by a mail server running at `mailslurp.mx` while `HTTP` inboxes are processed by AWS SES backed mailservers. An inbox email address is randomly assigned by default ending in either `mailslurp.com` or (if `useDomainPool` is enabled) ending in a similar domain such as `mailslurp.xyz` (selected at random). To specify an address use a custom domain: either pass the `emailAddress` options with `<your-recipient>@<your-domain>`. To create a randomized address for your domain set the `domainName` to the domain you have verified or pass the `domainId`. Virtual inboxes prevent outbound sending and instead trap mail.
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#allow_team_access ⇒ Object
DEPRECATED (team access is always true).
-
#description ⇒ Object
Optional description of the inbox for labelling purposes.
-
#domain_id ⇒ Object
ID of custom domain to use for email address.
-
#domain_name ⇒ Object
FQDN domain name for the domain you have verified.
-
#email_address ⇒ Object
A custom email address to use with the inbox.
-
#expires_at ⇒ Object
Optional inbox expiration date.
-
#expires_in ⇒ Object
Number of milliseconds that inbox should exist for.
-
#favourite ⇒ Object
Is the inbox a favorite.
-
#inbox_type ⇒ Object
Type of inbox.
-
#name ⇒ Object
Optional name of the inbox.
-
#tags ⇒ Object
Tags that inbox has been tagged with.
-
#use_domain_pool ⇒ Object
Use the MailSlurp domain name pool with this inbox when creating the email address.
-
#use_short_address ⇒ Object
Use a shorter email address under 31 characters.
-
#virtual_inbox ⇒ Object
Virtual inbox prevents any outbound emails from being sent.
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 = {}) ⇒ CreateInboxDto
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 = {}) ⇒ CreateInboxDto
Initializes the object
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 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
# File 'lib/mailslurp_client/models/create_inbox_dto.rb', line 144 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::CreateInboxDto` 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::CreateInboxDto`. 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?(:'email_address') self.email_address = attributes[:'email_address'] end if attributes.key?(:'domain_name') self.domain_name = attributes[:'domain_name'] end if attributes.key?(:'domain_id') self.domain_id = attributes[:'domain_id'] end if attributes.key?(:'name') self.name = attributes[:'name'] end if attributes.key?(:'description') self.description = attributes[:'description'] end if attributes.key?(:'use_domain_pool') self.use_domain_pool = attributes[:'use_domain_pool'] end if attributes.key?(:'tags') if (value = attributes[:'tags']).is_a?(Array) self. = value end end if attributes.key?(:'expires_at') self.expires_at = attributes[:'expires_at'] end if attributes.key?(:'favourite') self.favourite = attributes[:'favourite'] end if attributes.key?(:'expires_in') self.expires_in = attributes[:'expires_in'] end if attributes.key?(:'allow_team_access') self.allow_team_access = attributes[:'allow_team_access'] end if attributes.key?(:'inbox_type') self.inbox_type = attributes[:'inbox_type'] end if attributes.key?(:'virtual_inbox') self.virtual_inbox = attributes[:'virtual_inbox'] end if attributes.key?(:'use_short_address') self.use_short_address = attributes[:'use_short_address'] end end |
Instance Attribute Details
#allow_team_access ⇒ Object
DEPRECATED (team access is always true). Grant team access to this inbox and the emails that belong to it for team members of your organization.
49 50 51 |
# File 'lib/mailslurp_client/models/create_inbox_dto.rb', line 49 def allow_team_access @allow_team_access end |
#description ⇒ Object
Optional description of the inbox for labelling purposes. Is shown in the dashboard and can be used with
31 32 33 |
# File 'lib/mailslurp_client/models/create_inbox_dto.rb', line 31 def description @description end |
#domain_id ⇒ Object
ID of custom domain to use for email address.
25 26 27 |
# File 'lib/mailslurp_client/models/create_inbox_dto.rb', line 25 def domain_id @domain_id end |
#domain_name ⇒ Object
FQDN domain name for the domain you have verified. Will be appended with a randomly assigned recipient name. Use the `emailAddress` option instead to specify the full custom inbox.
22 23 24 |
# File 'lib/mailslurp_client/models/create_inbox_dto.rb', line 22 def domain_name @domain_name end |
#email_address ⇒ Object
A custom email address to use with the inbox. Defaults to null. When null MailSlurp will assign a random email address to the inbox such as `123@mailslurp.com`. If you use the `useDomainPool` option when the email address is null it will generate an email address with a more varied domain ending such as `123@mailslurp.info` or `123@mailslurp.biz`. When a custom email address is provided the address is split into a domain and the domain is queried against your user. If you have created the domain in the MailSlurp dashboard and verified it you can use any email address that ends with the domain. Note domain types must match the inbox type - so `SMTP` inboxes will only work with `SMTP` type domains. Avoid `SMTP` inboxes if you need to send emails as they can only receive. Send an email to this address and the inbox will receive and store it for you. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID.
19 20 21 |
# File 'lib/mailslurp_client/models/create_inbox_dto.rb', line 19 def email_address @email_address end |
#expires_at ⇒ Object
Optional inbox expiration date. If null then this inbox is permanent and the emails in it won't be deleted. If an expiration date is provided or is required by your plan the inbox will be closed when the expiration time is reached. Expired inboxes still contain their emails but can no longer send or receive emails. An ExpiredInboxRecord is created when an inbox and the email address and inbox ID are recorded. The expiresAt property is a timestamp string in ISO DateTime Format yyyy-MM-dd'T'HH:mm:ss.SSSXXX.
40 41 42 |
# File 'lib/mailslurp_client/models/create_inbox_dto.rb', line 40 def expires_at @expires_at end |
#expires_in ⇒ Object
Number of milliseconds that inbox should exist for
46 47 48 |
# File 'lib/mailslurp_client/models/create_inbox_dto.rb', line 46 def expires_in @expires_in end |
#favourite ⇒ Object
Is the inbox a favorite. Marking an inbox as a favorite is typically done in the dashboard for quick access or filtering
43 44 45 |
# File 'lib/mailslurp_client/models/create_inbox_dto.rb', line 43 def favourite @favourite end |
#inbox_type ⇒ Object
Type of inbox. HTTP inboxes are faster and better for most cases. SMTP inboxes are more suited for public facing inbound messages (but cannot send).
52 53 54 |
# File 'lib/mailslurp_client/models/create_inbox_dto.rb', line 52 def inbox_type @inbox_type end |
#name ⇒ Object
Optional name of the inbox. Displayed in the dashboard for easier search and used as the sender name when sending emails.
28 29 30 |
# File 'lib/mailslurp_client/models/create_inbox_dto.rb', line 28 def name @name end |
#tags ⇒ Object
Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI.
37 38 39 |
# File 'lib/mailslurp_client/models/create_inbox_dto.rb', line 37 def @tags end |
#use_domain_pool ⇒ Object
Use the MailSlurp domain name pool with this inbox when creating the email address. Defaults to null. If enabled the inbox will be an email address with a domain randomly chosen from a list of the MailSlurp domains. This is useful when the default `@mailslurp.com` email addresses used with inboxes are blocked or considered spam by a provider or receiving service. When domain pool is enabled an email address will be generated ending in `@mailslurp.world,info,xyz,…` . This means a TLD is randomly selecting from a list of `.biz`, `.info`, `.xyz` etc to add variance to the generated email addresses. When null or false MailSlurp uses the default behavior of `@mailslurp.com` or custom email address provided by the emailAddress field. Note this feature is only available for `HTTP` inbox types.
34 35 36 |
# File 'lib/mailslurp_client/models/create_inbox_dto.rb', line 34 def use_domain_pool @use_domain_pool end |
#use_short_address ⇒ Object
Use a shorter email address under 31 characters
58 59 60 |
# File 'lib/mailslurp_client/models/create_inbox_dto.rb', line 58 def use_short_address @use_short_address end |
#virtual_inbox ⇒ Object
Virtual inbox prevents any outbound emails from being sent. It creates sent email records but will never send real emails to recipients. Great for testing and faking email sending.
55 56 57 |
# File 'lib/mailslurp_client/models/create_inbox_dto.rb', line 55 def virtual_inbox @virtual_inbox end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/mailslurp_client/models/create_inbox_dto.rb', line 83 def self.attribute_map { :'email_address' => :'emailAddress', :'domain_name' => :'domainName', :'domain_id' => :'domainId', :'name' => :'name', :'description' => :'description', :'use_domain_pool' => :'useDomainPool', :'tags' => :'tags', :'expires_at' => :'expiresAt', :'favourite' => :'favourite', :'expires_in' => :'expiresIn', :'allow_team_access' => :'allowTeamAccess', :'inbox_type' => :'inboxType', :'virtual_inbox' => :'virtualInbox', :'use_short_address' => :'useShortAddress' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
277 278 279 |
# File 'lib/mailslurp_client/models/create_inbox_dto.rb', line 277 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/mailslurp_client/models/create_inbox_dto.rb', line 123 def self.openapi_nullable Set.new([ :'email_address', :'domain_name', :'domain_id', :'name', :'description', :'use_domain_pool', :'tags', :'expires_at', :'favourite', :'expires_in', :'allow_team_access', :'inbox_type', :'virtual_inbox', :'use_short_address' ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/mailslurp_client/models/create_inbox_dto.rb', line 103 def self.openapi_types { :'email_address' => :'String', :'domain_name' => :'String', :'domain_id' => :'String', :'name' => :'String', :'description' => :'String', :'use_domain_pool' => :'Boolean', :'tags' => :'Array<String>', :'expires_at' => :'DateTime', :'favourite' => :'Boolean', :'expires_in' => :'Integer', :'allow_team_access' => :'Boolean', :'inbox_type' => :'String', :'virtual_inbox' => :'Boolean', :'use_short_address' => :'Boolean' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 |
# File 'lib/mailslurp_client/models/create_inbox_dto.rb', line 243 def ==(o) return true if self.equal?(o) self.class == o.class && email_address == o.email_address && domain_name == o.domain_name && domain_id == o.domain_id && name == o.name && description == o.description && use_domain_pool == o.use_domain_pool && == o. && expires_at == o.expires_at && favourite == o.favourite && expires_in == o.expires_in && allow_team_access == o.allow_team_access && inbox_type == o.inbox_type && virtual_inbox == o.virtual_inbox && use_short_address == o.use_short_address end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 |
# File 'lib/mailslurp_client/models/create_inbox_dto.rb', line 305 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
374 375 376 377 378 379 380 381 382 383 384 385 386 |
# File 'lib/mailslurp_client/models/create_inbox_dto.rb', line 374 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
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 |
# File 'lib/mailslurp_client/models/create_inbox_dto.rb', line 284 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
264 265 266 |
# File 'lib/mailslurp_client/models/create_inbox_dto.rb', line 264 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
270 271 272 |
# File 'lib/mailslurp_client/models/create_inbox_dto.rb', line 270 def hash [email_address, domain_name, domain_id, name, description, use_domain_pool, , expires_at, favourite, expires_in, allow_team_access, inbox_type, virtual_inbox, use_short_address].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
218 219 220 221 |
# File 'lib/mailslurp_client/models/create_inbox_dto.rb', line 218 def list_invalid_properties invalid_properties = Array.new invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
350 351 352 |
# File 'lib/mailslurp_client/models/create_inbox_dto.rb', line 350 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
356 357 358 359 360 361 362 363 364 365 366 367 368 |
# File 'lib/mailslurp_client/models/create_inbox_dto.rb', line 356 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
344 345 346 |
# File 'lib/mailslurp_client/models/create_inbox_dto.rb', line 344 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
225 226 227 228 229 |
# File 'lib/mailslurp_client/models/create_inbox_dto.rb', line 225 def valid? inbox_type_validator = EnumAttributeValidator.new('String', ["HTTP_INBOX", "SMTP_INBOX"]) return false unless inbox_type_validator.valid?(@inbox_type) true end |