heroku_rs 0.6.0

Rust bindings for the Heroku API
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
//Anything related to creating apps and it's properties goes here.
use super::{App, AppSetup, AppWebhook, SNI, SSL};
use std::collections::HashMap;

use crate::framework::endpoint::{HerokuEndpoint, Method};

/// App Create
///
/// Create a new app.
///
/// [See Heroku documentation for more information about this endpoint](https://devcenter.heroku.com/articles/platform-api-reference#app-create)
///
/// # Example:
///
/// AppCreate has no required parameters, and returns the created [`App`][response].
/// ```rust
/// use heroku_rs::prelude::*;
///#    let api_client = HttpApiClient::create("API_KEY").unwrap();
///
/// let new_app = &AppCreate::new()
///     .name("an-example-name")
///     .stack("heroku-18")
///     .region("us")
///     .build();
/// let response = api_client.request(new_app);
///
///match response {
///     Ok(success) => println!("Success: {:#?}", success),
///     Err(e) => println!("Error: {}", e),
///}
//
/// ```
/// See how to create the Heroku [`api_client`][httpApiClientConfig].
///
/// [httpApiClientConfig]: ../../../framework/struct.HttpApiClient.html
/// [response]: ../struct.App.html
pub struct AppCreate<'a> {
    /// The parameters to pass to the Heroku API
    pub params: AppCreateParams<'a>,
}

#[cfg(feature = "builder")]
impl<'a> AppCreate<'a> {
    /// Create a new Heroku app without parameters
    pub fn new() -> AppCreate<'a> {
        AppCreate {
            params: AppCreateParams {
                name: None,
                region: None,
                stack: None,
            },
        }
    }

    /// # name: name of app
    ///
    /// `pattern`:  ^[a-z][a-z0-9-]{1,28}[a-z0-9]$
    pub fn name(&mut self, name: &'a str) -> &mut Self {
        self.params.name = Some(name);
        self
    }

    /// # region: unique identifier or name of region
    pub fn region(&mut self, region: &'a str) -> &mut Self {
        self.params.region = Some(region);
        self
    }

    /// # stack: unique name or identifier of stack
    pub fn stack(&mut self, stack: &'a str) -> &mut Self {
        self.params.stack = Some(stack);
        self
    }

    pub fn build(&self) -> AppCreate<'a> {
        AppCreate {
            params: AppCreateParams {
                name: self.params.name,
                region: self.params.region,
                stack: self.params.stack,
            },
        }
    }
}

/// Create a new app with parameters.
///
/// All three paramemters are optional.
///
/// [See Heroku documentation for more information about this endpoint](https://devcenter.heroku.com/articles/platform-api-reference#app-create-optional-parameters)
#[serde_with::skip_serializing_none]
#[derive(Serialize, Clone, Debug)]
pub struct AppCreateParams<'a> {
    /// name of app. pattern: ^[a-z][a-z0-9-]{1,28}[a-z0-9]$
    pub name: Option<&'a str>,
    /// unique identifier or name of region
    pub region: Option<&'a str>,
    /// unique name or identifier of stack
    pub stack: Option<&'a str>,
}

impl<'a> HerokuEndpoint<App, (), AppCreateParams<'a>> for AppCreate<'a> {
    fn method(&self) -> Method {
        Method::Post
    }
    fn path(&self) -> String {
        format!("apps")
    }
    fn body(&self) -> Option<AppCreateParams<'a>> {
        Some(self.params.clone())
    }
}

/// App Enable ACM
///
/// Enable ACM flag for an app
///
/// [See Heroku documentation for more information about this endpoint](https://devcenter.heroku.com/articles/platform-api-reference#app-enable-acm)
///
/// # Example:
///
/// AppEnableAcm takes one required parameter, app_id, and returns the [`App`][response].
/// ```rust
/// use heroku_rs::prelude::*;
///#    let api_client = HttpApiClient::create("API_KEY").unwrap();
///
/// let response = api_client.request(&AppEnableAcm::new("APP_ID"));
///
///match response {
///     Ok(success) => println!("Success: {:#?}", success),
///     Err(e) => println!("Error: {}", e),
///}
//
/// ```
/// See how to create the Heroku [`api_client`][httpApiClientConfig].
///
/// [httpApiClientConfig]: ../../../framework/struct.HttpApiClient.html
/// [response]: ../struct.App.html
pub struct AppEnableAcm<'a> {
    /// app_id can be the app id or name.
    pub app_id: &'a str,
}

