diesel-api-dsl 0.1.3 → 0.1.5
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/Gemfile +4 -0
- data/diesel.gemspec +1 -1
- data/lib/diesel/api_builder.rb +82 -32
- data/lib/diesel/api_group.rb +3 -2
- data/lib/diesel/middleware/auth/api_key.rb +13 -1
- data/lib/diesel/middleware/auth/basic.rb +27 -0
- data/lib/diesel/middleware/auth/oauth2.rb +2 -2
- data/lib/diesel/middleware/convert_json_body.rb +15 -0
- data/lib/diesel/middleware/set_body_parameter.rb +5 -1
- data/lib/diesel/middleware/set_path_parameter.rb +2 -1
- data/lib/diesel/request_context.rb +7 -1
- data/lib/diesel/swagger/definition.rb +1 -1
- data/lib/diesel/swagger/operation.rb +3 -1
- data/lib/diesel/swagger/parser.rb +25 -9
- data/lib/diesel/uri.rb +36 -0
- data/lib/diesel/version.rb +1 -1
- data/spec/diesel/api_builder_spec.rb +9 -3
- data/spec/diesel/swagger/parser_spec.rb +14 -0
- data/spec/diesel_spec.rb +173 -56
- data/spec/files/github.json +186 -0
- data/spec/files/harvest.json +75 -0
- data/spec/files/mandrill.json +502 -0
- data/spec/files/uber.json +43 -0
- data/spec/fixtures/vcr_cassettes/github_checkAuthorization.yml +71 -0
- data/spec/fixtures/vcr_cassettes/github_getUser.yml +82 -0
- data/spec/fixtures/vcr_cassettes/harvest_invoiceList.yml +85 -0
- data/spec/fixtures/vcr_cassettes/mandrill_userPing.yml +44 -0
- data/spec/fixtures/vcr_cassettes/uber_getProducts.yml +60 -0
- data/spec/spec_helper.rb +1 -0
- metadata +28 -6
| @@ -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,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 | 
            +
            }
         |