mailslurp_client 7.0.7 → 7.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +3 -0
  3. data/README.md +26 -13
  4. data/docs/AliasControllerApi.md +337 -0
  5. data/docs/AttachmentControllerApi.md +3 -1
  6. data/docs/AttachmentMetaData.md +4 -4
  7. data/docs/BulkSendEmailOptions.md +1 -1
  8. data/docs/CommonActionsControllerApi.md +60 -9
  9. data/docs/CreateAnonymousAliasOptions.md +17 -0
  10. data/docs/CreateOwnedAliasOptions.md +23 -0
  11. data/docs/EmailAnalysis.md +5 -5
  12. data/docs/FormControllerApi.md +79 -0
  13. data/docs/ForwardEmailOptions.md +7 -7
  14. data/docs/InboxControllerApi.md +54 -1
  15. data/docs/ModelAlias.md +31 -0
  16. data/docs/PageAlias.md +37 -0
  17. data/docs/SimpleSendEmailOptions.md +23 -0
  18. data/docs/ValidationDto.md +2 -2
  19. data/docs/WaitForConditions.md +6 -6
  20. data/docs/WaitForControllerApi.md +3 -3
  21. data/lib/mailslurp_client.rb +8 -1
  22. data/lib/mailslurp_client/api/alias_controller_api.rb +405 -0
  23. data/lib/mailslurp_client/api/attachment_controller_api.rb +4 -1
  24. data/lib/mailslurp_client/api/bulk_actions_controller_api.rb +1 -1
  25. data/lib/mailslurp_client/api/common_actions_controller_api.rb +71 -15
  26. data/lib/mailslurp_client/api/contact_controller_api.rb +1 -1
  27. data/lib/mailslurp_client/api/domain_controller_api.rb +1 -1
  28. data/lib/mailslurp_client/api/email_controller_api.rb +1 -1
  29. data/lib/mailslurp_client/api/form_controller_api.rb +104 -0
  30. data/lib/mailslurp_client/api/group_controller_api.rb +1 -1
  31. data/lib/mailslurp_client/api/inbox_controller_api.rb +60 -1
  32. data/lib/mailslurp_client/api/template_controller_api.rb +1 -1
  33. data/lib/mailslurp_client/api/wait_for_controller_api.rb +5 -5
  34. data/lib/mailslurp_client/api/webhook_controller_api.rb +1 -1
  35. data/lib/mailslurp_client/api_client.rb +1 -1
  36. data/lib/mailslurp_client/api_error.rb +1 -1
  37. data/lib/mailslurp_client/configuration.rb +1 -1
  38. data/lib/mailslurp_client/models/attachment_meta_data.rb +6 -21
  39. data/lib/mailslurp_client/models/basic_auth_options.rb +1 -1
  40. data/lib/mailslurp_client/models/bulk_send_email_options.rb +2 -7
  41. data/lib/mailslurp_client/models/contact_dto.rb +1 -1
  42. data/lib/mailslurp_client/models/contact_projection.rb +1 -1
  43. data/lib/mailslurp_client/models/create_anonymous_alias_options.rb +208 -0
  44. data/lib/mailslurp_client/models/create_contact_options.rb +1 -1
  45. data/lib/mailslurp_client/models/create_domain_options.rb +1 -1
  46. data/lib/mailslurp_client/models/create_group_options.rb +1 -1
  47. data/lib/mailslurp_client/models/create_owned_alias_options.rb +238 -0
  48. data/lib/mailslurp_client/models/create_template_options.rb +1 -1
  49. data/lib/mailslurp_client/models/create_webhook_options.rb +1 -1
  50. data/lib/mailslurp_client/models/domain_dto.rb +1 -1
  51. data/lib/mailslurp_client/models/domain_preview.rb +1 -1
  52. data/lib/mailslurp_client/models/email.rb +2 -2
  53. data/lib/mailslurp_client/models/email_analysis.rb +7 -2
  54. data/lib/mailslurp_client/models/email_preview.rb +2 -2
  55. data/lib/mailslurp_client/models/email_projection.rb +2 -1
  56. data/lib/mailslurp_client/models/forward_email_options.rb +29 -30
  57. data/lib/mailslurp_client/models/group_contacts_dto.rb +1 -1
  58. data/lib/mailslurp_client/models/group_dto.rb +1 -1
  59. data/lib/mailslurp_client/models/group_projection.rb +1 -1
  60. data/lib/mailslurp_client/models/html_validation_result.rb +1 -1
  61. data/lib/mailslurp_client/models/inbox.rb +1 -1
  62. data/lib/mailslurp_client/models/inbox_projection.rb +1 -1
  63. data/lib/mailslurp_client/models/json_node.rb +1 -1
  64. data/lib/mailslurp_client/models/match_option.rb +1 -1
  65. data/lib/mailslurp_client/models/match_options.rb +2 -2
  66. data/lib/mailslurp_client/models/model_alias.rb +284 -0
  67. data/lib/mailslurp_client/models/page_alias.rb +298 -0
  68. data/lib/mailslurp_client/models/page_contact_projection.rb +1 -1
  69. data/lib/mailslurp_client/models/page_email_preview.rb +1 -1
  70. data/lib/mailslurp_client/models/page_email_projection.rb +1 -1
  71. data/lib/mailslurp_client/models/page_group_projection.rb +1 -1
  72. data/lib/mailslurp_client/models/page_inbox_projection.rb +1 -1
  73. data/lib/mailslurp_client/models/page_template_projection.rb +1 -1
  74. data/lib/mailslurp_client/models/page_webhook_projection.rb +1 -1
  75. data/lib/mailslurp_client/models/pageable.rb +1 -1
  76. data/lib/mailslurp_client/models/raw_email_json.rb +1 -1
  77. data/lib/mailslurp_client/models/send_email_options.rb +1 -1
  78. data/lib/mailslurp_client/models/set_inbox_favourited_options.rb +1 -1
  79. data/lib/mailslurp_client/models/simple_send_email_options.rb +237 -0
  80. data/lib/mailslurp_client/models/sort.rb +1 -1
  81. data/lib/mailslurp_client/models/template_dto.rb +1 -1
  82. data/lib/mailslurp_client/models/template_projection.rb +1 -1
  83. data/lib/mailslurp_client/models/template_variable.rb +1 -1
  84. data/lib/mailslurp_client/models/unread_count.rb +1 -1
  85. data/lib/mailslurp_client/models/update_group_contacts.rb +1 -1
  86. data/lib/mailslurp_client/models/update_inbox_options.rb +1 -1
  87. data/lib/mailslurp_client/models/upload_attachment_options.rb +2 -2
  88. data/lib/mailslurp_client/models/validation_dto.rb +3 -11
  89. data/lib/mailslurp_client/models/validation_message.rb +1 -1
  90. data/lib/mailslurp_client/models/wait_for_conditions.rb +8 -7
  91. data/lib/mailslurp_client/models/webhook_dto.rb +1 -1
  92. data/lib/mailslurp_client/models/webhook_projection.rb +1 -1
  93. data/lib/mailslurp_client/models/webhook_test_request.rb +1 -1
  94. data/lib/mailslurp_client/models/webhook_test_response.rb +1 -1
  95. data/lib/mailslurp_client/models/webhook_test_result.rb +1 -1
  96. data/lib/mailslurp_client/version.rb +2 -2
  97. data/mailslurp_client.gemspec +2 -2
  98. data/spec/api/alias_controller_api_spec.rb +107 -0
  99. data/spec/api/form_controller_api_spec.rb +54 -0
  100. data/spec/models/create_anonymous_alias_options_spec.rb +41 -0
  101. data/spec/models/create_owned_alias_options_spec.rb +59 -0
  102. data/spec/models/model_alias_spec.rb +83 -0
  103. data/spec/models/page_alias_spec.rb +101 -0
  104. data/spec/models/simple_send_email_options_spec.rb +59 -0
  105. metadata +33 -3
