apiture 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +19 -0
  3. data/Gemfile +8 -0
  4. data/LICENSE +20 -0
  5. data/README.md +38 -0
  6. data/Rakefile +6 -0
  7. data/apiture.gemspec +30 -0
  8. data/lib/apiture.rb +24 -0
  9. data/lib/apiture/api_base.rb +27 -0
  10. data/lib/apiture/api_builder.rb +196 -0
  11. data/lib/apiture/api_error.rb +3 -0
  12. data/lib/apiture/api_group.rb +28 -0
  13. data/lib/apiture/data_model.rb +24 -0
  14. data/lib/apiture/endpoint.rb +25 -0
  15. data/lib/apiture/middleware/auth/api_key.rb +39 -0
  16. data/lib/apiture/middleware/auth/basic.rb +25 -0
  17. data/lib/apiture/middleware/auth/oauth2.rb +31 -0
  18. data/lib/apiture/middleware/convert_json_body.rb +15 -0
  19. data/lib/apiture/middleware/debug.rb +20 -0
  20. data/lib/apiture/middleware/set_body_parameter.rb +20 -0
  21. data/lib/apiture/middleware/set_header.rb +15 -0
  22. data/lib/apiture/middleware/set_parameter_base.rb +37 -0
  23. data/lib/apiture/middleware/set_path_parameter.rb +18 -0
  24. data/lib/apiture/middleware/set_query_parameter.rb +13 -0
  25. data/lib/apiture/middleware_builder.rb +15 -0
  26. data/lib/apiture/middleware_stack.rb +21 -0
  27. data/lib/apiture/request_context.rb +103 -0
  28. data/lib/apiture/swagger/data_type_field.rb +25 -0
  29. data/lib/apiture/swagger/definition.rb +20 -0
  30. data/lib/apiture/swagger/external_docs.rb +10 -0
  31. data/lib/apiture/swagger/info.rb +14 -0
  32. data/lib/apiture/swagger/node.rb +149 -0
  33. data/lib/apiture/swagger/operation.rb +32 -0
  34. data/lib/apiture/swagger/parameter.rb +35 -0
  35. data/lib/apiture/swagger/parser.rb +148 -0
  36. data/lib/apiture/swagger/path.rb +37 -0
  37. data/lib/apiture/swagger/property.rb +15 -0
  38. data/lib/apiture/swagger/security.rb +21 -0
  39. data/lib/apiture/swagger/security_definition.rb +23 -0
  40. data/lib/apiture/swagger/specification.rb +31 -0
  41. data/lib/apiture/uri.rb +36 -0
  42. data/lib/apiture/utils/inflections.rb +46 -0
  43. data/lib/apiture/version.rb +3 -0
  44. data/spec/apiture/api_builder_spec.rb +20 -0
  45. data/spec/apiture/swagger/parser_spec.rb +107 -0
  46. data/spec/apiture/swagger/specification_spec.rb +19 -0
  47. data/spec/apiture_spec.rb +228 -0
  48. data/spec/files/github.json +186 -0
  49. data/spec/files/harvest.json +75 -0
  50. data/spec/files/honeybadger.json +80 -0
  51. data/spec/files/mandrill.json +502 -0
  52. data/spec/files/pivotal_tracker.json +94 -0
  53. data/spec/files/slack.json +88 -0
  54. data/spec/files/uber.json +43 -0
  55. data/spec/fixtures/vcr_cassettes/github_checkAuthorization.yml +70 -0
  56. data/spec/fixtures/vcr_cassettes/github_getUser.yml +82 -0
  57. data/spec/fixtures/vcr_cassettes/harvest_invoiceList.yml +85 -0
  58. data/spec/fixtures/vcr_cassettes/honeybadger.yml +98 -0
  59. data/spec/fixtures/vcr_cassettes/mandrill_messageSend.yml +44 -0
  60. data/spec/fixtures/vcr_cassettes/mandrill_userPing.yml +44 -0
  61. data/spec/fixtures/vcr_cassettes/pivotal_tracker_create_story.yml +61 -0
  62. data/spec/fixtures/vcr_cassettes/slack.yml +43 -0
  63. data/spec/fixtures/vcr_cassettes/uber_getProducts.yml +60 -0
  64. data/spec/spec_helper.rb +11 -0
  65. metadata +241 -0
