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
674
675
//Anything related to POST requests for Addons and it's variations goes here.
use super::{Addon, AddonAttachment, AddonWebhook};
use crate::framework::endpoint::{HerokuEndpoint, Method};
use std::collections::HashMap;

/// Add-on Create
///
/// Create a new add-on.
///
/// [See Heroku documentation for more information about this endpoint](https://devcenter.heroku.com/articles/platform-api-reference#add-on-create)
///
/// # Example:
///
/// AddonCreate takes two required parameters, app_id and plan, and returns a [`Addon`][response].
/// ```rust
/// use heroku_rs::prelude::*;
/// use std::collections::HashMap;
///
///#    let api_client = HttpApiClient::create(&"API_KEY").unwrap();
///
/// let app_id = "APP_ID";
/// let plan = "heroku-postgresql:dev";
/// let mut config = HashMap::new();
/// config.insert("db-version", "1.2.3");
///
/// let addon = &AddonCreate::new(app_id, plan)
///     .attachment_name("DATABASE")
///     .confirm("EXAMPLE")
///     .name("acme-inc-primary-database")
///     .config(config)
///     .build();
/// let response = api_client.request(addon);
///
///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.Addon.html
pub struct AddonCreate<'a> {
    /// unique app identifier, either app id or app name.
    pub app_id: &'a str,
    /// parameters to pass to the Heroku API
    params: AddonCreateParams<'a>,
}

#[cfg(feature = "builder")]
impl<'a> AddonCreate<'a> {
    /// Create a new addon without required parameters only
    pub fn new(app_id: &'a str, plan: &'a str) -> AddonCreate<'a> {
        AddonCreate {
            app_id,
            params: AddonCreateParams {
                attachment: None,
                config: None,
                plan: plan,
                confirm: None,
                name: None,
            },
        }
    }

    /// # attachment_name: unique name for this add-on attachment to this app
    pub fn attachment_name(&mut self, attachment_name: &'a str) -> &mut Self {
        self.params.attachment = Some(Attachment {
            name: Some(attachment_name),
        });
        self
    }

    /// # config: custom add-on provisioning options
    pub fn config(&mut self, config: HashMap<&'a str, &'a str>) -> &mut Self {
        self.params.config = Some(config);
        self
    }

    /// # confirm: name of billing entity for confirmation
    pub fn confirm(&mut self, confirm: &'a str) -> &mut Self {
        self.params.confirm = Some(confirm);
        self
    }

    /// # name: globally unique name of the add-on
    ///
    /// `pattern:`  pattern: ^[a-zA-Z][A-Za-z0-9_-]+$
    pub fn name(&mut self, name: &'a str) -> &mut Self {
        self.params.name = Some(name);
        self
    }

    pub fn build(&self) -> AddonCreate<'a> {
        AddonCreate {
            app_id: self.app_id,
            params: AddonCreateParams {
                attachment: self.params.attachment.clone(),
                config: self.params.config.clone(),
                plan: self.params.plan,
                confirm: self.params.confirm,
                name: self.params.name,
            },
        }
    }
}

/// Create add-on with parameters.
///
/// [See Heroku documentation for more information about this endpoint](https://devcenter.heroku.com/articles/platform-api-reference#add-on-create-required-parameters)
#[serde_with::skip_serializing_none]
#[derive(Serialize, Clone, Debug)]
pub struct AddonCreateParams<'a> {
    /// unique name for this add-on attachment to this app
    pub attachment: Option<Attachment<'a>>,
    /// custom add-on provisioning options
    pub config: Option<HashMap<&'a str, &'a str>>,
    /// name of billing entity for confirmation
    pub confirm: Option<&'a str>,
    /// unique identifier or name of this plan
    pub plan: &'a str,
    /// globally unique name of the add-on
    ///  pattern: ^[a-zA-Z][A-Za-z0-9_-]+$
    pub name: Option<&'a str>,
}

#[derive(Serialize, Clone, Debug)]
pub struct Attachment<'a> {
    /// unique name for this add-on attachment to this app
    pub name: Option<&'a str>,
}

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

/// Add-on Resolution
///
/// Resolve an add-on from a name, optionally passing an app name. If there are matches it returns at least one add-on (exact match) or many.
///
/// [See Heroku documentation for more information about this endpoint](https://devcenter.heroku.com/articles/platform-api-reference#add-on-resolution)
///
/// # Example:
///
/// AddonResolutionCreate takes one required parameter, addon_id and returns a list of [`Addons`][response].
/// ```rust
/// use heroku_rs::prelude::*;
///
///#    let api_client = HttpApiClient::create(&"API_KEY").unwrap();
///
/// let response = api_client.request(
///     &AddonResolutionCreate::new("ADDON_ID")
///         .app("APP_ID")
///         .addon_service("heroku-postgresql")
///         .build(),
/// );
///
///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.Addon.html
pub struct AddonResolutionCreate<'a> {
    /// parameters to pass to the Heroku API
    pub params: AddonResolutionCreateParams<'a>,
}