@@ -3,7 +3,7 @@
3
3
 
4
4
  #MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
5
5
 
6
- The version of the OpenAPI document: 67c9a1eda264be4cfe0bb2c76151f0aadf0862bc
6
+ The version of the OpenAPI document: d1659dc1567a5b62f65d0612107a50aace03e085
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.2.3
@@ -3,7 +3,7 @@
3
3
 
4
4
  #MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
5
5
 
6
- The version of the OpenAPI document: 67c9a1eda264be4cfe0bb2c76151f0aadf0862bc
6
+ The version of the OpenAPI document: d1659dc1567a5b62f65d0612107a50aace03e085
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.2.3
@@ -3,7 +3,7 @@
3
3
 
4
4
  #MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
5
5
 
6
- The version of the OpenAPI document: 67c9a1eda264be4cfe0bb2c76151f0aadf0862bc
6
+ The version of the OpenAPI document: d1659dc1567a5b62f65d0612107a50aace03e085
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.2.3
@@ -3,7 +3,7 @@
3
3
 
4
4
  #MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
5
5
 
6
- The version of the OpenAPI document: 67c9a1eda264be4cfe0bb2c76151f0aadf0862bc
6
+ The version of the OpenAPI document: d1659dc1567a5b62f65d0612107a50aace03e085
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.2.3
@@ -3,7 +3,7 @@
3
3
 
