sendx-ruby-sdk 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +156 -0
- data/lib/sendx-ruby-sdk/api/campaign_api.rb +356 -0
- data/lib/sendx-ruby-sdk/api/contact_api.rb +426 -0
- data/lib/sendx-ruby-sdk/api/list_api.rb +356 -0
- data/lib/sendx-ruby-sdk/api/reports_api.rb +88 -0
- data/lib/sendx-ruby-sdk/api/sender_api.rb +156 -0
- data/lib/sendx-ruby-sdk/api/tags_api.rb +356 -0
- data/lib/sendx-ruby-sdk/api_client.rb +394 -0
- data/lib/sendx-ruby-sdk/api_error.rb +58 -0
- data/lib/sendx-ruby-sdk/configuration.rb +316 -0
- data/lib/sendx-ruby-sdk/models/campaign.rb +483 -0
- data/lib/sendx-ruby-sdk/models/campaign_dashboard_data.rb +255 -0
- data/lib/sendx-ruby-sdk/models/campaign_request.rb +441 -0
- data/lib/sendx-ruby-sdk/models/contact.rb +425 -0
- data/lib/sendx-ruby-sdk/models/contact_request.rb +292 -0
- data/lib/sendx-ruby-sdk/models/create_response.rb +232 -0
- data/lib/sendx-ruby-sdk/models/dashboard_stats.rb +234 -0
- data/lib/sendx-ruby-sdk/models/delete_campaign200_response.rb +225 -0
- data/lib/sendx-ruby-sdk/models/delete_request.rb +215 -0
- data/lib/sendx-ruby-sdk/models/delete_response.rb +223 -0
- data/lib/sendx-ruby-sdk/models/last_sent_campaign_stat.rb +284 -0
- data/lib/sendx-ruby-sdk/models/list_model.rb +410 -0
- data/lib/sendx-ruby-sdk/models/list_request.rb +379 -0
- data/lib/sendx-ruby-sdk/models/report_data.rb +358 -0
- data/lib/sendx-ruby-sdk/models/response.rb +235 -0
- data/lib/sendx-ruby-sdk/models/sender.rb +256 -0
- data/lib/sendx-ruby-sdk/models/sender_request.rb +239 -0
- data/lib/sendx-ruby-sdk/models/sender_response.rb +273 -0
- data/lib/sendx-ruby-sdk/models/tag.rb +241 -0
- data/lib/sendx-ruby-sdk/models/tag_request.rb +214 -0
- data/lib/sendx-ruby-sdk/version.rb +15 -0
- data/lib/sendx-ruby-sdk.rb +65 -0
- data/spec/api/campaign_api_spec.rb +98 -0
- data/spec/api/contact_api_spec.rb +111 -0
- data/spec/api/list_api_spec.rb +98 -0
- data/spec/api/reports_api_spec.rb +48 -0
- data/spec/api/sender_api_spec.rb +61 -0
- data/spec/api/tags_api_spec.rb +98 -0
- data/spec/models/campaign_dashboard_data_spec.rb +60 -0
- data/spec/models/campaign_request_spec.rb +148 -0
- data/spec/models/campaign_spec.rb +170 -0
- data/spec/models/contact_request_spec.rb +78 -0
- data/spec/models/contact_spec.rb +142 -0
- data/spec/models/create_response_spec.rb +48 -0
- data/spec/models/dashboard_stats_spec.rb +48 -0
- data/spec/models/delete_campaign200_response_spec.rb +42 -0
- data/spec/models/delete_request_spec.rb +36 -0
- data/spec/models/delete_response_spec.rb +42 -0
- data/spec/models/last_sent_campaign_stat_spec.rb +78 -0
- data/spec/models/list_model_spec.rb +136 -0
- data/spec/models/list_request_spec.rb +118 -0
- data/spec/models/report_data_spec.rb +120 -0
- data/spec/models/response_spec.rb +48 -0
- data/spec/models/sender_request_spec.rb +42 -0
- data/spec/models/sender_response_spec.rb +54 -0
- data/spec/models/sender_spec.rb +48 -0
- data/spec/models/tag_request_spec.rb +36 -0
- data/spec/models/tag_spec.rb +54 -0
- data/spec/spec_helper.rb +111 -0
- metadata +171 -0
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#SendX REST API
|
|
3
|
+
|
|
4
|
+
## Introduction SendX is an email marketing product. It helps you convert website visitors to customers, send them promotional emails, engage with them using drip sequences and craft custom journeys using powerful but simple automations. The SendX API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The SendX Rest API doesn’t support bulk updates. You can work on only one object per request. <br>
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.1
|
|
7
|
+
Contact: support@sendx.io
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.8.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module SendX
|
|
16
|
+
class ListApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Create List
|
|
23
|
+
# Create a new list.
|
|
24
|
+
# @param list_request [ListRequest]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [CreateResponse]
|
|
27
|
+
def create_list(list_request, opts = {})
|
|
28
|
+
data, _status_code, _headers = create_list_with_http_info(list_request, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Create List
|
|
33
|
+
# Create a new list.
|
|
34
|
+
# @param list_request [ListRequest]
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(CreateResponse, Integer, Hash)>] CreateResponse data, response status code and response headers
|
|
37
|
+
def create_list_with_http_info(list_request, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: ListApi.create_list ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'list_request' is set
|
|
42
|
+
if @api_client.config.client_side_validation && list_request.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'list_request' when calling ListApi.create_list"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/list'
|
|
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']) unless header_params['Accept']
|
|
55
|
+
# HTTP header 'Content-Type'
|
|
56
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
57
|
+
if !content_type.nil?
|
|
58
|
+
header_params['Content-Type'] = content_type
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# form parameters
|
|
62
|
+
form_params = opts[:form_params] || {}
|
|
63
|
+
|
|
64
|
+
# http body (model)
|
|
65
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(list_request)
|
|
66
|
+
|
|
67
|
+
# return_type
|
|
68
|
+
return_type = opts[:debug_return_type] || 'CreateResponse'
|
|
69
|
+
|
|
70
|
+
# auth_names
|
|
71
|
+
auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
|
|
72
|
+
|
|
73
|
+
new_options = opts.merge(
|
|
74
|
+
:operation => :"ListApi.create_list",
|
|
75
|
+
:header_params => header_params,
|
|
76
|
+
:query_params => query_params,
|
|
77
|
+
:form_params => form_params,
|
|
78
|
+
:body => post_body,
|
|
79
|
+
:auth_names => auth_names,
|
|
80
|
+
:return_type => return_type
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
84
|
+
if @api_client.config.debugging
|
|
85
|
+
@api_client.config.logger.debug "API called: ListApi#create_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
86
|
+
end
|
|
87
|
+
return data, status_code, headers
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Delete List
|
|
91
|
+
# Deletes a specific list by its ID.
|
|
92
|
+
# @param list_id [String] The ID of the list you want to delete
|
|
93
|
+
# @param [Hash] opts the optional parameters
|
|
94
|
+
# @return [DeleteResponse]
|
|
95
|
+
def delete_list(list_id, opts = {})
|
|
96
|
+
data, _status_code, _headers = delete_list_with_http_info(list_id, opts)
|
|
97
|
+
data
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Delete List
|
|
101
|
+
# Deletes a specific list by its ID.
|
|
102
|
+
# @param list_id [String] The ID of the list you want to delete
|
|
103
|
+
# @param [Hash] opts the optional parameters
|
|
104
|
+
# @return [Array<(DeleteResponse, Integer, Hash)>] DeleteResponse data, response status code and response headers
|
|
105
|
+
def delete_list_with_http_info(list_id, opts = {})
|
|
106
|
+
if @api_client.config.debugging
|
|
107
|
+
@api_client.config.logger.debug 'Calling API: ListApi.delete_list ...'
|
|
108
|
+
end
|
|
109
|
+
# verify the required parameter 'list_id' is set
|
|
110
|
+
if @api_client.config.client_side_validation && list_id.nil?
|
|
111
|
+
fail ArgumentError, "Missing the required parameter 'list_id' when calling ListApi.delete_list"
|
|
112
|
+
end
|
|
113
|
+
# resource path
|
|
114
|
+
local_var_path = '/list/{listId}'.sub('{' + 'listId' + '}', CGI.escape(list_id.to_s))
|
|
115
|
+
|
|
116
|
+
# query parameters
|
|
117
|
+
query_params = opts[:query_params] || {}
|
|
118
|
+
|
|
119
|
+
# header parameters
|
|
120
|
+
header_params = opts[:header_params] || {}
|
|
121
|
+
# HTTP header 'Accept' (if needed)
|
|
122
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
123
|
+
|
|
124
|
+
# form parameters
|
|
125
|
+
form_params = opts[:form_params] || {}
|
|
126
|
+
|
|
127
|
+
# http body (model)
|
|
128
|
+
post_body = opts[:debug_body]
|
|
129
|
+
|
|
130
|
+
# return_type
|
|
131
|
+
return_type = opts[:debug_return_type] || 'DeleteResponse'
|
|
132
|
+
|
|
133
|
+
# auth_names
|
|
134
|
+
auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
|
|
135
|
+
|
|
136
|
+
new_options = opts.merge(
|
|
137
|
+
:operation => :"ListApi.delete_list",
|
|
138
|
+
:header_params => header_params,
|
|
139
|
+
:query_params => query_params,
|
|
140
|
+
:form_params => form_params,
|
|
141
|
+
:body => post_body,
|
|
142
|
+
:auth_names => auth_names,
|
|
143
|
+
:return_type => return_type
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
147
|
+
if @api_client.config.debugging
|
|
148
|
+
@api_client.config.logger.debug "API called: ListApi#delete_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
149
|
+
end
|
|
150
|
+
return data, status_code, headers
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Get All Lists
|
|
154
|
+
# Retrieve all lists for the account.
|
|
155
|
+
# @param [Hash] opts the optional parameters
|
|
156
|
+
# @option opts [Integer] :offset Offset for pagination.
|
|
157
|
+
# @option opts [Integer] :limit Limit the number of results returned.
|
|
158
|
+
# @option opts [String] :search Search term to filter lists.
|
|
159
|
+
# @return [Array<ListModel>]
|
|
160
|
+
def get_all_lists(opts = {})
|
|
161
|
+
data, _status_code, _headers = get_all_lists_with_http_info(opts)
|
|
162
|
+
data
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Get All Lists
|
|
166
|
+
# Retrieve all lists for the account.
|
|
167
|
+
# @param [Hash] opts the optional parameters
|
|
168
|
+
# @option opts [Integer] :offset Offset for pagination.
|
|
169
|
+
# @option opts [Integer] :limit Limit the number of results returned.
|
|
170
|
+
# @option opts [String] :search Search term to filter lists.
|
|
171
|
+
# @return [Array<(Array<ListModel>, Integer, Hash)>] Array<ListModel> data, response status code and response headers
|
|
172
|
+
def get_all_lists_with_http_info(opts = {})
|
|
173
|
+
if @api_client.config.debugging
|
|
174
|
+
@api_client.config.logger.debug 'Calling API: ListApi.get_all_lists ...'
|
|
175
|
+
end
|
|
176
|
+
# resource path
|
|
177
|
+
local_var_path = '/list'
|
|
178
|
+
|
|
179
|
+
# query parameters
|
|
180
|
+
query_params = opts[:query_params] || {}
|
|
181
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
|
182
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
183
|
+
query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
|
|
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']) unless header_params['Accept']
|
|
189
|
+
|
|
190
|
+
# form parameters
|
|
191
|
+
form_params = opts[:form_params] || {}
|
|
192
|
+
|
|
193
|
+
# http body (model)
|
|
194
|
+
post_body = opts[:debug_body]
|
|
195
|
+
|
|
196
|
+
# return_type
|
|
197
|
+
return_type = opts[:debug_return_type] || 'Array<ListModel>'
|
|
198
|
+
|
|
199
|
+
# auth_names
|
|
200
|
+
auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
|
|
201
|
+
|
|
202
|
+
new_options = opts.merge(
|
|
203
|
+
:operation => :"ListApi.get_all_lists",
|
|
204
|
+
:header_params => header_params,
|
|
205
|
+
:query_params => query_params,
|
|
206
|
+
:form_params => form_params,
|
|
207
|
+
:body => post_body,
|
|
208
|
+
:auth_names => auth_names,
|
|
209
|
+
:return_type => return_type
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
213
|
+
if @api_client.config.debugging
|
|
214
|
+
@api_client.config.logger.debug "API called: ListApi#get_all_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
215
|
+
end
|
|
216
|
+
return data, status_code, headers
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
# Get List
|
|
220
|
+
# Retrieve a specific list by its ID.
|
|
221
|
+
# @param list_id [String] The ID of the list you want to retrieve
|
|
222
|
+
# @param [Hash] opts the optional parameters
|
|
223
|
+
# @return [ListModel]
|
|
224
|
+
def get_list_by_id(list_id, opts = {})
|
|
225
|
+
data, _status_code, _headers = get_list_by_id_with_http_info(list_id, opts)
|
|
226
|
+
data
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
# Get List
|
|
230
|
+
# Retrieve a specific list by its ID.
|
|
231
|
+
# @param list_id [String] The ID of the list you want to retrieve
|
|
232
|
+
# @param [Hash] opts the optional parameters
|
|
233
|
+
# @return [Array<(ListModel, Integer, Hash)>] ListModel data, response status code and response headers
|
|
234
|
+
def get_list_by_id_with_http_info(list_id, opts = {})
|
|
235
|
+
if @api_client.config.debugging
|
|
236
|
+
@api_client.config.logger.debug 'Calling API: ListApi.get_list_by_id ...'
|
|
237
|
+
end
|
|
238
|
+
# verify the required parameter 'list_id' is set
|
|
239
|
+
if @api_client.config.client_side_validation && list_id.nil?
|
|
240
|
+
fail ArgumentError, "Missing the required parameter 'list_id' when calling ListApi.get_list_by_id"
|
|
241
|
+
end
|
|
242
|
+
# resource path
|
|
243
|
+
local_var_path = '/list/{listId}'.sub('{' + 'listId' + '}', CGI.escape(list_id.to_s))
|
|
244
|
+
|
|
245
|
+
# query parameters
|
|
246
|
+
query_params = opts[:query_params] || {}
|
|
247
|
+
|
|
248
|
+
# header parameters
|
|
249
|
+
header_params = opts[:header_params] || {}
|
|
250
|
+
# HTTP header 'Accept' (if needed)
|
|
251
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
252
|
+
|
|
253
|
+
# form parameters
|
|
254
|
+
form_params = opts[:form_params] || {}
|
|
255
|
+
|
|
256
|
+
# http body (model)
|
|
257
|
+
post_body = opts[:debug_body]
|
|
258
|
+
|
|
259
|
+
# return_type
|
|
260
|
+
return_type = opts[:debug_return_type] || 'ListModel'
|
|
261
|
+
|
|
262
|
+
# auth_names
|
|
263
|
+
auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
|
|
264
|
+
|
|
265
|
+
new_options = opts.merge(
|
|
266
|
+
:operation => :"ListApi.get_list_by_id",
|
|
267
|
+
:header_params => header_params,
|
|
268
|
+
:query_params => query_params,
|
|
269
|
+
:form_params => form_params,
|
|
270
|
+
:body => post_body,
|
|
271
|
+
:auth_names => auth_names,
|
|
272
|
+
:return_type => return_type
|
|
273
|
+
)
|
|
274
|
+
|
|
275
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
276
|
+
if @api_client.config.debugging
|
|
277
|
+
@api_client.config.logger.debug "API called: ListApi#get_list_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
278
|
+
end
|
|
279
|
+
return data, status_code, headers
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
# Update List
|
|
283
|
+
# Update an existing list by its ID.
|
|
284
|
+
# @param list_request [ListRequest]
|
|
285
|
+
# @param list_id [String] The ID of the list to be updated.
|
|
286
|
+
# @param [Hash] opts the optional parameters
|
|
287
|
+
# @return [Response]
|
|
288
|
+
def update_list(list_request, list_id, opts = {})
|
|
289
|
+
data, _status_code, _headers = update_list_with_http_info(list_request, list_id, opts)
|
|
290
|
+
data
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
# Update List
|
|
294
|
+
# Update an existing list by its ID.
|
|
295
|
+
# @param list_request [ListRequest]
|
|
296
|
+
# @param list_id [String] The ID of the list to be updated.
|
|
297
|
+
# @param [Hash] opts the optional parameters
|
|
298
|
+
# @return [Array<(Response, Integer, Hash)>] Response data, response status code and response headers
|
|
299
|
+
def update_list_with_http_info(list_request, list_id, opts = {})
|
|
300
|
+
if @api_client.config.debugging
|
|
301
|
+
@api_client.config.logger.debug 'Calling API: ListApi.update_list ...'
|
|
302
|
+
end
|
|
303
|
+
# verify the required parameter 'list_request' is set
|
|
304
|
+
if @api_client.config.client_side_validation && list_request.nil?
|
|
305
|
+
fail ArgumentError, "Missing the required parameter 'list_request' when calling ListApi.update_list"
|
|
306
|
+
end
|
|
307
|
+
# verify the required parameter 'list_id' is set
|
|
308
|
+
if @api_client.config.client_side_validation && list_id.nil?
|
|
309
|
+
fail ArgumentError, "Missing the required parameter 'list_id' when calling ListApi.update_list"
|
|
310
|
+
end
|
|
311
|
+
# resource path
|
|
312
|
+
local_var_path = '/list/{listId}'.sub('{' + 'listId' + '}', CGI.escape(list_id.to_s))
|
|
313
|
+
|
|
314
|
+
# query parameters
|
|
315
|
+
query_params = opts[:query_params] || {}
|
|
316
|
+
|
|
317
|
+
# header parameters
|
|
318
|
+
header_params = opts[:header_params] || {}
|
|
319
|
+
# HTTP header 'Accept' (if needed)
|
|
320
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
321
|
+
# HTTP header 'Content-Type'
|
|
322
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
323
|
+
if !content_type.nil?
|
|
324
|
+
header_params['Content-Type'] = content_type
|
|
325
|
+
end
|
|
326
|
+
|
|
327
|
+
# form parameters
|
|
328
|
+
form_params = opts[:form_params] || {}
|
|
329
|
+
|
|
330
|
+
# http body (model)
|
|
331
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(list_request)
|
|
332
|
+
|
|
333
|
+
# return_type
|
|
334
|
+
return_type = opts[:debug_return_type] || 'Response'
|
|
335
|
+
|
|
336
|
+
# auth_names
|
|
337
|
+
auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
|
|
338
|
+
|
|
339
|
+
new_options = opts.merge(
|
|
340
|
+
:operation => :"ListApi.update_list",
|
|
341
|
+
:header_params => header_params,
|
|
342
|
+
:query_params => query_params,
|
|
343
|
+
:form_params => form_params,
|
|
344
|
+
:body => post_body,
|
|
345
|
+
:auth_names => auth_names,
|
|
346
|
+
:return_type => return_type
|
|
347
|
+
)
|
|
348
|
+
|
|
349
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
|
350
|
+
if @api_client.config.debugging
|
|
351
|
+
@api_client.config.logger.debug "API called: ListApi#update_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
352
|
+
end
|
|
353
|
+
return data, status_code, headers
|
|
354
|
+
end
|
|
355
|
+
end
|
|
356
|
+
end
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#SendX REST API
|
|
3
|
+
|
|
4
|
+
## Introduction SendX is an email marketing product. It helps you convert website visitors to customers, send them promotional emails, engage with them using drip sequences and craft custom journeys using powerful but simple automations. The SendX API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The SendX Rest API doesn’t support bulk updates. You can work on only one object per request. <br>
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.1
|
|
7
|
+
Contact: support@sendx.io
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.8.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module SendX
|
|
16
|
+
class ReportsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Get CampaignReport Data
|
|
23
|
+
# Retrieve the campaign report data based on the provided campaign id.
|
|
24
|
+
# @param campaign_id [String] The ID of the campaign to retrieve the report data for
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @option opts [String] :integration_type Type of integration for the report data (optional)
|
|
27
|
+
# @return [ReportData]
|
|
28
|
+
def get_campaign_report(campaign_id, opts = {})
|
|
29
|
+
data, _status_code, _headers = get_campaign_report_with_http_info(campaign_id, opts)
|
|
30
|
+
data
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Get CampaignReport Data
|
|
34
|
+
# Retrieve the campaign report data based on the provided campaign id.
|
|
35
|
+
# @param campaign_id [String] The ID of the campaign to retrieve the report data for
|
|
36
|
+
# @param [Hash] opts the optional parameters
|
|
37
|
+
# @option opts [String] :integration_type Type of integration for the report data (optional)
|
|
38
|
+
# @return [Array<(ReportData, Integer, Hash)>] ReportData data, response status code and response headers
|
|
39
|
+
def get_campaign_report_with_http_info(campaign_id, opts = {})
|
|
40
|
+
if @api_client.config.debugging
|
|
41
|
+
@api_client.config.logger.debug 'Calling API: ReportsApi.get_campaign_report ...'
|
|
42
|
+
end
|
|
43
|
+
# verify the required parameter 'campaign_id' is set
|
|
44
|
+
if @api_client.config.client_side_validation && campaign_id.nil?
|
|
45
|
+
fail ArgumentError, "Missing the required parameter 'campaign_id' when calling ReportsApi.get_campaign_report"
|
|
46
|
+
end
|
|
47
|
+
# resource path
|
|
48
|
+
local_var_path = '/report/campaign/{campaignId}'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s))
|
|
49
|
+
|
|
50
|
+
# query parameters
|
|
51
|
+
query_params = opts[:query_params] || {}
|
|
52
|
+
query_params[:'integrationType'] = opts[:'integration_type'] if !opts[:'integration_type'].nil?
|
|
53
|
+
|
|
54
|
+
# header parameters
|
|
55
|
+
header_params = opts[:header_params] || {}
|
|
56
|
+
# HTTP header 'Accept' (if needed)
|
|
57
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
58
|
+
|
|
59
|
+
# form parameters
|
|
60
|
+
form_params = opts[:form_params] || {}
|
|
61
|
+
|
|
62
|
+
# http body (model)
|
|
63
|
+
post_body = opts[:debug_body]
|
|
64
|
+
|
|
65
|
+
# return_type
|
|
66
|
+
return_type = opts[:debug_return_type] || 'ReportData'
|
|
67
|
+
|
|
68
|
+
# auth_names
|
|
69
|
+
auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
|
|
70
|
+
|
|
71
|
+
new_options = opts.merge(
|
|
72
|
+
:operation => :"ReportsApi.get_campaign_report",
|
|
73
|
+
:header_params => header_params,
|
|
74
|
+
:query_params => query_params,
|
|
75
|
+
:form_params => form_params,
|
|
76
|
+
:body => post_body,
|
|
77
|
+
:auth_names => auth_names,
|
|
78
|
+
:return_type => return_type
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
82
|
+
if @api_client.config.debugging
|
|
83
|
+
@api_client.config.logger.debug "API called: ReportsApi#get_campaign_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
84
|
+
end
|
|
85
|
+
return data, status_code, headers
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#SendX REST API
|
|
3
|
+
|
|
4
|
+
## Introduction SendX is an email marketing product. It helps you convert website visitors to customers, send them promotional emails, engage with them using drip sequences and craft custom journeys using powerful but simple automations. The SendX API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The SendX Rest API doesn’t support bulk updates. You can work on only one object per request. <br>
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.1
|
|
7
|
+
Contact: support@sendx.io
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.8.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module SendX
|
|
16
|
+
class SenderApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Create Sender
|
|
23
|
+
# Creates a new sender in the system.
|
|
24
|
+
# @param sender_request [SenderRequest]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [Sender]
|
|
27
|
+
def create_sender(sender_request, opts = {})
|
|
28
|
+
data, _status_code, _headers = create_sender_with_http_info(sender_request, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Create Sender
|
|
33
|
+
# Creates a new sender in the system.
|
|
34
|
+
# @param sender_request [SenderRequest]
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(Sender, Integer, Hash)>] Sender data, response status code and response headers
|
|
37
|
+
def create_sender_with_http_info(sender_request, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: SenderApi.create_sender ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'sender_request' is set
|
|
42
|
+
if @api_client.config.client_side_validation && sender_request.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'sender_request' when calling SenderApi.create_sender"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/sender'
|
|
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']) unless header_params['Accept']
|
|
55
|
+
# HTTP header 'Content-Type'
|
|
56
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
57
|
+
if !content_type.nil?
|
|
58
|
+
header_params['Content-Type'] = content_type
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# form parameters
|
|
62
|
+
form_params = opts[:form_params] || {}
|
|
63
|
+
|
|
64
|
+
# http body (model)
|
|
65
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(sender_request)
|
|
66
|
+
|
|
67
|
+
# return_type
|
|
68
|
+
return_type = opts[:debug_return_type] || 'Sender'
|
|
69
|
+
|
|
70
|
+
# auth_names
|
|
71
|
+
auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
|
|
72
|
+
|
|
73
|
+
new_options = opts.merge(
|
|
74
|
+
:operation => :"SenderApi.create_sender",
|
|
75
|
+
:header_params => header_params,
|
|
76
|
+
:query_params => query_params,
|
|
77
|
+
:form_params => form_params,
|
|
78
|
+
:body => post_body,
|
|
79
|
+
:auth_names => auth_names,
|
|
80
|
+
:return_type => return_type
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
84
|
+
if @api_client.config.debugging
|
|
85
|
+
@api_client.config.logger.debug "API called: SenderApi#create_sender\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
86
|
+
end
|
|
87
|
+
return data, status_code, headers
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Get All Senders
|
|
91
|
+
# Retrieve all senders for the team, with optional filters like offset, limit, and search.
|
|
92
|
+
# @param [Hash] opts the optional parameters
|
|
93
|
+
# @option opts [Integer] :offset Number of records to skip (default to 0)
|
|
94
|
+
# @option opts [Integer] :limit Maximum number of records to return (default to 10)
|
|
95
|
+
# @option opts [String] :search Search keyword to filter senders by name or email
|
|
96
|
+
# @return [Array<SenderResponse>]
|
|
97
|
+
def get_all_senders(opts = {})
|
|
98
|
+
data, _status_code, _headers = get_all_senders_with_http_info(opts)
|
|
99
|
+
data
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Get All Senders
|
|
103
|
+
# Retrieve all senders for the team, with optional filters like offset, limit, and search.
|
|
104
|
+
# @param [Hash] opts the optional parameters
|
|
105
|
+
# @option opts [Integer] :offset Number of records to skip (default to 0)
|
|
106
|
+
# @option opts [Integer] :limit Maximum number of records to return (default to 10)
|
|
107
|
+
# @option opts [String] :search Search keyword to filter senders by name or email
|
|
108
|
+
# @return [Array<(Array<SenderResponse>, Integer, Hash)>] Array<SenderResponse> data, response status code and response headers
|
|
109
|
+
def get_all_senders_with_http_info(opts = {})
|
|
110
|
+
if @api_client.config.debugging
|
|
111
|
+
@api_client.config.logger.debug 'Calling API: SenderApi.get_all_senders ...'
|
|
112
|
+
end
|
|
113
|
+
# resource path
|
|
114
|
+
local_var_path = '/sender'
|
|
115
|
+
|
|
116
|
+
# query parameters
|
|
117
|
+
query_params = opts[:query_params] || {}
|
|
118
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
|
119
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
120
|
+
query_params[:'search'] = opts[:'search'] if !opts[:'search'].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']) unless header_params['Accept']
|
|
126
|
+
|
|
127
|
+
# form parameters
|
|
128
|
+
form_params = opts[:form_params] || {}
|
|
129
|
+
|
|
130
|
+
# http body (model)
|
|
131
|
+
post_body = opts[:debug_body]
|
|
132
|
+
|
|
133
|
+
# return_type
|
|
134
|
+
return_type = opts[:debug_return_type] || 'Array<SenderResponse>'
|
|
135
|
+
|
|
136
|
+
# auth_names
|
|
137
|
+
auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
|
|
138
|
+
|
|
139
|
+
new_options = opts.merge(
|
|
140
|
+
:operation => :"SenderApi.get_all_senders",
|
|
141
|
+
:header_params => header_params,
|
|
142
|
+
:query_params => query_params,
|
|
143
|
+
:form_params => form_params,
|
|
144
|
+
:body => post_body,
|
|
145
|
+
:auth_names => auth_names,
|
|
146
|
+
:return_type => return_type
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
150
|
+
if @api_client.config.debugging
|
|
151
|
+
@api_client.config.logger.debug "API called: SenderApi#get_all_senders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
152
|
+
end
|
|
153
|
+
return data, status_code, headers
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
end
|