#[cfg(feature = "builder")]
impl<'a> AppEnableAcm<'a> {
    pub fn new(app_id: &'a str) -> AppEnableAcm<'a> {
        AppEnableAcm { app_id }
    }
}

impl<'a> HerokuEndpoint<App> for AppEnableAcm<'a> {
    fn method(&self) -> Method {
        Method::Post
    }
    fn path(&self) -> String {
        format!("apps/{}/acm", self.app_id)
    }
}

/// App Webhook Create
///
/// Create an app webhook subscription.
///
/// [See Heroku documentation for more information about this endpoint](https://devcenter.heroku.com/articles/platform-api-reference#app-webhook-create)
///
/// # Example:
///
/// AppWebhookCreate has four required parameters, and returns the created [`AppWebhook`][response].
/// ```rust
/// use heroku_rs::prelude::*;
///#    let api_client = HttpApiClient::create("API_KEY").unwrap();
///
/// let webhook = &AppWebhookCreate::new(
///     "APP_ID", //app_id
///     vec!["api:release"], //include
///     "notify",//level
///     "https://www.google.com",//url
/// );
///
/// let response = api_client.request(webhook);
///
///match response {
///     Ok(success) => println!("Success: {:#?}", success),
///     Err(e) => println!("Error: {}", e),
///}
//
/// ```
/// See how to create the Heroku [`api_client`][httpApiClientConfig].
///
/// [httpApiClientConfig]: ../../../framework/struct.HttpApiClient.html
/// [response]: ../struct.AppWebhook.html
pub struct AppWebhookCreate<'a> {
    /// app_id can be the app name or the app id
    pub app_id: &'a str,
    /// The parameters to pass to the Heroku API
    pub params: AppWebhookCreateParams<'a>,
}

#[cfg(feature = "builder")]
impl<'a> AppWebhookCreate<'a> {
    /// Create a new webhook without optional parameters
    pub fn new(
        app_id: &'a str,
        include: Vec<&'a str>,
        level: &'a str,
        url: &'a str,
    ) -> AppWebhookCreate<'a> {
        AppWebhookCreate {
            app_id: app_id,
            params: AppWebhookCreateParams {
                authorization: None,
                include: include,
                level: level,
                secret: None,
                url: url,
            },
        }
    }

    /// # authorization: a custom Authorization header that Heroku will include with all webhook notifications
    pub fn authorization(&mut self, authorization: &'a str) -> &mut Self {
        self.params.authorization = Some(authorization);
        self
    }

    /// # secret: a value that Heroku will use to sign all webhook notification requests (the signature is included in the request’s Heroku-Webhook-Hmac-SHA256 header)
    pub fn secret(&mut self, secret: &'a str) -> &mut Self {
        self.params.secret = Some(secret);
        self
    }

    pub fn build(&self) -> AppWebhookCreate<'a> {
        AppWebhookCreate {
            app_id: self.app_id,
            params: AppWebhookCreateParams {
                authorization: self.params.authorization,
                include: self.params.include.clone(),
                level: self.params.level,
                secret: self.params.secret,
                url: self.params.url,
            },
        }
    }
}

/// Create a new app webhook with parameters.
///
/// [See Heroku documentation for more information about this endpoint](https://devcenter.heroku.com/articles/platform-api-reference#app-webhook-create-required-parameters)
#[derive(Serialize, Clone, Debug)]
pub struct AppWebhookCreateParams<'a> {
    /// A custom Authorization header that Heroku will include with all webhook notifications
    pub authorization: Option<&'a str>,
    /// The entities that the subscription provides notifications for
    pub include: Vec<&'a str>,
    /// One of: "notify" or "sync"
    /// If notify, Heroku makes a single, fire-and-forget delivery attempt. If sync, Heroku attempts multiple deliveries until the request is successful or a limit is reached
    pub level: &'a str,
    /// A value that Heroku will use to sign all webhook notification requests (the signature is included in the request’s Heroku-Webhook-Hmac-SHA256 header)
    pub secret: Option<&'a str>,
    /// The URL where the webhook’s notification requests are sent
    pub url: &'a str,
}

impl<'a> HerokuEndpoint<AppWebhook, (), AppWebhookCreateParams<'a>> for AppWebhookCreate<'a> {
    fn method(&self) -> Method {
        Method::Post
    }
    fn path(&self) -> String {
        format!("apps/{}/webhooks", self.app_id)
    }
    fn body(&self) -> Option<AppWebhookCreateParams<'a>> {
        Some(self.params.clone())
    }
}

