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

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

pub use delete::{TeamDelete, TeamInvitationRevoke, TeamMemberDelete};
pub use get::{
    TeamAppDetails, TeamAppList, TeamAppPermissionList, TeamDetails, TeamFeatureDetails,
    TeamFeatureList, TeamInvitationDetails, TeamInvitationList, TeamInvoiceDetails,
    TeamInvoiceList, TeamList, TeamListByEA, TeamMemberAppsList, TeamMemberList, TeamPreferenceList
};
pub use patch::{
    TeamAppTransfer, TeamAppTransferParams, TeamAppUpdateLocked, TeamAppUpdateLockedParams,
    TeamMemberUpdate, TeamMemberUpdateParams, TeamUpdate, TeamUpdateParams, TeamPreferenceUpdate, TeamPreferenceUpdateParams
};
pub use post::{
    TeamAppCreate, TeamAppCreateParams, TeamCreate, TeamCreateByEA, TeamCreateByEAParams,
    TeamCreateOptionalParams, TeamCreateParams, TeamInvitationAccept, TeamMemberCreate,
    TeamMemberCreateParams,
};
pub use put::{
    TeamInvitationCreate, TeamInvitationCreateParams, TeamMemberCreateorUpdate,
    TeamMemberCreateorUpdateParams,
};

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

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

impl ApiResult for Vec<TeamAppPermission> {}

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

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

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

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

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

pub use team::Team;
pub use team_app::TeamApp;
pub use team_feature::TeamFeature;
pub use team_invitation::TeamInvitation;
pub use team_invoice::TeamInvoice;
pub use team_member::TeamMember;
pub use team_permission::TeamAppPermission;
pub use team_preferences::TeamPreferences;

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

    /// Team
    ///
    /// Stability: development
    ///
    /// Teams allow you to manage access to a shared group of applications and other resources.
    ///
    /// [For more information please refer to the Heroku documentation](https://devcenter.heroku.com/articles/platform-api-reference#team)
    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Eq)]
    pub struct Team {
        pub id: String,
        /// when the team was created
        pub created_at: DateTime<Utc>,
        /// whether charges incurred by the team are paid by credit card.
        pub credit_card_collections: bool,
        /// whether to use this team when none is specified
        pub default: bool,
        /// Entererprise account associated with the Team
        pub enterprise_account: Option<EnterpriseAccount>,
        /// Identity Provider associated with the Team
        pub identity_provider: Option<IdentityProvider>,
        /// upper limit of members allowed in a team.
        pub membership_limit: Option<i64>,
        /// unique name of team
        pub name: String,
        /// whether the team is provisioned licenses by salesforce.
        pub provisioned_licenses: bool,
        /// role in the team
        /// one of:"admin" or "collaborator" or "member" or "owner" or null(None)
        pub role: Option<String>,
        /// type of team.
        /// one of:"enterprise" or "team"
        #[serde(rename = "type")]
        pub type_field: String,
        /// when the team was updated
        pub updated_at: DateTime<Utc>,
    }

    /// Entererprise account associated with the Team
    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Eq)]
    pub struct EnterpriseAccount {
        /// unique identifier of the enterprise account
        pub id: String,
        /// unique name of the enterprise account
        pub name: String,
    }

    /// Identity Provider associated with the Team
    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Eq)]
    pub struct IdentityProvider {
        /// unique identifier of this identity provider
        pub id: String,
        /// user-friendly unique identifier for this identity provider
        pub slug: String,
    }
}

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

    /// Team App
    ///
    /// Stability: development
    ///
    /// A team app encapsulates the team specific functionality of Heroku apps.
    ///
    /// [For more information please refer to the Heroku documentation](https://devcenter.heroku.com/articles/platform-api-reference#team-app)
    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Eq)]
    pub struct TeamApp {
        /// when app was archived
        pub archived_at: Option<DateTime<Utc>>,
        /// description from buildpack of app
        pub buildpack_provided_description: Option<String>,
        /// build stack
        pub build_stack: BuildStack,
        /// when app was created
        pub created_at: DateTime<Utc>,
        /// git repo URL of app
        /// pattern: ^https://git\.heroku\.com/[a-z][a-z0-9-]{2,29}\.git$
        pub git_url: String,
        /// unique identifier
        pub id: String,
        /// describes whether a Private Spaces app is externally routable or not
        pub internal_routing: Option<bool>,
        /// is the current member a collaborator on this app.
        pub joined: bool,
        /// are other team members forbidden from joining this app.
        pub locked: bool,
        /// maintenance status of app
        pub maintenance: bool,
        /// name of app
        /// pattern: ^[a-z][a-z0-9-]{1,28}[a-z0-9]$
        pub name: String,
        /// team that owns this app
        pub team: Option<Team>,
        /// identity of app owner
        pub owner: Option<Owner>,
        /// A region represents a geographic location in which your application may run.
        pub region: Region,
        /// when app was released
        pub released_at: Option<DateTime<Utc>>,
        /// git repo size in bytes of app
        pub repo_size: Option<i64>,
        /// slug size in bytes of app
        pub slug_size: Option<i64>,
        /// identity of space
        pub space: Option<Space>,
        /// Stacks are the different application execution environments available in the Heroku platform.
        pub stack: Stack,
        /// when app was updated
        pub updated_at: DateTime<Utc>,
        /// web URL of app
        /// pattern: ^https?://[a-z][a-z0-9-]{3,30}\.herokuapp\.com/$
        pub web_url: String,
    }
    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Eq)]
    pub struct BuildStack {
        /// identifier of stack
        pub id: String,
        /// unique name
        pub name: String,
    }
    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Eq)]
    pub struct Team {
        /// unique name of team
        pub name: String,
    }
    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Eq)]
    pub struct Owner {
        /// unique email address
        pub email: String,
        /// identifier of an account
        pub id: String,
    }
    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Eq)]
    pub struct Region {
        /// unique identifier
        pub id: String,
        /// name of region
        pub name: String,
    }
    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Eq)]
    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, PartialEq, Eq)]
    pub struct Stack {
        /// identifier of stack
        pub id: String,
        /// unique name
        pub name: String,
    }
}

