openapi_github/models/orgs_create_invitation_request.rs
1/*
2 * GitHub's official OpenAPI spec + Octokit extension
3 *
4 * OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
5 *
6 * The version of the OpenAPI document: 16.6.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct OrgsCreateInvitationRequest {
16 /// **Required unless you provide `email`**. GitHub user ID for the person you are inviting.
17 #[serde(rename = "invitee_id", skip_serializing_if = "Option::is_none")]
18 pub invitee_id: Option<i32>,
19 /// **Required unless you provide `invitee_id`**. Email address of the person you are inviting, which can be an existing GitHub user.
20 #[serde(rename = "email", skip_serializing_if = "Option::is_none")]
21 pub email: Option<String>,
22 /// The role for the new member. * `admin` - Organization owners with full administrative rights to the organization and complete access to all repositories and teams. * `direct_member` - Non-owner organization members with ability to see other members and join teams by invitation. * `billing_manager` - Non-owner organization members with ability to manage the billing settings of your organization. * `reinstate` - The previous role assigned to the invitee before they were removed from your organization. Can be one of the roles listed above. Only works if the invitee was previously part of your organization.
23 #[serde(rename = "role", skip_serializing_if = "Option::is_none")]
24 pub role: Option<Role>,
25 /// Specify IDs for the teams you want to invite new members to.
26 #[serde(rename = "team_ids", skip_serializing_if = "Option::is_none")]
27 pub team_ids: Option<Vec<i32>>,
28}
29
30impl OrgsCreateInvitationRequest {
31 pub fn new() -> OrgsCreateInvitationRequest {
32 OrgsCreateInvitationRequest {
33 invitee_id: None,
34 email: None,
35 role: None,
36 team_ids: None,
37 }
38 }
39}
40/// The role for the new member. * `admin` - Organization owners with full administrative rights to the organization and complete access to all repositories and teams. * `direct_member` - Non-owner organization members with ability to see other members and join teams by invitation. * `billing_manager` - Non-owner organization members with ability to manage the billing settings of your organization. * `reinstate` - The previous role assigned to the invitee before they were removed from your organization. Can be one of the roles listed above. Only works if the invitee was previously part of your organization.
41#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
42pub enum Role {
43 #[serde(rename = "admin")]
44 Admin,
45 #[serde(rename = "direct_member")]
46 DirectMember,
47 #[serde(rename = "billing_manager")]
48 BillingManager,
49 #[serde(rename = "reinstate")]
50 Reinstate,
51}
52
53impl Default for Role {
54 fn default() -> Role {
55 Self::Admin
56 }
57}
58