4
4
  #MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
5
5
 
6
- The version of the OpenAPI document: 67c9a1eda264be4cfe0bb2c76151f0aadf0862bc
6
+ The version of the OpenAPI document: d1659dc1567a5b62f65d0612107a50aace03e085
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.2.3
@@ -13,13 +13,18 @@ OpenAPI Generator version: 4.2.3
13
13
  require 'date'
14
14
 
15
15
  module MailSlurpClient
16
+ # Meta data associated with an attachment. Attachments are stored as byte blobs so the meta data is stored separately.
16
17
  class AttachmentMetaData
18
+ # Size of attachment in bytes
17
19
  attr_accessor :content_length
18
20
 
21
+ # Content type of attachment
19
22
  attr_accessor :content_type
20
23
 
24
+ # ID of attachment
21
25
  attr_accessor :id
22
26
 
27
+ # Name of attachment
23
28
  attr_accessor :name
24
29
 
25
30
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -84,32 +89,12 @@ module MailSlurpClient
84
89
  # @return Array for valid properties with the reasons
85
90
  def list_invalid_properties
86
91
  invalid_properties = Array.new
87
- if @content_length.nil?
88
- invalid_properties.push('invalid value for "content_length", content_length cannot be nil.')
89
- end
90
-
91
- if @content_type.nil?
92
- invalid_properties.push('invalid value for "content_type", content_type cannot be nil.')
93
- end
94
-
95
- if @id.nil?
96
- invalid_properties.push('invalid value for "id", id cannot be nil.')
97
- end
98
-
99
- if @name.nil?
100
- invalid_properties.push('invalid value for "name", name cannot be nil.')
101
- end
102
-
103
92
  invalid_properties
104
93
  end
105
94
 
106
95
  # Check to see if the all the properties in the model are valid
107
96
  # @return true if the model is valid
108
97
  def valid?
109
- return false if @content_length.nil?
110
- return false if @content_type.nil?
111
- return false if @id.nil?
112
- return false if @name.nil?
113
98
  true
114
99
  end
115
100
 
@@ -3,7 +3,7 @@
3
3
 
4
4
  #MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
5
5
 
6
- The version of the OpenAPI document: 67c9a1eda264be4cfe0bb2c76151f0aadf0862bc
6
+ The version of the OpenAPI document: d1659dc1567a5b62f65d0612107a50aace03e085
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.2.3
@@ -3,7 +3,7 @@
3
3
 
