mailslurp_client 12.5.0 → 12.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (25) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailslurp_client.rb +9 -2
  3. data/lib/mailslurp_client/api/contact_controller_api.rb +4 -4
  4. data/lib/mailslurp_client/api/email_controller_api.rb +64 -0
  5. data/lib/mailslurp_client/api/group_controller_api.rb +4 -4
  6. data/lib/mailslurp_client/api/inbox_controller_api.rb +11 -8
  7. data/lib/mailslurp_client/api/inbox_ruleset_controller_api.rb +211 -3
  8. data/lib/mailslurp_client/api/missed_email_controller_api.rb +81 -7
  9. data/lib/mailslurp_client/api/template_controller_api.rb +4 -4
  10. data/lib/mailslurp_client/api/tracking_controller_api.rb +215 -0
  11. data/lib/mailslurp_client/api/wait_for_controller_api.rb +2 -2
  12. data/lib/mailslurp_client/models/create_inbox_ruleset_options.rb +4 -4
  13. data/lib/mailslurp_client/models/create_tracking_pixel_options.rb +215 -0
  14. data/lib/mailslurp_client/models/inbox_ruleset_dto.rb +17 -3
  15. data/lib/mailslurp_client/models/inbox_ruleset_test_options.rb +211 -0
  16. data/lib/mailslurp_client/models/inbox_ruleset_test_result.rb +223 -0
  17. data/lib/mailslurp_client/models/{page_inbox_ruleset_projection.rb → page_inbox_ruleset_dto.rb} +4 -4
  18. data/lib/mailslurp_client/models/page_tracking_pixel_projection.rb +299 -0
  19. data/lib/mailslurp_client/models/send_email_options.rb +11 -1
  20. data/lib/mailslurp_client/models/sent_email_dto.rb +12 -1
  21. data/lib/mailslurp_client/models/test_new_inbox_ruleset_options.rb +225 -0
  22. data/lib/mailslurp_client/models/{inbox_ruleset_projection.rb → tracking_pixel_dto.rb} +37 -115
  23. data/lib/mailslurp_client/models/tracking_pixel_projection.rb +262 -0
  24. data/lib/mailslurp_client/version.rb +1 -1
  25. metadata +11 -4
@@ -21,9 +21,10 @@ module MailSlurpClient
21
21
  end
22
22
  # Get all MissedEmails in paginated format
23
23
  # @param [Hash] opts the optional parameters
24
- # @option opts [Integer] :page Optional page index in inbox list pagination (default to 0)
24
+ # @option opts [String] :inbox_id Optional inbox ID filter
25
+ # @option opts [Integer] :page Optional page index in list pagination (default to 0)
25
26
  # @option opts [String] :search_filter Optional search filter
26
- # @option opts [Integer] :size Optional page size in inbox list pagination (default to 20)
27
+ # @option opts [Integer] :size Optional page size in list pagination (default to 20)
27
28
  # @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
28
29
  # @return [PageMissedEmailProjection]
29
30
  def get_all_missed_emails(opts = {})
@@ -33,9 +34,10 @@ module MailSlurpClient
33
34
 
34
35
  # Get all MissedEmails in paginated format
35
36
  # @param [Hash] opts the optional parameters
36
- # @option opts [Integer] :page Optional page index in inbox list pagination
37
+ # @option opts [String] :inbox_id Optional inbox ID filter
38
+ # @option opts [Integer] :page Optional page index in list pagination
37
39
  # @option opts [String] :search_filter Optional search filter
38
- # @option opts [Integer] :size Optional page size in inbox list pagination
40
+ # @option opts [Integer] :size Optional page size in list pagination
39
41
  # @option opts [String] :sort Optional createdAt sort direction ASC or DESC
40
42
  # @return [Array<(PageMissedEmailProjection, Integer, Hash)>] PageMissedEmailProjection data, response status code and response headers
41
43
  def get_all_missed_emails_with_http_info(opts = {})
@@ -51,6 +53,7 @@ module MailSlurpClient
51
53
 
