openapi_github/models/
organization_role.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/// OrganizationRole : Organization roles
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct OrganizationRole {
17    /// The unique identifier of the role.
18    #[serde(rename = "id")]
19    pub id: i32,
20    /// The name of the role.
21    #[serde(rename = "name")]
22    pub name: String,
23    /// A short description about who this role is for or what permissions it grants.
24    #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
25    pub description: Option<Option<String>>,
26    /// A list of permissions included in this role.
27    #[serde(rename = "permissions")]
28    pub permissions: Vec<String>,
29    #[serde(rename = "organization", deserialize_with = "Option::deserialize")]
30    pub organization: Option<Box<models::NullableSimpleUser>>,
31    /// The date and time the role was created.
32    #[serde(rename = "created_at")]
33    pub created_at: String,
34    /// The date and time the role was last updated.
35    #[serde(rename = "updated_at")]
36    pub updated_at: String,
37}
38
39impl OrganizationRole {
40    /// Organization roles
41    pub fn new(id: i32, name: String, permissions: Vec<String>, organization: Option<models::NullableSimpleUser>, created_at: String, updated_at: String) -> OrganizationRole {
42        OrganizationRole {
43            id,
44            name,
45            description: None,
46            permissions,
47            organization: organization.map(Box::new),
48            created_at,
49            updated_at,
50        }
51    }
52}
53