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
use crate::framework::response::ApiResult;
pub mod delete;
pub mod get;
pub mod patch;
pub mod post;
pub mod put;
pub use get::{
InboundRulesetCurrent, InboundRulesetDetails, InboundRulesetList, OutboundRulesetCurrent,
OutboundRulesetDetails, OutboundRulesetList, SpaceAccessDetails, SpaceAccessList, SpaceDetails,
SpaceList, SpaceNATDetails, VPNDetails, VPNList,
};
pub use patch::{SpaceAccessUpdate, SpaceAccessUpdateParams, SpaceUpdate, SpaceUpdateParams};
pub use post::{
SpaceCreate, SpaceCreateParams, SpaceTransferCreate, SpaceTransferCreateParams, VPNCreate,
VPNCreateParams,
};
pub use put::{
InboundRulesetCreate, InboundRulesetCreateParams, OutboundRulesetCreate,
OutboundRulesetCreateParams,
};
pub use delete::{SpaceDelete, VPNDelete};
impl ApiResult for Space {}
impl ApiResult for Vec<Space> {}
impl ApiResult for SpaceAccess {}
impl ApiResult for Vec<SpaceAccess> {}
impl ApiResult for SpaceNAT {}
impl ApiResult for Vec<SpaceNAT> {}
impl ApiResult for SpaceTransfer {}
impl ApiResult for Vec<SpaceTransfer> {}
impl ApiResult for InboundRuleset {}
impl ApiResult for Vec<InboundRuleset> {}
impl ApiResult for OutboundRuleset {}
impl ApiResult for Vec<OutboundRuleset> {}
impl ApiResult for VPN {}
impl ApiResult for Vec<VPN> {}
pub use inbound_ruleset::InboundRuleset;
pub use outbound_ruleset::OutboundRuleset;
pub use space_access::SpaceAccess;
pub use space_nat::SpaceNAT;
pub use space_transfer::SpaceTransfer;
pub use spaces::Space;
pub use vpn::VPN;
mod spaces {
use chrono::offset::Utc;
use chrono::DateTime;
/// Space
///
/// Stability: prototype
///
/// A space is an isolated, highly available, secure app execution environments, running in the modern VPC substrate.
///
/// [See Heroku documentation for more information about this endpoint](https://devcenter.heroku.com/articles/platform-api-reference#space-1)
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct Space {
/// when space was created
pub created_at: DateTime<Utc>,
/// unique identifier of space
pub id: String,
/// unique name of space
/// pattern: `^[a-z0-9](?:[a-z0-9]
pub name: String,
/// organization this space is in
pub organization: Organization,
/// team this space is in
pub team: Team,
/// region of this space
pub region: Region,
/// true if this space has shield enabled
pub shield: bool,
/// availability of this space
/// one of:"allocating" or "allocated" or "deleting"
pub state: String,
/// when space was updated
pub updated_at: DateTime<Utc>,
/// The RFC-1918 CIDR the Private Space will use. It must be a /16 in 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16
/// default: "10.0.0.0/16"
/// pattern: `^((?:10
pub cidr: String,
/// The RFC-1918 CIDR that the Private Space will use for the Heroku-managed peering connection that’s automatically created when using Heroku Data add-ons. It must be between a /16 and a /20
pub data_cidr: String,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct Organization {
/// unique name of team
pub name: String,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct Team {
/// unique identifier of team
pub id: String,
/// unique name of team
pub name: String,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct Region {
/// unique identifier
pub id: String,
/// name of region
pub name: String,
}
}
mod space_access {
use chrono::offset::Utc;
use chrono::DateTime;
/// Space Access
///
/// Stability: prototype
///
/// Space access represents the permissions a particular user has on a particular space.
///
/// [See Heroku documentation for more information about this endpoint](https://devcenter.heroku.com/articles/platform-api-reference#space-access)
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct SpaceAccess {
/// space object
pub space: Space,
/// when space was created
pub created_at: DateTime<Utc>,
/// unique identifier of space
pub id: String,
/// permissions
pub permissions: Vec<Permission>,
/// when space was updated
pub updated_at: DateTime<Utc>,
/// account
pub user: User,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct Space {
/// name of app
/// pattern: ^[a-z][a-z0-9-]{1,28}[a-z0-9]$
pub name: String,
/// unique identifier
pub id: String,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct Permission {
pub description: String,
pub name: String,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct User {
/// unique email address
pub email: String,
/// identifier of an account
pub id: String,
}
}
mod space_nat {
use chrono::offset::Utc;
use chrono::DateTime;
/// Space Network Address Translation
///
/// Stability: prototype
///
/// Network address translation (NAT) for stable outbound IP addresses from a space
///
/// [See Heroku documentation for more information about this endpoint](https://devcenter.heroku.com/articles/platform-api-reference#space-network-address-translation)
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct SpaceNAT {
/// when network address translation for a space was created
pub created_at: DateTime<Utc>,
/// potential IPs from which outbound network traffic will originate
pub sources: Vec<String>,
/// availability of network address translation for a space
/// one of:"disabled" or "updating" or "enabled"
pub state: String,
/// when network address translation for a space was updated
pub updated_at: DateTime<Utc>,
}
}
mod space_transfer {
use chrono::offset::Utc;
use chrono::DateTime;
/// Space Transfer
///
/// Stability: development
///
/// Transfer spaces between enterprise teams with the same Enterprise Account.
///
/// [See Heroku documentation for more information about this endpoint](https://devcenter.heroku.com/articles/platform-api-reference#space-transfer)
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct SpaceTransfer {
pub created_at: DateTime<Utc>,
pub id: String,
pub name: String,
pub organization: Organization,
pub team: Team,
pub region: Region,
pub shield: bool,
pub state: String,
pub updated_at: DateTime<Utc>,
pub cidr: String,
pub data_cidr: String,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct Organization {
pub name: String,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct Team {
pub id: String,
pub name: String,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct Region {
pub id: String,
pub name: String,
}
}
mod inbound_ruleset {
use chrono::offset::Utc;
use chrono::DateTime;
/// Inbound Ruleset
///
/// Stability: prototype
///
/// An inbound-ruleset is a collection of rules that specify what hosts can or cannot connect to an application.
///
/// [See Heroku documentation for more information about this endpoint](https://devcenter.heroku.com/articles/platform-api-reference#inbound-ruleset)
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct InboundRuleset {
/// unique identifier of an inbound-ruleset
pub id: String,
/// space
pub space: Space,
/// when inbound-ruleset was created
pub created_at: DateTime<Utc>,
/// rules
pub rules: Option<Vec<Rule>>,
/// unique email address
pub created_by: String,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct Space {
/// unique identifier of space
pub id: String,
/// pattern: `^[a-z0-9](?:[a-z0-9]
pub name: String,
}
/// example: [{"action":"allow","source":"1.1.1.1/1"}]
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct Rule {
pub action: String,
pub source: String,
}
}
mod outbound_ruleset {
use chrono::offset::Utc;
use chrono::DateTime;
/// Outbound Ruleset
///
/// Stability: prototype
///
/// An outbound-ruleset is a collection of rules that specify what hosts Dynos are allowed to communicate with.
///
/// [See Heroku documentation for more information about this endpoint](https://devcenter.heroku.com/articles/platform-api-reference#outbound-ruleset)
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct OutboundRuleset {
/// unique identifier of an outbound-ruleset
pub id: String,
/// space object
pub space: Space,
/// when outbound-ruleset was created
pub created_at: DateTime<Utc>,
/// rules
pub rules: Option<Vec<Rule>>,
/// unique email address
pub created_by: String,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct Space {
/// unique identifier of space
pub id: String,
/// unique name of space
/// pattern: `^[a-z0-9](?:[a-z0-9]
pub name: String,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct Rule {
pub target: String,
pub from_port: i64,
pub to_port: i64,
pub protocol: String,
}
}
mod vpn {
/// Private Spaces VPN
///
/// Stability: production
///
/// [VPN](https://devcenter.heroku.com/articles/private-space-vpn-connection) provides a way to connect your Private Spaces to your network via VPN.
///
/// [See Heroku documentation for more information about this endpoint](https://devcenter.heroku.com/articles/platform-api-reference#private-spaces-vpn)
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct VPN {
/// VPN unique identifier
pub id: String,
/// VPN Name
pub name: String,
/// Public IP of VPN customer gateway
pub public_ip: String,
/// Routable CIDRs of VPN
pub routable_cidrs: Vec<String>,
/// CIDR Block of the Private Space
pub space_cidr_block: String,
/// tunnels
pub tunnels: Vec<Tunnel>,
/// IKE Version
pub ike_version: i64,
/// Status of the VPN
/// one of:"pending" or "provisioning" or "active" or "deprovisioning" or "failed"
pub status: String,
/// Details of the status
pub status_message: String,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct Tunnel {
pub last_status_change: String,
pub ip: String,
pub customer_ip: String,
pub pre_shared_key: String,
pub status: String,
pub status_message: String,
}
}