52
54
  # query parameters
53
55
  query_params = opts[:query_params] || {}
56
+ query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?
54
57
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
55
58
  query_params[:'searchFilter'] = opts[:'search_filter'] if !opts[:'search_filter'].nil?
56
59
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
@@ -90,7 +93,7 @@ module MailSlurpClient
90
93
  end
91
94
 
92
95
  # Get MissedEmail
93
- # @param missed_email_id [String] MissedEmailId
96
+ # @param missed_email_id [String] missedEmailId
94
97
  # @param [Hash] opts the optional parameters
95
98
  # @return [MissedEmail]
96
99
  def get_missed_email(missed_email_id, opts = {})
@@ -99,7 +102,7 @@ module MailSlurpClient
99
102
  end
100
103
 
101
104
  # Get MissedEmail
102
- # @param missed_email_id [String] MissedEmailId
105
+ # @param missed_email_id [String] missedEmailId
103
106
  # @param [Hash] opts the optional parameters
104
107
  # @return [Array<(MissedEmail, Integer, Hash)>] MissedEmail data, response status code and response headers
105
108
  def get_missed_email_with_http_info(missed_email_id, opts = {})
@@ -111,7 +114,7 @@ module MailSlurpClient
111
114
  fail ArgumentError, "Missing the required parameter 'missed_email_id' when calling MissedEmailControllerApi.get_missed_email"
112
115
  end
113
116
  # resource path
114
- local_var_path = '/missed-emails/{MissedEmailId}'.sub('{' + 'MissedEmailId' + '}', CGI.escape(missed_email_id.to_s))
117
+ local_var_path = '/missed-emails/{missedEmailId}'.sub('{' + 'missedEmailId' + '}', CGI.escape(missed_email_id.to_s))
115
118
 
116
119
  # query parameters
117
120
  query_params = opts[:query_params] || {}
@@ -148,5 +151,76 @@ module MailSlurpClient
148
151
  end
149
152
  return data, status_code, headers
150
153
  end
154
+
155
+ # Wait for Nth missed email
156
+ # Wait for 0 based index missed email
157
+ # @param inbox_id [String] Optional inbox ID filter
158
+ # @param timeout [Integer] Optional timeout milliseconds
159
+ # @param [Hash] opts the optional parameters
160
+ # @option opts [Integer] :index Zero based index of the email to wait for. If 1 missed email already and you want to wait for the 2nd email pass index&#x3D;1
161
+ # @return [MissedEmail]
162
+ def wait_for_nth_missed_email(inbox_id, timeout, opts = {})
163
+ data, _status_code, _headers = wait_for_nth_missed_email_with_http_info(inbox_id, timeout, opts)
164
+ data
165
+ end
166
+
167
+ # Wait for Nth missed email
168
+ # Wait for 0 based index missed email
169
+ # @param inbox_id [String] Optional inbox ID filter
170
+ # @param timeout [Integer] Optional timeout milliseconds
171
+ # @param [Hash] opts the optional parameters
172
+ # @option opts [Integer] :index Zero based index of the email to wait for. If 1 missed email already and you want to wait for the 2nd email pass index&#x3D;1
173
+ # @return [Array<(MissedEmail, Integer, Hash)>] MissedEmail data, response status code and response headers
174
+ def wait_for_nth_missed_email_with_http_info(inbox_id, timeout, opts = {})
175
+ if @api_client.config.debugging
176
+ @api_client.config.logger.debug 'Calling API: MissedEmailControllerApi.wait_for_nth_missed_email ...'
177
+ end
178
+ # verify the required parameter 'inbox_id' is set
179
+ if @api_client.config.client_side_validation && inbox_id.nil?
180
+ fail ArgumentError, "Missing the required parameter 'inbox_id' when calling MissedEmailControllerApi.wait_for_nth_missed_email"
181
+ end
182
+ # verify the required parameter 'timeout' is set
183
+ if @api_client.config.client_side_validation && timeout.nil?
184
+ fail ArgumentError, "Missing the required parameter 'timeout' when calling MissedEmailControllerApi.wait_for_nth_missed_email"
185
+ end
186
+ # resource path
187
+ local_var_path = '/missed-emails/waitForNthMissedEmail'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s)).sub('{' + 'timeout' + '}', CGI.escape(timeout.to_s))
188
+
189
+ # query parameters
190
+ query_params = opts[:query_params] || {}
191
+ query_params[:'index'] = opts[:'index'] if !opts[:'index'].nil?
192
+
193
+ # header parameters
194
+ header_params = opts[:header_params] || {}
195
+ # HTTP header 'Accept' (if needed)
196
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
197
+
198
+ # form parameters
199
+ form_params = opts[:form_params] || {}
200
+
201
+ # http body (model)
202
+ post_body = opts[:body]
203
+
204
+ # return_type
205
+ return_type = opts[:return_type] || 'MissedEmail'
206
+
207
+ # auth_names
208
+ auth_names = opts[:auth_names] || ['API_KEY']
209
+
210
+ new_options = opts.merge(
211
+ :header_params => header_params,
212
+ :query_params => query_params,
213
+ :form_params => form_params,
214
+ :body => post_body,
215
+ :auth_names => auth_names,
216
+ :return_type => return_type
217
+ )
218
+
219
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
220
+ if @api_client.config.debugging
221
+ @api_client.config.logger.debug "API called: MissedEmailControllerApi#wait_for_nth_missed_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
222
+ end
223
+ return data, status_code, headers
224
+ end
151
225
  end
