mailslurp_client 12.4.7 → 12.6.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailslurp_client.rb +13 -0
  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 +234 -8
  7. data/lib/mailslurp_client/api/inbox_ruleset_controller_api.rb +548 -0
  8. data/lib/mailslurp_client/api/missed_email_controller_api.rb +75 -7
  9. data/lib/mailslurp_client/api/sent_emails_controller_api.rb +150 -4
  10. data/lib/mailslurp_client/api/template_controller_api.rb +4 -4
  11. data/lib/mailslurp_client/api/tracking_controller_api.rb +218 -0
  12. data/lib/mailslurp_client/api/wait_for_controller_api.rb +2 -2
  13. data/lib/mailslurp_client/api/webhook_controller_api.rb +55 -1
  14. data/lib/mailslurp_client/models/abstract_webhook_payload.rb +3 -3
  15. data/lib/mailslurp_client/models/create_inbox_ruleset_options.rb +274 -0
  16. data/lib/mailslurp_client/models/create_tracking_pixel_options.rb +215 -0
  17. data/lib/mailslurp_client/models/create_webhook_options.rb +3 -3
  18. data/lib/mailslurp_client/models/inbox_ruleset_dto.rb +353 -0
  19. data/lib/mailslurp_client/models/inbox_ruleset_test_options.rb +211 -0
  20. data/lib/mailslurp_client/models/inbox_ruleset_test_result.rb +223 -0
  21. data/lib/mailslurp_client/models/page_inbox_ruleset_dto.rb +299 -0
  22. data/lib/mailslurp_client/models/page_tracking_pixel_projection.rb +299 -0
  23. data/lib/mailslurp_client/models/send_email_options.rb +11 -1
  24. data/lib/mailslurp_client/models/sent_email_dto.rb +12 -1
  25. data/lib/mailslurp_client/models/test_new_inbox_ruleset_options.rb +225 -0
  26. data/lib/mailslurp_client/models/tracking_pixel_dto.rb +303 -0
  27. data/lib/mailslurp_client/models/tracking_pixel_projection.rb +289 -0
  28. data/lib/mailslurp_client/models/webhook_dto.rb +2 -2
  29. data/lib/mailslurp_client/models/webhook_email_opened_payload.rb +322 -0
  30. data/lib/mailslurp_client/models/webhook_new_attachment_payload.rb +2 -2
  31. data/lib/mailslurp_client/models/webhook_new_contact_payload.rb +2 -2
  32. data/lib/mailslurp_client/models/webhook_new_email_payload.rb +2 -2
  33. data/lib/mailslurp_client/models/webhook_result_entity.rb +2 -2
  34. data/lib/mailslurp_client/version.rb +1 -1
  35. metadata +15 -2
@@ -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,70 @@ 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 [Hash] opts the optional parameters
158
+ # @option opts [String] :inbox_id Optional inbox ID filter
159
+ # @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
160
+ # @option opts [Integer] :timeout Optional timeout milliseconds
161
+ # @return [MissedEmail]
162
+ def wait_for_nth_missed_email(opts = {})
163
+ data, _status_code, _headers = wait_for_nth_missed_email_with_http_info(opts)
164
+ data
165
+ end
166
+
167
+ # Wait for Nth missed email
168
+ # Wait for 0 based index missed email
169
+ # @param [Hash] opts the optional parameters
170
+ # @option opts [String] :inbox_id Optional inbox ID filter
171
+ # @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
172
+ # @option opts [Integer] :timeout Optional timeout milliseconds
173
+ # @return [Array<(MissedEmail, Integer, Hash)>] MissedEmail data, response status code and response headers
174
+ def wait_for_nth_missed_email_with_http_info(opts = {})
175
+ if @api_client.config.debugging
176
+ @api_client.config.logger.debug 'Calling API: MissedEmailControllerApi.wait_for_nth_missed_email ...'
177
+ end
178
+ # resource path
179
+ local_var_path = '/missed-emails/waitForNthMissedEmail'
180
+
181
+ # query parameters
182
+ query_params = opts[:query_params] || {}
183
+ query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?
184
+ query_params[:'index'] = opts[:'index'] if !opts[:'index'].nil?
185
+ query_params[:'timeout'] = opts[:'timeout'] if !opts[:'timeout'].nil?
186
+
187
+ # header parameters
188
+ header_params = opts[:header_params] || {}
189
+ # HTTP header 'Accept' (if needed)
190
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
191
+
192
+ # form parameters
193
+ form_params = opts[:form_params] || {}
194
+
195
+ # http body (model)
196
+ post_body = opts[:body]
197
+
198
+ # return_type
199
+ return_type = opts[:return_type] || 'MissedEmail'
200
+
201
+ # auth_names
202
+ auth_names = opts[:auth_names] || ['API_KEY']
203
+
204
+ new_options = opts.merge(
205
+ :header_params => header_params,
206
+ :query_params => query_params,
207
+ :form_params => form_params,
208
+ :body => post_body,
209
+ :auth_names => auth_names,
210
+ :return_type => return_type
211
+ )
212
+
213
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
214
+ if @api_client.config.debugging
215
+ @api_client.config.logger.debug "API called: MissedEmailControllerApi#wait_for_nth_missed_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
216
+ end
217
+ return data, status_code, headers
218
+ end
151
219
  end
