mailslurp_client 15.0.0 → 15.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (158) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/lib/mailslurp_client/api/alias_controller_api.rb +59 -55
  4. data/lib/mailslurp_client/api/attachment_controller_api.rb +49 -60
  5. data/lib/mailslurp_client/api/bounce_controller_api.rb +26 -18
  6. data/lib/mailslurp_client/api/bulk_actions_controller_api.rb +15 -15
  7. data/lib/mailslurp_client/api/common_actions_controller_api.rb +128 -67
  8. data/lib/mailslurp_client/api/contact_controller_api.rb +22 -22
  9. data/lib/mailslurp_client/api/domain_controller_api.rb +32 -32
  10. data/lib/mailslurp_client/api/email_controller_api.rb +190 -116
  11. data/lib/mailslurp_client/api/expired_controller_api.rb +19 -19
  12. data/lib/mailslurp_client/api/export_controller_api.rb +38 -38
  13. data/lib/mailslurp_client/api/form_controller_api.rb +16 -18
  14. data/lib/mailslurp_client/api/group_controller_api.rb +52 -52
  15. data/lib/mailslurp_client/api/inbox_controller_api.rb +359 -225
  16. data/lib/mailslurp_client/api/inbox_forwarder_controller_api.rb +33 -29
  17. data/lib/mailslurp_client/api/inbox_ruleset_controller_api.rb +33 -29
  18. data/lib/mailslurp_client/api/mail_server_controller_api.rb +26 -26
  19. data/lib/mailslurp_client/api/missed_email_controller_api.rb +54 -42
  20. data/lib/mailslurp_client/api/sent_emails_controller_api.rb +157 -47
  21. data/lib/mailslurp_client/api/template_controller_api.rb +21 -21
  22. data/lib/mailslurp_client/api/tracking_controller_api.rb +16 -16
  23. data/lib/mailslurp_client/api/wait_for_controller_api.rb +128 -88
  24. data/lib/mailslurp_client/api/webhook_controller_api.rb +102 -86
  25. data/lib/mailslurp_client/configuration.rb +4 -4
  26. data/lib/mailslurp_client/models/abstract_webhook_payload.rb +10 -25
  27. data/lib/mailslurp_client/models/alias_dto.rb +45 -56
  28. data/lib/mailslurp_client/models/alias_projection.rb +42 -72
  29. data/lib/mailslurp_client/models/attachment_entity.rb +34 -54
  30. data/lib/mailslurp_client/models/attachment_meta_data.rb +21 -21
  31. data/lib/mailslurp_client/models/attachment_projection.rb +36 -51
  32. data/lib/mailslurp_client/models/basic_auth_options.rb +0 -10
  33. data/lib/mailslurp_client/models/bounce_projection.rb +13 -23
  34. data/lib/mailslurp_client/models/bounce_recipient.rb +22 -42
  35. data/lib/mailslurp_client/models/bounced_email_dto.rb +56 -76
  36. data/lib/mailslurp_client/models/bounced_recipient_dto.rb +16 -31
  37. data/lib/mailslurp_client/models/bulk_send_email_options.rb +5 -0
  38. data/lib/mailslurp_client/models/condition_option.rb +2 -2
  39. data/lib/mailslurp_client/models/contact_dto.rb +53 -73
  40. data/lib/mailslurp_client/models/contact_projection.rb +42 -52
  41. data/lib/mailslurp_client/models/count_dto.rb +206 -0
  42. data/lib/mailslurp_client/models/create_contact_options.rb +42 -42
  43. data/lib/mailslurp_client/models/create_domain_options.rb +21 -16
  44. data/lib/mailslurp_client/models/create_group_options.rb +0 -5
  45. data/lib/mailslurp_client/models/create_inbox_dto.rb +58 -58
  46. data/lib/mailslurp_client/models/create_inbox_forwarder_options.rb +19 -14
  47. data/lib/mailslurp_client/models/create_inbox_ruleset_options.rb +23 -23
  48. data/lib/mailslurp_client/models/create_template_options.rb +0 -10
  49. data/lib/mailslurp_client/models/create_webhook_options.rb +18 -18
  50. data/lib/mailslurp_client/models/describe_mail_server_domain_result.rb +15 -25
  51. data/lib/mailslurp_client/models/dns_lookup_options.rb +24 -14
  52. data/lib/mailslurp_client/models/dns_lookup_result.rb +23 -42
  53. data/lib/mailslurp_client/models/dns_lookup_results.rb +0 -5
  54. data/lib/mailslurp_client/models/domain_dto.rb +59 -80
  55. data/lib/mailslurp_client/models/domain_name_record.rb +11 -30
  56. data/lib/mailslurp_client/models/domain_preview.rb +26 -50
  57. data/lib/mailslurp_client/models/email.rb +134 -135
  58. data/lib/mailslurp_client/models/email_analysis.rb +28 -28
  59. data/lib/mailslurp_client/models/email_content_match_result.rb +13 -23
  60. data/lib/mailslurp_client/models/email_links_result.rb +13 -23
  61. data/lib/mailslurp_client/models/email_preview.rb +47 -47
  62. data/lib/mailslurp_client/models/email_projection.rb +77 -97
  63. data/lib/mailslurp_client/models/email_recipients.rb +16 -15
  64. data/lib/mailslurp_client/models/email_text_lines_result.rb +13 -23
  65. data/lib/mailslurp_client/models/email_verification_result.rb +16 -36
  66. data/lib/mailslurp_client/models/expiration_defaults.rb +16 -26
  67. data/lib/mailslurp_client/models/expired_inbox_dto.rb +13 -28
  68. data/lib/mailslurp_client/models/expired_inbox_record_projection.rb +22 -42
  69. data/lib/mailslurp_client/models/export_link.rb +0 -5
  70. data/lib/mailslurp_client/models/export_options.rb +1 -6
  71. data/lib/mailslurp_client/models/flush_expired_inboxes_result.rb +13 -23
  72. data/lib/mailslurp_client/models/forward_email_options.rb +36 -31
  73. data/lib/mailslurp_client/models/gravatar_url.rb +13 -23
  74. data/lib/mailslurp_client/models/group_contacts_dto.rb +13 -23
  75. data/lib/mailslurp_client/models/group_dto.rb +22 -37
  76. data/lib/mailslurp_client/models/group_projection.rb +22 -37
  77. data/lib/mailslurp_client/models/html_validation_result.rb +13 -14
  78. data/lib/mailslurp_client/models/{inbox.rb → inbox_dto.rb} +47 -57
  79. data/lib/mailslurp_client/models/inbox_exists_dto.rb +0 -5
  80. data/lib/mailslurp_client/models/inbox_forwarder_dto.rb +31 -61
  81. data/lib/mailslurp_client/models/inbox_forwarder_test_options.rb +0 -5
  82. data/lib/mailslurp_client/models/inbox_forwarder_test_result.rb +13 -23
  83. data/lib/mailslurp_client/models/inbox_preview.rb +38 -38
  84. data/lib/mailslurp_client/models/inbox_ruleset_dto.rb +43 -78
  85. data/lib/mailslurp_client/models/inbox_ruleset_test_options.rb +0 -5
  86. data/lib/mailslurp_client/models/inbox_ruleset_test_result.rb +13 -18
  87. data/lib/mailslurp_client/models/inline_object.rb +221 -0
  88. data/lib/mailslurp_client/models/ip_address_result.rb +0 -10
  89. data/lib/mailslurp_client/models/json_schema_dto.rb +0 -5
  90. data/lib/mailslurp_client/models/match_option.rb +7 -2
  91. data/lib/mailslurp_client/models/match_options.rb +16 -16
  92. data/lib/mailslurp_client/models/missed_email.rb +67 -102
  93. data/lib/mailslurp_client/models/missed_email_projection.rb +19 -29
  94. data/lib/mailslurp_client/models/name_server_record.rb +10 -30
  95. data/lib/mailslurp_client/models/organization_inbox_projection.rb +44 -44
  96. data/lib/mailslurp_client/models/page_alias.rb +52 -52
  97. data/lib/mailslurp_client/models/page_attachment_entity.rb +52 -52
  98. data/lib/mailslurp_client/models/page_bounced_email.rb +52 -52
  99. data/lib/mailslurp_client/models/page_bounced_recipients.rb +52 -52
  100. data/lib/mailslurp_client/models/page_contact_projection.rb +52 -52
  101. data/lib/mailslurp_client/models/page_email_preview.rb +52 -52
  102. data/lib/mailslurp_client/models/page_email_projection.rb +52 -52
  103. data/lib/mailslurp_client/models/page_expired_inbox_record_projection.rb +52 -52
  104. data/lib/mailslurp_client/models/page_group_projection.rb +52 -52
  105. data/lib/mailslurp_client/models/page_inbox_forwarder_dto.rb +52 -52
  106. data/lib/mailslurp_client/models/page_inbox_projection.rb +52 -52
  107. data/lib/mailslurp_client/models/page_inbox_ruleset_dto.rb +52 -52
  108. data/lib/mailslurp_client/models/page_missed_email_projection.rb +52 -52
  109. data/lib/mailslurp_client/models/page_organization_inbox_projection.rb +52 -52
  110. data/lib/mailslurp_client/models/page_sent_email_projection.rb +49 -49
  111. data/lib/mailslurp_client/models/page_template_projection.rb +52 -52
  112. data/lib/mailslurp_client/models/page_thread_projection.rb +52 -52
  113. data/lib/mailslurp_client/models/page_tracking_pixel_projection.rb +52 -52
  114. data/lib/mailslurp_client/models/page_unknown_missed_email_projection.rb +52 -52
  115. data/lib/mailslurp_client/models/page_webhook_projection.rb +52 -52
  116. data/lib/mailslurp_client/models/page_webhook_result.rb +52 -52
  117. data/lib/mailslurp_client/models/pageable.rb +10 -10
  118. data/lib/mailslurp_client/models/raw_email_json.rb +0 -5
  119. data/lib/mailslurp_client/models/recipient.rb +13 -23
  120. data/lib/mailslurp_client/models/reply_to_alias_email_options.rb +38 -37
  121. data/lib/mailslurp_client/models/reply_to_email_options.rb +51 -50
  122. data/lib/mailslurp_client/models/send_email_options.rb +107 -115
  123. data/lib/mailslurp_client/models/sender.rb +14 -23
  124. data/lib/mailslurp_client/models/sent_email_dto.rb +97 -102
  125. data/lib/mailslurp_client/models/sent_email_projection.rb +66 -105
  126. data/lib/mailslurp_client/models/simple_send_email_options.rb +24 -24
  127. data/lib/mailslurp_client/models/template_dto.rb +22 -47
  128. data/lib/mailslurp_client/models/template_projection.rb +16 -41
  129. data/lib/mailslurp_client/models/template_variable.rb +0 -10
  130. data/lib/mailslurp_client/models/test_new_inbox_forwarder_options.rb +0 -10
  131. data/lib/mailslurp_client/models/test_new_inbox_ruleset_options.rb +0 -10
  132. data/lib/mailslurp_client/models/thread_projection.rb +60 -95
  133. data/lib/mailslurp_client/models/tracking_pixel_dto.rb +43 -68
  134. data/lib/mailslurp_client/models/tracking_pixel_projection.rb +34 -54
  135. data/lib/mailslurp_client/models/unknown_missed_email_projection.rb +19 -29
  136. data/lib/mailslurp_client/models/unread_count.rb +0 -5
  137. data/lib/mailslurp_client/models/unseen_error_count_dto.rb +0 -5
  138. data/lib/mailslurp_client/models/update_group_contacts.rb +0 -5
  139. data/lib/mailslurp_client/models/update_inbox_options.rb +26 -26
  140. data/lib/mailslurp_client/models/upload_attachment_options.rb +14 -14
  141. data/lib/mailslurp_client/models/validation_message.rb +1 -5
  142. data/lib/mailslurp_client/models/verify_email_address_options.rb +0 -5
  143. data/lib/mailslurp_client/models/wait_for_conditions.rb +48 -58
  144. data/lib/mailslurp_client/models/webhook_dto.rb +64 -69
  145. data/lib/mailslurp_client/models/webhook_email_opened_payload.rb +42 -42
  146. data/lib/mailslurp_client/models/webhook_email_read_payload.rb +49 -49
  147. data/lib/mailslurp_client/models/webhook_new_attachment_payload.rb +43 -43
  148. data/lib/mailslurp_client/models/webhook_new_contact_payload.rb +75 -95
  149. data/lib/mailslurp_client/models/webhook_new_email_payload.rb +84 -84
  150. data/lib/mailslurp_client/models/webhook_projection.rb +36 -61
  151. data/lib/mailslurp_client/models/webhook_redrive_result.rb +13 -23
  152. data/lib/mailslurp_client/models/webhook_result_dto.rb +76 -126
  153. data/lib/mailslurp_client/models/webhook_test_request.rb +21 -36
  154. data/lib/mailslurp_client/models/webhook_test_response.rb +13 -13
  155. data/lib/mailslurp_client/models/webhook_test_result.rb +13 -23
  156. data/lib/mailslurp_client/version.rb +1 -1
  157. data/lib/mailslurp_client.rb +3 -1
  158. metadata +5 -3
