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
//Anything related to DELETE requests for domains and it's properties goes here.
use super::Domain;

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

/// Domain Delete
///
/// Delete an existing domain
///
/// [See Heroku documentation for more information about this endpoint](https://devcenter.heroku.com/articles/platform-api-reference#domain-delete)
pub struct DomainDelete {
    /// app_id can be the app name or id.
    pub app_id: String,
    /// domain_id can be the domain hostname or id.
    pub domain_id: String,
}

impl DomainDelete {
    pub fn new(app_id: String, domain_id: String) -> DomainDelete {
        DomainDelete { app_id, domain_id }
    }
}

impl HerokuEndpoint<Domain> for DomainDelete {
    fn method(&self) -> Method {
        Method::Delete
    }
    fn path(&self) -> String {
        format!("apps/{}/domains/{}", self.app_id, self.domain_id)
    }
}