/// App Setup Create
///
/// Create a new app setup from a gzipped tar archive containing an app.json manifest file.
///
/// [See Heroku documentation for more information about this endpoint](https://devcenter.heroku.com/articles/platform-api-reference#app-setup-create)
///
/// # Example:
///
/// AppSetupCreate has one required parameter, url, and returns the created [`AppSetup`][response].
/// ```rust
/// use heroku_rs::prelude::*;
/// use std::collections::HashMap;
/// 
///#    let api_client = HttpApiClient::create("API_KEY").unwrap();
///
/// let mut env = HashMap::new();
/// env.insert("FOO", "bar");
/// env.insert("BAZ", "qux");
/// 
/// let source_blob_url = "https://github.com/heroku/ruby-rails-sample/tarball/master/";
/// 
/// let new_app_setup = &apps::AppSetupCreate::new(source_blob_url)
///     .version("v1.3.0")
///     .checksum("SHA256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")
///     .locked(true)
///     .name("gotye-probably")
///     .organization("my-org")
///     .personal(true)
///     .region("us")
///     .space("my-space")
///     .stack("heroku-18")
///     .buildpacks(vec!["https://github.com/heroku/heroku-buildpack-ruby"])
///     .env(env)
///     .build();
/// 
/// let response = api_client.request(new_app_setup);;
///
///match response {
///     Ok(success) => println!("Success: {:#?}", success),
///     Err(e) => println!("Error: {}", e),
///}
//
/// ```
/// See how to create the Heroku [`api_client`][httpApiClientConfig].
///
/// [httpApiClientConfig]: ../../../framework/struct.HttpApiClient.html
/// [response]: ../struct.AppSetup.html
pub struct AppSetupCreate<'a> {
    /// The parameters to pass to the Heroku API
    pub params: AppSetupCreateParams<'a>,
}

#[cfg(feature = "builder")]
impl<'a> AppSetupCreate<'a> {
    /// Create a new setup app with required parameters only
    pub fn new(url: &'a str) -> AppSetupCreate<'a> {
        AppSetupCreate {
            params: AppSetupCreateParams {
                app: SetupApp {
                    locked: None,
                    name: None,
                    organization: None,
                    personal: None,
                    region: None,
                    space: None,
                    stack: None,
                },
                source_blob: SourceBlob {
                    checksum: None,
                    url: url,
                    version: None,
                },
                overrides: Overrides {
                    buildpacks: None,
                    env: None,
                },
            },
        }
    }

    /// # version: Version of the gzipped tarball.
    pub fn version(&mut self, version: &'a str) -> &mut Self {
        self.params.source_blob.version = Some(version);
        self
    }
    /// # checksum: an optional checksum of the gzipped tarball for verifying its integrity
    pub fn checksum(&mut self, checksum: &'a str) -> &mut Self {
        self.params.source_blob.checksum = Some(checksum);
        self
    }

    /// # locked: are other team members forbidden from joining this app.
    pub fn locked(&mut self, locked: bool) -> &mut Self {
        self.params.app.locked = Some(locked);
        self
    }
    /// # name: name of app
    ///
    /// `pattern`:  pattern: ^[a-z][a-z0-9-]{1,28}[a-z0-9]$
    pub fn name(&mut self, name: &'a str) -> &mut Self {
        self.params.app.name = Some(name);
        self
    }
    /// # organization: unique name of team
    pub fn organization(&mut self, organization: &'a str) -> &mut Self {
        self.params.app.organization = Some(organization);
        self
    }
    /// # personal: force creation of the app in the user account even if a default team is set.
    pub fn personal(&mut self, personal: bool) -> &mut Self {
        self.params.app.personal = Some(personal);
        self
    }
    /// # region: name of region
    pub fn region(&mut self, region: &'a str) -> &mut Self {
        self.params.app.region = Some(region);
        self
    }
    /// # space: unique name of space
    ///
    /// `pattern`:  pattern: `^[a-z0-9](?:[a-z0-9]
    pub fn space(&mut self, space: &'a str) -> &mut Self {
        self.params.app.space = Some(space);
        self
    }
    /// # stack: unique name of stack
    pub fn stack(&mut self, stack: &'a str) -> &mut Self {
        self.params.app.stack = Some(stack);
        self
    }

    /// # buildpacks: overrides the buildpacks specified in the app.json manifest file
    pub fn buildpacks(&mut self, buildpacks_list: Vec<&'a str>) -> &mut Self {
        let mut buildpacks: Vec<Buildpack> = Vec::new();
        for var in buildpacks_list {
            buildpacks.push(Buildpack { url: var });
        }
        self.params.overrides.buildpacks = Some(buildpacks);
        self
    }
    /// # env: overrides of the env specified in the app.json manifest file
    pub fn env(&mut self, env: HashMap<&'a str, &'a str>) -> &mut Self {
        self.params.overrides.env = Some(env);
        self
    }
    /// Create a new Heroku app with required  and optional parameters
    pub fn build(&self) -> AppSetupCreate<'a> {
        AppSetupCreate {
            params: AppSetupCreateParams {
                app: self.params.app.clone(),
                source_blob: self.params.source_blob.clone(),
                overrides: self.params.overrides.clone(),
            },
        }
    }
}

