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
use crate::framework::response::ApiResult;

pub mod delete;
pub mod get;
pub mod patch;
pub mod post;
pub mod put;

pub use get::{RatelimitDetails, RegionDetails, RegionList, StackDetails, StackList};
pub use post::SourceCreate;

pub use ratelimit::Ratelimit;
pub use region::Region;
pub use sources::SourceBlob;
pub use stack::Stack;

impl ApiResult for Region {}
impl ApiResult for Vec<Region> {}

impl ApiResult for Ratelimit {}

impl ApiResult for Stack {}
impl ApiResult for Vec<Stack> {}

impl ApiResult for SourceBlob {}

mod region {
    use chrono::offset::Utc;
    use chrono::DateTime;

    /// Region
    ///
    /// Stability: production
    ///
    /// A region represents a geographic location in which your application may run.
    ///
    /// [For more information please refer to the Heroku documentation](https://devcenter.heroku.com/articles/platform-api-reference#region)
    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Eq)]
    pub struct Region {
        /// country where the region exists
        pub country: String,
        /// when region was created
        pub created_at: DateTime<Utc>,
        /// description of region
        pub description: String,
        /// unique identifier
        pub id: String,
        /// area in the country where the region exists
        pub locale: String,
        /// name of region
        pub name: String,
        /// whether or not region is available for creating a Private Space
        pub private_capable: bool,
        /// provider
        pub provider: Provider,
        /// when region was updated
        pub updated_at: DateTime<Utc>,
    }

    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Eq)]
    pub struct Provider {
        /// name of provider
        pub name: String,
        /// region name used by provider
        /// one of:"ap-south-1" or "eu-west-1" or "ap-southeast-1" or "ap-southeast-2" or "eu-central-1" or "ap-northeast-2" or "ap-northeast-1" or "us-east-1" or "sa-east-1" or "us-west-1" or "us-west-2"
        pub region: String,
    }
}

mod ratelimit {
    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Eq)]
    pub struct Ratelimit {
        pub remaining: i64,
    }
}

mod stack {
    use chrono::offset::Utc;
    use chrono::DateTime;

    /// Stack
    ///
    /// Stability: production
    ///
    /// Stacks are the different application execution environments available in the Heroku platform.
    ///
    /// [For more information please refer to the Heroku documentation](https://devcenter.heroku.com/articles/platform-api-reference#stack)

    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Eq)]
    pub struct Stack {
        /// indicates this stack is the default for new apps
        pub default: bool,
        /// when stack was introduced
        pub created_at: DateTime<Utc>,
        /// identifier of stack
        pub id: String,
        /// unique name
        pub name: String,
        /// availability of this stack: beta, deprecated or public
        pub state: String,
        /// when stack was last modified
        pub updated_at: DateTime<Utc>,
    }
}

mod sources {
    /// Source
    ///
    /// Stability: production
    ///
    /// A source is a location for uploading and downloading an application’s source code.
    ///
    /// [For more information please refer to the Heroku documentation](https://devcenter.heroku.com/articles/platform-api-reference#source)
    #[derive(Deserialize, Serialize, Debug, Clone)]
    pub struct SourceBlob {
        /// the urls which you can download or upload the source
        pub source_blob: SourceBlobData,
    }
    #[derive(Deserialize, Serialize, Debug, Clone)]
    pub struct SourceBlobData {
        /// URL to download the source
        pub get_url: String,
        /// URL to upload the source
        pub put_url: String,
    }
}