152
220
  end
@@ -19,6 +19,76 @@ module MailSlurpClient
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
+ # Get all sent email tracking pixels in paginated form
23
+ # @param [Hash] opts the optional parameters
24
+ # @option opts [Integer] :page Optional page index in sent email tracking pixel list pagination (default to 0)
25
+ # @option opts [String] :search_filter Optional search filter
26
+ # @option opts [Integer] :size Optional page size in sent email tracking pixel list pagination (default to 20)
27
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
28
+ # @return [PageTrackingPixelProjection]
29
+ def get_all_sent_tracking_pixels(opts = {})
30
+ data, _status_code, _headers = get_all_sent_tracking_pixels_with_http_info(opts)
31
+ data
32
+ end
33
+
34
+ # Get all sent email tracking pixels in paginated form
35
+ # @param [Hash] opts the optional parameters
36
+ # @option opts [Integer] :page Optional page index in sent email tracking pixel list pagination
37
+ # @option opts [String] :search_filter Optional search filter
38
+ # @option opts [Integer] :size Optional page size in sent email tracking pixel list pagination
39
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC
40
+ # @return [Array<(PageTrackingPixelProjection, Integer, Hash)>] PageTrackingPixelProjection data, response status code and response headers
41
+ def get_all_sent_tracking_pixels_with_http_info(opts = {})
42
+ if @api_client.config.debugging
43
+ @api_client.config.logger.debug 'Calling API: SentEmailsControllerApi.get_all_sent_tracking_pixels ...'
44
+ end
45
+ allowable_values = ["ASC", "DESC"]
46
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
47
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
48
+ end
49
+ # resource path
50
+ local_var_path = '/sent/tracking-pixels'
51
+
52
+ # query parameters
53
+ query_params = opts[:query_params] || {}
54
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
55
+ query_params[:'searchFilter'] = opts[:'search_filter'] if !opts[:'search_filter'].nil?
56
+ query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
57
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
58
+
59
+ # header parameters
60
+ header_params = opts[:header_params] || {}
61
+ # HTTP header 'Accept' (if needed)
62
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
63
+
64
+ # form parameters
65
+ form_params = opts[:form_params] || {}
66
+
67
+ # http body (model)
68
+ post_body = opts[:body]
69
+
70
+ # return_type
71
+ return_type = opts[:return_type] || 'PageTrackingPixelProjection'
72
+
73
+ # auth_names
74
+ auth_names = opts[:auth_names] || ['API_KEY']
75
+
76
+ new_options = opts.merge(
77
+ :header_params => header_params,
78
+ :query_params => query_params,
79
+ :form_params => form_params,
80
+ :body => post_body,
81
+ :auth_names => auth_names,
82
+ :return_type => return_type
83
+ )
84
+
85
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
86
+ if @api_client.config.debugging
87
+ @api_client.config.logger.debug "API called: SentEmailsControllerApi#get_all_sent_tracking_pixels\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
88
+ end
89
+ return data, status_code, headers
90
+ end
91
+
22
92
  # Get sent email receipt
23
93
  # @param id [String] id
24
94
  # @param [Hash] opts the optional parameters
@@ -79,6 +149,82 @@ module MailSlurpClient
79
149
  return data, status_code, headers
80
150
  end
81
151
 
