MailchimpMarketing 3.0.1 → 3.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/MailchimpMarketing.gemspec +1 -1
- data/README.md +55 -46
- data/lib/MailchimpMarketing.rb +5 -6
- data/lib/MailchimpMarketing/api/activity_feed_api.rb +13 -69
- data/lib/MailchimpMarketing/api/authorized_apps_api.rb +20 -113
- data/lib/MailchimpMarketing/api/automations_api.rb +130 -685
- data/lib/MailchimpMarketing/api/batch_webhooks_api.rb +33 -182
- data/lib/MailchimpMarketing/api/batches_api.rb +26 -146
- data/lib/MailchimpMarketing/api/campaign_folders_api.rb +33 -182
- data/lib/MailchimpMarketing/api/campaigns_api.rb +144 -803
- data/lib/MailchimpMarketing/api/connected_sites_api.rb +32 -179
- data/lib/MailchimpMarketing/api/conversations_api.rb +36 -205
- data/lib/MailchimpMarketing/api/dashboard_api.rb +32 -221
- data/lib/MailchimpMarketing/api/ecommerce_api.rb +447 -2312
- data/lib/MailchimpMarketing/api/external_auths_api.rb +20 -113
- data/lib/MailchimpMarketing/api/facebook_ads_api.rb +16 -83
- data/lib/MailchimpMarketing/api/file_manager_api.rb +71 -413
- data/lib/MailchimpMarketing/api/landing_pages_api.rb +51 -286
- data/lib/MailchimpMarketing/api/lists_api.rb +721 -2876
- data/lib/MailchimpMarketing/api/ping_api.rb +7 -33
- data/lib/MailchimpMarketing/api/postcards_api.rb +9 -41
- data/lib/MailchimpMarketing/api/reporting_api.rb +41 -237
- data/lib/MailchimpMarketing/api/reports_api.rb +153 -903
- data/lib/MailchimpMarketing/api/root_api.rb +7 -37
- data/lib/MailchimpMarketing/api/search_campaigns_api.rb +8 -39
- data/lib/MailchimpMarketing/api/search_members_api.rb +8 -41
- data/lib/MailchimpMarketing/api/template_folders_api.rb +33 -182
- data/lib/MailchimpMarketing/api/templates_api.rb +40 -234
- data/lib/MailchimpMarketing/api/verified_domains_api.rb +32 -170
- data/lib/MailchimpMarketing/api_client.rb +94 -64
- data/lib/MailchimpMarketing/api_error.rb +4 -4
- data/lib/MailchimpMarketing/configuration.rb +1 -1
- data/lib/MailchimpMarketing/version.rb +2 -2
- metadata +2 -2
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
5
5
|
|
6
|
-
OpenAPI spec version: 3.0.
|
6
|
+
OpenAPI spec version: 3.0.8
|
7
7
|
Contact: apihelp@mailchimp.com
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
9
|
Swagger Codegen version: 2.4.12
|
@@ -11,6 +11,7 @@ Swagger Codegen version: 2.4.12
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'uri'
|
14
|
+
require 'json'
|
14
15
|
|
15
16
|
module MailchimpMarketing
|
16
17
|
class TemplatesApi
|
@@ -19,89 +20,28 @@ module MailchimpMarketing
|
|
19
20
|
def initialize(api_client)
|
20
21
|
@api_client = api_client
|
21
22
|
end
|
22
|
-
# Delete a specific template
|
23
|
-
# Delete a specific template.
|
24
|
-
# @param template_id The unique id for the template.
|
25
|
-
# @param [Hash] opts the optional parameters
|
26
|
-
# @return [nil]
|
27
|
-
def delete_template(template_id = {}, opts = {})
|
28
|
-
delete_template_with_http_info(template_id, opts)
|
29
|
-
nil
|
30
|
-
end
|
31
23
|
|
32
|
-
# Delete
|
33
|
-
|
34
|
-
|
35
|
-
# @param [Hash] opts the optional parameters
|
36
|
-
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
37
|
-
def delete_template_with_http_info(template_id, opts = {})
|
38
|
-
# resource path
|
39
|
-
local_var_path = '/templates/{template_id}'.sub('{' + 'template_id' + '}', template_id.to_s)
|
24
|
+
# Delete template
|
25
|
+
def delete_template(template_id, opts = {})
|
26
|
+
fail ArgumentError, "Missing required param: 'template_id'" if template_id.nil?
|
40
27
|
|
41
|
-
# query parameters
|
42
28
|
query_params = {}
|
43
|
-
|
44
|
-
# header parameters
|
45
|
-
header_params = {}
|
46
|
-
# HTTP header 'Accept' (if needed)
|
47
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
|
48
|
-
# HTTP header 'Content-Type'
|
49
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
50
|
-
|
51
|
-
# form parameters
|
52
29
|
form_params = {}
|
53
|
-
|
54
|
-
# http body (model)
|
55
30
|
post_body = nil
|
56
|
-
|
31
|
+
|
32
|
+
local_var_path = '/templates/{template_id}'.sub('{' + 'template_id' + '}', template_id.to_s)
|
57
33
|
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
58
|
-
:header_params => header_params,
|
59
34
|
:query_params => query_params,
|
60
35
|
:form_params => form_params,
|
61
|
-
:body => post_body
|
62
|
-
:auth_names => auth_names)
|
36
|
+
:body => post_body)
|
63
37
|
return data, status_code, headers
|
64
38
|
end
|
65
|
-
# Get all templates
|
66
|
-
# Get a list of an account's available templates.
|
67
|
-
# @param [Hash] opts the optional parameters
|
68
|
-
# @option opts [Array<String>] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.
|
69
|
-
# @option opts [Array<String>] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.
|
70
|
-
# @option opts [Integer] :count The number of records to return. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **10**. [Maximum value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **1000** (default to 10)
|
71
|
-
# @option opts [Integer] :offset The number of records from a collection to skip. Iterating over large collections with this parameter can be slow. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **0**. (default to 0)
|
72
|
-
# @option opts [String] :created_by The Mailchimp account user who created the template.
|
73
|
-
# @option opts [String] :since_created_at Restrict the response to templates created after the set date. We recommend [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time format: 2015-10-21T15:41:36+00:00.
|
74
|
-
# @option opts [String] :before_created_at Restrict the response to templates created before the set date. We recommend [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time format: 2015-10-21T15:41:36+00:00.
|
75
|
-
# @option opts [String] :type Limit results based on template type.
|
76
|
-
# @option opts [String] :category Limit results based on category.
|
77
|
-
# @option opts [String] :folder_id The unique folder id.
|
78
|
-
# @option opts [String] :sort_field Returns user templates sorted by the specified field.
|
79
|
-
# @return [Templates]
|
80
|
-
def list(opts = {})
|
81
|
-
data, _status_code, _headers = list_with_http_info(opts)
|
82
|
-
data
|
83
|
-
end
|
84
39
|
|
85
|
-
#
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
# @option opts [Array<String>] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.
|
90
|
-
# @option opts [Integer] :count The number of records to return. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **10**. [Maximum value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **1000**
|
91
|
-
# @option opts [Integer] :offset The number of records from a collection to skip. Iterating over large collections with this parameter can be slow. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **0**.
|
92
|
-
# @option opts [String] :created_by The Mailchimp account user who created the template.
|
93
|
-
# @option opts [String] :since_created_at Restrict the response to templates created after the set date. We recommend [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time format: 2015-10-21T15:41:36+00:00.
|
94
|
-
# @option opts [String] :before_created_at Restrict the response to templates created before the set date. We recommend [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time format: 2015-10-21T15:41:36+00:00.
|
95
|
-
# @option opts [String] :type Limit results based on template type.
|
96
|
-
# @option opts [String] :category Limit results based on category.
|
97
|
-
# @option opts [String] :folder_id The unique folder id.
|
98
|
-
# @option opts [String] :sort_field Returns user templates sorted by the specified field.
|
99
|
-
# @return [Array<(Templates, Fixnum, Hash)>] Templates data, response status code and response headers
|
100
|
-
def list_with_http_info(opts = {})
|
101
|
-
# resource path
|
102
|
-
local_var_path = '/templates'
|
40
|
+
# List templates
|
41
|
+
def list(opts = {})
|
42
|
+
fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000
|
43
|
+
fail ArgumentError, 'invalid value for "sort_field", must be one of date_created, name' if opts[:'sort_field'] && !['date_created', 'name'].include?(opts[:'sort_field'])
|
103
44
|
|
104
|
-
# query parameters
|
105
45
|
query_params = {}
|
106
46
|
query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
|
107
47
|
query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
|
@@ -114,217 +54,83 @@ module MailchimpMarketing
|
|
114
54
|
query_params[:'category'] = opts[:'category'] if !opts[:'category'].nil?
|
115
55
|
query_params[:'folder_id'] = opts[:'folder_id'] if !opts[:'folder_id'].nil?
|
116
56
|
query_params[:'sort_field'] = opts[:'sort_field'] if !opts[:'sort_field'].nil?
|
117
|
-
|
118
|
-
# header parameters
|
119
|
-
header_params = {}
|
120
|
-
# HTTP header 'Accept' (if needed)
|
121
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
|
122
|
-
# HTTP header 'Content-Type'
|
123
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
124
|
-
|
125
|
-
# form parameters
|
126
57
|
form_params = {}
|
127
|
-
|
128
|
-
# http body (model)
|
129
58
|
post_body = nil
|
130
|
-
|
59
|
+
|
60
|
+
local_var_path = '/templates'
|
131
61
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
132
|
-
:header_params => header_params,
|
133
62
|
:query_params => query_params,
|
134
63
|
:form_params => form_params,
|
135
|
-
:body => post_body
|
136
|
-
:auth_names => auth_names,
|
137
|
-
:return_type => 'Templates')
|
64
|
+
:body => post_body)
|
138
65
|
return data, status_code, headers
|
139
66
|
end
|
140
|
-
# Get information about a specific template
|
141
|
-
# Get information about a specific template.
|
142
|
-
# @param template_id The unique id for the template.
|
143
|
-
# @param [Hash] opts the optional parameters
|
144
|
-
# @option opts [Array<String>] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.
|
145
|
-
# @option opts [Array<String>] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.
|
146
|
-
# @return [TemplateInstance]
|
147
|
-
def get_template(template_id = {}, opts = {})
|
148
|
-
data, _status_code, _headers = get_template_with_http_info(template_id, opts)
|
149
|
-
data
|
150
|
-
end
|
151
67
|
|
152
|
-
# Get
|
153
|
-
|
154
|
-
|
155
|
-
# @param [Hash] opts the optional parameters
|
156
|
-
# @option opts [Array<String>] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.
|
157
|
-
# @option opts [Array<String>] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.
|
158
|
-
# @return [Array<(TemplateInstance, Fixnum, Hash)>] TemplateInstance data, response status code and response headers
|
159
|
-
def get_template_with_http_info(template_id, opts = {})
|
160
|
-
# resource path
|
161
|
-
local_var_path = '/templates/{template_id}'.sub('{' + 'template_id' + '}', template_id.to_s)
|
68
|
+
# Get template info
|
69
|
+
def get_template(template_id, opts = {})
|
70
|
+
fail ArgumentError, "Missing required param: 'template_id'" if template_id.nil?
|
162
71
|
|
163
|
-
# query parameters
|
164
72
|
query_params = {}
|
165
73
|
query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
|
166
74
|
query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
|
167
|
-
|
168
|
-
# header parameters
|
169
|
-
header_params = {}
|
170
|
-
# HTTP header 'Accept' (if needed)
|
171
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
|
172
|
-
# HTTP header 'Content-Type'
|
173
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
174
|
-
|
175
|
-
# form parameters
|
176
75
|
form_params = {}
|
177
|
-
|
178
|
-
# http body (model)
|
179
76
|
post_body = nil
|
180
|
-
|
77
|
+
|
78
|
+
local_var_path = '/templates/{template_id}'.sub('{' + 'template_id' + '}', template_id.to_s)
|
181
79
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
182
|
-
:header_params => header_params,
|
183
80
|
:query_params => query_params,
|
184
81
|
:form_params => form_params,
|
185
|
-
:body => post_body
|
186
|
-
:auth_names => auth_names,
|
187
|
-
:return_type => 'TemplateInstance')
|
82
|
+
:body => post_body)
|
188
83
|
return data, status_code, headers
|
189
84
|
end
|
190
|
-
# Get the default content for a template
|
191
|
-
# Get the sections that you can edit in a template, including each section's default content.
|
192
|
-
# @param template_id The unique id for the template.
|
193
|
-
# @param [Hash] opts the optional parameters
|
194
|
-
# @option opts [Array<String>] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.
|
195
|
-
# @option opts [Array<String>] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.
|
196
|
-
# @return [TemplateDefaultContent]
|
197
|
-
def get_default_content_for_template(template_id = {}, opts = {})
|
198
|
-
data, _status_code, _headers = get_default_content_for_template_with_http_info(template_id, opts)
|
199
|
-
data
|
200
|
-
end
|
201
85
|
|
202
|
-
#
|
203
|
-
|
204
|
-
|
205
|
-
# @param [Hash] opts the optional parameters
|
206
|
-
# @option opts [Array<String>] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.
|
207
|
-
# @option opts [Array<String>] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.
|
208
|
-
# @return [Array<(TemplateDefaultContent, Fixnum, Hash)>] TemplateDefaultContent data, response status code and response headers
|
209
|
-
def get_default_content_for_template_with_http_info(template_id, opts = {})
|
210
|
-
# resource path
|
211
|
-
local_var_path = '/templates/{template_id}/default-content'.sub('{' + 'template_id' + '}', template_id.to_s)
|
86
|
+
# View default content
|
87
|
+
def get_default_content_for_template(template_id, opts = {})
|
88
|
+
fail ArgumentError, "Missing required param: 'template_id'" if template_id.nil?
|
212
89
|
|
213
|
-
# query parameters
|
214
90
|
query_params = {}
|
215
91
|
query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
|
216
92
|
query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
|
217
|
-
|
218
|
-
# header parameters
|
219
|
-
header_params = {}
|
220
|
-
# HTTP header 'Accept' (if needed)
|
221
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
|
222
|
-
# HTTP header 'Content-Type'
|
223
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
224
|
-
|
225
|
-
# form parameters
|
226
93
|
form_params = {}
|
227
|
-
|
228
|
-
# http body (model)
|
229
94
|
post_body = nil
|
230
|
-
|
95
|
+
|
96
|
+
local_var_path = '/templates/{template_id}/default-content'.sub('{' + 'template_id' + '}', template_id.to_s)
|
231
97
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
232
|
-
:header_params => header_params,
|
233
98
|
:query_params => query_params,
|
234
99
|
:form_params => form_params,
|
235
|
-
:body => post_body
|
236
|
-
:auth_names => auth_names,
|
237
|
-
:return_type => 'TemplateDefaultContent')
|
100
|
+
:body => post_body)
|
238
101
|
return data, status_code, headers
|
239
102
|
end
|
240
|
-
# Update an existing template
|
241
|
-
# Update the name, HTML, or `folder_id` of an existing template.
|
242
|
-
# @param template_id The unique id for the template.
|
243
|
-
# @param body
|
244
|
-
# @param [Hash] opts the optional parameters
|
245
|
-
# @return [TemplateInstance]
|
246
|
-
def update_template(template_id = {}, body = {}, opts = {})
|
247
|
-
data, _status_code, _headers = update_template_with_http_info(template_id, body, opts)
|
248
|
-
data
|
249
|
-
end
|
250
103
|
|
251
|
-
# Update
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
# @param [Hash] opts the optional parameters
|
256
|
-
# @return [Array<(TemplateInstance, Fixnum, Hash)>] TemplateInstance data, response status code and response headers
|
257
|
-
def update_template_with_http_info(template_id, body, opts = {})
|
258
|
-
# resource path
|
259
|
-
local_var_path = '/templates/{template_id}'.sub('{' + 'template_id' + '}', template_id.to_s)
|
104
|
+
# Update template
|
105
|
+
def update_template(template_id, body, opts = {})
|
106
|
+
fail ArgumentError, "Missing required param: 'template_id'" if template_id.nil?
|
107
|
+
fail ArgumentError, "Missing required param: 'body'" if body.nil?
|
260
108
|
|
261
|
-
# query parameters
|
262
109
|
query_params = {}
|
263
|
-
|
264
|
-
# header parameters
|
265
|
-
header_params = {}
|
266
|
-
# HTTP header 'Accept' (if needed)
|
267
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
|
268
|
-
# HTTP header 'Content-Type'
|
269
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
270
|
-
|
271
|
-
# form parameters
|
272
110
|
form_params = {}
|
273
|
-
|
274
|
-
# http body (model)
|
275
111
|
post_body = @api_client.object_to_http_body(body)
|
276
|
-
|
112
|
+
|
113
|
+
local_var_path = '/templates/{template_id}'.sub('{' + 'template_id' + '}', template_id.to_s)
|
277
114
|
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
|
278
|
-
:header_params => header_params,
|
279
115
|
:query_params => query_params,
|
280
116
|
:form_params => form_params,
|
281
|
-
:body => post_body
|
282
|
-
:auth_names => auth_names,
|
283
|
-
:return_type => 'TemplateInstance')
|
117
|
+
:body => post_body)
|
284
118
|
return data, status_code, headers
|
285
119
|
end
|
286
|
-
# Create a new template
|
287
|
-
# Create a new template for the account. Only [Classic templates](https://mailchimp.com/help/types-of-templates/) are supported.
|
288
|
-
# @param body
|
289
|
-
# @param [Hash] opts the optional parameters
|
290
|
-
# @return [TemplateInstance]
|
291
|
-
def create(body = {}, opts = {})
|
292
|
-
data, _status_code, _headers = create_with_http_info(body, opts)
|
293
|
-
data
|
294
|
-
end
|
295
120
|
|
296
|
-
#
|
297
|
-
|
298
|
-
|
299
|
-
# @param [Hash] opts the optional parameters
|
300
|
-
# @return [Array<(TemplateInstance, Fixnum, Hash)>] TemplateInstance data, response status code and response headers
|
301
|
-
def create_with_http_info(body, opts = {})
|
302
|
-
# resource path
|
303
|
-
local_var_path = '/templates'
|
121
|
+
# Add template
|
122
|
+
def create(body, opts = {})
|
123
|
+
fail ArgumentError, "Missing required param: 'body'" if body.nil?
|
304
124
|
|
305
|
-
# query parameters
|
306
125
|
query_params = {}
|
307
|
-
|
308
|
-
# header parameters
|
309
|
-
header_params = {}
|
310
|
-
# HTTP header 'Accept' (if needed)
|
311
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
|
312
|
-
# HTTP header 'Content-Type'
|
313
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
314
|
-
|
315
|
-
# form parameters
|
316
126
|
form_params = {}
|
317
|
-
|
318
|
-
# http body (model)
|
319
127
|
post_body = @api_client.object_to_http_body(body)
|
320
|
-
|
128
|
+
|
129
|
+
local_var_path = '/templates'
|
321
130
|
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
322
|
-
:header_params => header_params,
|
323
131
|
:query_params => query_params,
|
324
132
|
:form_params => form_params,
|
325
|
-
:body => post_body
|
326
|
-
:auth_names => auth_names,
|
327
|
-
:return_type => 'TemplateInstance')
|
133
|
+
:body => post_body)
|
328
134
|
return data, status_code, headers
|
329
135
|
end
|
330
136
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
5
5
|
|
6
|
-
OpenAPI spec version: 3.0.
|
6
|
+
OpenAPI spec version: 3.0.8
|
7
7
|
Contact: apihelp@mailchimp.com
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
9
|
Swagger Codegen version: 2.4.12
|
@@ -11,6 +11,7 @@ Swagger Codegen version: 2.4.12
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'uri'
|
14
|
+
require 'json'
|
14
15
|
|
15
16
|
module MailchimpMarketing
|
16
17
|
class VerifiedDomainsApi
|
@@ -19,223 +20,84 @@ module MailchimpMarketing
|
|
19
20
|
def initialize(api_client)
|
20
21
|
@api_client = api_client
|
21
22
|
end
|
22
|
-
# Add a domain to the account, triggering a verification e-mail to the provided address.
|
23
|
-
# Add a domain to the account.
|
24
|
-
# @param body
|
25
|
-
# @param [Hash] opts the optional parameters
|
26
|
-
# @return [VerifiedDomains]
|
27
|
-
def create_verified_domain(body = {}, opts = {})
|
28
|
-
data, _status_code, _headers = create_verified_domain_with_http_info(body, opts)
|
29
|
-
data
|
30
|
-
end
|
31
23
|
|
32
|
-
# Add
|
33
|
-
|
34
|
-
|
35
|
-
# @param [Hash] opts the optional parameters
|
36
|
-
# @return [Array<(VerifiedDomains, Fixnum, Hash)>] VerifiedDomains data, response status code and response headers
|
37
|
-
def create_verified_domain_with_http_info(body, opts = {})
|
38
|
-
# resource path
|
39
|
-
local_var_path = '/verified-domains'
|
24
|
+
# Add domain to account
|
25
|
+
def create_verified_domain(body, opts = {})
|
26
|
+
fail ArgumentError, "Missing required param: 'body'" if body.nil?
|
40
27
|
|
41
|
-
# query parameters
|
42
28
|
query_params = {}
|
43
|
-
|
44
|
-
# header parameters
|
45
|
-
header_params = {}
|
46
|
-
# HTTP header 'Accept' (if needed)
|
47
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
|
48
|
-
# HTTP header 'Content-Type'
|
49
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
50
|
-
|
51
|
-
# form parameters
|
52
29
|
form_params = {}
|
53
|
-
|
54
|
-
# http body (model)
|
55
30
|
post_body = @api_client.object_to_http_body(body)
|
56
|
-
|
31
|
+
|
32
|
+
local_var_path = '/verified-domains'
|
57
33
|
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
58
|
-
:header_params => header_params,
|
59
34
|
:query_params => query_params,
|
60
35
|
:form_params => form_params,
|
61
|
-
:body => post_body
|
62
|
-
:auth_names => auth_names,
|
63
|
-
:return_type => 'VerifiedDomains')
|
36
|
+
:body => post_body)
|
64
37
|
return data, status_code, headers
|
65
38
|
end
|
66
|
-
# Delete a verified domain
|
67
|
-
# Delete a verified domain from the account.
|
68
|
-
# @param domain_name The domain to be verified.
|
69
|
-
# @param [Hash] opts the optional parameters
|
70
|
-
# @return [nil]
|
71
|
-
def delete_domain(domain_name = {}, opts = {})
|
72
|
-
delete_domain_with_http_info(domain_name, opts)
|
73
|
-
nil
|
74
|
-
end
|
75
39
|
|
76
|
-
# Delete
|
77
|
-
|
78
|
-
|
79
|
-
# @param [Hash] opts the optional parameters
|
80
|
-
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
81
|
-
def delete_domain_with_http_info(domain_name, opts = {})
|
82
|
-
# resource path
|
83
|
-
local_var_path = '/verified-domains/{domain_name}'.sub('{' + 'domain_name' + '}', domain_name.to_s)
|
40
|
+
# Delete domain
|
41
|
+
def delete_domain(domain_name, opts = {})
|
42
|
+
fail ArgumentError, "Missing required param: 'domain_name'" if domain_name.nil?
|
84
43
|
|
85
|
-
# query parameters
|
86
44
|
query_params = {}
|
87
|
-
|
88
|
-
# header parameters
|
89
|
-
header_params = {}
|
90
|
-
# HTTP header 'Accept' (if needed)
|
91
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
|
92
|
-
# HTTP header 'Content-Type'
|
93
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
94
|
-
|
95
|
-
# form parameters
|
96
45
|
form_params = {}
|
97
|
-
|
98
|
-
# http body (model)
|
99
46
|
post_body = nil
|
100
|
-
|
47
|
+
|
48
|
+
local_var_path = '/verified-domains/{domain_name}'.sub('{' + 'domain_name' + '}', domain_name.to_s)
|
101
49
|
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
102
|
-
:header_params => header_params,
|
103
50
|
:query_params => query_params,
|
104
51
|
:form_params => form_params,
|
105
|
-
:body => post_body
|
106
|
-
:auth_names => auth_names)
|
52
|
+
:body => post_body)
|
107
53
|
return data, status_code, headers
|
108
54
|
end
|
109
|
-
# Get the details for a single domain on the account.
|
110
|
-
# Get the details for a single domain on the account.
|
111
|
-
# @param domain_name The domain to be verified.
|
112
|
-
# @param [Hash] opts the optional parameters
|
113
|
-
# @return [VerifiedDomains]
|
114
|
-
def get_domain(domain_name = {}, opts = {})
|
115
|
-
data, _status_code, _headers = get_domain_with_http_info(domain_name, opts)
|
116
|
-
data
|
117
|
-
end
|
118
55
|
|
119
|
-
# Get
|
120
|
-
|
121
|
-
|
122
|
-
# @param [Hash] opts the optional parameters
|
123
|
-
# @return [Array<(VerifiedDomains, Fixnum, Hash)>] VerifiedDomains data, response status code and response headers
|
124
|
-
def get_domain_with_http_info(domain_name, opts = {})
|
125
|
-
# resource path
|
126
|
-
local_var_path = '/verified-domains/{domain_name}'.sub('{' + 'domain_name' + '}', domain_name.to_s)
|
56
|
+
# Get domain info
|
57
|
+
def get_domain(domain_name, opts = {})
|
58
|
+
fail ArgumentError, "Missing required param: 'domain_name'" if domain_name.nil?
|
127
59
|
|
128
|
-
# query parameters
|
129
60
|
query_params = {}
|
130
|
-
|
131
|
-
# header parameters
|
132
|
-
header_params = {}
|
133
|
-
# HTTP header 'Accept' (if needed)
|
134
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
|
135
|
-
# HTTP header 'Content-Type'
|
136
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
137
|
-
|
138
|
-
# form parameters
|
139
61
|
form_params = {}
|
140
|
-
|
141
|
-
# http body (model)
|
142
62
|
post_body = nil
|
143
|
-
|
63
|
+
|
64
|
+
local_var_path = '/verified-domains/{domain_name}'.sub('{' + 'domain_name' + '}', domain_name.to_s)
|
144
65
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
145
|
-
:header_params => header_params,
|
146
66
|
:query_params => query_params,
|
147
67
|
:form_params => form_params,
|
148
|
-
:body => post_body
|
149
|
-
:auth_names => auth_names,
|
150
|
-
:return_type => 'VerifiedDomains')
|
68
|
+
:body => post_body)
|
151
69
|
return data, status_code, headers
|
152
70
|
end
|
153
|
-
# Get all of the sending domains on the account.
|
154
|
-
# Get all of the sending domains on the account.
|
155
|
-
# @param [Hash] opts the optional parameters
|
156
|
-
# @return [VerifiedDomains1]
|
157
|
-
def get_verified_domains_all(opts = {})
|
158
|
-
data, _status_code, _headers = get_verified_domains_all_with_http_info(opts)
|
159
|
-
data
|
160
|
-
end
|
161
71
|
|
162
|
-
#
|
163
|
-
|
164
|
-
# @param [Hash] opts the optional parameters
|
165
|
-
# @return [Array<(VerifiedDomains1, Fixnum, Hash)>] VerifiedDomains1 data, response status code and response headers
|
166
|
-
def get_verified_domains_all_with_http_info(opts = {})
|
167
|
-
# resource path
|
168
|
-
local_var_path = '/verified-domains'
|
72
|
+
# List sending domains
|
73
|
+
def get_verified_domains_all(opts = {})
|
169
74
|
|
170
|
-
# query parameters
|
171
75
|
query_params = {}
|
172
|
-
|
173
|
-
# header parameters
|
174
|
-
header_params = {}
|
175
|
-
# HTTP header 'Accept' (if needed)
|
176
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
|
177
|
-
# HTTP header 'Content-Type'
|
178
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
179
|
-
|
180
|
-
# form parameters
|
181
76
|
form_params = {}
|
182
|
-
|
183
|
-
# http body (model)
|
184
77
|
post_body = nil
|
185
|
-
|
78
|
+
|
79
|
+
local_var_path = '/verified-domains'
|
186
80
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
187
|
-
:header_params => header_params,
|
188
81
|
:query_params => query_params,
|
189
82
|
:form_params => form_params,
|
190
|
-
:body => post_body
|
191
|
-
:auth_names => auth_names,
|
192
|
-
:return_type => 'VerifiedDomains1')
|
83
|
+
:body => post_body)
|
193
84
|
return data, status_code, headers
|
194
85
|
end
|
195
|
-
# Submit a response to the verification challenge and verify a domain for sending.
|
196
|
-
# Verify a domain for sending.
|
197
|
-
# @param domain_name The domain to be verified.
|
198
|
-
# @param body
|
199
|
-
# @param [Hash] opts the optional parameters
|
200
|
-
# @return [VerifiedDomains]
|
201
|
-
def submit_domain_verification(domain_name = {}, body = {}, opts = {})
|
202
|
-
data, _status_code, _headers = submit_domain_verification_with_http_info(domain_name, body, opts)
|
203
|
-
data
|
204
|
-
end
|
205
86
|
|
206
|
-
#
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
# @param [Hash] opts the optional parameters
|
211
|
-
# @return [Array<(VerifiedDomains, Fixnum, Hash)>] VerifiedDomains data, response status code and response headers
|
212
|
-
def submit_domain_verification_with_http_info(domain_name, body, opts = {})
|
213
|
-
# resource path
|
214
|
-
local_var_path = '/verified-domains/{domain_name}/actions/verify'.sub('{' + 'domain_name' + '}', domain_name.to_s)
|
87
|
+
# Verify domain
|
88
|
+
def submit_domain_verification(domain_name, body, opts = {})
|
89
|
+
fail ArgumentError, "Missing required param: 'domain_name'" if domain_name.nil?
|
90
|
+
fail ArgumentError, "Missing required param: 'body'" if body.nil?
|
215
91
|
|
216
|
-
# query parameters
|
217
92
|
query_params = {}
|
218
|
-
|
219
|
-
# header parameters
|
220
|
-
header_params = {}
|
221
|
-
# HTTP header 'Accept' (if needed)
|
222
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
|
223
|
-
# HTTP header 'Content-Type'
|
224
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
225
|
-
|
226
|
-
# form parameters
|
227
93
|
form_params = {}
|
228
|
-
|
229
|
-
# http body (model)
|
230
94
|
post_body = @api_client.object_to_http_body(body)
|
231
|
-
|
95
|
+
|
96
|
+
local_var_path = '/verified-domains/{domain_name}/actions/verify'.sub('{' + 'domain_name' + '}', domain_name.to_s)
|
232
97
|
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
233
|
-
:header_params => header_params,
|
234
98
|
:query_params => query_params,
|
235
99
|
:form_params => form_params,
|
236
|
-
:body => post_body
|
237
|
-
:auth_names => auth_names,
|
238
|
-
:return_type => 'VerifiedDomains')
|
100
|
+
:body => post_body)
|
239
101
|
return data, status_code, headers
|
240
102
|
end
|
241
103
|
end
|