@@ -14,47 +14,47 @@ require 'date'
14
14
 
15
15
  module MailSlurpClient
16
16
  class ContactProjection
17
- attr_accessor :company
18
-
19
- attr_accessor :created_at
17
+ attr_accessor :id
20
18
 
21
- attr_accessor :email_addresses
19
+ attr_accessor :group_id
22
20
 
23
21
  attr_accessor :first_name
24
22
 
25
- attr_accessor :group_id
23
+ attr_accessor :last_name
26
24
 
27
- attr_accessor :id
25
+ attr_accessor :company
28
26
 
29
- attr_accessor :last_name
27
+ attr_accessor :email_addresses
30
28
 
31
29
  attr_accessor :opt_out
32
30
 
31
+ attr_accessor :created_at
32
+
33
33
  # Attribute mapping from ruby-style variable name to JSON key.
34
34
  def self.attribute_map
35
35
  {
36
- :'company' => :'company',
37
- :'created_at' => :'createdAt',
38
- :'email_addresses' => :'emailAddresses',
39
- :'first_name' => :'firstName',
40
- :'group_id' => :'groupId',
41
36
  :'id' => :'id',
37
+ :'group_id' => :'groupId',
38
+ :'first_name' => :'firstName',
42
39
  :'last_name' => :'lastName',
43
- :'opt_out' => :'optOut'
40
+ :'company' => :'company',
41
+ :'email_addresses' => :'emailAddresses',
42
+ :'opt_out' => :'optOut',
43
+ :'created_at' => :'createdAt'
44
44
  }