@@ -0,0 +1,186 @@
1
+ {
2
+ "swagger": "2.0",
3
+
4
+ "info": {
5
+ "title": "Github",
6
+ "version": "3"
7
+ },
8
+
9
+ "host": "api.github.com",
10
+
11
+ "basePath": "/",
12
+
13
+ "schemes": ["https"],
14
+
15
+ "produces": ["application/json"],
16
+
17
+ "securityDefinitions": {
18
+ "oauth2": {
19
+ "type": "oauth2",
20
+ "flow": "accessCode",
21
+ "authorizationUrl": "https://github.com/login/oauth/authorize",
22
+ "tokenUrl": "https://github.com/login/oauth/access_token",
23
+ "scopes": {
24
+ "user": "Grants read/write access to profile info only.",
25
+ "user:email": "Grants read access to a user’s email addresses.",
26
+ "user:follow": "Grants access to follow or unfollow other users.",
27
+ "public_repo": "Grants read/write access to code, commit statuses, collaborators, and deployment statuses for public repositories and organizations.",
28
+ "repo": "Grants read/write access to code, commit statuses, collaborators, and deployment statuses for public and private repositories and organizations.",
29
+ "repo_deployment": "Grants access to deployment statuses for public and private repositories.",
30
+ "repo:status": "Grants read/write access to public and private repository commit statuses.",
31
+ "delete_repo": "Grants access to delete adminable repositories.",
32
+ "notifications": "Grants read access to a user’s notifications.",
33
+ "gist": "Grants write access to gists.",
34
+ "read:repo_hook": "Grants read and ping access to hooks in public or private repositories.",
35
+ "write:repo_hook": "Grants read, write, and ping access to hooks in public or private repositories.",
36
+ "admin:repo_hook": "Grants read, write, ping, and delete access to hooks in public or private repositories.",
37
+ "admin:org_hook": "Grants read, write, ping, and delete access to organization hooks.",
38
+ "read:org": "Read-only access to organization, teams, and membership.",
39
+ "write:org": "Publicize and unpublicize organization membership.",
40
+ "admin:org": "Fully manage organization, teams, and memberships.",
41
+ "read:public_key": "List and view details for public keys.",
42
+ "write:public_key": "Create, list, and view details for public keys.",
43
+ "admin:public_key": "Fully manage public keys."
44
+ }
45
+ },
46
+ "basic": {
47
+ "type": "basic"
48
+ }
49
+ },
50
+
51
+ "security": {
52
+ "oauth2": []
53
+ },
54
+
55
+ "paths": {
56
+ "/user": {
57
+ "get": {
58
+ "summary": "Get the authenticated user",
59
+ "operationId": "getUser"
60
+ }
61
+ },
62
+ "/user/emails": {
63
+ "get": {
64
+ "summary": "List email addresses for a user",
65
+ "operationId": "getUserEmails",
66
+ "security": {
67
+ "basic": ["user:email"]
68
+ }
69
+ }
70
+ },
71
+ "/user/repos": {
72
+ "get": {
73
+ "summary": "List repositories that are accessible to the authenticated user.",
74
+ "operationId": "getUserRepos",
75
+ "parameters": [{
76
+ "name": "visibility",
77
+ "in": "query",
78
+ "enum": [
79
+ "all",
80
+ "public",
81
+ "private"
82
+ ]
83
+ }, {
84
+ "name": "affiliation",
85
+ "in": "query"
86
+ }, {
87
+ "name": "type",
88
+ "in": "query",
89
+ "enum": [
90
+ "all",
91
+ "owner",
92
+ "public",
93
+ "private",
94
+ "member"
95
+ ]
96
+ }, {
97
+ "name": "sort",
98
+ "in": "query",
99
+ "enum": [
100
+ "created",
101
+ "updated",
102
+ "pushed",
103
+ "full_name"
104
+ ]
105
+ }, {
106
+ "name": "direction",
107
+ "in": "query",
108
+ "enum": [
109
+ "asc",
110
+ "desc"
111
+ ]
112
+ }]
113
+ }
114
+ },
115
+ "/user/orgs": {
116
+ "get": {
117
+ "summary": "List organizations for the authenticated user",
118
+ "operationId": "getUserOrgs",
119
+ "security": {
120
+ "oauth2": [
121
+ "user",
122
+ "read:org"
123
+ ]
124
+ }
125
+ }
126
+ },
127
+ "/orgs/{org}/repos": {
128
+ "get": {
129
+ "summary": "List repositories for the specified org",
130
+ "operationId": "getOrgRepos",
131
+ "parameters": [{
132
+ "name": "org",
133
+ "in": "path",
134
+ "required": true
135
+ }, {
136
+ "name": "type",
137
+ "in": "query",
138
+ "enum": [
139
+ "all",
140
+ "public",
141
+ "private",
142
+ "forks",
143
+ "sources",
144
+ "member"
145
+ ]
146
+ }]
147
+ }
148
+ },
149
+ "/repos/{owner}/{repo}/issues/{number}": {
150
+ "get": {
151
+ "summary": "Get a single issue",
152
+ "operationId": "getIssue",
153
+ "parameters": [{
154
+ "name": "owner",
155
+ "in": "path",
156
+ "required": true
157
+ },{
158
+ "name": "repo",
159
+ "in": "path",
160
+ "required": true
161
+ },{
162
+ "name": "number",
163
+ "in": "path",
164
+ "required": true
165
+ }]
166
+ }
167
+ },
168
+ "/applications/{clientId}/tokens/{accessToken}": {
169
+ "get": {
170
+ "operationId": "checkAuthorization",
171
+ "parameters": [{
172
+ "name": "clientId",
173
+ "in": "path",
174
+ "required": true
175
+ },{
176
+ "name": "accessToken",
177
+ "in": "path",
178
+ "required": true
179
+ }],
180
+ "security": {
181
+ "basic": []
182
+ }
183
+ }
184
+ }
185
+ }
186
+ }
@@ -0,0 +1,75 @@
1
+ {
2
+ "swagger": "2.0",
3
+
4
+ "info": {
5
+ "title": "Mandrill",
6
+ "version": "1.0"
7
+ },
8
+
9
+ "x-base-host": "harvestapp.com",
10
+
11
+ "basePath": "/",
12
+
13
+ "schemes": ["https"],
14
+
15
+ "produces": ["application/json", "application/xml"],
16
+
17
+ "securityDefinitions": {
18
+ "oauth2": {
19
+ "type": "oauth2",
20
+ "flow": "accessCode",
21
+ "authorizationUrl": "/oauth2/authorize",
22
+ "tokenUrl": "/oauth2/token",
23
+ "scopes": {}
24
+ }
25
+ },
26
+
27
+ "security": {
28
+ "oauth2": []
29
+ },
30
+
31
+ "paths": {
32
+ "/invoices": {
33
+ "get": {
34
+ "summary": "List invoices",
35
+ "operationId": "invoiceList",
36
+ "parameters": [{
37
+ "name": "page",
38
+ "type": "integer",
39
+ "in": "query"
40
+ },{
41
+ "name": "from",
42
+ "type": "string",
43
+ "in": "query",
44
+ "x-date-format": "%Y%m%d"
45
+ },{
46
+ "name": "to",
47
+ "type": "string",
48
+ "in": "query",
49
+ "x-date-format": "%Y%m%d"
50
+ },{
51
+ "name": "updated_since",
52
+ "type": "string",
53
+ "in": "query",
54
+ "x-date-format": "%Y-%m-%d %H:%M"
55
+ },{
56
+ "name": "status",
57
+ "type": "string",
58
+ "in": "query",
59
+ "enum": [
60
+ "open",
61
+ "partial",
62
+ "draft",
63
+ "paid",
64
+ "unpaid",
65
+ "pastdue"
66
+ ]
67
+ },{
68
+ "name": "client",
69
+ "type": "integer",
70
+ "in": "query"
71
+ }]
72
+ }
73
+ }
74
+ }
75
+ }
@@ -0,0 +1,80 @@
1
+ {
2
+ "swagger": "2.0",
3
+
4
+ "info": {
5
+ "title": "Honeybadger",
6
+ "description": "Honeybadger Read API v1",
7
+ "version": "1"
8
+ },
9
+
10
+ "host": "api.honeybadger.io",
11
+
12
+ "basePath": "/v1",
13
+
14
+ "schemes": ["https"],
15
+
16
+ "produces": ["application/json"],
17
+
18
+ "paths": {
19
+ "/projects/{projectId}/faults": {
20
+ "get": {
21
+ "summary": "Returns a list of faults for the given project",
22
+ "externalDocs": {
23
+ "url": "https://www.honeybadger.io/documentation/read_api"
24
+ },
25
+ "operationId": "getFaults",
26
+ "parameters": [
27
+ {
28
+ "name": "projectId",
29
+ "in": "path",
30
+ "required": true,
31
+ "type": "string"
32
+ },
33
+ {
34
+ "name": "page",
35
+ "in": "query"
36
+ }
37
+ ]
38
+ }
39
+ },
40
+ "/projects/{projectId}/faults/{faultId}/notices": {
41
+ "get": {
42
+ "summary": "Returns a list of notices for the given fault",
43
+ "externalDocs": {
44
+ "url": "https://www.honeybadger.io/documentation/read_api"
45
+ },
46
+ "operationId": "getNotices",
47
+ "parameters": [
48
+ {
49
+ "name": "projectId",
50
+ "in": "path",
51
+ "required": true,
52
+ "type": "string"
53
+ },
54
+ {
55
+ "name": "faultId",
56
+ "in": "path",
57
+ "required": true,
58
+ "type": "string"
59
+ },
60
+ {
61
+ "name": "page",
62
+ "in": "query"
63
+ }
64
+ ]
65
+ }
66
+ }
67
+ },
68
+
69
+ "securityDefinitions": {
70
+ "authToken": {
71
+ "type": "apiKey",
72
+ "name": "auth_token",
73
+ "in": "query"
74
+ }
75
+ },
76
+
77
+ "security": {
78
+ "authToken": []
79
+ }
80
+ }
@@ -0,0 +1,502 @@
1
+ {
2
+ "swagger": "2.0",
3
+
4
+ "info": {
5
+ "title": "Mandrill",
6
+ "version": "1.0"
7
+ },
8
+
9
+ "host": "mandrillapp.com",
10
+
11
+ "basePath": "/api/1.0/",
12
+
13
+ "schemes": ["https"],
14
+
15
+ "produces": ["application/json"],
16
+ "consumes": ["application/json"],
17
+
18
+ "securityDefinitions": {
19
+ "key": {
20
+ "type": "apiKey",
21
+ "name": "key",
22
+ "in": "body"
23
+ }
24
+ },
25
+
26
+ "security": {
27
+ "key": []
28
+ },
29
+
30
+ "paths": {
31
+ "/users/info.json": {
32
+ "post": {
33
+ "summary": "Return the information about the API-connected user",
34
+ "operationId": "userInfo"
35
+ }
36
+ },
37
+ "/users/ping.json": {
38
+ "post": {
39
+ "summary": "Validate an API key and respond to a ping",
40
+ "operationId": "userPing"
41
+ },
42
+ "produces": ["text/plain"]
43
+ },
44
+ "/users/ping2.json": {
45
+ "post": {
46
+ "summary": "Validate an API key and respond to a ping (anal JSON parser version)",
47
+ "operationId": "userPing2"
48
+ }
49
+ },
50
+ "/users/senders.json": {
51
+ "post": {
52
+ "summary": "Return the senders that have tried to use this account, both verified and unverified",
53
+ "operationId": "userSenders"
54
+ }
55
+ },
56
+
57
+ "/messages/send.json": {
58
+ "post": {
59
+ "summary": "Send a new transactional message through Mandrill",
60
+ "operationId": "messageSend",
61
+ "parameters": [{
62
+ "name": "request",
63
+ "in": "body",
64
+ "schema": {
65
+ "type": "object",
66
+ "required": [ "message" ],
67
+ "properties": {
68
+ "message": {
69
+ "$ref": "#/definitions/Message"
70
+ },
71
+ "async": {
72
+ "type": "boolean"
73
+ },
74
+ "ip_pool": {
75
+ "type": "string"
76
+ },
77
+ "send_at": {
78
+ "type": "string",
79
+ "x-date-format": "%Y-%m-%d %H:%M:%S"
80
+ }
81
+ }
82
+ }
83
+ }]
84
+ }
85
+ },
86
+ "/messages/send-template.json": {
87
+ "post": {
88
+ "summary": "Send a new transactional message through Mandrill using a template",
89
+ "operationId": "messageSendTemplate",
90
+ "parameters": [{
91
+ "name": "request",
92
+ "in": "body",
93
+ "schema": {
94
+ "type": "object",
95
+ "required": [
96
+ "template_name",
97
+ "template_content",
98
+ "message"
99
+ ],
100
+ "properties": {
101
+ "template_name": {
102
+ "type": "string"
103
+ },
104
+ "template_content": {
105
+ "type": "array",
106
+ "items": {
107
+ "$ref": "#/definitions/TemplateContent"
108
+ }
109
+ },
110
+ "message": {
111
+ "$ref": "#/definitions/Message"
112
+ },
113
+ "async": {
114
+ "type": "boolean"
115
+ },
116
+ "ip_pool": {
117
+ "type": "string"
118
+ },
119
+ "send_at": {
120
+ "type": "string",
121
+ "x-date-format": "%Y-%m-%d %H:%M:%S"
122
+ }
123
+ }
124
+ }
125
+ }]
126
+ }
127
+ },
128
+
129
+ "/webhooks/list.json": {
130
+ "post": {
131
+ "summary": "Get the list of all webhooks defined on the account",
132
+ "operationId": "webhookList"
133
+ }
134
+ },
135
+ "/webhooks/add.json": {
136
+ "post": {
137
+ "summary": "Add a new webhook",
138
+ "operationId": "webhookAdd",
139
+ "parameters": [{
140
+ "name": "request",
141
+ "in": "body",
142
+ "schema": {
143
+ "type": "object",
144
+ "required": [
145
+ "key",
146
+ "url"
147
+ ],
148
+ "properties": {
149
+ "url": {
150
+ "type": "string"
151
+ },
152
+ "description": {
153
+ "type": "string"
154
+ },
155
+ "events": {
156
+ "type": "array",
157
+ "items": {
158
+ "type": "string",
159
+ "enum": [
160
+ "send",
161
+ "hard_bounce",
162
+ "soft_bounce",
163
+ "open",
164
+ "click",
165
+ "spam",
166
+ "unsub",
167
+ "reject"
168
+ ]
169
+ }
170
+ }
171
+ }
172
+ }
173
+ }]
174
+ }
175
+ },
176
+ "/webhooks/info.json": {
177
+ "post": {
178
+ "summary": "Given the ID of an existing webhook, return the data about it",
179
+ "operationId": "webhookInfo",
180
+ "parameters": [{
181
+ "name": "request",
182
+ "in": "body",
183
+ "schema": {
184
+ "type": "object",
185
+ "required": [ "id" ],
186
+ "properties": {
187
+ "id": {
188
+ "type": "integer"
189
+ }
190
+ }
191
+ }
192
+ }]
193
+ }
194
+ },
195
+ "/webhooks/update.json": {
196
+ "post": {
197
+ "summary": "Update an existing webhook",
198
+ "operationId": "webhookUpdate",
199
+ "parameters": [{
200
+ "name": "request",
201
+ "in": "body",
202
+ "schema": {
203
+ "type": "object",
204
+ "required": [ "id", "url" ],
205
+ "properties": {
206
+ "id": {
207
+ "type": "integer"
208
+ },
209
+ "url": {
210
+ "type": "string"
211
+ },
212
+ "description": {
213
+ "type": "string"
214
+ },
215
+ "events": {
216
+ "type": "array",
217
+ "items": {
218
+ "type": "string",
219
+ "enum": [
220
+ "send",
221
+ "hard_bounce",
222
+ "soft_bounce",
223
+ "open",
224
+ "click",
225
+ "spam",
226
+ "unsub",
227
+ "reject"
228
+ ]
229
+ }
230
+ }
231
+ }
232
+ }
233
+ }]
234
+ }
235
+ },
236
+ "/webhooks/delete.json": {
237
+ "post": {
238
+ "summary": "Delete an existing webhook",
239
+ "operationId": "webhookDelete",
240
+ "parameters": [{
241
+ "name": "request",
242
+ "in": "body",
243
+ "schema": {
244
+ "type": "object",
245
+ "required": [ "id" ],
246
+ "properties": {
247
+ "id": {
248
+ "type": "integer"
249
+ }
250
+ }
251
+ }
252
+ }]
253
+ }
254
+ }
255
+ },
256
+
257
+ "definitions": {
258
+ "MergeVars": {
259
+ "type": "object",
260
+ "required": [ "rcpt" ],
261
+ "properties": {
262
+ "rcpt": {
263
+ "type": "string",
264
+ "description": "the email address of the recipient that the merge variables should apply to"
265
+ },
266
+ "vars": {
267
+ "type": "array",
268
+ "description": "the recipient's merge variables",
269
+ "items": {
270
+ "$ref": "#/definitions/Var"
271
+ }
272
+ }
273
+ }
274
+ },
275
+ "Var": {
276
+ "type": "object",
277
+ "properties": {
278
+ "name": {
279
+ "type": "string",
280
+ "description": "the merge variable's name. Merge variable names are case-insensitive and may not start with _"
281
+ },
282
+ "content": {
283
+ "type": "string",
284
+ "description": "the merge variable's content"
285
+ }
286
+ }
287
+ },
288
+ "Attachment": {
289
+ "type": "object",
290
+ "properties": {
291
+ "type": {
292
+ "type": "string",
293
+ "description": "the MIME type of the attachment"
294
+ },
295
+ "name": {
296
+ "type": "string",
297
+ "description": "the file name of the attachment"
298
+ },
299
+ "content": {
300
+ "type": "string",
301
+ "description": "the content of the attachment as a base64-encoded string"
302
+ }
303
+ }
304
+ },
305
+ "Recipient": {
306
+ "type": "object",
307
+ "required": ["email"],
308
+ "properties": {
309
+ "email": {
310
+ "type": "string",
311
+ "description": "the email address of the recipient"
312
+ },
313
+ "name": {
314
+ "type": "string",
315
+ "description": "the optional display name to use for the recipient"
316
+ },
317
+ "type": {
318
+ "type": "string",
319
+ "description": "the header type to use for the recipient, defaults to \"to\" if not provided",
320
+ "enum": [ "to", "cc", "bcc" ]
321
+ }
322
+ }
323
+ },
324
+ "RecipientMetadata": {
325
+ "type": "object",
326
+ "properties": {
327
+ "rcpt": {
328
+ "type": "string",
329
+ "description": "the email address of the recipient that the metadata is associated with"
330
+ },
331
+ "values": {
332
+ "type": "object",
333
+ "description": "an associated array containing the recipient's unique metadata. If a key exists in both the per-recipient metadata and the global metadata, the per-recipient metadata will be used."
334
+ }
335
+ }
336
+ },
337
+ "Message": {
338
+ "type": "object",
339
+ "properties": {
340
+ "html": {
341
+ "type": "string",
342
+ "description": "the full HTML content to be sent"
343
+ },
344
+ "text": {
345
+ "type": "string",
346
+ "description": "optional full text content to be sent"
347
+ },
348
+ "subject": {
349
+ "type": "string",
350
+ "description": "the message subject"
351
+ },
352
+ "from_email": {
353
+ "type": "string",
354
+ "description": "the sender email address"
355
+ },
356
+ "from_name": {
357
+ "type": "string",
358
+ "description": "optional from name to be used"
359
+ },
360
+ "to": {
361
+ "type": "array",
362
+ "description": "an array of recipient information",
363
+ "items": {
364
+ "$ref": "#/definitions/Recipient"
365
+ }
366
+ },
367
+ "headers": {
368
+ "type": "object",
369
+ "description": "optional extra headers to add to the message (most headers are allowed)"
370
+ },
371
+ "important": {
372
+ "type": "boolean",
373
+ "description": "whether or not this message is important, and should be delivered ahead of non-important messages"
374
+ },
375
+ "track_opens": {
376
+ "type": "boolean",
377
+ "description": "whether or not to turn on open tracking for the message"
378
+ },
379
+ "track_clicks": {
380
+ "type": "boolean",
381
+ "description": "whether or not to turn on click tracking for the message"
382
+ },
383
+ "auto_text": {
384
+ "type": "boolean",
385
+ "description": "whether or not to automatically generate a text part for messages that are not given text"
386
+ },
387
+ "auto_html": {
388
+ "type": "boolean",
389
+ "description": "whether or not to automatically generate an HTML part for messages that are not given HTML"
390
+ },
391
+ "inline_css": {
392
+ "type": "boolean",
393
+ "description": "whether or not to automatically inline all CSS styles provided in the message HTML - only for HTML documents less than 256KB in size"
394
+ },
395
+ "url_strip_qs": {
396
+ "type": "boolean",
397
+ "description": "whether or not to strip the query string from URLs when aggregating tracked URL data"
398
+ },
399
+ "preserve_recipients": {
400
+ "type": "boolean",
401
+ "description": "whether or not to expose all recipients in to \"To\" header for each email"
402
+ },
403
+ "view_content_link": {
404
+ "type": "boolean",
405
+ "description": "set to false to remove content logging for sensitive emails"
406
+ },
407
+ "bcc_address": {
408
+ "type": "string",
409
+ "description": "an optional address to receive an exact copy of each recipient's email"
410
+ },
411
+ "tracking_domain": {
412
+ "type": "string",
413
+ "description": "a custom domain to use for tracking opens and clicks instead of mandrillapp.com"
414
+ },
415
+ "signing_domain": {
416
+ "type": "string",
417
+ "description": "a custom domain to use for SPF/DKIM signing instead of mandrill (for \"via\" or \"on behalf of\" in email clients)"
418
+ },
419
+ "return_path_domain": {
420
+ "type": "string",
421
+ "description": "a custom domain to use for the messages's return-path"
422
+ },
423
+ "merge": {
424
+ "type": "boolean",
425
+ "description": "whether to evaluate merge tags in the message. Will automatically be set to true if either merge_vars or global_merge_vars are provided."
426
+ },
427
+ "merge_language": {
428
+ "type": "string",
429
+ "description": "the merge tag language to use when evaluating merge tags, either mailchimp or handlebars",
430
+ "enum": [
431
+ "mailchimp",
432
+ "handlebars"
433
+ ]
434
+ },
435
+ "global_merge_vars": {
436
+ "type": "array",
437
+ "description": "global merge variables to use for all recipients. You can override these per recipient.",
438
+ "items": {
439
+ "$ref": "#/definitions/Var"
440
+ }
441
+ },
442
+ "merge_vars": {
443
+ "type": "array",
444
+ "description": "per-recipient merge variables, which override global merge variables with the same name.",
445
+ "items": {
446
+ "$ref": "#/definitions/MergeVars"
447
+ }
448
+ },
449
+ "tags": {
450
+ "type": "array",
451
+ "description": "an array of string to tag the message with. Stats are accumulated using tags, though we only store the first 100 we see, so this should not be unique or change frequently. Tags should be 50 characters or less. Any tags starting with an underscore are reserved for internal use and will cause errors.",
452
+ "items": {
453
+ "type": "string"
454
+ }
455
+ },
456
+ "subaccount": {
457
+ "type": "string",
458
+ "description": "the unique id of a subaccount for this message - must already exist or will fail with an error"
459
+ },
460
+ "google_analytics_domains": {
461
+ "type": "array",
462
+ "description": "an array of strings indicating for which any matching URLs will automatically have Google Analytics parameters appended to their query string automatically.",
463
+ "items": {
464
+ "type": "string"
465
+ }
466
+ },
467
+ "google_analytics_campaign": {
468
+ "type": "array",
469
+ "description": "optional string indicating the value to set for the utm_campaign tracking parameter. If this isn't provided the email's from address will be used instead.",
470
+ "items": {
471
+ "type": "string"
472
+ }
473
+ },
474
+ "metadata": {
475
+ "type": "array",
476
+ "description": "metadata an associative array of user metadata. Mandrill will store this metadata and make it available for retrieval. In addition, you can select up to 10 metadata fields to index and make searchable using the Mandrill search api."
477
+ },
478
+ "recipient_metadata": {
479
+ "type": "array",
480
+ "description": "Per-recipient metadata that will override the global values specified in the metadata parameter.",
481
+ "items": {
482
+ "$ref": "#/definitions/RecipientMetadata"
483
+ }
484
+ },
485
+ "attachments": {
486
+ "type": "array",
487
+ "description": "an array of supported attachments to add to the message",
488
+ "items": {
489
+ "$ref": "#/definitions/Attachment"
490
+ }
491
+ },
492
+ "images": {
493
+ "type": "array",
494
+ "description": "an array of embedded images to add to the message",
495
+ "items": {
496
+ "$ref": "#/definitions/Attachment"
497
+ }
498
+ }
499
+ }
500
+ }
501
+ }
502
+ }