4
4
  #MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
5
5
 
6
- The version of the OpenAPI document: 67c9a1eda264be4cfe0bb2c76151f0aadf0862bc
6
+ The version of the OpenAPI document: d1659dc1567a5b62f65d0612107a50aace03e085
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.2.3
@@ -13,7 +13,7 @@ OpenAPI Generator version: 4.2.3
13
13
  require 'date'
14
14
 
15
15
  module MailSlurpClient
16
- # Options for bulk sending an email from multiple addresses
16
+ # Options for bulk sending an email from multiple addresses. See regular `sendEmail` methods for more information.
17
17
  class BulkSendEmailOptions
18
18
  # Inboxes to send the email from
19
19
  attr_accessor :inbox_ids
@@ -72,17 +72,12 @@ module MailSlurpClient
72
72
  # @return Array for valid properties with the reasons
73
73
  def list_invalid_properties
74
74
  invalid_properties = Array.new
75
- if @send_email_options.nil?
76
- invalid_properties.push('invalid value for "send_email_options", send_email_options cannot be nil.')
77
- end
78
-
79
75
  invalid_properties
80
76
  end
81
77
 
82
78
  # Check to see if the all the properties in the model are valid
83
79
  # @return true if the model is valid
84
80
  def valid?
85
- return false if @send_email_options.nil?
86
81
  true
87
82
  end
88
83
 
@@ -3,7 +3,7 @@
3
3
 
4
4
  #MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
5
5
 
6
- The version of the OpenAPI document: 67c9a1eda264be4cfe0bb2c76151f0aadf0862bc
6
+ The version of the OpenAPI document: d1659dc1567a5b62f65d0612107a50aace03e085
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.2.3
@@ -3,7 +3,7 @@
3
3
 
4
4
  #MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
5
5
 