#[cfg(feature = "builder")]
impl<'a> AddonResolutionCreate<'a> {
    /// Create a new addon resolution without optional parameters
    pub fn new(addon: &'a str) -> AddonResolutionCreate<'a> {
        AddonResolutionCreate {
            params: AddonResolutionCreateParams {
                addon: addon,
                addon_service: None,
                app: None,
            },
        }
    }
    /// # app: unique name of this add-on-service
    pub fn addon_service(&mut self, addon_service: &'a str) -> &mut Self {
        self.params.addon_service = Some(addon_service);
        self
    }
    /// # app: unique name of app
    ///
    /// `pattern:` ^[a-z][a-z0-9-]{1,28}[a-z0-9]$ 	"example"
    pub fn app(&mut self, app: &'a str) -> &mut Self {
        self.params.app = Some(app);
        self
    }

    pub fn build(&self) -> AddonResolutionCreate<'a> {
        AddonResolutionCreate {
            params: AddonResolutionCreateParams {
                addon: self.params.addon,
                addon_service: self.params.addon_service,
                app: self.params.app,
            },
        }
    }
}

/// Create add-on resolution with parameters.
///
/// [See Heroku documentation for more information about this endpoint](https://devcenter.heroku.com/articles/platform-api-reference#add-on-resolution-required-parameters)
#[serde_with::skip_serializing_none]
#[derive(Serialize, Clone, Debug)]
pub struct AddonResolutionCreateParams<'a> {
    /// globally unique name of the add-on
    ///  pattern: ^[a-zA-Z][A-Za-z0-9_-]+$
    pub addon: &'a str,
    /// unique name of this add-on-service
    pub addon_service: Option<&'a str>,
    /// unique name of app
    ///  pattern: ^[a-z][a-z0-9-]{1,28}[a-z0-9]$
    pub app: Option<&'a str>,
}

impl<'a> HerokuEndpoint<Vec<Addon>, (), AddonResolutionCreateParams<'a>>
    for AddonResolutionCreate<'a>
{
    fn method(&self) -> Method {
        Method::Post
    }
    fn path(&self) -> String {
        format!("actions/addons/resolve")
    }
    fn body(&self) -> Option<AddonResolutionCreateParams<'a>> {
        Some(self.params.clone())
    }
}

/// Add-on Action Provision
///
/// Mark an add-on as provisioned for use.
///
/// [See Heroku documentation for more information about this endpoint](https://devcenter.heroku.com/articles/platform-api-reference#add-on-action)
///
/// # Example:
///
/// AddonActionProvision takes one required parameter, addon_id, and returns a [`Addon`][response].
/// ```rust
/// use heroku_rs::prelude::*;
/// use std::collections::HashMap;
///
///#    let api_client = HttpApiClient::create(&"API_KEY").unwrap();
///
/// let response = api_client.request(
///     &AddonActionProvision::new("ADDON_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.Addon.html
pub struct AddonActionProvision<'a> {
    pub addon_id: &'a str,
}

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

impl<'a> HerokuEndpoint<Addon> for AddonActionProvision<'a> {
    fn method(&self) -> Method {
        Method::Post
    }
    fn path(&self) -> String {
        format!("addons/{}/actions/provision", self.addon_id)
    }
}

/// Add-on Action Deprovision
///
/// Mark an add-on as deprovisioned.
///
/// [See Heroku documentation for more information about this endpoint](https://devcenter.heroku.com/articles/platform-api-reference#add-on-action-deprovision)
///
/// # Example:
///
/// AddonActionDeprovision takes one required parameter, addon_id, and returns a [`Addon`][response].
/// ```rust
/// use heroku_rs::prelude::*;
///
///#    let api_client = HttpApiClient::create(&"API_KEY").unwrap();
///
/// let response = api_client.request(
///     &AddonActionDeprovision::new("ADDON_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.Addon.html
pub struct AddonActionDeprovision<'a> {
    pub addon_id: &'a str,
}

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

impl<'a> HerokuEndpoint<Addon> for AddonActionDeprovision<'a> {
    fn method(&self) -> Method {
        Method::Post
    }
    fn path(&self) -> String {
        format!("addons/{}/actions/deprovision", self.addon_id)
    }
}