/// Create a new  setup app with parameters.
///
/// All three papparamemters are optional.
///
/// [See Heroku documentation for more information about this endpoint](https://devcenter.heroku.com/articles/platform-api-reference#app-setup-create-required-parameters)
#[serde_with::skip_serializing_none]
#[derive(Serialize, Clone, Debug)]
pub struct AppSetupCreateParams<'a> {
    pub app: SetupApp<'a>,
    pub source_blob: SourceBlob<'a>,
    pub overrides: Overrides<'a>,
}

#[serde_with::skip_serializing_none]
#[derive(Serialize, Clone, Debug)]
pub struct SetupApp<'a> {
    /// are other team members forbidden from joining this app.
    pub locked: Option<bool>,
    /// name of app
    ///  pattern: ^[a-z][a-z0-9-]{1,28}[a-z0-9]$
    pub name: Option<&'a str>,
    /// unique name of team
    pub organization: Option<&'a str>,
    /// force creation of the app in the user account even if a default team is set.
    pub personal: Option<bool>,
    /// name of region
    pub region: Option<&'a str>,
    /// unique name of space
    ///  pattern: `^[a-z0-9](?:[a-z0-9]
    pub space: Option<&'a str>,
    /// unique name
    pub stack: Option<&'a str>,
}

#[derive(Serialize, Clone, Debug)]
pub struct SourceBlob<'a> {
    /// an optional checksum of the gzipped tarball for verifying its integrity. [Nullable]
    pub checksum: Option<&'a str>,
    /// URL of gzipped tarball of source code containing app.json manifest file.
    pub url: &'a str,
    /// Version of the gzipped tarball. [Nullable]
    pub version: Option<&'a str>,
}

#[serde_with::skip_serializing_none]
#[derive(Serialize, Clone, Debug)]
pub struct Overrides<'a> {
    /// overrides the buildpacks specified in the app.json manifest file
    pub buildpacks: Option<Vec<Buildpack<'a>>>,
    /// overrides of the env specified in the app.json manifest file
    pub env: Option<HashMap<&'a str, &'a str>>,
}

#[serde_with::skip_serializing_none]
#[derive(Serialize, Clone, Debug)]
pub struct Buildpack<'a> {
    pub url: &'a str,
}

impl<'a> HerokuEndpoint<AppSetup, (), AppSetupCreateParams<'a>> for AppSetupCreate<'a> {
    fn method(&self) -> Method {
        Method::Post
    }
    fn path(&self) -> String {
        format!("app-setups")
    }
    fn body(&self) -> Option<AppSetupCreateParams<'a>> {
        Some(self.params.clone())
    }
}

/// SNI Endpoint Create
///
/// Create a new SNI endpoint.
///
/// [See Heroku documentation for more information about this endpoint](https://devcenter.heroku.com/articles/platform-api-reference#sni-endpoint-create)
///
/// # Example:
///
/// SNICreate has three required parameters, app_id, certificate_chain, private_key, and returns the created [`SNI`][response].
/// ```rust
/// use heroku_rs::prelude::*;
///#    let api_client = HttpApiClient::create("API_KEY").unwrap();
///
/// let certificate_chain = "chain_here";
/// let private_key = "key_here";
/// let response = api_client.request(&SNICreate::new(
///     "APP_ID",
///     certificate_chain,
///     private_key,
/// ));
///
///match response {
///     Ok(success) => println!("Success: {:#?}", success),
///     Err(e) => println!("Error: {}", e),
///}
//
/// ```
/// See how to create the Heroku [`api_client`][httpApiClientConfig].
///
/// [httpApiClientConfig]: ../../../framework/struct.HttpApiClient.html
/// [response]: ../struct.SNI.html
pub struct SNICreate<'a> {
    /// unique app identifier, either app id or app name
    pub app_id: &'a str,
    /// The parameters to pass to the Heroku API
    pub params: SNICreateParams<'a>,
}