45
45
  end
46
46
 
47
47
  # Attribute type mapping.
48
48
  def self.openapi_types
49
49
  {
50
- :'company' => :'String',
51
- :'created_at' => :'DateTime',
52
- :'email_addresses' => :'Array<String>',
53
- :'first_name' => :'String',
54
- :'group_id' => :'String',
55
50
  :'id' => :'String',
51
+ :'group_id' => :'String',
52
+ :'first_name' => :'String',
56
53
  :'last_name' => :'String',
57
- :'opt_out' => :'Boolean'
54
+ :'company' => :'String',
55
+ :'email_addresses' => :'Array<String>',
56
+ :'opt_out' => :'Boolean',
57
+ :'created_at' => :'DateTime'
58
58
  }
59
59
  end
60
60
 
@@ -79,61 +79,51 @@ module MailSlurpClient
79
79
  h[k.to_sym] = v
80
80
  }
81
81
 
82
- if attributes.key?(:'company')
83
- self.company = attributes[:'company']
84
- end
85
-
86
- if attributes.key?(:'created_at')
87
- self.created_at = attributes[:'created_at']
82
+ if attributes.key?(:'id')
83
+ self.id = attributes[:'id']
88
84
  end
89
85
 
90
- if attributes.key?(:'email_addresses')
91
- if (value = attributes[:'email_addresses']).is_a?(Array)
92
- self.email_addresses = value
93
- end
86
+ if attributes.key?(:'group_id')
87
+ self.group_id = attributes[:'group_id']
94
88
  end