/// Add-on Attachment Create
///
/// Create a new add-on attachment.
///
/// [See Heroku documentation for more information about this endpoint](https://devcenter.heroku.com/articles/platform-api-reference#add-on-attachment-create)
///
/// # Example:
///
/// AttachmentCreate takes two required parameters, addon_id and app_id, and returns a [`AddonAttachment`][response].
/// ```rust
/// use heroku_rs::prelude::*;
///
///#    let api_client = HttpApiClient::create(&"API_KEY").unwrap();
///
/// let response = api_client.request(
///     &AttachmentCreate::new("ADDON_ID", "APP_ID")
///         .namespace("role:analytics")
///         .confirm("EXAMPLE")
///         .name("DATABASE")
///         .build(),
/// );
///
///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.AddonAttachment.html
pub struct AttachmentCreate<'a> {
    /// parameters to pass to the Heroku API
    pub params: AttachmentCreateParams<'a>,
}

#[cfg(feature = "builder")]
impl<'a> AttachmentCreate<'a> {
    /// Create a new addon resolution without optional parameters
    pub fn new(addon: &'a str, app: &'a str) -> AttachmentCreate<'a> {
        AttachmentCreate {
            params: AttachmentCreateParams {
                addon: addon,
                app: app,
                confirm: None,
                name: None,
                namespace: None,
            },
        }
    }

    /// # confirm: name of owning app for confirmation
    pub fn confirm(&mut self, confirm: &'a str) -> &mut Self {
        self.params.confirm = Some(confirm);
        self
    }
    /// # name: unique name for this add-on attachment to this app
    pub fn name(&mut self, name: &'a str) -> &mut Self {
        self.params.name = Some(name);
        self
    }
    /// # namespace: attachment namespace
    pub fn namespace(&mut self, namespace: &'a str) -> &mut Self {
        self.params.namespace = Some(namespace);
        self
    }

    pub fn build(&self) -> AttachmentCreate<'a> {
        AttachmentCreate {
            params: AttachmentCreateParams {
                addon: self.params.addon,
                app: self.params.app,
                confirm: self.params.confirm,
                name: self.params.name,
                namespace: self.params.namespace,
            },
        }
    }
}

/// Create add-on resolution with parameters.
///
/// [See Heroku documentation for more information about these paramters](https://devcenter.heroku.com/articles/platform-api-reference#add-on-attachment-create-required-parameters)
#[derive(Serialize, Clone, Debug)]
pub struct AttachmentCreateParams<'a> {
    /// globally unique name of the add-on
    ///  pattern: ^[a-zA-Z][A-Za-z0-9_-]+$
    pub addon: &'a str,
    /// unique name of app
    ///  pattern: ^[a-z][a-z0-9-]{1,28}[a-z0-9]$
    pub app: &'a str,
    /// name of owning app for confirmation
    #[serde(skip_serializing_if = "Option::is_none")]
    pub confirm: Option<&'a str>,
    /// unique name for this add-on attachment to this app
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<&'a str>,
    /// attachment namespace. [Nullable]
    pub namespace: Option<&'a str>,
}

impl<'a> HerokuEndpoint<AddonAttachment, (), AttachmentCreateParams<'a>> for AttachmentCreate<'a> {
    fn method(&self) -> Method {
        Method::Post
    }
    fn path(&self) -> String {
        format!("addon-attachments")
    }
    fn body(&self) -> Option<AttachmentCreateParams<'a>> {
        Some(self.params.clone())
    }
}

/// Add-on Attachment Resolution
///
/// Resolve an add-on attachment from a name, optionally passing an app name. If there are matches it returns at least one add-on attachment (exact match) or many.
///
/// [See Heroku documentation for more information about this endpoint](https://devcenter.heroku.com/articles/platform-api-reference#add-on-attachment-resolution)
///
/// # Example:
///
/// AttachmentResolutionCreate takes one required parameter, addon_attachment, and returns a list of [`AddonAttachment`][response].
/// ```rust
/// use heroku_rs::prelude::*;
///
///#    let api_client = HttpApiClient::create(&"API_KEY").unwrap();
///
/// let response = api_client.request(
///     &AttachmentResolutionCreate::new("ADDON_ATTACHMENT")
///         .app("APP_NAME")
///         .addon_service("heroku-postgresql")
///         .build(),
/// );
///
///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.AddonAttachment.html
pub struct AttachmentResolutionCreate<'a> {
    /// parameters to pass to the Heroku API
    pub params: AttachmentResolutionCreateParams<'a>,
}