152
226
  end
@@ -141,8 +141,8 @@ module MailSlurpClient
141
141
 
142
142
  # Get all Templates in paginated format
143
143
  # @param [Hash] opts the optional parameters
144
- # @option opts [Integer] :page Optional page index in inbox list pagination (default to 0)
145
- # @option opts [Integer] :size Optional page size in inbox list pagination (default to 20)
144
+ # @option opts [Integer] :page Optional page index in list pagination (default to 0)
145
+ # @option opts [Integer] :size Optional page size in list pagination (default to 20)
146
146
  # @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
147
147
  # @return [PageTemplateProjection]
148
148
  def get_all_templates(opts = {})
@@ -152,8 +152,8 @@ module MailSlurpClient
152
152
 
153
153
  # Get all Templates in paginated format
154
154
  # @param [Hash] opts the optional parameters
155
- # @option opts [Integer] :page Optional page index in inbox list pagination
156
- # @option opts [Integer] :size Optional page size in inbox list pagination
155
+ # @option opts [Integer] :page Optional page index in list pagination
156
+ # @option opts [Integer] :size Optional page size in list pagination
157
157
  # @option opts [String] :sort Optional createdAt sort direction ASC or DESC
158
158
  # @return [Array<(PageTemplateProjection, Integer, Hash)>] PageTemplateProjection data, response status code and response headers
159
159
  def get_all_templates_with_http_info(opts = {})