95
89
 
96
90
  if attributes.key?(:'first_name')
97
91
  self.first_name = attributes[:'first_name']
98
92
  end
99
93
 
100
- if attributes.key?(:'group_id')
101
- self.group_id = attributes[:'group_id']
94
+ if attributes.key?(:'last_name')
95
+ self.last_name = attributes[:'last_name']
102
96
  end
103
97
 
104
- if attributes.key?(:'id')
105
- self.id = attributes[:'id']
98
+ if attributes.key?(:'company')
99
+ self.company = attributes[:'company']
106
100
  end
107
101
 
108
- if attributes.key?(:'last_name')
109
- self.last_name = attributes[:'last_name']
102
+ if attributes.key?(:'email_addresses')
103
+ if (value = attributes[:'email_addresses']).is_a?(Array)
104
+ self.email_addresses = value
105
+ end
110
106
  end
111
107
 
112
108
  if attributes.key?(:'opt_out')
113
109
  self.opt_out = attributes[:'opt_out']
114
110
  end
111
+
112
+ if attributes.key?(:'created_at')
113
+ self.created_at = attributes[:'created_at']
114
+ end
115
115
  end
116
116
 
117
117
  # Show invalid properties with the reasons. Usually used together with valid?
118
118
  # @return Array for valid properties with the reasons
119
119
  def list_invalid_properties
120
120
  invalid_properties = Array.new
121
- if @created_at.nil?
122
- invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
123
- end
124
-
125
- if @id.nil?
126
- invalid_properties.push('invalid value for "id", id cannot be nil.')
127
- end
128
-
129
121
  invalid_properties
130
122
  end
131
123
 
132
124
  # Check to see if the all the properties in the model are valid
133
125
  # @return true if the model is valid
134
126
  def valid?
135
- return false if @created_at.nil?
136
- return false if @id.nil?
137
127
  true
138
128
  end
139
129
 
@@ -142,14 +132,14 @@ module MailSlurpClient
142
132
  def ==(o)
143
133
  return true if self.equal?(o)
144
134
  self.class == o.class &&
145
- company == o.company &&
146
- created_at == o.created_at &&
147
- email_addresses == o.email_addresses &&
148
- first_name == o.first_name &&
149
- group_id == o.group_id &&
150
135
  id == o.id &&
136
+ group_id == o.group_id &&
137
+ first_name == o.first_name &&
151
138
  last_name == o.last_name &&
152
- opt_out == o.opt_out
139
+ company == o.company &&
140
+ email_addresses == o.email_addresses &&
141
+ opt_out == o.opt_out &&
142
+ created_at == o.created_at
153
143
  end