mod team_permission {
    /// Team App Permission
    ///
    /// Stability: prototype
    ///
    /// A team app permission is a behavior that is assigned to a user in a team app.
    ///
    /// [For more information please refer to the Heroku documentation](https://devcenter.heroku.com/articles/platform-api-reference#team-app-permission)
    ///
    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Eq)]
    pub struct TeamAppPermission {
        /// The name of the app permission.
        pub name: String,
        /// A description of what the app permission allows.
        pub description: String,
    }
}

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

    /// Team Feature
    ///
    /// Stability: development
    ///
    /// A team feature represents a feature enabled on a team account.
    ///
    /// [For more information please refer to the Heroku documentation](https://devcenter.heroku.com/articles/platform-api-reference#team-feature)
    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Eq)]
    pub struct TeamFeature {
        /// when team feature was created
        pub created_at: DateTime<Utc>,
        /// description of team feature
        pub description: String,
        /// documentation URL of team feature
        pub doc_url: String,
        /// whether or not team feature has been enabled
        pub enabled: bool,
        /// e-mail to send feedback about the feature
        pub id: String,
        /// unique name of team feature
        pub name: String,
        /// state of team feature
        pub state: String,
        /// when team feature was updated
        pub updated_at: DateTime<Utc>,
        /// user readable feature name
        pub display_name: String,
        /// e-mail to send feedback about the feature
        pub feedback_email: String,
    }
}

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

    /// Team Invitation
    ///
    /// Stability: development
    ///
    /// A team invitation represents an invite to a team.
    ///
    /// [For more information please refer to the Heroku documentation](https://devcenter.heroku.com/articles/platform-api-reference#team-invitation)
    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Eq)]
    pub struct TeamInvitation {
        /// when invitation was created
        pub created_at: DateTime<Utc>,
        /// unique identifier of an invitation
        pub id: String,
        /// invited by
        pub invited_by: InvitedBy,
        /// team invited
        pub team: Team,
        /// role in the team
        ///  one of:"admin" or "collaborator" or "member" or "owner" or null
        pub role: Option<String>,
        /// when invitation was updated
        pub updated_at: DateTime<Utc>,
        /// account
        pub user: User,
    }
    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Eq)]
    pub struct InvitedBy {
        /// unique email address
        pub email: String,
        /// identifier of an account
        pub id: String,
        /// full name of the account owner
        pub name: Option<String>,
    }
    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Eq)]
    pub struct Team {
        /// unique identifier of team
        pub id: String,
        /// unique name of team
        pub name: String,
    }
    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Eq)]
    pub struct User {
        /// unique email address
        pub email: String,
        /// identifier of an account
        pub id: String,
        /// full name of the account owner
        pub name: Option<String>,
    }
}

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

    /// Team Invoice
    ///
    /// Stability: development
    ///
    /// A Team Invoice is an itemized bill of goods for a team which includes pricing and charges.
    ///
    /// [For more information please refer to the Heroku documentation](https://devcenter.heroku.com/articles/platform-api-reference#team-invoice)
    #[derive(Deserialize, Serialize, Debug, Clone)]
    pub struct TeamInvoice {
        /// total add-ons charges in on this invoice
        pub addons_total: i64,
        /// total database charges on this invoice
        pub database_total: i64,
        /// total charges on this invoice
        pub charges_total: i64,
        /// when invoice was created
        pub created_at: DateTime<Utc>,
        /// total credits on this invoice
        pub credits_total: i64,
        /// total amount of dyno units consumed across dyno types.
        pub dyno_units: f64,
        /// unique identifier of this invoice
        pub id: String,
        /// human readable invoice number
        pub number: i64,
        /// status of the invoice payment
        pub payment_status: String,
        /// the ending date that the invoice covers
        pub period_end: String,
        /// the starting date that this invoice covers
        pub period_start: String,
        /// total platform charges on this invoice
        pub platform_total: i64,
        /// payment status for this invoice (pending, successful, failed)
        pub state: i64,
        /// combined total of charges and credits on this invoice
        pub total: i64,
        /// when invoice was updated
        pub updated_at: DateTime<Utc>,
        /// The total amount of hours consumed across dyno types.
        pub weighted_dyno_hours: i64,
    }
}

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

    /// Team Member
    ///
    /// Stability: development
    ///
    /// A team member is an individual with access to a team.
    ///
    /// [For more information please refer to the Heroku documentation](https://devcenter.heroku.com/articles/platform-api-reference#team-member)
    #[derive(Deserialize, Serialize, Debug, Clone)]
    pub struct TeamMember {
        /// when the membership record was created
        pub created_at: DateTime<Utc>,
        /// email address of the team member
        pub email: String,
        /// whether the user is federated and belongs to an Identity Provider
        pub federated: bool,
        /// unique identifier of the team member
        pub id: String,
        /// Identity Provider information the member is federated with
        pub identity_provider: Option<IdentityProvider>,
        /// role in the team
        /// one of:"admin" or "collaborator" or "member" or "owner" or null
        pub role: Option<String>,
        /// whether the Enterprise team member has two factor authentication enabled
        pub two_factor_authentication: bool,
        /// when the membership record was updated
        pub updated_at: DateTime<Utc>,
        /// account
        pub user: User,
    }
    #[derive(Deserialize, Serialize, Debug, Clone)]
    pub struct IdentityProvider {
        /// unique identifier of this identity provider
        pub id: String,
        /// name of the identity provider
        pub name: String,
        /// whether the identity_provider information is redacted or not
        pub redacted: bool,
        /// account owner
        pub owner: Owner,
    }
    #[derive(Deserialize, Serialize, Debug, Clone)]
    pub struct Owner {
        /// unique identifier of the owner
        pub id: String,
        /// name of the owner
        pub name: String,
        /// type of the owner
        /// one of:"team" or "enterprise-account"
        #[serde(rename = "type")]
        pub type_field: String,
    }
    #[derive(Deserialize, Serialize, Debug, Clone)]
    pub struct User {
        /// unique email address
        pub email: String,
        /// identifier of an account
        pub id: String,
        /// full name of the account owner
        pub name: Option<String>,
    }
}


mod team_preferences {

    /// Team Preferences
    ///
    /// Stability: development
    ///
    /// Tracks a Team’s Preferences
    ///
    /// [For more information please refer to the Heroku documentation](https://devcenter.heroku.com/articles/platform-api-reference#team-preferences)
    #[derive(Deserialize, Serialize, Debug, Clone)]
    pub struct TeamPreferences {
        /// The default permission used when adding new members to the team
        ///  one of:"admin" or "member" or "viewer" or null 
        #[serde(rename = "default-permission")]
        pub default_permission: Option<String>,
        /// Whether whitelisting rules should be applied to add-on installations
        #[serde(rename = "whitelisting-enabled")]
        pub whitelisting_enabled: Option<bool>,
    }
}