openapi_github/models/orgs_set_membership_for_user_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 OrgsSetMembershipForUserRequest {
16 /// The role to give the user in the organization. Can be one of: * `admin` - The user will become an owner of the organization. * `member` - The user will become a non-owner member of the organization.
17 #[serde(rename = "role", skip_serializing_if = "Option::is_none")]
18 pub role: Option<Role>,
19}
20
21impl OrgsSetMembershipForUserRequest {
22 pub fn new() -> OrgsSetMembershipForUserRequest {
23 OrgsSetMembershipForUserRequest {
24 role: None,
25 }
26 }
27}
28/// The role to give the user in the organization. Can be one of: * `admin` - The user will become an owner of the organization. * `member` - The user will become a non-owner member of the organization.
29#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
30pub enum Role {
31 #[serde(rename = "admin")]
32 Admin,
33 #[serde(rename = "member")]
34 Member,
35}
36
37impl Default for Role {
38 fn default() -> Role {
39 Self::Admin
40 }
41}
42