154
144
 
155
145
  # @see the `==` method
@@ -161,7 +151,7 @@ module MailSlurpClient
161
151
  # Calculates hash code according to all attributes.
162
152
  # @return [Integer] Hash code
163
153
  def hash
164
- [company, created_at, email_addresses, first_name, group_id, id, last_name, opt_out].hash
154
+ [id, group_id, first_name, last_name, company, email_addresses, opt_out, created_at].hash
165
155
  end
166
156
 
167
157
  # Builds the object from hash
@@ -0,0 +1,206 @@
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: 6.5.2
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module MailSlurpClient
16
+ class CountDto
17
+ attr_accessor :total_elements
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ :'total_elements' => :'totalElements'
23
+ }
24
+ end
25
+
26
+ # Attribute type mapping.
27
+ def self.openapi_types
28
+ {
29
+ :'total_elements' => :'Integer'
30
+ }
31
+ end
32
+
33
+ # List of attributes with nullable: true
34
+ def self.openapi_nullable
35
+ Set.new([
36
+ ])
37
+ end
38
+
39
+ # Initializes the object
40
+ # @param [Hash] attributes Model attributes in the form of hash
41
+ def initialize(attributes = {})
42
+ if (!attributes.is_a?(Hash))
43
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::CountDto` initialize method"
44
+ end
45
+
46
+ # check to see if the attribute exists and convert string to symbol for hash key
47
+ attributes = attributes.each_with_object({}) { |(k, v), h|
48
+ if (!self.class.attribute_map.key?(k.to_sym))
49
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::CountDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
50
+ end
51
+ h[k.to_sym] = v
52
+ }
53
+
54
+ if attributes.key?(:'total_elements')
55
+ self.total_elements = attributes[:'total_elements']
56
+ end
57
+ end
58
+
59
+ # Show invalid properties with the reasons. Usually used together with valid?
60
+ # @return Array for valid properties with the reasons
61
+ def list_invalid_properties
62
+ invalid_properties = Array.new
63
+ invalid_properties
64
+ end
65
+
66
+ # Check to see if the all the properties in the model are valid
67
+ # @return true if the model is valid
68
+ def valid?
69
+ true
70
+ end
71
+
72
+ # Checks equality by comparing each attribute.
73
+ # @param [Object] Object to be compared
74
+ def ==(o)
75
+ return true if self.equal?(o)
76
+ self.class == o.class &&
77
+ total_elements == o.total_elements
78
+ end
79
+
80
+ # @see the `==` method
81
+ # @param [Object] Object to be compared
82
+ def eql?(o)
83
+ self == o
84
+ end
85
+
86
+ # Calculates hash code according to all attributes.
87
+ # @return [Integer] Hash code
88
+ def hash
89
+ [total_elements].hash
90
+ end
91
+
92
+ # Builds the object from hash
93
+ # @param [Hash] attributes Model attributes in the form of hash
94
+ # @return [Object] Returns the model itself
95
+ def self.build_from_hash(attributes)
96
+ new.build_from_hash(attributes)
97
+ end
98
+
99
+ # Builds the object from hash
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ # @return [Object] Returns the model itself
102
+ def build_from_hash(attributes)
103
+ return nil unless attributes.is_a?(Hash)
104
+ self.class.openapi_types.each_pair do |key, type|
105
+ if type =~ /\AArray<(.*)>/i
106
+ # check to ensure the input is an array given that the attribute
107
+ # is documented as an array but the input is not
108
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
109
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
110
+ end
111
+ elsif !attributes[self.class.attribute_map[key]].nil?
112
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
113
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
114
+ end
115
+
116
+ self
117
+ end
118
+
119
+ # Deserializes the data based on type
120
+ # @param string type Data type
121
+ # @param string value Value to be deserialized
122
+ # @return [Object] Deserialized data
123
+ def _deserialize(type, value)
124
+ case type.to_sym
125
+ when :DateTime
126
+ DateTime.parse(value)
127
+ when :Date
128
+ Date.parse(value)
129
+ when :String
130
+ value.to_s
131
+ when :Integer
132
+ value.to_i
133
+ when :Float
134
+ value.to_f
135
+ when :Boolean
136
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
137
+ true
138
+ else
139
+ false
140
+ end
141
+ when :Object
142
+ # generic object (usually a Hash), return directly
143
+ value
144
+ when /\AArray<(?<inner_type>.+)>\z/
145
+ inner_type = Regexp.last_match[:inner_type]
146
+ value.map { |v| _deserialize(inner_type, v) }
147
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
148
+ k_type = Regexp.last_match[:k_type]
149
+ v_type = Regexp.last_match[:v_type]
150
+ {}.tap do |hash|
151
+ value.each do |k, v|
152
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
153
+ end
154
+ end
155
+ else # model
156
+ MailSlurpClient.const_get(type).build_from_hash(value)
157
+ end
158
+ end
159
+
160
+ # Returns the string representation of the object
161
+ # @return [String] String presentation of the object
162
+ def to_s
163
+ to_hash.to_s
164
+ end
165
+
166
+ # to_body is an alias to to_hash (backward compatibility)
167
+ # @return [Hash] Returns the object in the form of hash
168
+ def to_body
169
+ to_hash
170
+ end
171
+
172
+ # Returns the object in the form of hash
173
+ # @return [Hash] Returns the object in the form of hash
174
+ def to_hash
175
+ hash = {}
176
+ self.class.attribute_map.each_pair do |attr, param|
177
+ value = self.send(attr)
178
+ if value.nil?
179
+ is_nullable = self.class.openapi_nullable.include?(attr)
180
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
181
+ end
182
+
183
+ hash[param] = _to_hash(value)
184
+ end
185
+ hash
186
+ end
187
+
188
+ # Outputs non-array value in the form of hash
189
+ # For object, use to_hash. Otherwise, just return the value
190
+ # @param [Object] value Any valid value
191
+ # @return [Hash] Returns the value in the form of hash
192
+ def _to_hash(value)
193
+ if value.is_a?(Array)
194
+ value.compact.map { |v| _to_hash(v) }
195
+ elsif value.is_a?(Hash)
196
+ {}.tap do |hash|
197
+ value.each { |k, v| hash[k] = _to_hash(v) }
198
+ end
199
+ elsif value.respond_to? :to_hash
200
+ value.to_hash
201
+ else
202
+ value
203
+ end
204
+ end
205
+ end
206
+ end
@@ -14,51 +14,51 @@ require 'date'
14
14
 
15
15
  module MailSlurpClient
16
16
  class CreateContactOptions
17
- # Set of email addresses belonging to the contact
18
- attr_accessor :email_addresses
19
-
20
17
  attr_accessor :first_name
21
18
 
22
- # Group IDs that contact belongs to
23
- attr_accessor :group_id
19
+ attr_accessor :last_name
24
20
 
25
- attr_accessor :meta_data
21
+ attr_accessor :company
26
22
 
27
- # Has the user explicitly or implicitly opted out of being contacted? If so MailSlurp will ignore them in all actions.
28
- attr_accessor :opt_out
23
+ # Set of email addresses belonging to the contact
24
+ attr_accessor :email_addresses
29
25
 
30
26
  # Tags that can be used to search and group contacts
31
27
  attr_accessor :tags
32
28
 
33
- attr_accessor :last_name
29
+ attr_accessor :meta_data
34
30
 
35
- attr_accessor :company
31
+ # Has the user explicitly or implicitly opted out of being contacted? If so MailSlurp will ignore them in all actions.
32
+ attr_accessor :opt_out
33
+
34
+ # Group IDs that contact belongs to
35
+ attr_accessor :group_id
36
36
 
37
37
  # Attribute mapping from ruby-style variable name to JSON key.
38
38
  def self.attribute_map
39
39
  {
40
- :'email_addresses' => :'emailAddresses',
41
40
  :'first_name' => :'firstName',
42
- :'group_id' => :'groupId',
41
+ :'last_name' => :'lastName',
42
+ :'company' => :'company',
43
+ :'email_addresses' => :'emailAddresses',
44
+ :'tags' => :'tags',
43
45
  :'meta_data' => :'metaData',
44
46
  :'opt_out' => :'optOut',
45
- :'tags' => :'tags',
46
- :'last_name' => :'lastName',
47
- :'company' => :'company'
47
+ :'group_id' => :'groupId'
48
48
  }
49
49
  end
50
50
 
51
51
  # Attribute type mapping.
52
52
  def self.openapi_types
53
53
  {
54
- :'email_addresses' => :'Array<String>',
55
54
  :'first_name' => :'String',
56
- :'group_id' => :'String',
55
+ :'last_name' => :'String',
56
+ :'company' => :'String',
57
+ :'email_addresses' => :'Array<String>',
58
+ :'tags' => :'Array<String>',
57
59
  :'meta_data' => :'Object',
58
60
  :'opt_out' => :'Boolean',
59
- :'tags' => :'Array<String>',
60
- :'last_name' => :'String',
61
- :'company' => :'String'
61
+ :'group_id' => :'String'
62
62
  }
63
63
  end
64
64
 
@@ -83,26 +83,22 @@ module MailSlurpClient
83
83
  h[k.to_sym] = v
84
84
  }
85
85
 
86
- if attributes.key?(:'email_addresses')
87
- if (value = attributes[:'email_addresses']).is_a?(Array)
88
- self.email_addresses = value
89
- end
90
- end
91
-
92
86
  if attributes.key?(:'first_name')
93
87
  self.first_name = attributes[:'first_name']
94
88
  end
95
89
 
96
- if attributes.key?(:'group_id')
97
- self.group_id = attributes[:'group_id']
90
+ if attributes.key?(:'last_name')
91
+ self.last_name = attributes[:'last_name']
98
92
  end
99
93
 
100
- if attributes.key?(:'meta_data')
101
- self.meta_data = attributes[:'meta_data']
94
+ if attributes.key?(:'company')
95
+ self.company = attributes[:'company']
102
96
  end
103
97
 
104
- if attributes.key?(:'opt_out')
105
- self.opt_out = attributes[:'opt_out']
98
+ if attributes.key?(:'email_addresses')
99
+ if (value = attributes[:'email_addresses']).is_a?(Array)
100
+ self.email_addresses = value
101
+ end
106
102
  end
107
103
 
108
104
  if attributes.key?(:'tags')
@@ -111,12 +107,16 @@ module MailSlurpClient
111
107
  end
112
108
  end
113
109
 
114
- if attributes.key?(:'last_name')
115
- self.last_name = attributes[:'last_name']
110
+ if attributes.key?(:'meta_data')
111
+ self.meta_data = attributes[:'meta_data']
116
112
  end
117
113
 
118
- if attributes.key?(:'company')
119
- self.company = attributes[:'company']
114
+ if attributes.key?(:'opt_out')
115
+ self.opt_out = attributes[:'opt_out']
116
+ end
117
+
118
+ if attributes.key?(:'group_id')
119
+ self.group_id = attributes[:'group_id']
120
120
  end
121
121
  end
122
122
 
@@ -138,14 +138,14 @@ module MailSlurpClient
138
138
  def ==(o)
139
139
  return true if self.equal?(o)
140
140
  self.class == o.class &&
141
- email_addresses == o.email_addresses &&
142
141
  first_name == o.first_name &&
143
- group_id == o.group_id &&
142
+ last_name == o.last_name &&
143
+ company == o.company &&
144
+ email_addresses == o.email_addresses &&
145
+ tags == o.tags &&
144
146
  meta_data == o.meta_data &&
145
147
  opt_out == o.opt_out &&
146
- tags == o.tags &&
147
- last_name == o.last_name &&
148
- company == o.company
148
+ group_id == o.group_id
149
149
  end
150
150
 
151
151
  # @see the `==` method
@@ -157,7 +157,7 @@ module MailSlurpClient
157
157
  # Calculates hash code according to all attributes.
158
158
  # @return [Integer] Hash code
159
159
  def hash
160
- [email_addresses, first_name, group_id, meta_data, opt_out, tags, last_name, company].hash
160
+ [first_name, last_name, company, email_addresses, tags, meta_data, opt_out, group_id].hash
161
161
  end
162
162
 
163
163
  # Builds the object from hash
@@ -15,16 +15,16 @@ require 'date'
15
15
  module MailSlurpClient
16
16
  # Options for creating a domain to use with MailSlurp. You must have ownership access to this domain in order to verify it. Domains will not function correctly until the domain has been verified. See https://www.mailslurp.com/guides/custom-domains for help. Domains can be either `HTTP` or `SMTP` type. The type of domain determines which inboxes can be used with it. `SMTP` inboxes use a mail server running `mx.mailslurp.com` while `HTTP` inboxes are handled by AWS SES.
17
17
  class CreateDomainOptions
18
- # Whether to create a catch all inbox for the domain. Any email sent to an address using your domain that cannot be matched to an existing inbox you created with the domain will be routed to the created catch all inbox. You can access emails using the regular methods on this inbox ID.
19
- attr_accessor :created_catch_all_inbox
18
+ # The top level domain you wish to use with MailSlurp. Do not specify subdomain just the top level. So `test.com` covers all subdomains such as `mail.test.com`. Don't include a protocol such as `http://`. Once added you must complete the verification steps by adding the returned records to your domain.
19
+ attr_accessor :domain
20
20
 