#[cfg(feature = "builder")]
impl<'a> AttachmentResolutionCreate<'a> {
    /// Create a new addon resolution without optional parameters
    pub fn new(addon_attachment: &'a str) -> AttachmentResolutionCreate<'a> {
        AttachmentResolutionCreate {
            params: AttachmentResolutionCreateParams {
                addon_attachment: addon_attachment,
                addon_service: None,
                app: None,
            },
        }
    }
    /// # confirm: name of app
    /// 
    /// `pattern`:  pattern: ^[a-z][a-z0-9-]{1,28}[a-z0-9]$ 
    pub fn app(&mut self, app: &'a str) -> &mut Self {
        self.params.app = Some(app);
        self
    }

    /// # addon_service: unique name of this add-on-service
    pub fn addon_service(&mut self, addon_service: &'a str) -> &mut Self {
        self.params.addon_service = Some(addon_service);
        self
    }

    pub fn build(&self) -> AttachmentResolutionCreate<'a> {
        AttachmentResolutionCreate {
            params: AttachmentResolutionCreateParams {
                addon_attachment: self.params.addon_attachment,
                addon_service: self.params.addon_service,
                app: self.params.app,
            },
        }
    }
}

/// Create add-on resolution with parameters.
///
/// [See Heroku documentation for more information about this endpoint](https://devcenter.heroku.com/articles/platform-api-reference#add-on-resolution-required-parameters)
#[serde_with::skip_serializing_none]
#[derive(Serialize, Clone, Debug)]
pub struct AttachmentResolutionCreateParams<'a> {
    /// unique name for this add-on attachment to this app
    pub addon_attachment: &'a str,
    /// unique name of this add-on-service
    pub addon_service: Option<&'a str>,
    /// unique name of app
    ///  pattern: ^[a-z][a-z0-9-]{1,28}[a-z0-9]$
    pub app: Option<&'a str>,
}

impl<'a> HerokuEndpoint<Vec<AddonAttachment>, (), AttachmentResolutionCreateParams<'a>>
    for AttachmentResolutionCreate<'a>
{
    fn method(&self) -> Method {
        Method::Post
    }
    fn path(&self) -> String {
        format!("actions/addon-attachments/resolve")
    }
    fn body(&self) -> Option<AttachmentResolutionCreateParams<'a>> {
        Some(self.params.clone())
    }
}

/// Add-on Webhook Create
///
/// Create an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on.
///
/// [See Heroku documentation for more information about this endpoint](https://devcenter.heroku.com/articles/platform-api-reference#add-on-webhook-create)
///
/// # Example:
///
/// AttachmentResolutionCreate takes one required parameter, addon_attachment, and returns a [`AddonWebhook`][response].
/// ```rust
/// use heroku_rs::prelude::*;
///
///#    let api_client = HttpApiClient::create(&"API_KEY").unwrap();
///
/// let webhook_include = vec!["api:release"];
/// let webhook_level = "notify";
/// let webhook_url = "https://www.bing.com";
/// let response = api_client.request(&addons::WebhookCreate::new(
///     "ADDON_ID",
///     webhook_include,
///     webhook_level,
///     webhook_url,
/// ));
///
///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.AddonWebhook.html
pub struct WebhookCreate<'a> {
    /// unique addon indentifier, either id or name
    pub addon_id: &'a str,
    /// parameters to pass to the Heroku API
    pub params: WebhookCreateParams<'a>,
}

#[cfg(feature = "builder")]
impl<'a> WebhookCreate<'a> {
    /// Create a new addon webhook without optional parameters
    pub fn new(
        addon_id: &'a str,
        include: Vec<&'a str>,
        level: &'a str,
        url: &'a str,
    ) -> WebhookCreate<'a> {
        WebhookCreate {
            addon_id,
            params: WebhookCreateParams {
                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) -> WebhookCreate<'a> {
        WebhookCreate {
            addon_id: self.addon_id,
            params: WebhookCreateParams {
                authorization: None,
                include: self.params.include.clone(),
                level: self.params.level,
                secret: self.params.secret,
                url: self.params.url,
            },
        }
    }
}

/// Create add-on webhook with parameters.
///
/// [See Heroku documentation for more information about this endpoint](https://devcenter.heroku.com/articles/platform-api-reference#add-on-webhook-create-required-parameters)
#[derive(Serialize, Clone, Debug)]
pub struct WebhookCreateParams<'a> {
    /// a custom Authorization header that Heroku will include with all webhook notifications. [Nullable]
    pub authorization: Option<&'a str>,
    /// the entities that the subscription provides notifications for
    pub include: Vec<&'a str>,
    /// 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
    ///  one of:"notify" or "sync"
    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). [Nullable]
    pub secret: Option<&'a str>,
    /// the URL where the webhook’s notification requests are sent
    pub url: &'a str,
}

impl<'a> HerokuEndpoint<AddonWebhook, (), WebhookCreateParams<'a>> for WebhookCreate<'a> {
    fn method(&self) -> Method {
        Method::Post
    }
    fn path(&self) -> String {
        format!("addons/{}/webhooks", self.addon_id)
    }
    fn body(&self) -> Option<WebhookCreateParams<'a>> {
        Some(self.params.clone())
    }
}