ruby-transmitsms 0.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/Gemfile +4 -0
- data/Gemfile.lock +49 -0
- data/LICENSE +22 -0
- data/README.md +62 -0
- data/Rakefile +7 -0
- data/fixtures/vcr_cassettes/account_api_get_balance.yml +49 -0
- data/fixtures/vcr_cassettes/email_sms_api_add_email.yml +49 -0
- data/fixtures/vcr_cassettes/email_sms_api_delete_email.yml +49 -0
- data/fixtures/vcr_cassettes/keywords_api_add_keyword.yml +49 -0
- data/fixtures/vcr_cassettes/keywords_api_edit_keyword.yml +49 -0
- data/fixtures/vcr_cassettes/keywords_api_get_keywords.yml +50 -0
- data/fixtures/vcr_cassettes/lists_api_add_list.yml +49 -0
- data/fixtures/vcr_cassettes/lists_api_add_to_list.yml +50 -0
- data/fixtures/vcr_cassettes/lists_api_delete_from_list.yml +49 -0
- data/fixtures/vcr_cassettes/lists_api_edit_list_member.yml +50 -0
- data/fixtures/vcr_cassettes/lists_api_get_list.yml +60 -0
- data/fixtures/vcr_cassettes/lists_api_get_lists.yml +61 -0
- data/fixtures/vcr_cassettes/lists_api_optout_list_member.yml +49 -0
- data/fixtures/vcr_cassettes/lists_api_remove_list.yml +49 -0
- data/fixtures/vcr_cassettes/numbers_api_get_number.yml +49 -0
- data/fixtures/vcr_cassettes/numbers_api_get_numbers.yml +49 -0
- data/fixtures/vcr_cassettes/numbers_api_lease_number.yml +50 -0
- data/fixtures/vcr_cassettes/resellers_api_add_client.yml +49 -0
- data/fixtures/vcr_cassettes/resellers_api_edit_client.yml +40 -0
- data/fixtures/vcr_cassettes/resellers_api_get_client.yml +50 -0
- data/fixtures/vcr_cassettes/resellers_api_get_clients.yml +59 -0
- data/fixtures/vcr_cassettes/resellers_api_get_transaction.yml +51 -0
- data/fixtures/vcr_cassettes/resellers_api_get_transactions.yml +61 -0
- data/fixtures/vcr_cassettes/sms_api_test_cancel_sms.yml +50 -0
- data/fixtures/vcr_cassettes/sms_api_test_format_number.yml +49 -0
- data/fixtures/vcr_cassettes/sms_api_test_format_number_fail_in_missing_msisdn.yml +50 -0
- data/fixtures/vcr_cassettes/sms_api_test_get_message_log.yml +50 -0
- data/fixtures/vcr_cassettes/sms_api_test_get_sms_info.yml +49 -0
- data/fixtures/vcr_cassettes/sms_api_test_get_sms_info_fail_for_not_existing_message_id.yml +50 -0
- data/fixtures/vcr_cassettes/sms_api_test_get_sms_responses.yml +53 -0
- data/fixtures/vcr_cassettes/sms_api_test_get_sms_sent.yml +50 -0
- data/fixtures/vcr_cassettes/sms_api_test_get_user_sms_responses.yml +49 -0
- data/fixtures/vcr_cassettes/sms_api_test_message_reply.yml +49 -0
- data/fixtures/vcr_cassettes/sms_api_test_send.yml +49 -0
- data/fixtures/vcr_cassettes/sms_api_test_send_missing_to_and_list_id.yml +50 -0
- data/fixtures/vcr_cassettes/sms_api_test_send_with_list_id.yml +50 -0
- data/geminstall.sh +1 -0
- data/lib/account_api.rb +80 -0
- data/lib/email_api.rb +137 -0
- data/lib/keywords_api.rb +224 -0
- data/lib/lists_api.rb +523 -0
- data/lib/monkey.rb +90 -0
- data/lib/numbers_api.rb +188 -0
- data/lib/resellers_api.rb +379 -0
- data/lib/ruby-transmitsms.rb +16 -0
- data/lib/sms_api.rb +550 -0
- data/lib/swagger.rb +84 -0
- data/lib/swagger/configuration.rb +22 -0
- data/lib/swagger/request.rb +212 -0
- data/lib/swagger/response.rb +70 -0
- data/lib/swagger/version.rb +4 -0
- data/ruby-transmitsms.gemspec +33 -0
- data/runtest.sh +8 -0
- data/setup.sh +1 -0
- data/spec/.resellers_api_spec.rb.swp +0 -0
- data/spec/account_api_spec.rb +30 -0
- data/spec/email_sms_api_spec.rb +40 -0
- data/spec/keywords_api_spec.rb +56 -0
- data/spec/lists_api_spec.rb +117 -0
- data/spec/numbers_api_spec.rb +53 -0
- data/spec/resellers_api_spec.rb +85 -0
- data/spec/sms_api_spec.rb +174 -0
- data/spec/spec.opts +4 -0
- metadata +219 -0
data/lib/lists_api.rb
ADDED
@@ -0,0 +1,523 @@
|
|
1
|
+
require "uri"
|
2
|
+
|
3
|
+
class ListsApi
|
4
|
+
basePath = "http://api.burst.dev.local/"
|
5
|
+
# apiInvoker = APIInvoker
|
6
|
+
|
7
|
+
def initialize(api_key, api_secret)
|
8
|
+
@api_key = api_key
|
9
|
+
@api_secret = api_secret
|
10
|
+
@sms_api = SmsApi
|
11
|
+
|
12
|
+
@api_key_secret = create_api_key_secret()
|
13
|
+
|
14
|
+
config_swagger()
|
15
|
+
end
|
16
|
+
|
17
|
+
def create_api_key_secret()
|
18
|
+
api_key_secret = Base64.encode64("#{@api_key}:#{@api_secret}")
|
19
|
+
"Basic #{api_key_secret}"
|
20
|
+
end
|
21
|
+
|
22
|
+
def config_swagger()
|
23
|
+
Swagger.configure do |config|
|
24
|
+
config.host = "http://api.burst.dev.local/".gsub("http://", "").gsub("/", "")
|
25
|
+
config.base_path = "/"
|
26
|
+
config.format = "x-www-form-urlencoded"
|
27
|
+
config.camelize_params = false
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
# Create a new list including the ability to add custom fields.
|
33
|
+
#
|
34
|
+
# @param name A unique name for the list
|
35
|
+
# @param field_1 Custom field value 1
|
36
|
+
# @param field_2 Custom field value 2
|
37
|
+
# @param field_3 Custom field value 3
|
38
|
+
# @param field_4 Custom field value 4
|
39
|
+
# @param field_5 Custom field value 5
|
40
|
+
# @param field_6 Custom field value 6
|
41
|
+
# @param field_7 Custom field value 7
|
42
|
+
# @param field_8 Custom field value 8
|
43
|
+
# @param field_9 Custom field value 9
|
44
|
+
# @param field_10 Custom field value 10
|
45
|
+
# @return void
|
46
|
+
def add_list (name = nil, field_1 = nil, field_2 = nil, field_3 = nil, field_4 = nil, field_5 = nil, field_6 = nil, field_7 = nil, field_8 = nil, field_9 = nil, field_10 = nil, opts={})
|
47
|
+
query_param_keys = [:name,:field_1,:field_2,:field_3,:field_4,:field_5,:field_6,:field_7,:field_8,:field_9,:field_10]
|
48
|
+
headerParams = {}
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
# set default values and merge with input
|
53
|
+
options = {
|
54
|
+
:'name' => name,
|
55
|
+
:'field_1' => field_1,
|
56
|
+
:'field_2' => field_2,
|
57
|
+
:'field_3' => field_3,
|
58
|
+
:'field_4' => field_4,
|
59
|
+
:'field_5' => field_5,
|
60
|
+
:'field_6' => field_6,
|
61
|
+
:'field_7' => field_7,
|
62
|
+
:'field_8' => field_8,
|
63
|
+
:'field_9' => field_9,
|
64
|
+
:'field_10' => field_10
|
65
|
+
|
66
|
+
}.merge(opts)
|
67
|
+
|
68
|
+
#resource path
|
69
|
+
path = "/add-list.json".sub('{format}','json')
|
70
|
+
|
71
|
+
# pull querystring keys from options
|
72
|
+
queryopts = options.select do |key,value|
|
73
|
+
query_param_keys.include? key
|
74
|
+
end
|
75
|
+
|
76
|
+
# header parameters
|
77
|
+
headers = {}
|
78
|
+
|
79
|
+
_header_accept = 'application/json'
|
80
|
+
if _header_accept != ''
|
81
|
+
headerParams['Accept'] = _header_accept
|
82
|
+
end
|
83
|
+
_header_content_type = ['application/x-www-form-urlencoded']
|
84
|
+
headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
headers[:'Authorization'] = @api_key_secret
|
89
|
+
|
90
|
+
# http body (model)
|
91
|
+
post_body = nil
|
92
|
+
|
93
|
+
# form parameters
|
94
|
+
form_parameter_hash = {}
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body, :form_params => form_parameter_hash }).make
|
99
|
+
|
100
|
+
|
101
|
+
end
|
102
|
+
|
103
|
+
# Get a list of numbers either leased by you or available to be leased.
|
104
|
+
#
|
105
|
+
# @param list_id ID of the list to add to
|
106
|
+
# @param msisdn Mobile number of the member
|
107
|
+
# @param first_name First name of the member
|
108
|
+
# @param last_name Last name of the member
|
109
|
+
# @param field_1 Custom field value 1
|
110
|
+
# @param field_2 Custom field value 2
|
111
|
+
# @param field_3 Custom field value 3
|
112
|
+
# @param field_4 Custom field value 4
|
113
|
+
# @param field_5 Custom field value 5
|
114
|
+
# @param field_6 Custom field value 6
|
115
|
+
# @param field_7 Custom field value 7
|
116
|
+
# @param field_8 Custom field value 8
|
117
|
+
# @param field_9 Custom field value 9
|
118
|
+
# @param field_10 Custom field value 10
|
119
|
+
# @return void
|
120
|
+
def add_to_list (list_id = nil, msisdn = nil, first_name = nil, last_name = nil, field_1 = nil, field_2 = nil, field_3 = nil, field_4 = nil, field_5 = nil, field_6 = nil, field_7 = nil, field_8 = nil, field_9 = nil, field_10 = nil, opts={})
|
121
|
+
query_param_keys = [:list_id,:msisdn,:first_name,:last_name,:field_1,:field_2,:field_3,:field_4,:field_5,:field_6,:field_7,:field_8,:field_9,:field_10]
|
122
|
+
headerParams = {}
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
# set default values and merge with input
|
127
|
+
options = {
|
128
|
+
:'list_id' => list_id,
|
129
|
+
:'msisdn' => msisdn,
|
130
|
+
:'first_name' => first_name,
|
131
|
+
:'last_name' => last_name,
|
132
|
+
:'field_1' => field_1,
|
133
|
+
:'field_2' => field_2,
|
134
|
+
:'field_3' => field_3,
|
135
|
+
:'field_4' => field_4,
|
136
|
+
:'field_5' => field_5,
|
137
|
+
:'field_6' => field_6,
|
138
|
+
:'field_7' => field_7,
|
139
|
+
:'field_8' => field_8,
|
140
|
+
:'field_9' => field_9,
|
141
|
+
:'field_10' => field_10
|
142
|
+
|
143
|
+
}.merge(opts)
|
144
|
+
|
145
|
+
#resource path
|
146
|
+
path = "/add-to-list.json".sub('{format}','json')
|
147
|
+
|
148
|
+
# pull querystring keys from options
|
149
|
+
queryopts = options.select do |key,value|
|
150
|
+
query_param_keys.include? key
|
151
|
+
end
|
152
|
+
|
153
|
+
# header parameters
|
154
|
+
headers = {}
|
155
|
+
|
156
|
+
_header_accept = 'application/json'
|
157
|
+
if _header_accept != ''
|
158
|
+
headerParams['Accept'] = _header_accept
|
159
|
+
end
|
160
|
+
_header_content_type = ['application/x-www-form-urlencoded']
|
161
|
+
headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
headers[:'Authorization'] = @api_key_secret
|
166
|
+
|
167
|
+
# http body (model)
|
168
|
+
post_body = nil
|
169
|
+
|
170
|
+
# form parameters
|
171
|
+
form_parameter_hash = {}
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body, :form_params => form_parameter_hash }).make
|
176
|
+
|
177
|
+
|
178
|
+
end
|
179
|
+
|
180
|
+
# Remove a member from one list or all lists.
|
181
|
+
#
|
182
|
+
# @param list_id ID of the list to remove from. If set to 0 (zero) the member will be removed from all lists.
|
183
|
+
# @param msisdn Mobile number of the member
|
184
|
+
# @return void
|
185
|
+
def delete_from_list (list_id = nil, msisdn = nil, opts={})
|
186
|
+
query_param_keys = [:list_id,:msisdn]
|
187
|
+
headerParams = {}
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
# set default values and merge with input
|
192
|
+
options = {
|
193
|
+
:'list_id' => list_id,
|
194
|
+
:'msisdn' => msisdn
|
195
|
+
|
196
|
+
}.merge(opts)
|
197
|
+
|
198
|
+
#resource path
|
199
|
+
path = "/delete-from-list.json".sub('{format}','json')
|
200
|
+
|
201
|
+
# pull querystring keys from options
|
202
|
+
queryopts = options.select do |key,value|
|
203
|
+
query_param_keys.include? key
|
204
|
+
end
|
205
|
+
|
206
|
+
# header parameters
|
207
|
+
headers = {}
|
208
|
+
|
209
|
+
_header_accept = 'application/json'
|
210
|
+
if _header_accept != ''
|
211
|
+
headerParams['Accept'] = _header_accept
|
212
|
+
end
|
213
|
+
_header_content_type = ['application/x-www-form-urlencoded']
|
214
|
+
headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
headers[:'Authorization'] = @api_key_secret
|
219
|
+
|
220
|
+
# http body (model)
|
221
|
+
post_body = nil
|
222
|
+
|
223
|
+
# form parameters
|
224
|
+
form_parameter_hash = {}
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body, :form_params => form_parameter_hash }).make
|
229
|
+
|
230
|
+
|
231
|
+
end
|
232
|
+
|
233
|
+
# Create a new list including the ability to add custom fields.
|
234
|
+
#
|
235
|
+
# @param list_id ID of the list the member belongs to
|
236
|
+
# @param msisdn Mobile number of the member to edit
|
237
|
+
# @param first_name First name of the member
|
238
|
+
# @param last_name Last name of the member
|
239
|
+
# @param field_1 Custom field value 1
|
240
|
+
# @param field_2 Custom field value 2
|
241
|
+
# @param field_3 Custom field value 3
|
242
|
+
# @param field_4 Custom field value 4
|
243
|
+
# @param field_5 Custom field value 5
|
244
|
+
# @param field_6 Custom field value 6
|
245
|
+
# @param field_7 Custom field value 7
|
246
|
+
# @param field_8 Custom field value 8
|
247
|
+
# @param field_9 Custom field value 9
|
248
|
+
# @param field_10 Custom field value 10
|
249
|
+
# @return void
|
250
|
+
def edit_list_member (list_id = nil, msisdn = nil, first_name = nil, last_name = nil, field_1 = nil, field_2 = nil, field_3 = nil, field_4 = nil, field_5 = nil, field_6 = nil, field_7 = nil, field_8 = nil, field_9 = nil, field_10 = nil, opts={})
|
251
|
+
query_param_keys = [:list_id,:msisdn,:first_name,:last_name,:field_1,:field_2,:field_3,:field_4,:field_5,:field_6,:field_7,:field_8,:field_9,:field_10]
|
252
|
+
headerParams = {}
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
# set default values and merge with input
|
257
|
+
options = {
|
258
|
+
:'list_id' => list_id,
|
259
|
+
:'msisdn' => msisdn,
|
260
|
+
:'first_name' => first_name,
|
261
|
+
:'last_name' => last_name,
|
262
|
+
:'field_1' => field_1,
|
263
|
+
:'field_2' => field_2,
|
264
|
+
:'field_3' => field_3,
|
265
|
+
:'field_4' => field_4,
|
266
|
+
:'field_5' => field_5,
|
267
|
+
:'field_6' => field_6,
|
268
|
+
:'field_7' => field_7,
|
269
|
+
:'field_8' => field_8,
|
270
|
+
:'field_9' => field_9,
|
271
|
+
:'field_10' => field_10
|
272
|
+
|
273
|
+
}.merge(opts)
|
274
|
+
|
275
|
+
#resource path
|
276
|
+
path = "/edit-list-member.json".sub('{format}','json')
|
277
|
+
|
278
|
+
# pull querystring keys from options
|
279
|
+
queryopts = options.select do |key,value|
|
280
|
+
query_param_keys.include? key
|
281
|
+
end
|
282
|
+
|
283
|
+
# header parameters
|
284
|
+
headers = {}
|
285
|
+
|
286
|
+
_header_accept = 'application/json'
|
287
|
+
if _header_accept != ''
|
288
|
+
headerParams['Accept'] = _header_accept
|
289
|
+
end
|
290
|
+
_header_content_type = ['application/x-www-form-urlencoded']
|
291
|
+
headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
headers[:'Authorization'] = @api_key_secret
|
296
|
+
|
297
|
+
# http body (model)
|
298
|
+
post_body = nil
|
299
|
+
|
300
|
+
# form parameters
|
301
|
+
form_parameter_hash = {}
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body, :form_params => form_parameter_hash }).make
|
306
|
+
|
307
|
+
|
308
|
+
end
|
309
|
+
|
310
|
+
# Get information about a list and its members.
|
311
|
+
#
|
312
|
+
# @param list_id List ID
|
313
|
+
# @param members Types of members to return. (active, inactive, all, none)
|
314
|
+
# @param page Page number, for pagination
|
315
|
+
# @param max Maximum results returned per page
|
316
|
+
# @return void
|
317
|
+
def get_list (list_id = nil, members = nil, page = nil, max = nil, opts={})
|
318
|
+
query_param_keys = [:list_id,:members,:page,:max]
|
319
|
+
headerParams = {}
|
320
|
+
|
321
|
+
|
322
|
+
|
323
|
+
# set default values and merge with input
|
324
|
+
options = {
|
325
|
+
:'list_id' => list_id,
|
326
|
+
:'members' => members,
|
327
|
+
:'page' => page,
|
328
|
+
:'max' => max
|
329
|
+
|
330
|
+
}.merge(opts)
|
331
|
+
|
332
|
+
#resource path
|
333
|
+
path = "/get-list.json".sub('{format}','json')
|
334
|
+
|
335
|
+
# pull querystring keys from options
|
336
|
+
queryopts = options.select do |key,value|
|
337
|
+
query_param_keys.include? key
|
338
|
+
end
|
339
|
+
|
340
|
+
# header parameters
|
341
|
+
headers = {}
|
342
|
+
|
343
|
+
_header_accept = 'application/json'
|
344
|
+
if _header_accept != ''
|
345
|
+
headerParams['Accept'] = _header_accept
|
346
|
+
end
|
347
|
+
_header_content_type = ['application/x-www-form-urlencoded']
|
348
|
+
headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'
|
349
|
+
|
350
|
+
|
351
|
+
|
352
|
+
headers[:'Authorization'] = @api_key_secret
|
353
|
+
|
354
|
+
# http body (model)
|
355
|
+
post_body = nil
|
356
|
+
|
357
|
+
# form parameters
|
358
|
+
form_parameter_hash = {}
|
359
|
+
|
360
|
+
|
361
|
+
|
362
|
+
Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body, :form_params => form_parameter_hash }).make
|
363
|
+
|
364
|
+
|
365
|
+
end
|
366
|
+
|
367
|
+
# Get the metadata of all your lists.
|
368
|
+
#
|
369
|
+
# @param page Page number, for pagination
|
370
|
+
# @param max Maximum results returned per page
|
371
|
+
# @return void
|
372
|
+
def get_lists (page = nil, max = nil, opts={})
|
373
|
+
query_param_keys = [:page,:max]
|
374
|
+
headerParams = {}
|
375
|
+
|
376
|
+
|
377
|
+
|
378
|
+
# set default values and merge with input
|
379
|
+
options = {
|
380
|
+
:'page' => page,
|
381
|
+
:'max' => max
|
382
|
+
|
383
|
+
}.merge(opts)
|
384
|
+
|
385
|
+
#resource path
|
386
|
+
path = "/get-lists.json".sub('{format}','json')
|
387
|
+
|
388
|
+
# pull querystring keys from options
|
389
|
+
queryopts = options.select do |key,value|
|
390
|
+
query_param_keys.include? key
|
391
|
+
end
|
392
|
+
|
393
|
+
# header parameters
|
394
|
+
headers = {}
|
395
|
+
|
396
|
+
_header_accept = 'application/json'
|
397
|
+
if _header_accept != ''
|
398
|
+
headerParams['Accept'] = _header_accept
|
399
|
+
end
|
400
|
+
_header_content_type = ['application/x-www-form-urlencoded']
|
401
|
+
headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
headers[:'Authorization'] = @api_key_secret
|
406
|
+
|
407
|
+
# http body (model)
|
408
|
+
post_body = nil
|
409
|
+
|
410
|
+
# form parameters
|
411
|
+
form_parameter_hash = {}
|
412
|
+
|
413
|
+
|
414
|
+
|
415
|
+
Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body, :form_params => form_parameter_hash }).make
|
416
|
+
|
417
|
+
|
418
|
+
end
|
419
|
+
|
420
|
+
# Get a list of numbers either leased by you or available to be leased.
|
421
|
+
#
|
422
|
+
# @param list_id ID of the list to opt the user out of. Set this to 0 (zero) to opt out of all of your lists.
|
423
|
+
# @param msisdn Mobile number of the member to opt out
|
424
|
+
# @return void
|
425
|
+
def optout_list_member (list_id = nil, msisdn = nil, opts={})
|
426
|
+
query_param_keys = [:list_id,:msisdn]
|
427
|
+
headerParams = {}
|
428
|
+
|
429
|
+
|
430
|
+
|
431
|
+
# set default values and merge with input
|
432
|
+
options = {
|
433
|
+
:'list_id' => list_id,
|
434
|
+
:'msisdn' => msisdn
|
435
|
+
|
436
|
+
}.merge(opts)
|
437
|
+
|
438
|
+
#resource path
|
439
|
+
path = "/optout-list-member.json".sub('{format}','json')
|
440
|
+
|
441
|
+
# pull querystring keys from options
|
442
|
+
queryopts = options.select do |key,value|
|
443
|
+
query_param_keys.include? key
|
444
|
+
end
|
445
|
+
|
446
|
+
# header parameters
|
447
|
+
headers = {}
|
448
|
+
|
449
|
+
_header_accept = 'application/json'
|
450
|
+
if _header_accept != ''
|
451
|
+
headerParams['Accept'] = _header_accept
|
452
|
+
end
|
453
|
+
_header_content_type = ['application/x-www-form-urlencoded']
|
454
|
+
headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'
|
455
|
+
|
456
|
+
|
457
|
+
|
458
|
+
headers[:'Authorization'] = @api_key_secret
|
459
|
+
|
460
|
+
# http body (model)
|
461
|
+
post_body = nil
|
462
|
+
|
463
|
+
# form parameters
|
464
|
+
form_parameter_hash = {}
|
465
|
+
|
466
|
+
|
467
|
+
|
468
|
+
Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body, :form_params => form_parameter_hash }).make
|
469
|
+
|
470
|
+
|
471
|
+
end
|
472
|
+
|
473
|
+
# Remove contact list.
|
474
|
+
#
|
475
|
+
# @param list_id ID of the list to remove.
|
476
|
+
# @return void
|
477
|
+
def remove_list (list_id = nil, opts={})
|
478
|
+
query_param_keys = [:list_id]
|
479
|
+
headerParams = {}
|
480
|
+
|
481
|
+
|
482
|
+
|
483
|
+
# set default values and merge with input
|
484
|
+
options = {
|
485
|
+
:'list_id' => list_id
|
486
|
+
|
487
|
+
}.merge(opts)
|
488
|
+
|
489
|
+
#resource path
|
490
|
+
path = "/remove-list.json".sub('{format}','json')
|
491
|
+
|
492
|
+
# pull querystring keys from options
|
493
|
+
queryopts = options.select do |key,value|
|
494
|
+
query_param_keys.include? key
|
495
|
+
end
|
496
|
+
|
497
|
+
# header parameters
|
498
|
+
headers = {}
|
499
|
+
|
500
|
+
_header_accept = 'application/json'
|
501
|
+
if _header_accept != ''
|
502
|
+
headerParams['Accept'] = _header_accept
|
503
|
+
end
|
504
|
+
_header_content_type = ['application/x-www-form-urlencoded']
|
505
|
+
headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'
|
506
|
+
|
507
|
+
|
508
|
+
|
509
|
+
headers[:'Authorization'] = @api_key_secret
|
510
|
+
|
511
|
+
# http body (model)
|
512
|
+
post_body = nil
|
513
|
+
|
514
|
+
# form parameters
|
515
|
+
form_parameter_hash = {}
|
516
|
+
|
517
|
+
|
518
|
+
|
519
|
+
Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body, :form_params => form_parameter_hash }).make
|
520
|
+
|
521
|
+
|
522
|
+
end
|
523
|
+
end
|