21
21
  # Optional description of the domain.
22
22
  attr_accessor :description
23
23
 
24
- # The top level domain you wish to use with MailSlurp. Do not specify subdomain just the top level. So `test.com` covers all subdomains such as `mail.test.com`. Don't include a protocol such as `http://`. Once added you must complete the verification steps by adding the returned records to your domain.
25
- attr_accessor :domain
24
+ # Whether to create a catch all inbox for the domain. Any email sent to an address using your domain that cannot be matched to an existing inbox you created with the domain will be routed to the created catch all inbox. You can access emails using the regular methods on this inbox ID.
25
+ attr_accessor :created_catch_all_inbox
26
26
 
27
- # Domain type to create. HTTP or SMTP domain. HTTP domain uses MailSlurps SES MX records. SMTP uses a custom SMTP server MX record. SMTP domains can only be used with SMTP inboxes. SMTP inboxes are more reliable for public inbound emails while HTTP inboxes are more suitable for testing.
27
+ # Type of domain. Dictates type of inbox that can be created with domain. HTTP means inboxes are processed using SES while SMTP inboxes use a custom SMTP mail server. SMTP does not support sending so use HTTP for sending emails.
28
28
  attr_accessor :domain_type
29
29
 
30
30
  class EnumAttributeValidator
@@ -52,9 +52,9 @@ module MailSlurpClient
52
52
  # Attribute mapping from ruby-style variable name to JSON key.