@@ -0,0 +1,215 @@
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 'cgi'
14
+
15
+ module MailSlurpClient
16
+ class TrackingControllerApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create tracking pixel
23
+ # Create a tracking pixel
24
+ # @param create_tracking_pixel_options [CreateTrackingPixelOptions] createTrackingPixelOptions
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [TrackingPixelDto]
27
+ def create_tracking_pixel(create_tracking_pixel_options, opts = {})
28
+ data, _status_code, _headers = create_tracking_pixel_with_http_info(create_tracking_pixel_options, opts)
29
+ data
30
+ end
31
+
32
+ # Create tracking pixel
33
+ # Create a tracking pixel
34
+ # @param create_tracking_pixel_options [CreateTrackingPixelOptions] createTrackingPixelOptions
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(TrackingPixelDto, Integer, Hash)>] TrackingPixelDto data, response status code and response headers
37
+ def create_tracking_pixel_with_http_info(create_tracking_pixel_options, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: TrackingControllerApi.create_tracking_pixel ...'
40
+ end
41
+ # verify the required parameter 'create_tracking_pixel_options' is set
42
+ if @api_client.config.client_side_validation && create_tracking_pixel_options.nil?
43
+ fail ArgumentError, "Missing the required parameter 'create_tracking_pixel_options' when calling TrackingControllerApi.create_tracking_pixel"
44
+ end
45
+ # resource path
46
+ local_var_path = '/tracking/pixels'
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
55
+ # HTTP header 'Content-Type'
56
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
57
+
58
+ # form parameters
59
+ form_params = opts[:form_params] || {}
60
+
61
+ # http body (model)
62
+ post_body = opts[:body] || @api_client.object_to_http_body(create_tracking_pixel_options)
63
+
64
+ # return_type
65
+ return_type = opts[:return_type] || 'TrackingPixelDto'
66
+
67
+ # auth_names
68
+ auth_names = opts[:auth_names] || ['API_KEY']
69
+
70
+ new_options = opts.merge(
71
+ :header_params => header_params,
72
+ :query_params => query_params,
73
+ :form_params => form_params,
74
+ :body => post_body,
75
+ :auth_names => auth_names,
76
+ :return_type => return_type
77
+ )
78
+
79
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
80
+ if @api_client.config.debugging
81
+ @api_client.config.logger.debug "API called: TrackingControllerApi#create_tracking_pixel\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
82
+ end
83
+ return data, status_code, headers
84
+ end
85
+
86
+ # Get tracking pixels
87
+ # List tracking pixels in paginated form
88
+ # @param [Hash] opts the optional parameters
89
+ # @option opts [Integer] :page Optional page index in list pagination (default to 0)
90
+ # @option opts [Integer] :size Optional page size in list pagination (default to 20)
91
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
92
+ # @return [PageTrackingPixelProjection]
93
+ def get_all_tracking_pixels(opts = {})
94
+ data, _status_code, _headers = get_all_tracking_pixels_with_http_info(opts)
95
+ data
96
+ end
97
+
98
+ # Get tracking pixels
99
+ # List tracking pixels in paginated form
100
+ # @param [Hash] opts the optional parameters
101
+ # @option opts [Integer] :page Optional page index in list pagination
102
+ # @option opts [Integer] :size Optional page size in list pagination
103
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC
104
+ # @return [Array<(PageTrackingPixelProjection, Integer, Hash)>] PageTrackingPixelProjection data, response status code and response headers
105
+ def get_all_tracking_pixels_with_http_info(opts = {})
106
+ if @api_client.config.debugging
107
+ @api_client.config.logger.debug 'Calling API: TrackingControllerApi.get_all_tracking_pixels ...'
108
+ end
109
+ allowable_values = ["ASC", "DESC"]
110
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
111
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
112
+ end
113
+ # resource path
114
+ local_var_path = '/tracking/pixels'
115
+
116
+ # query parameters
117
+ query_params = opts[:query_params] || {}
118
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
119
+ query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
120
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
121
+
122
+ # header parameters
123
+ header_params = opts[:header_params] || {}
124
+ # HTTP header 'Accept' (if needed)
125
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
126
+
127
+ # form parameters
128
+ form_params = opts[:form_params] || {}
129
+
130
+ # http body (model)
131
+ post_body = opts[:body]
132
+
133
+ # return_type
134
+ return_type = opts[:return_type] || 'PageTrackingPixelProjection'
135
+
136
+ # auth_names
137
+ auth_names = opts[:auth_names] || ['API_KEY']
138
+
139
+ new_options = opts.merge(
140
+ :header_params => header_params,
141
+ :query_params => query_params,
142
+ :form_params => form_params,
143
+ :body => post_body,
144
+ :auth_names => auth_names,
145
+ :return_type => return_type
146
+ )
147
+
148
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
149
+ if @api_client.config.debugging
150
+ @api_client.config.logger.debug "API called: TrackingControllerApi#get_all_tracking_pixels\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
151
+ end
152
+ return data, status_code, headers
153
+ end
154
+
155
+ # Get pixel
156
+ # @param id [String] id
157
+ # @param [Hash] opts the optional parameters
158
+ # @return [TrackingPixelDto]
159
+ def get_tracking_pixel(id, opts = {})
160
+ data, _status_code, _headers = get_tracking_pixel_with_http_info(id, opts)
161
+ data
162
+ end
163
+
164
+ # Get pixel
165
+ # @param id [String] id
166
+ # @param [Hash] opts the optional parameters
167
+ # @return [Array<(TrackingPixelDto, Integer, Hash)>] TrackingPixelDto data, response status code and response headers
168
+ def get_tracking_pixel_with_http_info(id, opts = {})
169
+ if @api_client.config.debugging
170
+ @api_client.config.logger.debug 'Calling API: TrackingControllerApi.get_tracking_pixel ...'
171
+ end
172
+ # verify the required parameter 'id' is set
173
+ if @api_client.config.client_side_validation && id.nil?
174
+ fail ArgumentError, "Missing the required parameter 'id' when calling TrackingControllerApi.get_tracking_pixel"
175
+ end
176
+ # resource path
177
+ local_var_path = '/tracking/pixels/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
178
+
179
+ # query parameters
180
+ query_params = opts[:query_params] || {}
181
+
182
+ # header parameters
183
+ header_params = opts[:header_params] || {}
184
+ # HTTP header 'Accept' (if needed)
185
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
186
+
187
+ # form parameters
188
+ form_params = opts[:form_params] || {}
189
+
190
+ # http body (model)
191
+ post_body = opts[:body]
192
+
193
+ # return_type
194
+ return_type = opts[:return_type] || 'TrackingPixelDto'
195
+
196
+ # auth_names
197
+ auth_names = opts[:auth_names] || ['API_KEY']
198
+
199
+ new_options = opts.merge(
200
+ :header_params => header_params,
201
+ :query_params => query_params,
202
+ :form_params => form_params,
203
+ :body => post_body,
204
+ :auth_names => auth_names,
205
+ :return_type => return_type
206
+ )
207
+
208
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
209
+ if @api_client.config.debugging
210
+ @api_client.config.logger.debug "API called: TrackingControllerApi#get_tracking_pixel\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
211
+ end
212
+ return data, status_code, headers
213
+ end
214
+ end
215
+ end
@@ -361,7 +361,7 @@ module MailSlurpClient
361
361
  return data, status_code, headers
362
362
  end
363
363
 
364
- # Wait for or fetch the email with a given index in the inbox specified. IF indx doesn't exist waits for it to exist or timeout to occur.
364
+ # Wait for or fetch the email with a given index in the inbox specified. If index doesn't exist waits for it to exist or timeout to occur.
365
365
  # If nth email is already present in inbox then return it. If not hold the connection open until timeout expires or the nth email is received and returned.
366
366
  # @param [Hash] opts the optional parameters
367
367
  # @option opts [String] :inbox_id Id of the inbox you are fetching emails from
@@ -374,7 +374,7 @@ module MailSlurpClient
374
374
  data
375
375
  end
376
376
 
377
- # Wait for or fetch the email with a given index in the inbox specified. IF indx doesn&#39;t exist waits for it to exist or timeout to occur.
377
+ # Wait for or fetch the email with a given index in the inbox specified. If index doesn&#39;t exist waits for it to exist or timeout to occur.
378
378
  # If nth email is already present in inbox then return it. If not hold the connection open until timeout expires or the nth email is received and returned.
379
379
  # @param [Hash] opts the optional parameters
380
380
  # @option opts [String] :inbox_id Id of the inbox you are fetching emails from
@@ -13,9 +13,9 @@ OpenAPI Generator version: 4.3.1
13
13
  require 'date'
14
14
 
15
15
  module MailSlurpClient
16
- # Options for creating inbox rulesets. Inbox rulesets can be used to block, allow, or forward emails when sending or receiving using the inbox.
16
+ # Options for creating inbox rulesets. Inbox rulesets can be used to block, allow, filter, or forward emails when sending or receiving using the inbox.
17
17
  class CreateInboxRulesetOptions
18
- # Action to be taken when the ruleset matches an email for the given scope. For example: `BLOCK` action with target `*` and scope `SENDING_EMAILS` blocks sending to all recipients. Note `ALLOW` takes precedent over `BLOCK`.
18
+ # Action to be taken when the ruleset matches an email for the given scope. For example: `BLOCK` action with target `*` and scope `SENDING_EMAILS` blocks sending to all recipients. Note `ALLOW` takes precedent over `BLOCK`. `FILTER_REMOVE` is like block but will remove offending email addresses during a send or receive event instead of blocking the action.
19
19
  attr_accessor :action
20
20
 
21
21
  # What type of emails actions to apply ruleset to. Either `SENDING_EMAILS` or `RECEIVING_EMAILS` will apply action and target to any sending or receiving of emails respectively.
@@ -108,7 +108,7 @@ module MailSlurpClient
108
108
  # Check to see if the all the properties in the model are valid
109
109
  # @return true if the model is valid
110
110
  def valid?
111
- action_validator = EnumAttributeValidator.new('String', ["BLOCK", "ALLOW", "FORWARD"])
111
+ action_validator = EnumAttributeValidator.new('String', ["BLOCK", "ALLOW", "FILTER_REMOVE"])
112
112
  return false unless action_validator.valid?(@action)
113
113
  scope_validator = EnumAttributeValidator.new('String', ["RECEIVING_EMAILS", "SENDING_EMAILS"])
114
114
  return false unless scope_validator.valid?(@scope)
@@ -118,7 +118,7 @@ module MailSlurpClient
118
118
  # Custom attribute writer method checking allowed values (enum).
119
119
  # @param [Object] action Object to be assigned
120
120
  def action=(action)
121
- validator = EnumAttributeValidator.new('String', ["BLOCK", "ALLOW", "FORWARD"])
121
+ validator = EnumAttributeValidator.new('String', ["BLOCK", "ALLOW", "FILTER_REMOVE"])
122
122
  unless validator.valid?(action)
123
123
  fail ArgumentError, "invalid value for \"action\", must be one of #{validator.allowable_values}."
124
124
  end
@@ -0,0 +1,215 @@
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 CreateTrackingPixelOptions
17
+ attr_accessor :name
18
+
19
+ attr_accessor :recipient
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'name' => :'name',
25
+ :'recipient' => :'recipient'
26
+ }
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.openapi_types
31
+ {
32
+ :'name' => :'String',
33
+ :'recipient' => :'String'
34
+ }
35
+ end
36
+
37
+ # List of attributes with nullable: true
38
+ def self.openapi_nullable
39
+ Set.new([
40
+ ])
41
+ end
42
+
43
+ # Initializes the object
44
+ # @param [Hash] attributes Model attributes in the form of hash
45
+ def initialize(attributes = {})
46
+ if (!attributes.is_a?(Hash))
47
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::CreateTrackingPixelOptions` initialize method"
48
+ end
49
+
50
+ # check to see if the attribute exists and convert string to symbol for hash key
51
+ attributes = attributes.each_with_object({}) { |(k, v), h|
52
+ if (!self.class.attribute_map.key?(k.to_sym))
53
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::CreateTrackingPixelOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
54
+ end
55
+ h[k.to_sym] = v
56
+ }
57
+
58
+ if attributes.key?(:'name')
59
+ self.name = attributes[:'name']
60
+ end
61
+
62
+ if attributes.key?(:'recipient')
63
+ self.recipient = attributes[:'recipient']
64
+ end
65
+ end
66
+
67
+ # Show invalid properties with the reasons. Usually used together with valid?
68
+ # @return Array for valid properties with the reasons
69
+ def list_invalid_properties
70
+ invalid_properties = Array.new
71
+ invalid_properties
72
+ end
73
+
74
+ # Check to see if the all the properties in the model are valid
75
+ # @return true if the model is valid
76
+ def valid?
77
+ true
78
+ end
79
+
80
+ # Checks equality by comparing each attribute.
81
+ # @param [Object] Object to be compared
82
+ def ==(o)
83
+ return true if self.equal?(o)
84
+ self.class == o.class &&
85
+ name == o.name &&
86
+ recipient == o.recipient
87
+ end
88
+
89
+ # @see the `==` method
90
+ # @param [Object] Object to be compared
91
+ def eql?(o)
92
+ self == o
93
+ end
94
+
95
+ # Calculates hash code according to all attributes.
96
+ # @return [Integer] Hash code
97
+ def hash
98
+ [name, recipient].hash
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 self.build_from_hash(attributes)
105
+ new.build_from_hash(attributes)
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def build_from_hash(attributes)
112
+ return nil unless attributes.is_a?(Hash)
113
+ self.class.openapi_types.each_pair do |key, type|
114
+ if type =~ /\AArray<(.*)>/i
115
+ # check to ensure the input is an array given that the attribute
116
+ # is documented as an array but the input is not
117
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
118
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
119
+ end
120
+ elsif !attributes[self.class.attribute_map[key]].nil?
121
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
122
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
123
+ end
124
+
125
+ self
126
+ end
127
+
128
+ # Deserializes the data based on type
129
+ # @param string type Data type
130
+ # @param string value Value to be deserialized
131
+ # @return [Object] Deserialized data
132
+ def _deserialize(type, value)
133
+ case type.to_sym
134
+ when :DateTime
135
+ DateTime.parse(value)
136
+ when :Date
137
+ Date.parse(value)
138
+ when :String
139
+ value.to_s
140
+ when :Integer
141
+ value.to_i
142
+ when :Float
143
+ value.to_f
144
+ when :Boolean
145
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
146
+ true
147
+ else
148
+ false
149
+ end
150
+ when :Object
151
+ # generic object (usually a Hash), return directly
152
+ value
153
+ when /\AArray<(?<inner_type>.+)>\z/
154
+ inner_type = Regexp.last_match[:inner_type]
155
+ value.map { |v| _deserialize(inner_type, v) }
156
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
157
+ k_type = Regexp.last_match[:k_type]
158
+ v_type = Regexp.last_match[:v_type]
159
+ {}.tap do |hash|
160
+ value.each do |k, v|
161
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
162
+ end
163
+ end
164
+ else # model
165
+ MailSlurpClient.const_get(type).build_from_hash(value)
166
+ end
167
+ end
168
+
169
+ # Returns the string representation of the object
170
+ # @return [String] String presentation of the object
171
+ def to_s
172
+ to_hash.to_s
173
+ end
174
+
175
+ # to_body is an alias to to_hash (backward compatibility)
176
+ # @return [Hash] Returns the object in the form of hash
177
+ def to_body
178
+ to_hash
179
+ end
180
+
181
+ # Returns the object in the form of hash
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_hash
184
+ hash = {}
185
+ self.class.attribute_map.each_pair do |attr, param|
186
+ value = self.send(attr)
187
+ if value.nil?
188
+ is_nullable = self.class.openapi_nullable.include?(attr)
189
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
190
+ end
191
+
192
+ hash[param] = _to_hash(value)
193
+ end
194
+ hash
195
+ end
196
+
197
+ # Outputs non-array value in the form of hash
198
+ # For object, use to_hash. Otherwise, just return the value
199
+ # @param [Object] value Any valid value
200
+ # @return [Hash] Returns the value in the form of hash
201
+ def _to_hash(value)
202
+ if value.is_a?(Array)
203
+ value.compact.map { |v| _to_hash(v) }
204
+ elsif value.is_a?(Hash)
205
+ {}.tap do |hash|
206
+ value.each { |k, v| hash[k] = _to_hash(v) }
207
+ end
208
+ elsif value.respond_to? :to_hash
209
+ value.to_hash
210
+ else
211
+ value
212
+ end
213
+ end
214
+ end
215
+ end