#[cfg(feature = "builder")]
impl<'a> SNICreate<'a> {
    /// Create a new Heroku app SNI with parameters
    pub fn new(app_id: &'a str, certificate_chain: &'a str, private_key: &'a str) -> SNICreate<'a> {
        SNICreate {
            app_id,
            params: SNICreateParams {
                certificate_chain,
                private_key,
            },
        }
    }
}

/// Create a new app sni with parameters.
///
/// [See Heroku documentation for more information about this endpoint](https://devcenter.heroku.com/articles/platform-api-reference#sni-endpoint-create-required-parameters)
#[derive(Serialize, Clone, Debug)]
pub struct SNICreateParams<'a> {
    /// raw contents of the public certificate chain (eg: .crt or .pem file)
    pub certificate_chain: &'a str,
    /// contents of the private key (eg .key file)
    pub private_key: &'a str,
}

impl<'a> HerokuEndpoint<SNI, (), SNICreateParams<'a>> for SNICreate<'a> {
    fn method(&self) -> Method {
        Method::Post
    }
    fn path(&self) -> String {
        format!("apps/{}/sni-endpoints", self.app_id)
    }
    fn body(&self) -> Option<SNICreateParams<'a>> {
        Some(self.params.clone())
    }
}

/// SSL Endpoint Create
///
/// Create a new SSL endpoint.
///
/// [See Heroku documentation for more information about this endpoint](https://devcenter.heroku.com/articles/platform-api-reference#ssl-endpoint-create)
///
/// # Example:
///
/// SSLCreate takes three required parameters, app_id, certificate_chain, private_key. Returns the created [`SSL`][response].
/// ```rust
/// use heroku_rs::prelude::*;
///#    let api_client = HttpApiClient::create("API_KEY").unwrap();
/// 
/// let certificate_chain = "chain_here";
/// let private_key = "key_here";
/// 
/// let create_ssl = &SSLCreate::new("APP_ID", certificate_chain, private_key).preprocess(true).build();
/// let response = api_client.request(create_ssl);
///
///match response {
///     Ok(success) => println!("Success: {:#?}", success),
///     Err(e) => println!("Error: {}", e),
///}
//
/// ```
/// See how to create the Heroku [`api_client`][httpApiClientConfig].
///
/// [httpApiClientConfig]: ../../../framework/struct.HttpApiClient.html
/// [response]: ../struct.SSL.html
pub struct SSLCreate<'a> {
    /// unique app identifier, either app id or app name
    pub app_id: &'a str,
    /// The parameters to pass to the Heroku API
    pub params: SSLCreateParams<'a>,
}

#[cfg(feature = "builder")]
impl<'a> SSLCreate<'a> {
    /// Update Heroku app SSL with parameters
    pub fn new(app_id: &'a str, certificate_chain: &'a str, private_key: &'a str) -> SSLCreate<'a> {
        SSLCreate {
            app_id,
            params: SSLCreateParams {
                certificate_chain: certificate_chain,
                private_key: private_key,
                preprocess: None,
            },
        }
    }

    /// # preprocess: allow Heroku to modify an uploaded public certificate chain if deemed advantageous by adding missing intermediaries, stripping unnecessary ones, etc.
    /// 
    /// `default`: true
    pub fn preprocess(&mut self, preprocess: bool) -> &mut Self {
        self.params.preprocess = Some(preprocess);
        self
    }
    pub fn build(&self) -> SSLCreate<'a> {
        SSLCreate {
            app_id: self.app_id,
            params: SSLCreateParams {
                certificate_chain: self.params.certificate_chain,
                private_key: self.params.private_key,
                preprocess: self.params.preprocess,
            },
        }
    }
}

/// Create a new app ssl endpoint with parameters.
///
/// [See Heroku documentation for more information about this endpoint](hhttps://devcenter.heroku.com/articles/platform-api-reference#ssl-endpoint-create-required-parameters)
#[serde_with::skip_serializing_none]
#[derive(Serialize, Clone, Debug)]
pub struct SSLCreateParams<'a> {
    /// raw contents of the public certificate chain (eg: .crt or .pem file)
    pub certificate_chain: &'a str,
    /// contents of the private key (eg .key file)
    pub private_key: &'a str,
    /// allow Heroku to modify an uploaded public certificate chain if deemed advantageous by adding missing intermediaries, stripping unnecessary ones, etc.
    ///  default: true
    pub preprocess: Option<bool>,
}

impl<'a> HerokuEndpoint<SSL, (), SSLCreateParams<'a>> for SSLCreate<'a> {
    fn method(&self) -> Method {
        Method::Post
    }
    fn path(&self) -> String {
        format!("apps/{}/ssl-endpoints", self.app_id)
    }
    fn body(&self) -> Option<SSLCreateParams<'a>> {
        Some(self.params.clone())
    }
}