152
+ # Get all tracking pixels for a sent email in paginated form
153
+ # @param id [String] id
154
+ # @param [Hash] opts the optional parameters
155
+ # @option opts [Integer] :page Optional page index in sent email tracking pixel list pagination (default to 0)
156
+ # @option opts [String] :search_filter Optional search filter
157
+ # @option opts [Integer] :size Optional page size in sent email tracking pixel list pagination (default to 20)
158
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
159
+ # @return [PageTrackingPixelProjection]
160
+ def get_sent_email_tracking_pixels(id, opts = {})
161
+ data, _status_code, _headers = get_sent_email_tracking_pixels_with_http_info(id, opts)
162
+ data
163
+ end
164
+
165
+ # Get all tracking pixels for a sent email in paginated form
166
+ # @param id [String] id
167
+ # @param [Hash] opts the optional parameters
168
+ # @option opts [Integer] :page Optional page index in sent email tracking pixel list pagination
169
+ # @option opts [String] :search_filter Optional search filter
170
+ # @option opts [Integer] :size Optional page size in sent email tracking pixel list pagination
171
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC
172
+ # @return [Array<(PageTrackingPixelProjection, Integer, Hash)>] PageTrackingPixelProjection data, response status code and response headers
173
+ def get_sent_email_tracking_pixels_with_http_info(id, opts = {})
174
+ if @api_client.config.debugging
175
+ @api_client.config.logger.debug 'Calling API: SentEmailsControllerApi.get_sent_email_tracking_pixels ...'
176
+ end
177
+ # verify the required parameter 'id' is set
178
+ if @api_client.config.client_side_validation && id.nil?
179
+ fail ArgumentError, "Missing the required parameter 'id' when calling SentEmailsControllerApi.get_sent_email_tracking_pixels"
180
+ end
181
+ allowable_values = ["ASC", "DESC"]
182
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
183
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
184
+ end
185
+ # resource path
186
+ local_var_path = '/sent/{id}/tracking-pixels'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
187
+
188
+ # query parameters
189
+ query_params = opts[:query_params] || {}
190
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
191
+ query_params[:'searchFilter'] = opts[:'search_filter'] if !opts[:'search_filter'].nil?
192
+ query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
193
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
194
+
195
+ # header parameters
196
+ header_params = opts[:header_params] || {}
197
+ # HTTP header 'Accept' (if needed)
198
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
199
+
200
+ # form parameters
201
+ form_params = opts[:form_params] || {}
202
+
203
+ # http body (model)
204
+ post_body = opts[:body]
205
+
206
+ # return_type
207
+ return_type = opts[:return_type] || 'PageTrackingPixelProjection'
208
+
209
+ # auth_names
210
+ auth_names = opts[:auth_names] || ['API_KEY']
211
+
212
+ new_options = opts.merge(
213
+ :header_params => header_params,
214
+ :query_params => query_params,
215
+ :form_params => form_params,
216
+ :body => post_body,
217
+ :auth_names => auth_names,
218
+ :return_type => return_type
219
+ )
220
+
221
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
222
+ if @api_client.config.debugging
223
+ @api_client.config.logger.debug "API called: SentEmailsControllerApi#get_sent_email_tracking_pixels\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
224
+ end
225
+ return data, status_code, headers
226
+ end
227
+
82
228
  # Get all sent emails in paginated form
83
229
  # @param [Hash] opts the optional parameters
84
230
  # @option opts [String] :inbox_id Optional inboxId to filter sender of sent emails by
@@ -155,9 +301,9 @@ module MailSlurpClient
155
301
  # Get all sent organization emails in paginated form
156
302
  # @param [Hash] opts the optional parameters
157
303
  # @option opts [String] :inbox_id Optional inboxId to filter sender of sent emails by
158
- # @option opts [Integer] :page Optional page index in inbox sent email list pagination (default to 0)
304
+ # @option opts [Integer] :page Optional page index in sent email list pagination (default to 0)
159
305
  # @option opts [String] :search_filter Optional search filter
160
- # @option opts [Integer] :size Optional page size in inbox sent email list pagination (default to 20)
306
+ # @option opts [Integer] :size Optional page size in sent email list pagination (default to 20)
161
307
  # @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
162
308
  # @return [PageSentEmailProjection]
163
309
  def get_sent_organization_emails(opts = {})
@@ -168,9 +314,9 @@ module MailSlurpClient
168
314
  # Get all sent organization emails in paginated form
169
315
  # @param [Hash] opts the optional parameters
170
316
  # @option opts [String] :inbox_id Optional inboxId to filter sender of sent emails by
171
- # @option opts [Integer] :page Optional page index in inbox sent email list pagination
317
+ # @option opts [Integer] :page Optional page index in sent email list pagination
172
318
  # @option opts [String] :search_filter Optional search filter
173
- # @option opts [Integer] :size Optional page size in inbox sent email list pagination
319
+ # @option opts [Integer] :size Optional page size in sent email list pagination
174
320
  # @option opts [String] :sort Optional createdAt sort direction ASC or DESC
175
321
  # @return [Array<(PageSentEmailProjection, Integer, Hash)>] PageSentEmailProjection data, response status code and response headers
176
322
  def get_sent_organization_emails_with_http_info(opts = {})