6
- The version of the OpenAPI document: 67c9a1eda264be4cfe0bb2c76151f0aadf0862bc
6
+ The version of the OpenAPI document: d1659dc1567a5b62f65d0612107a50aace03e085
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.2.3
@@ -0,0 +1,208 @@
1
+ =begin
2
+ #MailSlurp API
3
+
4
+ #MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
5
+
6
+ The version of the OpenAPI document: d1659dc1567a5b62f65d0612107a50aace03e085
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module MailSlurpClient
16
+ # Create anonymous email alias options. Email aliases can be used to mask real email addresses behind an ID
17
+ class CreateAnonymousAliasOptions
18
+ # Email address to be hidden behind alias
19
+ attr_accessor :email_address
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'email_address' => :'emailAddress'
25
+ }
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.openapi_types
30
+ {
31
+ :'email_address' => :'String'
32
+ }
33
+ end
34
+
35
+ # List of attributes with nullable: true
36
+ def self.openapi_nullable
37
+ Set.new([
38
+ ])
39
+ end
40
+
41
+ # Initializes the object
42
+ # @param [Hash] attributes Model attributes in the form of hash
43
+ def initialize(attributes = {})
44
+ if (!attributes.is_a?(Hash))
45
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::CreateAnonymousAliasOptions` initialize method"
46
+ end
47
+
48
+ # check to see if the attribute exists and convert string to symbol for hash key
49
+ attributes = attributes.each_with_object({}) { |(k, v), h|
50
+ if (!self.class.attribute_map.key?(k.to_sym))
51
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::CreateAnonymousAliasOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
52
+ end
53
+ h[k.to_sym] = v
54
+ }
55
+
56
+ if attributes.key?(:'email_address')
57
+ self.email_address = attributes[:'email_address']
58
+ end
59
+ end
60
+
61
+ # Show invalid properties with the reasons. Usually used together with valid?
62
+ # @return Array for valid properties with the reasons
63
+ def list_invalid_properties
64
+ invalid_properties = Array.new
65
+ invalid_properties
66
+ end
67
+
68
+ # Check to see if the all the properties in the model are valid
69
+ # @return true if the model is valid
70
+ def valid?
71
+ true
72
+ end
73
+
74
+ # Checks equality by comparing each attribute.
75
+ # @param [Object] Object to be compared
76
+ def ==(o)
77
+ return true if self.equal?(o)
78
+ self.class == o.class &&
79
+ email_address == o.email_address
80
+ end
81
+
82
+ # @see the `==` method
83
+ # @param [Object] Object to be compared
84
+ def eql?(o)
85
+ self == o
86
+ end
87
+
88
+ # Calculates hash code according to all attributes.
89
+ # @return [Integer] Hash code
90
+ def hash
91
+ [email_address].hash
92
+ end
93
+
94
+ # Builds the object from hash
95
+ # @param [Hash] attributes Model attributes in the form of hash
96
+ # @return [Object] Returns the model itself
97
+ def self.build_from_hash(attributes)
98
+ new.build_from_hash(attributes)
99
+ end
100
+
101
+ # Builds the object from hash
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ # @return [Object] Returns the model itself
104
+ def build_from_hash(attributes)
105
+ return nil unless attributes.is_a?(Hash)
106
+ self.class.openapi_types.each_pair do |key, type|
107
+ if type =~ /\AArray<(.*)>/i
108
+ # check to ensure the input is an array given that the attribute
109
+ # is documented as an array but the input is not
110
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
111
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
112
+ end
113
+ elsif !attributes[self.class.attribute_map[key]].nil?
114
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
115
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
116
+ end
117
+
118
+ self
119
+ end
120
+
121
+ # Deserializes the data based on type
122
+ # @param string type Data type
123
+ # @param string value Value to be deserialized
124
+ # @return [Object] Deserialized data
125
+ def _deserialize(type, value)
126
+ case type.to_sym
127
+ when :DateTime
128
+ DateTime.parse(value)
129
+ when :Date
130
+ Date.parse(value)
131
+ when :String
132
+ value.to_s
133
+ when :Integer
134
+ value.to_i
135
+ when :Float
136
+ value.to_f
137
+ when :Boolean
138
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
139
+ true
140
+ else
141
+ false
142
+ end
143
+ when :Object
144
+ # generic object (usually a Hash), return directly
145
+ value
146
+ when /\AArray<(?<inner_type>.+)>\z/
147
+ inner_type = Regexp.last_match[:inner_type]
148
+ value.map { |v| _deserialize(inner_type, v) }
149
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
150
+ k_type = Regexp.last_match[:k_type]
151
+ v_type = Regexp.last_match[:v_type]
152
+ {}.tap do |hash|
153
+ value.each do |k, v|
154
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
155
+ end
156
+ end
157
+ else # model
158
+ MailSlurpClient.const_get(type).build_from_hash(value)
159
+ end
160
+ end
161
+
162
+ # Returns the string representation of the object
163
+ # @return [String] String presentation of the object
164
+ def to_s
165
+ to_hash.to_s
166
+ end
167
+
168
+ # to_body is an alias to to_hash (backward compatibility)
169
+ # @return [Hash] Returns the object in the form of hash
170
+ def to_body
171
+ to_hash
172
+ end
173
+
174
+ # Returns the object in the form of hash
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_hash
177
+ hash = {}
178
+ self.class.attribute_map.each_pair do |attr, param|
179
+ value = self.send(attr)
180
+ if value.nil?
181
+ is_nullable = self.class.openapi_nullable.include?(attr)
182
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
183
+ end
184
+
185
+ hash[param] = _to_hash(value)
186
+ end
187
+ hash
188
+ end
189
+
190
+ # Outputs non-array value in the form of hash
191
+ # For object, use to_hash. Otherwise, just return the value
192
+ # @param [Object] value Any valid value
193
+ # @return [Hash] Returns the value in the form of hash
194
+ def _to_hash(value)
195
+ if value.is_a?(Array)
196
+ value.compact.map { |v| _to_hash(v) }
197
+ elsif value.is_a?(Hash)
198
+ {}.tap do |hash|
199
+ value.each { |k, v| hash[k] = _to_hash(v) }
200
+ end
201
+ elsif value.respond_to? :to_hash
202
+ value.to_hash
203
+ else
204
+ value
205
+ end
206
+ end
207
+ end
208
+ end
@@ -3,7 +3,7 @@
3
3
 
4
4
  #MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
5
5
 
6
- The version of the OpenAPI document: 67c9a1eda264be4cfe0bb2c76151f0aadf0862bc
6
+ The version of the OpenAPI document: d1659dc1567a5b62f65d0612107a50aace03e085
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.2.3
@@ -3,7 +3,7 @@
3
3
 
4
4
  #MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
5
5
 
6
- The version of the OpenAPI document: 67c9a1eda264be4cfe0bb2c76151f0aadf0862bc
6
+ The version of the OpenAPI document: d1659dc1567a5b62f65d0612107a50aace03e085
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.2.3
@@ -3,7 +3,7 @@
3
3
 
4
4
  #MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
5
5
 
6
- The version of the OpenAPI document: 67c9a1eda264be4cfe0bb2c76151f0aadf0862bc
6
+ The version of the OpenAPI document: d1659dc1567a5b62f65d0612107a50aace03e085
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.2.3
@@ -0,0 +1,238 @@
1
+ =begin
2
+ #MailSlurp API
3
+
4
+ #MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
5
+
6
+ The version of the OpenAPI document: d1659dc1567a5b62f65d0612107a50aace03e085
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module MailSlurpClient
16
+ # Create email alias options. Email aliases can be used to mask real email addresses behind an ID. You can also attach an inbox to an alias so that any email received by the inbox email address if forwarded to the alias email address.
17
+ class CreateOwnedAliasOptions
18
+ # Email address to be hidden behind alias
19
+ attr_accessor :email_address
20
+
21
+ # Optional inbox ID to attach to alias. Emails received by this inbox will be forwarded to the alias email address
22
+ attr_accessor :inbox_id
23
+
24
+ # Optional name for alias
25
+ attr_accessor :name
26
+
27
+ # Optional proxied flag. When proxied is true alias will forward the incoming emails to the aliased email address via a proxy inbox. A new proxy is created for every new email thread. By replying to the proxy you can correspond with using your email alias without revealing your real email address.
28
+ attr_accessor :proxied
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'email_address' => :'emailAddress',
34
+ :'inbox_id' => :'inboxId',
35
+ :'name' => :'name',
36
+ :'proxied' => :'proxied'
37
+ }
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'email_address' => :'String',
44
+ :'inbox_id' => :'String',
45
+ :'name' => :'String',
46
+ :'proxied' => :'Boolean'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::CreateOwnedAliasOptions` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!self.class.attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::CreateOwnedAliasOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'email_address')
72
+ self.email_address = attributes[:'email_address']
73
+ end
74
+
75
+ if attributes.key?(:'inbox_id')
76
+ self.inbox_id = attributes[:'inbox_id']
77
+ end
78
+
79
+ if attributes.key?(:'name')
80
+ self.name = attributes[:'name']
81
+ end
82
+
83
+ if attributes.key?(:'proxied')
84
+ self.proxied = attributes[:'proxied']
85
+ end
86
+ end
87
+
88
+ # Show invalid properties with the reasons. Usually used together with valid?
89
+ # @return Array for valid properties with the reasons
90
+ def list_invalid_properties
91
+ invalid_properties = Array.new
92
+ invalid_properties
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ def valid?
98
+ true
99
+ end
100
+
101
+ # Checks equality by comparing each attribute.
102
+ # @param [Object] Object to be compared
103
+ def ==(o)
104
+ return true if self.equal?(o)
105
+ self.class == o.class &&
106
+ email_address == o.email_address &&
107
+ inbox_id == o.inbox_id &&
108
+ name == o.name &&
109
+ proxied == o.proxied
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] Object to be compared
114
+ def eql?(o)
115
+ self == o
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Integer] Hash code
120
+ def hash
121
+ [email_address, inbox_id, name, proxied].hash
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def self.build_from_hash(attributes)
128
+ new.build_from_hash(attributes)
129
+ end
130
+
131
+ # Builds the object from hash
132
+ # @param [Hash] attributes Model attributes in the form of hash
133
+ # @return [Object] Returns the model itself
134
+ def build_from_hash(attributes)
135
+ return nil unless attributes.is_a?(Hash)
136
+ self.class.openapi_types.each_pair do |key, type|
137
+ if type =~ /\AArray<(.*)>/i
138
+ # check to ensure the input is an array given that the attribute
139
+ # is documented as an array but the input is not
140
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
141
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
142
+ end
143
+ elsif !attributes[self.class.attribute_map[key]].nil?
144
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
145
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
146
+ end
147
+
148
+ self
149
+ end
150
+
151
+ # Deserializes the data based on type
152
+ # @param string type Data type
153
+ # @param string value Value to be deserialized
154
+ # @return [Object] Deserialized data
155
+ def _deserialize(type, value)
156
+ case type.to_sym
157
+ when :DateTime
158
+ DateTime.parse(value)
159
+ when :Date
160
+ Date.parse(value)
161
+ when :String
162
+ value.to_s
163
+ when :Integer
164
+ value.to_i
165
+ when :Float
166
+ value.to_f
167
+ when :Boolean
168
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
169
+ true
170
+ else
171
+ false
172
+ end
173
+ when :Object
174
+ # generic object (usually a Hash), return directly
175
+ value
176
+ when /\AArray<(?<inner_type>.+)>\z/
177
+ inner_type = Regexp.last_match[:inner_type]
178
+ value.map { |v| _deserialize(inner_type, v) }
179
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
180
+ k_type = Regexp.last_match[:k_type]
181
+ v_type = Regexp.last_match[:v_type]
182
+ {}.tap do |hash|
183
+ value.each do |k, v|
184
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
185
+ end
186
+ end
187
+ else # model
188
+ MailSlurpClient.const_get(type).build_from_hash(value)
189
+ end
190
+ end
191
+
192
+ # Returns the string representation of the object
193
+ # @return [String] String presentation of the object
194
+ def to_s
195
+ to_hash.to_s
196
+ end
197
+
198
+ # to_body is an alias to to_hash (backward compatibility)
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_body
201
+ to_hash
202
+ end
203
+
204
+ # Returns the object in the form of hash
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_hash
207
+ hash = {}
208
+ self.class.attribute_map.each_pair do |attr, param|
209
+ value = self.send(attr)
210
+ if value.nil?
211
+ is_nullable = self.class.openapi_nullable.include?(attr)
212
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
213
+ end
214
+
215
+ hash[param] = _to_hash(value)
216
+ end
217
+ hash
218
+ end
219
+
220
+ # Outputs non-array value in the form of hash
221
+ # For object, use to_hash. Otherwise, just return the value
222
+ # @param [Object] value Any valid value
223
+ # @return [Hash] Returns the value in the form of hash
224
+ def _to_hash(value)
225
+ if value.is_a?(Array)
226
+ value.compact.map { |v| _to_hash(v) }
227
+ elsif value.is_a?(Hash)
228
+ {}.tap do |hash|
229
+ value.each { |k, v| hash[k] = _to_hash(v) }
230
+ end
231
+ elsif value.respond_to? :to_hash
232
+ value.to_hash
233
+ else
234
+ value
235
+ end
236
+ end
237
+ end
238
+ end