53
53
  def self.attribute_map
54
54
  {
55
- :'created_catch_all_inbox' => :'createdCatchAllInbox',
56
- :'description' => :'description',
57
55
  :'domain' => :'domain',
56
+ :'description' => :'description',
57
+ :'created_catch_all_inbox' => :'createdCatchAllInbox',
58
58
  :'domain_type' => :'domainType'
59
59
  }
60
60
  end
@@ -62,9 +62,9 @@ module MailSlurpClient
62
62
  # Attribute type mapping.
63
63
  def self.openapi_types
64
64
  {
65
- :'created_catch_all_inbox' => :'Boolean',
66
- :'description' => :'String',
67
65
  :'domain' => :'String',
66
+ :'description' => :'String',
67
+ :'created_catch_all_inbox' => :'Boolean',
68
68
  :'domain_type' => :'String'
69
69
  }
70
70
  end
@@ -90,16 +90,16 @@ module MailSlurpClient
90
90
  h[k.to_sym] = v
91
91
  }
92
92
 
93
- if attributes.key?(:'created_catch_all_inbox')
94
- self.created_catch_all_inbox = attributes[:'created_catch_all_inbox']
93
+ if attributes.key?(:'domain')
94
+ self.domain = attributes[:'domain']
95
95
  end
96
96
 