@@ -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,218 @@
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. A tracking pixel is an image that can be embedded in an email. When the email is viewed and the image is seen MailSlurp will mark the pixel as seen. Use tracking pixels to monitor email open events. You can receive open notifications via webhook or by fetching the 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. A tracking pixel is an image that can be embedded in an email. When the email is viewed and the image is seen MailSlurp will mark the pixel as seen. Use tracking pixels to monitor email open events. You can receive open notifications via webhook or by fetching the 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 [String] :search_filter Optional search filter
91
+ # @option opts [Integer] :size Optional page size in list pagination (default to 20)
92
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
93
+ # @return [PageTrackingPixelProjection]
94
+ def get_all_tracking_pixels(opts = {})
95
+ data, _status_code, _headers = get_all_tracking_pixels_with_http_info(opts)
96
+ data
97
+ end
98
+
99
+ # Get tracking pixels
100
+ # List tracking pixels in paginated form
101
+ # @param [Hash] opts the optional parameters
102
+ # @option opts [Integer] :page Optional page index in list pagination
103
+ # @option opts [String] :search_filter Optional search filter
104
+ # @option opts [Integer] :size Optional page size in list pagination
105
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC
106
+ # @return [Array<(PageTrackingPixelProjection, Integer, Hash)>] PageTrackingPixelProjection data, response status code and response headers
107
+ def get_all_tracking_pixels_with_http_info(opts = {})
108
+ if @api_client.config.debugging
109
+ @api_client.config.logger.debug 'Calling API: TrackingControllerApi.get_all_tracking_pixels ...'
110
+ end
111
+ allowable_values = ["ASC", "DESC"]
112
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
113
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
114
+ end
115
+ # resource path
116
+ local_var_path = '/tracking/pixels'
117
+
118
+ # query parameters
119
+ query_params = opts[:query_params] || {}
120
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
121
+ query_params[:'searchFilter'] = opts[:'search_filter'] if !opts[:'search_filter'].nil?
122
+ query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
123
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
124
+
125
+ # header parameters
126
+ header_params = opts[:header_params] || {}
127
+ # HTTP header 'Accept' (if needed)
128
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
129
+
130
+ # form parameters
131
+ form_params = opts[:form_params] || {}
132
+
133
+ # http body (model)
134
+ post_body = opts[:body]
135
+
136
+ # return_type
137
+ return_type = opts[:return_type] || 'PageTrackingPixelProjection'
138
+
139
+ # auth_names
140
+ auth_names = opts[:auth_names] || ['API_KEY']
141
+
142
+ new_options = opts.merge(
143
+ :header_params => header_params,
144
+ :query_params => query_params,
145
+ :form_params => form_params,
146
+ :body => post_body,
147
+ :auth_names => auth_names,
148
+ :return_type => return_type
149
+ )
150
+
151
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
152
+ if @api_client.config.debugging
153
+ @api_client.config.logger.debug "API called: TrackingControllerApi#get_all_tracking_pixels\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
154
+ end
155
+ return data, status_code, headers
156
+ end
157
+
158
+ # Get pixel
159
+ # @param id [String] id
160
+ # @param [Hash] opts the optional parameters
161
+ # @return [TrackingPixelDto]
162
+ def get_tracking_pixel(id, opts = {})
163
+ data, _status_code, _headers = get_tracking_pixel_with_http_info(id, opts)
164
+ data
165
+ end
166
+
167
+ # Get pixel
168
+ # @param id [String] id
169
+ # @param [Hash] opts the optional parameters
170
+ # @return [Array<(TrackingPixelDto, Integer, Hash)>] TrackingPixelDto data, response status code and response headers
171
+ def get_tracking_pixel_with_http_info(id, opts = {})
172
+ if @api_client.config.debugging
173
+ @api_client.config.logger.debug 'Calling API: TrackingControllerApi.get_tracking_pixel ...'
174
+ end
175
+ # verify the required parameter 'id' is set
176
+ if @api_client.config.client_side_validation && id.nil?
177
+ fail ArgumentError, "Missing the required parameter 'id' when calling TrackingControllerApi.get_tracking_pixel"
178
+ end
179
+ # resource path
180
+ local_var_path = '/tracking/pixels/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
181
+
182
+ # query parameters
183
+ query_params = opts[:query_params] || {}
184
+
185
+ # header parameters
186
+ header_params = opts[:header_params] || {}
187
+ # HTTP header 'Accept' (if needed)
188
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
189
+
190
+ # form parameters
191
+ form_params = opts[:form_params] || {}
192
+
193
+ # http body (model)
194
+ post_body = opts[:body]
195
+
196
+ # return_type
197
+ return_type = opts[:return_type] || 'TrackingPixelDto'
198
+
199
+ # auth_names
200
+ auth_names = opts[:auth_names] || ['API_KEY']
201
+
202
+ new_options = opts.merge(
203
+ :header_params => header_params,
204
+ :query_params => query_params,
205
+ :form_params => form_params,
206
+ :body => post_body,
207
+ :auth_names => auth_names,
208
+ :return_type => return_type
209
+ )
210
+
211
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
212
+ if @api_client.config.debugging
213
+ @api_client.config.logger.debug "API called: TrackingControllerApi#get_tracking_pixel\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
214
+ end
215
+ return data, status_code, headers
216
+ end
217
+ end
218
+ end