MailchimpTransactional 1.0.4

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.
@@ -0,0 +1,356 @@
1
+ =begin
2
+ #Mailchimp Transactional API
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 1.0.4
7
+ Contact: apihelp@mandrill.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.12
10
+
11
+ =end
12
+
13
+ require 'uri'
14
+
15
+ module MailchimpTransactional
16
+ class MessagesApi
17
+ attr_accessor :api_client
18
+
19
+ attr_accessor :api_key
20
+
21
+ def initialize(api_key = '', api_client = ApiClient.default)
22
+ @api_key = api_key
23
+ @api_client = api_client
24
+ end
25
+ # /messages/cancel-scheduled
26
+ # Queries your scheduled emails.
27
+ # @param body
28
+ # @param [Hash] opts the optional parameters
29
+ # @return [Array<InlineResponse20032>]
30
+ def cancel_scheduled(body = {}, opts = {})
31
+ data, _status_code, _headers = cancel_scheduled_with_http_info(body, opts)
32
+ data
33
+ end
34
+
35
+ # /messages/cancel-scheduled
36
+ # Queries your scheduled emails.
37
+ # @param body
38
+ # @param [Hash] opts the optional parameters
39
+ # @return [Array<(Array<InlineResponse20032>, Fixnum, Hash)>] Array<InlineResponse20032> data, response status code and response headers
40
+ def cancel_scheduled_with_http_info(body, opts = {})
41
+ # add api key to request body
42
+ body[:key] = @api_key
43
+
44
+ # resource path
45
+ local_var_path = '/messages/cancel-scheduled'
46
+
47
+ # http body (model)
48
+ auth_names = []
49
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
50
+ :body => body,
51
+ :auth_names => auth_names,
52
+ :return_type => 'Array<InlineResponse20032>')
53
+ return data, status_code, headers
54
+ end
55
+ # /messages/content
56
+ # Get the full content of a recently sent message
57
+ # @param body
58
+ # @param [Hash] opts the optional parameters
59
+ # @return [InlineResponse20030]
60
+ def content(body = {}, opts = {})
61
+ data, _status_code, _headers = content_with_http_info(body, opts)
62
+ data
63
+ end
64
+
65
+ # /messages/content
66
+ # Get the full content of a recently sent message
67
+ # @param body
68
+ # @param [Hash] opts the optional parameters
69
+ # @return [Array<(InlineResponse20030, Fixnum, Hash)>] InlineResponse20030 data, response status code and response headers
70
+ def content_with_http_info(body, opts = {})
71
+ # add api key to request body
72
+ body[:key] = @api_key
73
+
74
+ # resource path
75
+ local_var_path = '/messages/content'
76
+
77
+ # http body (model)
78
+ auth_names = []
79
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
80
+ :body => body,
81
+ :auth_names => auth_names,
82
+ :return_type => 'InlineResponse20030')
83
+ return data, status_code, headers
84
+ end
85
+ # /messages/info
86
+ # Get the information for a single recently sent message
87
+ # @param body
88
+ # @param [Hash] opts the optional parameters
89
+ # @return [InlineResponse20029]
90
+ def info(body = {}, opts = {})
91
+ data, _status_code, _headers = info_with_http_info(body, opts)
92
+ data
93
+ end
94
+
95
+ # /messages/info
96
+ # Get the information for a single recently sent message
97
+ # @param body
98
+ # @param [Hash] opts the optional parameters
99
+ # @return [Array<(InlineResponse20029, Fixnum, Hash)>] InlineResponse20029 data, response status code and response headers
100
+ def info_with_http_info(body, opts = {})
101
+ # add api key to request body
102
+ body[:key] = @api_key
103
+
104
+ # resource path
105
+ local_var_path = '/messages/info'
106
+
107
+ # http body (model)
108
+ auth_names = []
109
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
110
+ :body => body,
111
+ :auth_names => auth_names,
112
+ :return_type => 'InlineResponse20029')
113
+ return data, status_code, headers
114
+ end
115
+ # /messages/list-scheduled
116
+ # Queries your scheduled emails.
117
+ # @param body
118
+ # @param [Hash] opts the optional parameters
119
+ # @return [Array<InlineResponse20032>]
120
+ def list_scheduled(body = {}, opts = {})
121
+ data, _status_code, _headers = list_scheduled_with_http_info(body, opts)
122
+ data
123
+ end
124
+
125
+ # /messages/list-scheduled
126
+ # Queries your scheduled emails.
127
+ # @param body
128
+ # @param [Hash] opts the optional parameters
129
+ # @return [Array<(Array<InlineResponse20032>, Fixnum, Hash)>] Array<InlineResponse20032> data, response status code and response headers
130
+ def list_scheduled_with_http_info(body, opts = {})
131
+ # add api key to request body
132
+ body[:key] = @api_key
133
+
134
+ # resource path
135
+ local_var_path = '/messages/list-scheduled'
136
+
137
+ # http body (model)
138
+ auth_names = []
139
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
140
+ :body => body,
141
+ :auth_names => auth_names,
142
+ :return_type => 'Array<InlineResponse20032>')
143
+ return data, status_code, headers
144
+ end
145
+ # /messages/parse
146
+ # Parse the full MIME document for an email message, returning the content of the message broken into its constituent pieces
147
+ # @param body
148
+ # @param [Hash] opts the optional parameters
149
+ # @return [InlineResponse20031]
150
+ def parse(body = {}, opts = {})
151
+ data, _status_code, _headers = parse_with_http_info(body, opts)
152
+ data
153
+ end
154
+
155
+ # /messages/parse
156
+ # Parse the full MIME document for an email message, returning the content of the message broken into its constituent pieces
157
+ # @param body
158
+ # @param [Hash] opts the optional parameters
159
+ # @return [Array<(InlineResponse20031, Fixnum, Hash)>] InlineResponse20031 data, response status code and response headers
160
+ def parse_with_http_info(body, opts = {})
161
+ # add api key to request body
162
+ body[:key] = @api_key
163
+
164
+ # resource path
165
+ local_var_path = '/messages/parse'
166
+
167
+ # http body (model)
168
+ auth_names = []
169
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
170
+ :body => body,
171
+ :auth_names => auth_names,
172
+ :return_type => 'InlineResponse20031')
173
+ return data, status_code, headers
174
+ end
175
+ # /messages/reschedule
176
+ # Queries your scheduled emails.
177
+ # @param body
178
+ # @param [Hash] opts the optional parameters
179
+ # @return [Array<InlineResponse20032>]
180
+ def reschedule(body = {}, opts = {})
181
+ data, _status_code, _headers = reschedule_with_http_info(body, opts)
182
+ data
183
+ end
184
+
185
+ # /messages/reschedule
186
+ # Queries your scheduled emails.
187
+ # @param body
188
+ # @param [Hash] opts the optional parameters
189
+ # @return [Array<(Array<InlineResponse20032>, Fixnum, Hash)>] Array<InlineResponse20032> data, response status code and response headers
190
+ def reschedule_with_http_info(body, opts = {})
191
+ # add api key to request body
192
+ body[:key] = @api_key
193
+
194
+ # resource path
195
+ local_var_path = '/messages/reschedule'
196
+
197
+ # http body (model)
198
+ auth_names = []
199
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
200
+ :body => body,
201
+ :auth_names => auth_names,
202
+ :return_type => 'Array<InlineResponse20032>')
203
+ return data, status_code, headers
204
+ end
205
+ # /messages/search
206
+ # Search recently sent messages and optionally narrow by date range, tags, senders, and API keys. If no date range is specified, results within the last 7 days are returned. This method may be called up to 20 times per minute. If you need the data more often, you can use /messages/info.json to get the information for a single message, or webhooks to push activity to your own application for querying.
207
+ # @param body
208
+ # @param [Hash] opts the optional parameters
209
+ # @return [Array<InlineResponse20027>]
210
+ def search(body = {}, opts = {})
211
+ data, _status_code, _headers = search_with_http_info(body, opts)
212
+ data
213
+ end
214
+
215
+ # /messages/search
216
+ # Search recently sent messages and optionally narrow by date range, tags, senders, and API keys. If no date range is specified, results within the last 7 days are returned. This method may be called up to 20 times per minute. If you need the data more often, you can use /messages/info.json to get the information for a single message, or webhooks to push activity to your own application for querying.
217
+ # @param body
218
+ # @param [Hash] opts the optional parameters
219
+ # @return [Array<(Array<InlineResponse20027>, Fixnum, Hash)>] Array<InlineResponse20027> data, response status code and response headers
220
+ def search_with_http_info(body, opts = {})
221
+ # add api key to request body
222
+ body[:key] = @api_key
223
+
224
+ # resource path
225
+ local_var_path = '/messages/search'
226
+
227
+ # http body (model)
228
+ auth_names = []
229
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
230
+ :body => body,
231
+ :auth_names => auth_names,
232
+ :return_type => 'Array<InlineResponse20027>')
233
+ return data, status_code, headers
234
+ end
235
+ # /messages/search-time-series
236
+ # Search the content of recently sent messages and return the aggregated hourly stats for matching messages
237
+ # @param body
238
+ # @param [Hash] opts the optional parameters
239
+ # @return [Array<InlineResponse20028>]
240
+ def search_time_series(body = {}, opts = {})
241
+ data, _status_code, _headers = search_time_series_with_http_info(body, opts)
242
+ data
243
+ end
244
+
245
+ # /messages/search-time-series
246
+ # Search the content of recently sent messages and return the aggregated hourly stats for matching messages
247
+ # @param body
248
+ # @param [Hash] opts the optional parameters
249
+ # @return [Array<(Array<InlineResponse20028>, Fixnum, Hash)>] Array<InlineResponse20028> data, response status code and response headers
250
+ def search_time_series_with_http_info(body, opts = {})
251
+ # add api key to request body
252
+ body[:key] = @api_key
253
+
254
+ # resource path
255
+ local_var_path = '/messages/search-time-series'
256
+
257
+ # http body (model)
258
+ auth_names = []
259
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
260
+ :body => body,
261
+ :auth_names => auth_names,
262
+ :return_type => 'Array<InlineResponse20028>')
263
+ return data, status_code, headers
264
+ end
265
+ # /messages/send
266
+ # Send a new transactional message through Mandrill
267
+ # @param body
268
+ # @param [Hash] opts the optional parameters
269
+ # @return [Array<InlineResponse20025>]
270
+ def send(body = {}, opts = {})
271
+ data, _status_code, _headers = send_with_http_info(body, opts)
272
+ data
273
+ end
274
+
275
+ # /messages/send
276
+ # Send a new transactional message through Mandrill
277
+ # @param body
278
+ # @param [Hash] opts the optional parameters
279
+ # @return [Array<(Array<InlineResponse20025>, Fixnum, Hash)>] Array<InlineResponse20025> data, response status code and response headers
280
+ def send_with_http_info(body, opts = {})
281
+ # add api key to request body
282
+ body[:key] = @api_key
283
+
284
+ # resource path
285
+ local_var_path = '/messages/send'
286
+
287
+ # http body (model)
288
+ auth_names = []
289
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
290
+ :body => body,
291
+ :auth_names => auth_names,
292
+ :return_type => 'Array<InlineResponse20025>')
293
+ return data, status_code, headers
294
+ end
295
+ # /messages/send-raw
296
+ # Take a raw MIME document for a message, and send it exactly as if it were sent through Mandrill's SMTP servers
297
+ # @param body
298
+ # @param [Hash] opts the optional parameters
299
+ # @return [Object]
300
+ def send_raw(body = {}, opts = {})
301
+ data, _status_code, _headers = send_raw_with_http_info(body, opts)
302
+ data
303
+ end
304
+
305
+ # /messages/send-raw
306
+ # Take a raw MIME document for a message, and send it exactly as if it were sent through Mandrill&#39;s SMTP servers
307
+ # @param body
308
+ # @param [Hash] opts the optional parameters
309
+ # @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
310
+ def send_raw_with_http_info(body, opts = {})
311
+ # add api key to request body
312
+ body[:key] = @api_key
313
+
314
+ # resource path
315
+ local_var_path = '/messages/send-raw'
316
+
317
+ # http body (model)
318
+ auth_names = []
319
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
320
+ :body => body,
321
+ :auth_names => auth_names,
322
+ :return_type => 'Object')
323
+ return data, status_code, headers
324
+ end
325
+ # /messages/send-template
326
+ # Send a new transactional message through Mandrill
327
+ # @param body
328
+ # @param [Hash] opts the optional parameters
329
+ # @return [Array<InlineResponse20026>]
330
+ def send_template(body = {}, opts = {})
331
+ data, _status_code, _headers = send_template_with_http_info(body, opts)
332
+ data
333
+ end
334
+
335
+ # /messages/send-template
336
+ # Send a new transactional message through Mandrill
337
+ # @param body
338
+ # @param [Hash] opts the optional parameters
339
+ # @return [Array<(Array<InlineResponse20026>, Fixnum, Hash)>] Array<InlineResponse20026> data, response status code and response headers
340
+ def send_template_with_http_info(body, opts = {})
341
+ # add api key to request body
342
+ body[:key] = @api_key
343
+
344
+ # resource path
345
+ local_var_path = '/messages/send-template'
346
+
347
+ # http body (model)
348
+ auth_names = []
349
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
350
+ :body => body,
351
+ :auth_names => auth_names,
352
+ :return_type => 'Array<InlineResponse20026>')
353
+ return data, status_code, headers
354
+ end
355
+ end
356
+ end
@@ -0,0 +1,146 @@
1
+ =begin
2
+ #Mailchimp Transactional API
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 1.0.4
7
+ Contact: apihelp@mandrill.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.12
10
+
11
+ =end
12
+
13
+ require 'uri'
14
+
15
+ module MailchimpTransactional
16
+ class MetadataApi
17
+ attr_accessor :api_client
18
+
19
+ attr_accessor :api_key
20
+
21
+ def initialize(api_key = '', api_client = ApiClient.default)
22
+ @api_key = api_key
23
+ @api_client = api_client
24
+ end
25
+ # /metadata/add
26
+ # Add a new custom metadata field to be indexed for the account.
27
+ # @param body
28
+ # @param [Hash] opts the optional parameters
29
+ # @return [InlineResponse20034]
30
+ def add(body = {}, opts = {})
31
+ data, _status_code, _headers = add_with_http_info(body, opts)
32
+ data
33
+ end
34
+
35
+ # /metadata/add
36
+ # Add a new custom metadata field to be indexed for the account.
37
+ # @param body
38
+ # @param [Hash] opts the optional parameters
39
+ # @return [Array<(InlineResponse20034, Fixnum, Hash)>] InlineResponse20034 data, response status code and response headers
40
+ def add_with_http_info(body, opts = {})
41
+ # add api key to request body
42
+ body[:key] = @api_key
43
+
44
+ # resource path
45
+ local_var_path = '/metadata/add'
46
+
47
+ # http body (model)
48
+ auth_names = []
49
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
50
+ :body => body,
51
+ :auth_names => auth_names,
52
+ :return_type => 'InlineResponse20034')
53
+ return data, status_code, headers
54
+ end
55
+ # /metadata/delete
56
+ # Delete an existing custom metadata field. Deletion isn't instataneous, and /metadata/list will continue to return the field until the asynchronous deletion process is complete.
57
+ # @param body
58
+ # @param [Hash] opts the optional parameters
59
+ # @return [InlineResponse20036]
60
+ def delete(body = {}, opts = {})
61
+ data, _status_code, _headers = delete_with_http_info(body, opts)
62
+ data
63
+ end
64
+
65
+ # /metadata/delete
66
+ # Delete an existing custom metadata field. Deletion isn&#39;t instataneous, and /metadata/list will continue to return the field until the asynchronous deletion process is complete.
67
+ # @param body
68
+ # @param [Hash] opts the optional parameters
69
+ # @return [Array<(InlineResponse20036, Fixnum, Hash)>] InlineResponse20036 data, response status code and response headers
70
+ def delete_with_http_info(body, opts = {})
71
+ # add api key to request body
72
+ body[:key] = @api_key
73
+
74
+ # resource path
75
+ local_var_path = '/metadata/delete'
76
+
77
+ # http body (model)
78
+ auth_names = []
79
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
80
+ :body => body,
81
+ :auth_names => auth_names,
82
+ :return_type => 'InlineResponse20036')
83
+ return data, status_code, headers
84
+ end
85
+ # /metadata/list
86
+ # Get the list of custom metadata fields indexed for the account.
87
+ # @param body
88
+ # @param [Hash] opts the optional parameters
89
+ # @return [Array<InlineResponse20033>]
90
+ def list(body = {}, opts = {})
91
+ data, _status_code, _headers = list_with_http_info(body, opts)
92
+ data
93
+ end
94
+
95
+ # /metadata/list
96
+ # Get the list of custom metadata fields indexed for the account.
97
+ # @param body
98
+ # @param [Hash] opts the optional parameters
99
+ # @return [Array<(Array<InlineResponse20033>, Fixnum, Hash)>] Array<InlineResponse20033> data, response status code and response headers
100
+ def list_with_http_info(body, opts = {})
101
+ # add api key to request body
102
+ body[:key] = @api_key
103
+
104
+ # resource path
105
+ local_var_path = '/metadata/list'
106
+
107
+ # http body (model)
108
+ auth_names = []
109
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
110
+ :body => body,
111
+ :auth_names => auth_names,
112
+ :return_type => 'Array<InlineResponse20033>')
113
+ return data, status_code, headers
114
+ end
115
+ # /metadata/update
116
+ # Delete an existing custom metadata field. Deletion isn't instataneous, and /metadata/list will continue to return the field until the asynchronous deletion process is complete.
117
+ # @param body
118
+ # @param [Hash] opts the optional parameters
119
+ # @return [InlineResponse20035]
120
+ def update(body = {}, opts = {})
121
+ data, _status_code, _headers = update_with_http_info(body, opts)
122
+ data
123
+ end
124
+
125
+ # /metadata/update
126
+ # Delete an existing custom metadata field. Deletion isn&#39;t instataneous, and /metadata/list will continue to return the field until the asynchronous deletion process is complete.
127
+ # @param body
128
+ # @param [Hash] opts the optional parameters
129
+ # @return [Array<(InlineResponse20035, Fixnum, Hash)>] InlineResponse20035 data, response status code and response headers
130
+ def update_with_http_info(body, opts = {})
131
+ # add api key to request body
132
+ body[:key] = @api_key
133
+
134
+ # resource path
135
+ local_var_path = '/metadata/update'
136
+
137
+ # http body (model)
138
+ auth_names = []
139
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
140
+ :body => body,
141
+ :auth_names => auth_names,
142
+ :return_type => 'InlineResponse20035')
143
+ return data, status_code, headers
144
+ end
145
+ end
146
+ end