97
97
  if attributes.key?(:'description')
98
98
  self.description = attributes[:'description']
99
99
  end
100
100
 
101
- if attributes.key?(:'domain')
102
- self.domain = attributes[:'domain']
101
+ if attributes.key?(:'created_catch_all_inbox')
102
+ self.created_catch_all_inbox = attributes[:'created_catch_all_inbox']
103
103
  end
104
104
 
105
105
  if attributes.key?(:'domain_type')
@@ -111,12 +111,17 @@ module MailSlurpClient
111
111
  # @return Array for valid properties with the reasons
112
112
  def list_invalid_properties
113
113
  invalid_properties = Array.new
114
+ if @domain.nil?
115
+ invalid_properties.push('invalid value for "domain", domain cannot be nil.')
116
+ end
117
+
114
118
  invalid_properties
115
119
  end
116
120
 
117
121
  # Check to see if the all the properties in the model are valid
118
122
  # @return true if the model is valid
119
123
  def valid?
124
+ return false if @domain.nil?
120
125
  domain_type_validator = EnumAttributeValidator.new('String', ["HTTP_INBOX", "SMTP_DOMAIN"])
121
126
  return false unless domain_type_validator.valid?(@domain_type)
122
127
  true
@@ -137,9 +142,9 @@ module MailSlurpClient
137
142
  def ==(o)
138
143
  return true if self.equal?(o)
139
144
  self.class == o.class &&
140
- created_catch_all_inbox == o.created_catch_all_inbox &&
141
- description == o.description &&
142
145
  domain == o.domain &&
146
+ description == o.description &&
147
+ created_catch_all_inbox == o.created_catch_all_inbox &&
143
148
  domain_type == o.domain_type
144
149
  end
145
150
 
@@ -152,7 +157,7 @@ module MailSlurpClient
152
157
  # Calculates hash code according to all attributes.
153
158
  # @return [Integer] Hash code
154
159
  def hash
155
- [created_catch_all_inbox, description, domain, domain_type].hash
160
+ [domain, description, created_catch_all_inbox, domain_type].hash
156
161
  end
157
162
 
158
163
  # Builds the object from hash
@@ -68,17 +68,12 @@ module MailSlurpClient
68
68
  # @return Array for valid properties with the reasons
69
69
  def list_invalid_properties
70
70
  invalid_properties = Array.new
71
- if @name.nil?
72
- invalid_properties.push('invalid value for "name", name cannot be nil.')
73
- end
74
-
75
71
  invalid_properties
76
72
  end
77
73
 
78
74
  # Check to see if the all the properties in the model are valid
79
75
  # @return true if the model is valid
80
76
  def valid?
81
- return false if @name.nil?
82
77
  true
83
78
  end
84
79