sib-api-v3-sdk 9.0.0 → 9.1.0
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 +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,274 +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 AttributesApi
|
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
|
-
# Create contact attribute
|
33
|
-
# @param attribute_category Category of the attribute
|
34
|
-
# @param attribute_name Name of the attribute
|
35
|
-
# @param create_attribute Values to create an attribute
|
36
|
-
# @param [Hash] opts the optional parameters
|
37
|
-
# @return [nil]
|
38
|
-
def create_attribute(attribute_category, attribute_name, create_attribute, opts = {})
|
39
|
-
create_attribute_with_http_info(attribute_category, attribute_name, create_attribute, opts)
|
40
|
-
nil
|
41
|
-
end
|
42
|
-
|
43
|
-
# Create contact attribute
|
44
|
-
# @param attribute_category Category of the attribute
|
45
|
-
# @param attribute_name Name of the attribute
|
46
|
-
# @param create_attribute Values to create an attribute
|
47
|
-
# @param [Hash] opts the optional parameters
|
48
|
-
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
49
|
-
def create_attribute_with_http_info(attribute_category, attribute_name, create_attribute, opts = {})
|
50
|
-
if @api_client.config.debugging
|
51
|
-
@api_client.config.logger.debug 'Calling API: AttributesApi.create_attribute ...'
|
52
|
-
end
|
53
|
-
# verify the required parameter 'attribute_category' is set
|
54
|
-
if @api_client.config.client_side_validation && attribute_category.nil?
|
55
|
-
fail ArgumentError, "Missing the required parameter 'attribute_category' when calling AttributesApi.create_attribute"
|
56
|
-
end
|
57
|
-
# verify enum value
|
58
|
-
if @api_client.config.client_side_validation && !['normal', 'transactional', 'category', 'calculated', 'global'].include?(attribute_category)
|
59
|
-
fail ArgumentError, "invalid value for 'attribute_category', must be one of normal, transactional, category, calculated, global"
|
60
|
-
end
|
61
|
-
# verify the required parameter 'attribute_name' is set
|
62
|
-
if @api_client.config.client_side_validation && attribute_name.nil?
|
63
|
-
fail ArgumentError, "Missing the required parameter 'attribute_name' when calling AttributesApi.create_attribute"
|
64
|
-
end
|
65
|
-
# verify the required parameter 'create_attribute' is set
|
66
|
-
if @api_client.config.client_side_validation && create_attribute.nil?
|
67
|
-
fail ArgumentError, "Missing the required parameter 'create_attribute' when calling AttributesApi.create_attribute"
|
68
|
-
end
|
69
|
-
# resource path
|
70
|
-
local_var_path = '/contacts/attributes/{attributeCategory}/{attributeName}'.sub('{' + 'attributeCategory' + '}', attribute_category.to_s).sub('{' + 'attributeName' + '}', attribute_name.to_s)
|
71
|
-
|
72
|
-
# query parameters
|
73
|
-
query_params = {}
|
74
|
-
|
75
|
-
# header parameters
|
76
|
-
header_params = {}
|
77
|
-
# HTTP header 'Accept' (if needed)
|
78
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
79
|
-
# HTTP header 'Content-Type'
|
80
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
81
|
-
|
82
|
-
# form parameters
|
83
|
-
form_params = {}
|
84
|
-
|
85
|
-
# http body (model)
|
86
|
-
post_body = @api_client.object_to_http_body(create_attribute)
|
87
|
-
auth_names = ['api-key', 'partner-key']
|
88
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
89
|
-
:header_params => header_params,
|
90
|
-
:query_params => query_params,
|
91
|
-
:form_params => form_params,
|
92
|
-
:body => post_body,
|
93
|
-
:auth_names => auth_names)
|
94
|
-
if @api_client.config.debugging
|
95
|
-
@api_client.config.logger.debug "API called: AttributesApi#create_attribute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
96
|
-
end
|
97
|
-
return data, status_code, headers
|
98
|
-
end
|
99
|
-
# Delete an attribute
|
100
|
-
# @param attribute_category Category of the attribute
|
101
|
-
# @param attribute_name Name of the existing attribute
|
102
|
-
# @param [Hash] opts the optional parameters
|
103
|
-
# @return [nil]
|
104
|
-
def delete_attribute(attribute_category, attribute_name, opts = {})
|
105
|
-
delete_attribute_with_http_info(attribute_category, attribute_name, opts)
|
106
|
-
nil
|
107
|
-
end
|
108
|
-
|
109
|
-
# Delete an attribute
|
110
|
-
# @param attribute_category Category of the attribute
|
111
|
-
# @param attribute_name Name of the existing attribute
|
112
|
-
# @param [Hash] opts the optional parameters
|
113
|
-
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
114
|
-
def delete_attribute_with_http_info(attribute_category, attribute_name, opts = {})
|
115
|
-
if @api_client.config.debugging
|
116
|
-
@api_client.config.logger.debug 'Calling API: AttributesApi.delete_attribute ...'
|
117
|
-
end
|
118
|
-
# verify the required parameter 'attribute_category' is set
|
119
|
-
if @api_client.config.client_side_validation && attribute_category.nil?
|
120
|
-
fail ArgumentError, "Missing the required parameter 'attribute_category' when calling AttributesApi.delete_attribute"
|
121
|
-
end
|
122
|
-
# verify enum value
|
123
|
-
if @api_client.config.client_side_validation && !['normal', 'transactional', 'category', 'calculated', 'global'].include?(attribute_category)
|
124
|
-
fail ArgumentError, "invalid value for 'attribute_category', must be one of normal, transactional, category, calculated, global"
|
125
|
-
end
|
126
|
-
# verify the required parameter 'attribute_name' is set
|
127
|
-
if @api_client.config.client_side_validation && attribute_name.nil?
|
128
|
-
fail ArgumentError, "Missing the required parameter 'attribute_name' when calling AttributesApi.delete_attribute"
|
129
|
-
end
|
130
|
-
# resource path
|
131
|
-
local_var_path = '/contacts/attributes/{attributeCategory}/{attributeName}'.sub('{' + 'attributeCategory' + '}', attribute_category.to_s).sub('{' + 'attributeName' + '}', attribute_name.to_s)
|
132
|
-
|
133
|
-
# query parameters
|
134
|
-
query_params = {}
|
135
|
-
|
136
|
-
# header parameters
|
137
|
-
header_params = {}
|
138
|
-
# HTTP header 'Accept' (if needed)
|
139
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
140
|
-
# HTTP header 'Content-Type'
|
141
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
142
|
-
|
143
|
-
# form parameters
|
144
|
-
form_params = {}
|
145
|
-
|
146
|
-
# http body (model)
|
147
|
-
post_body = nil
|
148
|
-
auth_names = ['api-key', 'partner-key']
|
149
|
-
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
150
|
-
:header_params => header_params,
|
151
|
-
:query_params => query_params,
|
152
|
-
:form_params => form_params,
|
153
|
-
:body => post_body,
|
154
|
-
:auth_names => auth_names)
|
155
|
-
if @api_client.config.debugging
|
156
|
-
@api_client.config.logger.debug "API called: AttributesApi#delete_attribute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
157
|
-
end
|
158
|
-
return data, status_code, headers
|
159
|
-
end
|
160
|
-
# List all attributes
|
161
|
-
# @param [Hash] opts the optional parameters
|
162
|
-
# @return [GetAttributes]
|
163
|
-
def get_attributes(opts = {})
|
164
|
-
data, _status_code, _headers = get_attributes_with_http_info(opts)
|
165
|
-
data
|
166
|
-
end
|
167
|
-
|
168
|
-
# List all attributes
|
169
|
-
# @param [Hash] opts the optional parameters
|
170
|
-
# @return [Array<(GetAttributes, Fixnum, Hash)>] GetAttributes data, response status code and response headers
|
171
|
-
def get_attributes_with_http_info(opts = {})
|
172
|
-
if @api_client.config.debugging
|
173
|
-
@api_client.config.logger.debug 'Calling API: AttributesApi.get_attributes ...'
|
174
|
-
end
|
175
|
-
# resource path
|
176
|
-
local_var_path = '/contacts/attributes'
|
177
|
-
|
178
|
-
# query parameters
|
179
|
-
query_params = {}
|
180
|
-
|
181
|
-
# header parameters
|
182
|
-
header_params = {}
|
183
|
-
# HTTP header 'Accept' (if needed)
|
184
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
185
|
-
# HTTP header 'Content-Type'
|
186
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
187
|
-
|
188
|
-
# form parameters
|
189
|
-
form_params = {}
|
190
|
-
|
191
|
-
# http body (model)
|
192
|
-
post_body = nil
|
193
|
-
auth_names = ['api-key', 'partner-key']
|
194
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
195
|
-
:header_params => header_params,
|
196
|
-
:query_params => query_params,
|
197
|
-
:form_params => form_params,
|
198
|
-
:body => post_body,
|
199
|
-
:auth_names => auth_names,
|
200
|
-
:return_type => 'GetAttributes')
|
201
|
-
if @api_client.config.debugging
|
202
|
-
@api_client.config.logger.debug "API called: AttributesApi#get_attributes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
203
|
-
end
|
204
|
-
return data, status_code, headers
|
205
|
-
end
|
206
|
-
# Update contact attribute
|
207
|
-
# @param attribute_category Category of the attribute
|
208
|
-
# @param attribute_name Name of the existing attribute
|
209
|
-
# @param update_attribute Values to update an attribute
|
210
|
-
# @param [Hash] opts the optional parameters
|
211
|
-
# @return [nil]
|
212
|
-
def update_attribute(attribute_category, attribute_name, update_attribute, opts = {})
|
213
|
-
update_attribute_with_http_info(attribute_category, attribute_name, update_attribute, opts)
|
214
|
-
nil
|
215
|
-
end
|
216
|
-
|
217
|
-
# Update contact attribute
|
218
|
-
# @param attribute_category Category of the attribute
|
219
|
-
# @param attribute_name Name of the existing attribute
|
220
|
-
# @param update_attribute Values to update an attribute
|
221
|
-
# @param [Hash] opts the optional parameters
|
222
|
-
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
223
|
-
def update_attribute_with_http_info(attribute_category, attribute_name, update_attribute, opts = {})
|
224
|
-
if @api_client.config.debugging
|
225
|
-
@api_client.config.logger.debug 'Calling API: AttributesApi.update_attribute ...'
|
226
|
-
end
|
227
|
-
# verify the required parameter 'attribute_category' is set
|
228
|
-
if @api_client.config.client_side_validation && attribute_category.nil?
|
229
|
-
fail ArgumentError, "Missing the required parameter 'attribute_category' when calling AttributesApi.update_attribute"
|
230
|
-
end
|
231
|
-
# verify enum value
|
232
|
-
if @api_client.config.client_side_validation && !['category', 'calculated', 'global'].include?(attribute_category)
|
233
|
-
fail ArgumentError, "invalid value for 'attribute_category', must be one of category, calculated, global"
|
234
|
-
end
|
235
|
-
# verify the required parameter 'attribute_name' is set
|
236
|
-
if @api_client.config.client_side_validation && attribute_name.nil?
|
237
|
-
fail ArgumentError, "Missing the required parameter 'attribute_name' when calling AttributesApi.update_attribute"
|
238
|
-
end
|
239
|
-
# verify the required parameter 'update_attribute' is set
|
240
|
-
if @api_client.config.client_side_validation && update_attribute.nil?
|
241
|
-
fail ArgumentError, "Missing the required parameter 'update_attribute' when calling AttributesApi.update_attribute"
|
242
|
-
end
|
243
|
-
# resource path
|
244
|
-
local_var_path = '/contacts/attributes/{attributeCategory}/{attributeName}'.sub('{' + 'attributeCategory' + '}', attribute_category.to_s).sub('{' + 'attributeName' + '}', attribute_name.to_s)
|
245
|
-
|
246
|
-
# query parameters
|
247
|
-
query_params = {}
|
248
|
-
|
249
|
-
# header parameters
|
250
|
-
header_params = {}
|
251
|
-
# HTTP header 'Accept' (if needed)
|
252
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
253
|
-
# HTTP header 'Content-Type'
|
254
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
255
|
-
|
256
|
-
# form parameters
|
257
|
-
form_params = {}
|
258
|
-
|
259
|
-
# http body (model)
|
260
|
-
post_body = @api_client.object_to_http_body(update_attribute)
|
261
|
-
auth_names = ['api-key', 'partner-key']
|
262
|
-
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
263
|
-
:header_params => header_params,
|
264
|
-
:query_params => query_params,
|
265
|
-
:form_params => form_params,
|
266
|
-
:body => post_body,
|
267
|
-
:auth_names => auth_names)
|
268
|
-
if @api_client.config.debugging
|
269
|
-
@api_client.config.logger.debug "API called: AttributesApi#update_attribute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
270
|
-
end
|
271
|
-
return data, status_code, headers
|
272
|
-
end
|
273
|
-
end
|
274
|
-
end
|
@@ -1,383 +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 FoldersApi
|
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
|
-
# Create a folder
|
33
|
-
# @param create_folder Name of the folder
|
34
|
-
# @param [Hash] opts the optional parameters
|
35
|
-
# @return [CreateModel]
|
36
|
-
def create_folder(create_folder, opts = {})
|
37
|
-
data, _status_code, _headers = create_folder_with_http_info(create_folder, opts)
|
38
|
-
data
|
39
|
-
end
|
40
|
-
|
41
|
-
# Create a folder
|
42
|
-
# @param create_folder Name of the folder
|
43
|
-
# @param [Hash] opts the optional parameters
|
44
|
-
# @return [Array<(CreateModel, Fixnum, Hash)>] CreateModel data, response status code and response headers
|
45
|
-
def create_folder_with_http_info(create_folder, opts = {})
|
46
|
-
if @api_client.config.debugging
|
47
|
-
@api_client.config.logger.debug 'Calling API: FoldersApi.create_folder ...'
|
48
|
-
end
|
49
|
-
# verify the required parameter 'create_folder' is set
|
50
|
-
if @api_client.config.client_side_validation && create_folder.nil?
|
51
|
-
fail ArgumentError, "Missing the required parameter 'create_folder' when calling FoldersApi.create_folder"
|
52
|
-
end
|
53
|
-
# resource path
|
54
|
-
local_var_path = '/contacts/folders'
|
55
|
-
|
56
|
-
# query parameters
|
57
|
-
query_params = {}
|
58
|
-
|
59
|
-
# header parameters
|
60
|
-
header_params = {}
|
61
|
-
# HTTP header 'Accept' (if needed)
|
62
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
63
|
-
# HTTP header 'Content-Type'
|
64
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
65
|
-
|
66
|
-
# form parameters
|
67
|
-
form_params = {}
|
68
|
-
|
69
|
-
# http body (model)
|
70
|
-
post_body = @api_client.object_to_http_body(create_folder)
|
71
|
-
auth_names = ['api-key', 'partner-key']
|
72
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
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 => 'CreateModel')
|
79
|
-
if @api_client.config.debugging
|
80
|
-
@api_client.config.logger.debug "API called: FoldersApi#create_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
81
|
-
end
|
82
|
-
return data, status_code, headers
|
83
|
-
end
|
84
|
-
# Delete a folder (and all its lists)
|
85
|
-
# @param folder_id Id of the folder
|
86
|
-
# @param [Hash] opts the optional parameters
|
87
|
-
# @return [nil]
|
88
|
-
def delete_folder(folder_id, opts = {})
|
89
|
-
delete_folder_with_http_info(folder_id, opts)
|
90
|
-
nil
|
91
|
-
end
|
92
|
-
|
93
|
-
# Delete a folder (and all its lists)
|
94
|
-
# @param folder_id Id of the folder
|
95
|
-
# @param [Hash] opts the optional parameters
|
96
|
-
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
97
|
-
def delete_folder_with_http_info(folder_id, opts = {})
|
98
|
-
if @api_client.config.debugging
|
99
|
-
@api_client.config.logger.debug 'Calling API: FoldersApi.delete_folder ...'
|
100
|
-
end
|
101
|
-
# verify the required parameter 'folder_id' is set
|
102
|
-
if @api_client.config.client_side_validation && folder_id.nil?
|
103
|
-
fail ArgumentError, "Missing the required parameter 'folder_id' when calling FoldersApi.delete_folder"
|
104
|
-
end
|
105
|
-
# resource path
|
106
|
-
local_var_path = '/contacts/folders/{folderId}'.sub('{' + 'folderId' + '}', folder_id.to_s)
|
107
|
-
|
108
|
-
# query parameters
|
109
|
-
query_params = {}
|
110
|
-
|
111
|
-
# header parameters
|
112
|
-
header_params = {}
|
113
|
-
# HTTP header 'Accept' (if needed)
|
114
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
115
|
-
# HTTP header 'Content-Type'
|
116
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
117
|
-
|
118
|
-
# form parameters
|
119
|
-
form_params = {}
|
120
|
-
|
121
|
-
# http body (model)
|
122
|
-
post_body = nil
|
123
|
-
auth_names = ['api-key', 'partner-key']
|
124
|
-
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
125
|
-
:header_params => header_params,
|
126
|
-
:query_params => query_params,
|
127
|
-
:form_params => form_params,
|
128
|
-
:body => post_body,
|
129
|
-
:auth_names => auth_names)
|
130
|
-
if @api_client.config.debugging
|
131
|
-
@api_client.config.logger.debug "API called: FoldersApi#delete_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
132
|
-
end
|
133
|
-
return data, status_code, headers
|
134
|
-
end
|
135
|
-
# Returns a folder's details
|
136
|
-
# @param folder_id id of the folder
|
137
|
-
# @param [Hash] opts the optional parameters
|
138
|
-
# @return [GetFolder]
|
139
|
-
def get_folder(folder_id, opts = {})
|
140
|
-
data, _status_code, _headers = get_folder_with_http_info(folder_id, opts)
|
141
|
-
data
|
142
|
-
end
|
143
|
-
|
144
|
-
# Returns a folder's details
|
145
|
-
# @param folder_id id of the folder
|
146
|
-
# @param [Hash] opts the optional parameters
|
147
|
-
# @return [Array<(GetFolder, Fixnum, Hash)>] GetFolder data, response status code and response headers
|
148
|
-
def get_folder_with_http_info(folder_id, opts = {})
|
149
|
-
if @api_client.config.debugging
|
150
|
-
@api_client.config.logger.debug 'Calling API: FoldersApi.get_folder ...'
|
151
|
-
end
|
152
|
-
# verify the required parameter 'folder_id' is set
|
153
|
-
if @api_client.config.client_side_validation && folder_id.nil?
|
154
|
-
fail ArgumentError, "Missing the required parameter 'folder_id' when calling FoldersApi.get_folder"
|
155
|
-
end
|
156
|
-
# resource path
|
157
|
-
local_var_path = '/contacts/folders/{folderId}'.sub('{' + 'folderId' + '}', folder_id.to_s)
|
158
|
-
|
159
|
-
# query parameters
|
160
|
-
query_params = {}
|
161
|
-
|
162
|
-
# header parameters
|
163
|
-
header_params = {}
|
164
|
-
# HTTP header 'Accept' (if needed)
|
165
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
166
|
-
# HTTP header 'Content-Type'
|
167
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
168
|
-
|
169
|
-
# form parameters
|
170
|
-
form_params = {}
|
171
|
-
|
172
|
-
# http body (model)
|
173
|
-
post_body = nil
|
174
|
-
auth_names = ['api-key', 'partner-key']
|
175
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
176
|
-
:header_params => header_params,
|
177
|
-
:query_params => query_params,
|
178
|
-
:form_params => form_params,
|
179
|
-
:body => post_body,
|
180
|
-
:auth_names => auth_names,
|
181
|
-
:return_type => 'GetFolder')
|
182
|
-
if @api_client.config.debugging
|
183
|
-
@api_client.config.logger.debug "API called: FoldersApi#get_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
184
|
-
end
|
185
|
-
return data, status_code, headers
|
186
|
-
end
|
187
|
-
# Get lists in a folder
|
188
|
-
# @param folder_id Id of the folder
|
189
|
-
# @param [Hash] opts the optional parameters
|
190
|
-
# @option opts [Integer] :limit Number of documents per page (default to 10)
|
191
|
-
# @option opts [Integer] :offset Index of the first document of the page (default to 0)
|
192
|
-
# @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)
|
193
|
-
# @return [GetFolderLists]
|
194
|
-
def get_folder_lists(folder_id, opts = {})
|
195
|
-
data, _status_code, _headers = get_folder_lists_with_http_info(folder_id, opts)
|
196
|
-
data
|
197
|
-
end
|
198
|
-
|
199
|
-
# Get lists in a folder
|
200
|
-
# @param folder_id Id of the folder
|
201
|
-
# @param [Hash] opts the optional parameters
|
202
|
-
# @option opts [Integer] :limit Number of documents per page
|
203
|
-
# @option opts [Integer] :offset Index of the first document of the page
|
204
|
-
# @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
|
205
|
-
# @return [Array<(GetFolderLists, Fixnum, Hash)>] GetFolderLists data, response status code and response headers
|
206
|
-
def get_folder_lists_with_http_info(folder_id, opts = {})
|
207
|
-
if @api_client.config.debugging
|
208
|
-
@api_client.config.logger.debug 'Calling API: FoldersApi.get_folder_lists ...'
|
209
|
-
end
|
210
|
-
# verify the required parameter 'folder_id' is set
|
211
|
-
if @api_client.config.client_side_validation && folder_id.nil?
|
212
|
-
fail ArgumentError, "Missing the required parameter 'folder_id' when calling FoldersApi.get_folder_lists"
|
213
|
-
end
|
214
|
-
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 50
|
215
|
-
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling FoldersApi.get_folder_lists, must be smaller than or equal to 50.'
|
216
|
-
end
|
217
|
-
|
218
|
-
if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort'])
|
219
|
-
fail ArgumentError, 'invalid value for "sort", must be one of asc, desc'
|
220
|
-
end
|
221
|
-
# resource path
|
222
|
-
local_var_path = '/contacts/folders/{folderId}/lists'.sub('{' + 'folderId' + '}', folder_id.to_s)
|
223
|
-
|
224
|
-
# query parameters
|
225
|
-
query_params = {}
|
226
|
-
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
227
|
-
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
228
|
-
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
229
|
-
|
230
|
-
# header parameters
|
231
|
-
header_params = {}
|
232
|
-
# HTTP header 'Accept' (if needed)
|
233
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
234
|
-
# HTTP header 'Content-Type'
|
235
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
236
|
-
|
237
|
-
# form parameters
|
238
|
-
form_params = {}
|
239
|
-
|
240
|
-
# http body (model)
|
241
|
-
post_body = nil
|
242
|
-
auth_names = ['api-key', 'partner-key']
|
243
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
244
|
-
:header_params => header_params,
|
245
|
-
:query_params => query_params,
|
246
|
-
:form_params => form_params,
|
247
|
-
:body => post_body,
|
248
|
-
:auth_names => auth_names,
|
249
|
-
:return_type => 'GetFolderLists')
|
250
|
-
if @api_client.config.debugging
|
251
|
-
@api_client.config.logger.debug "API called: FoldersApi#get_folder_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
252
|
-
end
|
253
|
-
return data, status_code, headers
|
254
|
-
end
|
255
|
-
# Get all folders
|
256
|
-
# @param limit Number of documents per page
|
257
|
-
# @param offset Index of the first document of the page
|
258
|
-
# @param [Hash] opts the optional parameters
|
259
|
-
# @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)
|
260
|
-
# @return [GetFolders]
|
261
|
-
def get_folders(limit, offset, opts = {})
|
262
|
-
data, _status_code, _headers = get_folders_with_http_info(limit, offset, opts)
|
263
|
-
data
|
264
|
-
end
|
265
|
-
|
266
|
-
# Get all folders
|
267
|
-
# @param limit Number of documents per page
|
268
|
-
# @param offset Index of the first document of the page
|
269
|
-
# @param [Hash] opts the optional parameters
|
270
|
-
# @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
|
271
|
-
# @return [Array<(GetFolders, Fixnum, Hash)>] GetFolders data, response status code and response headers
|
272
|
-
def get_folders_with_http_info(limit, offset, opts = {})
|
273
|
-
if @api_client.config.debugging
|
274
|
-
@api_client.config.logger.debug 'Calling API: FoldersApi.get_folders ...'
|
275
|
-
end
|
276
|
-
# verify the required parameter 'limit' is set
|
277
|
-
if @api_client.config.client_side_validation && limit.nil?
|
278
|
-
fail ArgumentError, "Missing the required parameter 'limit' when calling FoldersApi.get_folders"
|
279
|
-
end
|
280
|
-
if @api_client.config.client_side_validation && limit > 50
|
281
|
-
fail ArgumentError, 'invalid value for "limit" when calling FoldersApi.get_folders, must be smaller than or equal to 50.'
|
282
|
-
end
|
283
|
-
|
284
|
-
# verify the required parameter 'offset' is set
|
285
|
-
if @api_client.config.client_side_validation && offset.nil?
|
286
|
-
fail ArgumentError, "Missing the required parameter 'offset' when calling FoldersApi.get_folders"
|
287
|
-
end
|
288
|
-
if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort'])
|
289
|
-
fail ArgumentError, 'invalid value for "sort", must be one of asc, desc'
|
290
|
-
end
|
291
|
-
# resource path
|
292
|
-
local_var_path = '/contacts/folders'
|
293
|
-
|
294
|
-
# query parameters
|
295
|
-
query_params = {}
|
296
|
-
query_params[:'limit'] = limit
|
297
|
-
query_params[:'offset'] = offset
|
298
|
-
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
299
|
-
|
300
|
-
# header parameters
|
301
|
-
header_params = {}
|
302
|
-
# HTTP header 'Accept' (if needed)
|
303
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
304
|
-
# HTTP header 'Content-Type'
|
305
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
306
|
-
|
307
|
-
# form parameters
|
308
|
-
form_params = {}
|
309
|
-
|
310
|
-
# http body (model)
|
311
|
-
post_body = nil
|
312
|
-
auth_names = ['api-key', 'partner-key']
|
313
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
314
|
-
:header_params => header_params,
|
315
|
-
:query_params => query_params,
|
316
|
-
:form_params => form_params,
|
317
|
-
:body => post_body,
|
318
|
-
:auth_names => auth_names,
|
319
|
-
:return_type => 'GetFolders')
|
320
|
-
if @api_client.config.debugging
|
321
|
-
@api_client.config.logger.debug "API called: FoldersApi#get_folders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
322
|
-
end
|
323
|
-
return data, status_code, headers
|
324
|
-
end
|
325
|
-
# Update a folder
|
326
|
-
# @param folder_id Id of the folder
|
327
|
-
# @param update_folder Name of the folder
|
328
|
-
# @param [Hash] opts the optional parameters
|
329
|
-
# @return [nil]
|
330
|
-
def update_folder(folder_id, update_folder, opts = {})
|
331
|
-
update_folder_with_http_info(folder_id, update_folder, opts)
|
332
|
-
nil
|
333
|
-
end
|
334
|
-
|
335
|
-
# Update a folder
|
336
|
-
# @param folder_id Id of the folder
|
337
|
-
# @param update_folder Name of the folder
|
338
|
-
# @param [Hash] opts the optional parameters
|
339
|
-
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
340
|
-
def update_folder_with_http_info(folder_id, update_folder, opts = {})
|
341
|
-
if @api_client.config.debugging
|
342
|
-
@api_client.config.logger.debug 'Calling API: FoldersApi.update_folder ...'
|
343
|
-
end
|
344
|
-
# verify the required parameter 'folder_id' is set
|
345
|
-
if @api_client.config.client_side_validation && folder_id.nil?
|
346
|
-
fail ArgumentError, "Missing the required parameter 'folder_id' when calling FoldersApi.update_folder"
|
347
|
-
end
|
348
|
-
# verify the required parameter 'update_folder' is set
|
349
|
-
if @api_client.config.client_side_validation && update_folder.nil?
|
350
|
-
fail ArgumentError, "Missing the required parameter 'update_folder' when calling FoldersApi.update_folder"
|
351
|
-
end
|
352
|
-
# resource path
|
353
|
-
local_var_path = '/contacts/folders/{folderId}'.sub('{' + 'folderId' + '}', folder_id.to_s)
|
354
|
-
|
355
|
-
# query parameters
|
356
|
-
query_params = {}
|
357
|
-
|
358
|
-
# header parameters
|
359
|
-
header_params = {}
|
360
|
-
# HTTP header 'Accept' (if needed)
|
361
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
362
|
-
# HTTP header 'Content-Type'
|
363
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
364
|
-
|
365
|
-
# form parameters
|
366
|
-
form_params = {}
|
367
|
-
|
368
|
-
# http body (model)
|
369
|
-
post_body = @api_client.object_to_http_body(update_folder)
|
370
|
-
auth_names = ['api-key', 'partner-key']
|
371
|
-
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
372
|
-
:header_params => header_params,
|
373
|
-
:query_params => query_params,
|
374
|
-
:form_params => form_params,
|
375
|
-
:body => post_body,
|
376
|
-
:auth_names => auth_names)
|
377
|
-
if @api_client.config.debugging
|
378
|
-
@api_client.config.logger.debug "API called: FoldersApi#update_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
379
|
-
end
|
380
|
-
return data, status_code, headers
|
381
|
-
end
|
382
|
-
end
|
383
|
-
end
|