sib-api-v3-sdk 9.0.0 → 9.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -19
- data/docs/Body.md +1 -0
- data/docs/Body1.md +1 -0
- data/docs/Body10.md +2 -2
- data/docs/Body12.md +1 -1
- data/docs/Body8.md +2 -2
- data/docs/CreateEmailCampaign.md +2 -0
- data/docs/CreateEmailCampaignRecipients.md +1 -0
- data/docs/NoteData.md +1 -0
- data/docs/TransactionalEmailsApi.md +2 -2
- data/docs/UpdateEmailCampaign.md +2 -0
- data/docs/UpdateEmailCampaignRecipients.md +2 -1
- data/lib/sib-api-v3-sdk/api/contacts_api.rb +20 -0
- data/lib/sib-api-v3-sdk/api/email_campaigns_api.rb +4 -0
- data/lib/sib-api-v3-sdk/api/inbound_parsing_api.rb +4 -0
- data/lib/sib-api-v3-sdk/api/process_api.rb +4 -0
- data/lib/sib-api-v3-sdk/api/reseller_api.rb +4 -0
- data/lib/sib-api-v3-sdk/api/sms_campaigns_api.rb +4 -0
- data/lib/sib-api-v3-sdk/api/transactional_emails_api.rb +27 -3
- data/lib/sib-api-v3-sdk/models/body.rb +14 -4
- data/lib/sib-api-v3-sdk/models/body_1.rb +14 -4
- data/lib/sib-api-v3-sdk/models/body_10.rb +2 -2
- data/lib/sib-api-v3-sdk/models/body_12.rb +1 -1
- data/lib/sib-api-v3-sdk/models/body_8.rb +2 -2
- data/lib/sib-api-v3-sdk/models/create_email_campaign.rb +24 -4
- data/lib/sib-api-v3-sdk/models/create_email_campaign_recipients.rb +17 -5
- data/lib/sib-api-v3-sdk/models/note_data.rb +16 -4
- data/lib/sib-api-v3-sdk/models/update_email_campaign.rb +24 -4
- data/lib/sib-api-v3-sdk/models/update_email_campaign_recipients.rb +18 -6
- data/lib/sib-api-v3-sdk/version.rb +1 -1
- data/lib/sib-api-v3-sdk.rb +0 -3
- data/spec/models/body_1_spec.rb +6 -0
- data/spec/models/body_spec.rb +6 -0
- data/spec/models/create_email_campaign_recipients_spec.rb +6 -0
- data/spec/models/create_email_campaign_spec.rb +12 -0
- data/spec/models/note_data_spec.rb +6 -0
- data/spec/models/update_email_campaign_recipients_spec.rb +6 -0
- data/spec/models/update_email_campaign_spec.rb +12 -0
- metadata +2 -14
- data/docs/AttributesApi.md +0 -246
- data/docs/FoldersApi.md +0 -372
- data/docs/ListsApi.md +0 -560
- data/lib/sib-api-v3-sdk/api/attributes_api.rb +0 -274
- data/lib/sib-api-v3-sdk/api/folders_api.rb +0 -383
- data/lib/sib-api-v3-sdk/api/lists_api.rb +0 -562
- data/spec/api/attributes_api_spec.rb +0 -83
- data/spec/api/folders_api_spec.rb +0 -107
- data/spec/api/lists_api_spec.rb +0 -146
@@ -1,562 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#SendinBlue API
|
3
|
-
|
4
|
-
#SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable |
|
5
|
-
|
6
|
-
OpenAPI spec version: 3.0.0
|
7
|
-
Contact: contact@sendinblue.com
|
8
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.4.19
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'uri'
|
14
|
-
|
15
|
-
module SibApiV3Sdk
|
16
|
-
class ListsApi
|
17
|
-
attr_accessor :api_client
|
18
|
-
|
19
|
-
def initialize(api_client = ApiClient.default)
|
20
|
-
@api_client = api_client
|
21
|
-
end
|
22
|
-
|
23
|
-
# Set custom user_agent if explicitly passed in api
|
24
|
-
# default will still remain Swagger-Codegen/#{VERSION}/ruby
|
25
|
-
def setUserAgent(user_agent)
|
26
|
-
@user_agent = user_agent
|
27
|
-
if user_agent.is_a?(String) && user_agent.downcase.start_with?('sendinblue_')
|
28
|
-
@api_client.default_headers['User-Agent'] = @user_agent
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
# Add existing contacts to a list
|
33
|
-
# @param list_id Id of the list
|
34
|
-
# @param contact_emails Emails addresses OR IDs of the contacts
|
35
|
-
# @param [Hash] opts the optional parameters
|
36
|
-
# @return [PostContactInfo]
|
37
|
-
def add_contact_to_list(list_id, contact_emails, opts = {})
|
38
|
-
data, _status_code, _headers = add_contact_to_list_with_http_info(list_id, contact_emails, opts)
|
39
|
-
data
|
40
|
-
end
|
41
|
-
|
42
|
-
# Add existing contacts to a list
|
43
|
-
# @param list_id Id of the list
|
44
|
-
# @param contact_emails Emails addresses OR IDs of the contacts
|
45
|
-
# @param [Hash] opts the optional parameters
|
46
|
-
# @return [Array<(PostContactInfo, Fixnum, Hash)>] PostContactInfo data, response status code and response headers
|
47
|
-
def add_contact_to_list_with_http_info(list_id, contact_emails, opts = {})
|
48
|
-
if @api_client.config.debugging
|
49
|
-
@api_client.config.logger.debug 'Calling API: ListsApi.add_contact_to_list ...'
|
50
|
-
end
|
51
|
-
# verify the required parameter 'list_id' is set
|
52
|
-
if @api_client.config.client_side_validation && list_id.nil?
|
53
|
-
fail ArgumentError, "Missing the required parameter 'list_id' when calling ListsApi.add_contact_to_list"
|
54
|
-
end
|
55
|
-
# verify the required parameter 'contact_emails' is set
|
56
|
-
if @api_client.config.client_side_validation && contact_emails.nil?
|
57
|
-
fail ArgumentError, "Missing the required parameter 'contact_emails' when calling ListsApi.add_contact_to_list"
|
58
|
-
end
|
59
|
-
# resource path
|
60
|
-
local_var_path = '/contacts/lists/{listId}/contacts/add'.sub('{' + 'listId' + '}', list_id.to_s)
|
61
|
-
|
62
|
-
# query parameters
|
63
|
-
query_params = {}
|
64
|
-
|
65
|
-
# header parameters
|
66
|
-
header_params = {}
|
67
|
-
# HTTP header 'Accept' (if needed)
|
68
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
69
|
-
# HTTP header 'Content-Type'
|
70
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
71
|
-
|
72
|
-
# form parameters
|
73
|
-
form_params = {}
|
74
|
-
|
75
|
-
# http body (model)
|
76
|
-
post_body = @api_client.object_to_http_body(contact_emails)
|
77
|
-
auth_names = ['api-key', 'partner-key']
|
78
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
79
|
-
:header_params => header_params,
|
80
|
-
:query_params => query_params,
|
81
|
-
:form_params => form_params,
|
82
|
-
:body => post_body,
|
83
|
-
:auth_names => auth_names,
|
84
|
-
:return_type => 'PostContactInfo')
|
85
|
-
if @api_client.config.debugging
|
86
|
-
@api_client.config.logger.debug "API called: ListsApi#add_contact_to_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
87
|
-
end
|
88
|
-
return data, status_code, headers
|
89
|
-
end
|
90
|
-
# Create a list
|
91
|
-
# @param create_list Values to create a list
|
92
|
-
# @param [Hash] opts the optional parameters
|
93
|
-
# @return [CreateModel]
|
94
|
-
def create_list(create_list, opts = {})
|
95
|
-
data, _status_code, _headers = create_list_with_http_info(create_list, opts)
|
96
|
-
data
|
97
|
-
end
|
98
|
-
|
99
|
-
# Create a list
|
100
|
-
# @param create_list Values to create a list
|
101
|
-
# @param [Hash] opts the optional parameters
|
102
|
-
# @return [Array<(CreateModel, Fixnum, Hash)>] CreateModel data, response status code and response headers
|
103
|
-
def create_list_with_http_info(create_list, opts = {})
|
104
|
-
if @api_client.config.debugging
|
105
|
-
@api_client.config.logger.debug 'Calling API: ListsApi.create_list ...'
|
106
|
-
end
|
107
|
-
# verify the required parameter 'create_list' is set
|
108
|
-
if @api_client.config.client_side_validation && create_list.nil?
|
109
|
-
fail ArgumentError, "Missing the required parameter 'create_list' when calling ListsApi.create_list"
|
110
|
-
end
|
111
|
-
# resource path
|
112
|
-
local_var_path = '/contacts/lists'
|
113
|
-
|
114
|
-
# query parameters
|
115
|
-
query_params = {}
|
116
|
-
|
117
|
-
# header parameters
|
118
|
-
header_params = {}
|
119
|
-
# HTTP header 'Accept' (if needed)
|
120
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
121
|
-
# HTTP header 'Content-Type'
|
122
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
123
|
-
|
124
|
-
# form parameters
|
125
|
-
form_params = {}
|
126
|
-
|
127
|
-
# http body (model)
|
128
|
-
post_body = @api_client.object_to_http_body(create_list)
|
129
|
-
auth_names = ['api-key', 'partner-key']
|
130
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
131
|
-
:header_params => header_params,
|
132
|
-
:query_params => query_params,
|
133
|
-
:form_params => form_params,
|
134
|
-
:body => post_body,
|
135
|
-
:auth_names => auth_names,
|
136
|
-
:return_type => 'CreateModel')
|
137
|
-
if @api_client.config.debugging
|
138
|
-
@api_client.config.logger.debug "API called: ListsApi#create_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
139
|
-
end
|
140
|
-
return data, status_code, headers
|
141
|
-
end
|
142
|
-
# Delete a list
|
143
|
-
# @param list_id Id of the list
|
144
|
-
# @param [Hash] opts the optional parameters
|
145
|
-
# @return [nil]
|
146
|
-
def delete_list(list_id, opts = {})
|
147
|
-
delete_list_with_http_info(list_id, opts)
|
148
|
-
nil
|
149
|
-
end
|
150
|
-
|
151
|
-
# Delete a list
|
152
|
-
# @param list_id Id of the list
|
153
|
-
# @param [Hash] opts the optional parameters
|
154
|
-
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
155
|
-
def delete_list_with_http_info(list_id, opts = {})
|
156
|
-
if @api_client.config.debugging
|
157
|
-
@api_client.config.logger.debug 'Calling API: ListsApi.delete_list ...'
|
158
|
-
end
|
159
|
-
# verify the required parameter 'list_id' is set
|
160
|
-
if @api_client.config.client_side_validation && list_id.nil?
|
161
|
-
fail ArgumentError, "Missing the required parameter 'list_id' when calling ListsApi.delete_list"
|
162
|
-
end
|
163
|
-
# resource path
|
164
|
-
local_var_path = '/contacts/lists/{listId}'.sub('{' + 'listId' + '}', list_id.to_s)
|
165
|
-
|
166
|
-
# query parameters
|
167
|
-
query_params = {}
|
168
|
-
|
169
|
-
# header parameters
|
170
|
-
header_params = {}
|
171
|
-
# HTTP header 'Accept' (if needed)
|
172
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
173
|
-
# HTTP header 'Content-Type'
|
174
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
175
|
-
|
176
|
-
# form parameters
|
177
|
-
form_params = {}
|
178
|
-
|
179
|
-
# http body (model)
|
180
|
-
post_body = nil
|
181
|
-
auth_names = ['api-key', 'partner-key']
|
182
|
-
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
183
|
-
:header_params => header_params,
|
184
|
-
:query_params => query_params,
|
185
|
-
:form_params => form_params,
|
186
|
-
:body => post_body,
|
187
|
-
:auth_names => auth_names)
|
188
|
-
if @api_client.config.debugging
|
189
|
-
@api_client.config.logger.debug "API called: ListsApi#delete_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
190
|
-
end
|
191
|
-
return data, status_code, headers
|
192
|
-
end
|
193
|
-
# Get contacts in a list
|
194
|
-
# @param list_id Id of the list
|
195
|
-
# @param [Hash] opts the optional parameters
|
196
|
-
# @option opts [String] :modified_since Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.
|
197
|
-
# @option opts [Integer] :limit Number of documents per page (default to 50)
|
198
|
-
# @option opts [Integer] :offset Index of the first document of the page (default to 0)
|
199
|
-
# @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to desc)
|
200
|
-
# @return [GetContacts]
|
201
|
-
def get_contacts_from_list(list_id, opts = {})
|
202
|
-
data, _status_code, _headers = get_contacts_from_list_with_http_info(list_id, opts)
|
203
|
-
data
|
204
|
-
end
|
205
|
-
|
206
|
-
# Get contacts in a list
|
207
|
-
# @param list_id Id of the list
|
208
|
-
# @param [Hash] opts the optional parameters
|
209
|
-
# @option opts [String] :modified_since Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.
|
210
|
-
# @option opts [Integer] :limit Number of documents per page
|
211
|
-
# @option opts [Integer] :offset Index of the first document of the page
|
212
|
-
# @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
|
213
|
-
# @return [Array<(GetContacts, Fixnum, Hash)>] GetContacts data, response status code and response headers
|
214
|
-
def get_contacts_from_list_with_http_info(list_id, opts = {})
|
215
|
-
if @api_client.config.debugging
|
216
|
-
@api_client.config.logger.debug 'Calling API: ListsApi.get_contacts_from_list ...'
|
217
|
-
end
|
218
|
-
# verify the required parameter 'list_id' is set
|
219
|
-
if @api_client.config.client_side_validation && list_id.nil?
|
220
|
-
fail ArgumentError, "Missing the required parameter 'list_id' when calling ListsApi.get_contacts_from_list"
|
221
|
-
end
|
222
|
-
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
|
223
|
-
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ListsApi.get_contacts_from_list, must be smaller than or equal to 500.'
|
224
|
-
end
|
225
|
-
|
226
|
-
if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort'])
|
227
|
-
fail ArgumentError, 'invalid value for "sort", must be one of asc, desc'
|
228
|
-
end
|
229
|
-
# resource path
|
230
|
-
local_var_path = '/contacts/lists/{listId}/contacts'.sub('{' + 'listId' + '}', list_id.to_s)
|
231
|
-
|
232
|
-
# query parameters
|
233
|
-
query_params = {}
|
234
|
-
query_params[:'modifiedSince'] = opts[:'modified_since'] if !opts[:'modified_since'].nil?
|
235
|
-
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
236
|
-
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
237
|
-
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
238
|
-
|
239
|
-
# header parameters
|
240
|
-
header_params = {}
|
241
|
-
# HTTP header 'Accept' (if needed)
|
242
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
243
|
-
# HTTP header 'Content-Type'
|
244
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
245
|
-
|
246
|
-
# form parameters
|
247
|
-
form_params = {}
|
248
|
-
|
249
|
-
# http body (model)
|
250
|
-
post_body = nil
|
251
|
-
auth_names = ['api-key', 'partner-key']
|
252
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
253
|
-
:header_params => header_params,
|
254
|
-
:query_params => query_params,
|
255
|
-
:form_params => form_params,
|
256
|
-
:body => post_body,
|
257
|
-
:auth_names => auth_names,
|
258
|
-
:return_type => 'GetContacts')
|
259
|
-
if @api_client.config.debugging
|
260
|
-
@api_client.config.logger.debug "API called: ListsApi#get_contacts_from_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
261
|
-
end
|
262
|
-
return data, status_code, headers
|
263
|
-
end
|
264
|
-
# Get lists in a folder
|
265
|
-
# @param folder_id Id of the folder
|
266
|
-
# @param [Hash] opts the optional parameters
|
267
|
-
# @option opts [Integer] :limit Number of documents per page (default to 10)
|
268
|
-
# @option opts [Integer] :offset Index of the first document of the page (default to 0)
|
269
|
-
# @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to desc)
|
270
|
-
# @return [GetFolderLists]
|
271
|
-
def get_folder_lists(folder_id, opts = {})
|
272
|
-
data, _status_code, _headers = get_folder_lists_with_http_info(folder_id, opts)
|
273
|
-
data
|
274
|
-
end
|
275
|
-
|
276
|
-
# Get lists in a folder
|
277
|
-
# @param folder_id Id of the folder
|
278
|
-
# @param [Hash] opts the optional parameters
|
279
|
-
# @option opts [Integer] :limit Number of documents per page
|
280
|
-
# @option opts [Integer] :offset Index of the first document of the page
|
281
|
-
# @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
|
282
|
-
# @return [Array<(GetFolderLists, Fixnum, Hash)>] GetFolderLists data, response status code and response headers
|
283
|
-
def get_folder_lists_with_http_info(folder_id, opts = {})
|
284
|
-
if @api_client.config.debugging
|
285
|
-
@api_client.config.logger.debug 'Calling API: ListsApi.get_folder_lists ...'
|
286
|
-
end
|
287
|
-
# verify the required parameter 'folder_id' is set
|
288
|
-
if @api_client.config.client_side_validation && folder_id.nil?
|
289
|
-
fail ArgumentError, "Missing the required parameter 'folder_id' when calling ListsApi.get_folder_lists"
|
290
|
-
end
|
291
|
-
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 50
|
292
|
-
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ListsApi.get_folder_lists, must be smaller than or equal to 50.'
|
293
|
-
end
|
294
|
-
|
295
|
-
if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort'])
|
296
|
-
fail ArgumentError, 'invalid value for "sort", must be one of asc, desc'
|
297
|
-
end
|
298
|
-
# resource path
|
299
|
-
local_var_path = '/contacts/folders/{folderId}/lists'.sub('{' + 'folderId' + '}', folder_id.to_s)
|
300
|
-
|
301
|
-
# query parameters
|
302
|
-
query_params = {}
|
303
|
-
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
304
|
-
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
305
|
-
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
306
|
-
|
307
|
-
# header parameters
|
308
|
-
header_params = {}
|
309
|
-
# HTTP header 'Accept' (if needed)
|
310
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
311
|
-
# HTTP header 'Content-Type'
|
312
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
313
|
-
|
314
|
-
# form parameters
|
315
|
-
form_params = {}
|
316
|
-
|
317
|
-
# http body (model)
|
318
|
-
post_body = nil
|
319
|
-
auth_names = ['api-key', 'partner-key']
|
320
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
321
|
-
:header_params => header_params,
|
322
|
-
:query_params => query_params,
|
323
|
-
:form_params => form_params,
|
324
|
-
:body => post_body,
|
325
|
-
:auth_names => auth_names,
|
326
|
-
:return_type => 'GetFolderLists')
|
327
|
-
if @api_client.config.debugging
|
328
|
-
@api_client.config.logger.debug "API called: ListsApi#get_folder_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
329
|
-
end
|
330
|
-
return data, status_code, headers
|
331
|
-
end
|
332
|
-
# Get a list's details
|
333
|
-
# @param list_id Id of the list
|
334
|
-
# @param [Hash] opts the optional parameters
|
335
|
-
# @return [GetExtendedList]
|
336
|
-
def get_list(list_id, opts = {})
|
337
|
-
data, _status_code, _headers = get_list_with_http_info(list_id, opts)
|
338
|
-
data
|
339
|
-
end
|
340
|
-
|
341
|
-
# Get a list's details
|
342
|
-
# @param list_id Id of the list
|
343
|
-
# @param [Hash] opts the optional parameters
|
344
|
-
# @return [Array<(GetExtendedList, Fixnum, Hash)>] GetExtendedList data, response status code and response headers
|
345
|
-
def get_list_with_http_info(list_id, opts = {})
|
346
|
-
if @api_client.config.debugging
|
347
|
-
@api_client.config.logger.debug 'Calling API: ListsApi.get_list ...'
|
348
|
-
end
|
349
|
-
# verify the required parameter 'list_id' is set
|
350
|
-
if @api_client.config.client_side_validation && list_id.nil?
|
351
|
-
fail ArgumentError, "Missing the required parameter 'list_id' when calling ListsApi.get_list"
|
352
|
-
end
|
353
|
-
# resource path
|
354
|
-
local_var_path = '/contacts/lists/{listId}'.sub('{' + 'listId' + '}', list_id.to_s)
|
355
|
-
|
356
|
-
# query parameters
|
357
|
-
query_params = {}
|
358
|
-
|
359
|
-
# header parameters
|
360
|
-
header_params = {}
|
361
|
-
# HTTP header 'Accept' (if needed)
|
362
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
363
|
-
# HTTP header 'Content-Type'
|
364
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
365
|
-
|
366
|
-
# form parameters
|
367
|
-
form_params = {}
|
368
|
-
|
369
|
-
# http body (model)
|
370
|
-
post_body = nil
|
371
|
-
auth_names = ['api-key', 'partner-key']
|
372
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
373
|
-
:header_params => header_params,
|
374
|
-
:query_params => query_params,
|
375
|
-
:form_params => form_params,
|
376
|
-
:body => post_body,
|
377
|
-
:auth_names => auth_names,
|
378
|
-
:return_type => 'GetExtendedList')
|
379
|
-
if @api_client.config.debugging
|
380
|
-
@api_client.config.logger.debug "API called: ListsApi#get_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
381
|
-
end
|
382
|
-
return data, status_code, headers
|
383
|
-
end
|
384
|
-
# Get all the lists
|
385
|
-
# @param [Hash] opts the optional parameters
|
386
|
-
# @option opts [Integer] :limit Number of documents per page (default to 10)
|
387
|
-
# @option opts [Integer] :offset Index of the first document of the page (default to 0)
|
388
|
-
# @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to desc)
|
389
|
-
# @return [GetLists]
|
390
|
-
def get_lists(opts = {})
|
391
|
-
data, _status_code, _headers = get_lists_with_http_info(opts)
|
392
|
-
data
|
393
|
-
end
|
394
|
-
|
395
|
-
# Get all the lists
|
396
|
-
# @param [Hash] opts the optional parameters
|
397
|
-
# @option opts [Integer] :limit Number of documents per page
|
398
|
-
# @option opts [Integer] :offset Index of the first document of the page
|
399
|
-
# @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
|
400
|
-
# @return [Array<(GetLists, Fixnum, Hash)>] GetLists data, response status code and response headers
|
401
|
-
def get_lists_with_http_info(opts = {})
|
402
|
-
if @api_client.config.debugging
|
403
|
-
@api_client.config.logger.debug 'Calling API: ListsApi.get_lists ...'
|
404
|
-
end
|
405
|
-
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 50
|
406
|
-
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ListsApi.get_lists, must be smaller than or equal to 50.'
|
407
|
-
end
|
408
|
-
|
409
|
-
if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort'])
|
410
|
-
fail ArgumentError, 'invalid value for "sort", must be one of asc, desc'
|
411
|
-
end
|
412
|
-
# resource path
|
413
|
-
local_var_path = '/contacts/lists'
|
414
|
-
|
415
|
-
# query parameters
|
416
|
-
query_params = {}
|
417
|
-
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
418
|
-
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
419
|
-
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
420
|
-
|
421
|
-
# header parameters
|
422
|
-
header_params = {}
|
423
|
-
# HTTP header 'Accept' (if needed)
|
424
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
425
|
-
# HTTP header 'Content-Type'
|
426
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
427
|
-
|
428
|
-
# form parameters
|
429
|
-
form_params = {}
|
430
|
-
|
431
|
-
# http body (model)
|
432
|
-
post_body = nil
|
433
|
-
auth_names = ['api-key', 'partner-key']
|
434
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
435
|
-
:header_params => header_params,
|
436
|
-
:query_params => query_params,
|
437
|
-
:form_params => form_params,
|
438
|
-
:body => post_body,
|
439
|
-
:auth_names => auth_names,
|
440
|
-
:return_type => 'GetLists')
|
441
|
-
if @api_client.config.debugging
|
442
|
-
@api_client.config.logger.debug "API called: ListsApi#get_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
443
|
-
end
|
444
|
-
return data, status_code, headers
|
445
|
-
end
|
446
|
-
# Delete a contact from a list
|
447
|
-
# @param list_id Id of the list
|
448
|
-
# @param contact_emails Emails addresses OR IDs of the contacts
|
449
|
-
# @param [Hash] opts the optional parameters
|
450
|
-
# @return [PostContactInfo]
|
451
|
-
def remove_contact_from_list(list_id, contact_emails, opts = {})
|
452
|
-
data, _status_code, _headers = remove_contact_from_list_with_http_info(list_id, contact_emails, opts)
|
453
|
-
data
|
454
|
-
end
|
455
|
-
|
456
|
-
# Delete a contact from a list
|
457
|
-
# @param list_id Id of the list
|
458
|
-
# @param contact_emails Emails addresses OR IDs of the contacts
|
459
|
-
# @param [Hash] opts the optional parameters
|
460
|
-
# @return [Array<(PostContactInfo, Fixnum, Hash)>] PostContactInfo data, response status code and response headers
|
461
|
-
def remove_contact_from_list_with_http_info(list_id, contact_emails, opts = {})
|
462
|
-
if @api_client.config.debugging
|
463
|
-
@api_client.config.logger.debug 'Calling API: ListsApi.remove_contact_from_list ...'
|
464
|
-
end
|
465
|
-
# verify the required parameter 'list_id' is set
|
466
|
-
if @api_client.config.client_side_validation && list_id.nil?
|
467
|
-
fail ArgumentError, "Missing the required parameter 'list_id' when calling ListsApi.remove_contact_from_list"
|
468
|
-
end
|
469
|
-
# verify the required parameter 'contact_emails' is set
|
470
|
-
if @api_client.config.client_side_validation && contact_emails.nil?
|
471
|
-
fail ArgumentError, "Missing the required parameter 'contact_emails' when calling ListsApi.remove_contact_from_list"
|
472
|
-
end
|
473
|
-
# resource path
|
474
|
-
local_var_path = '/contacts/lists/{listId}/contacts/remove'.sub('{' + 'listId' + '}', list_id.to_s)
|
475
|
-
|
476
|
-
# query parameters
|
477
|
-
query_params = {}
|
478
|
-
|
479
|
-
# header parameters
|
480
|
-
header_params = {}
|
481
|
-
# HTTP header 'Accept' (if needed)
|
482
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
483
|
-
# HTTP header 'Content-Type'
|
484
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
485
|
-
|
486
|
-
# form parameters
|
487
|
-
form_params = {}
|
488
|
-
|
489
|
-
# http body (model)
|
490
|
-
post_body = @api_client.object_to_http_body(contact_emails)
|
491
|
-
auth_names = ['api-key', 'partner-key']
|
492
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
493
|
-
:header_params => header_params,
|
494
|
-
:query_params => query_params,
|
495
|
-
:form_params => form_params,
|
496
|
-
:body => post_body,
|
497
|
-
:auth_names => auth_names,
|
498
|
-
:return_type => 'PostContactInfo')
|
499
|
-
if @api_client.config.debugging
|
500
|
-
@api_client.config.logger.debug "API called: ListsApi#remove_contact_from_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
501
|
-
end
|
502
|
-
return data, status_code, headers
|
503
|
-
end
|
504
|
-
# Update a list
|
505
|
-
# @param list_id Id of the list
|
506
|
-
# @param update_list Values to update a list
|
507
|
-
# @param [Hash] opts the optional parameters
|
508
|
-
# @return [nil]
|
509
|
-
def update_list(list_id, update_list, opts = {})
|
510
|
-
update_list_with_http_info(list_id, update_list, opts)
|
511
|
-
nil
|
512
|
-
end
|
513
|
-
|
514
|
-
# Update a list
|
515
|
-
# @param list_id Id of the list
|
516
|
-
# @param update_list Values to update a list
|
517
|
-
# @param [Hash] opts the optional parameters
|
518
|
-
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
519
|
-
def update_list_with_http_info(list_id, update_list, opts = {})
|
520
|
-
if @api_client.config.debugging
|
521
|
-
@api_client.config.logger.debug 'Calling API: ListsApi.update_list ...'
|
522
|
-
end
|
523
|
-
# verify the required parameter 'list_id' is set
|
524
|
-
if @api_client.config.client_side_validation && list_id.nil?
|
525
|
-
fail ArgumentError, "Missing the required parameter 'list_id' when calling ListsApi.update_list"
|
526
|
-
end
|
527
|
-
# verify the required parameter 'update_list' is set
|
528
|
-
if @api_client.config.client_side_validation && update_list.nil?
|
529
|
-
fail ArgumentError, "Missing the required parameter 'update_list' when calling ListsApi.update_list"
|
530
|
-
end
|
531
|
-
# resource path
|
532
|
-
local_var_path = '/contacts/lists/{listId}'.sub('{' + 'listId' + '}', list_id.to_s)
|
533
|
-
|
534
|
-
# query parameters
|
535
|
-
query_params = {}
|
536
|
-
|
537
|
-
# header parameters
|
538
|
-
header_params = {}
|
539
|
-
# HTTP header 'Accept' (if needed)
|
540
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
541
|
-
# HTTP header 'Content-Type'
|
542
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
543
|
-
|
544
|
-
# form parameters
|
545
|
-
form_params = {}
|
546
|
-
|
547
|
-
# http body (model)
|
548
|
-
post_body = @api_client.object_to_http_body(update_list)
|
549
|
-
auth_names = ['api-key', 'partner-key']
|
550
|
-
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
551
|
-
:header_params => header_params,
|
552
|
-
:query_params => query_params,
|
553
|
-
:form_params => form_params,
|
554
|
-
:body => post_body,
|
555
|
-
:auth_names => auth_names)
|
556
|
-
if @api_client.config.debugging
|
557
|
-
@api_client.config.logger.debug "API called: ListsApi#update_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
558
|
-
end
|
559
|
-
return data, status_code, headers
|
560
|
-
end
|
561
|
-
end
|
562
|
-
end
|
@@ -1,83 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#SendinBlue API
|
3
|
-
|
4
|
-
#SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable |
|
5
|
-
|
6
|
-
OpenAPI spec version: 3.0.0
|
7
|
-
Contact: contact@sendinblue.com
|
8
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.4.19
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'spec_helper'
|
14
|
-
require 'json'
|
15
|
-
|
16
|
-
# Unit tests for SibApiV3Sdk::AttributesApi
|
17
|
-
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
18
|
-
# Please update as you see appropriate
|
19
|
-
describe 'AttributesApi' do
|
20
|
-
before do
|
21
|
-
# run before each test
|
22
|
-
@instance = SibApiV3Sdk::AttributesApi.new
|
23
|
-
end
|
24
|
-
|
25
|
-
after do
|
26
|
-
# run after each test
|
27
|
-
end
|
28
|
-
|
29
|
-
describe 'test an instance of AttributesApi' do
|
30
|
-
it 'should create an instance of AttributesApi' do
|
31
|
-
expect(@instance).to be_instance_of(SibApiV3Sdk::AttributesApi)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
# unit tests for create_attribute
|
36
|
-
# Create contact attribute
|
37
|
-
# @param attribute_category Category of the attribute
|
38
|
-
# @param attribute_name Name of the attribute
|
39
|
-
# @param create_attribute Values to create an attribute
|
40
|
-
# @param [Hash] opts the optional parameters
|
41
|
-
# @return [nil]
|
42
|
-
describe 'create_attribute test' do
|
43
|
-
it 'should work' do
|
44
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
# unit tests for delete_attribute
|
49
|
-
# Delete an attribute
|
50
|
-
# @param attribute_category Category of the attribute
|
51
|
-
# @param attribute_name Name of the existing attribute
|
52
|
-
# @param [Hash] opts the optional parameters
|
53
|
-
# @return [nil]
|
54
|
-
describe 'delete_attribute test' do
|
55
|
-
it 'should work' do
|
56
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
# unit tests for get_attributes
|
61
|
-
# List all attributes
|
62
|
-
# @param [Hash] opts the optional parameters
|
63
|
-
# @return [GetAttributes]
|
64
|
-
describe 'get_attributes test' do
|
65
|
-
it 'should work' do
|
66
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
# unit tests for update_attribute
|
71
|
-
# Update contact attribute
|
72
|
-
# @param attribute_category Category of the attribute
|
73
|
-
# @param attribute_name Name of the existing attribute
|
74
|
-
# @param update_attribute Values to update an attribute
|
75
|
-
# @param [Hash] opts the optional parameters
|
76
|
-
# @return [nil]
|
77
|
-
describe 'update_attribute test' do
|
78
|
-
it 'should work' do
|
79
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
end
|