openapi_github/models/
copilot_seat_details.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/// CopilotSeatDetails : Information about a Copilot Business seat assignment for a user, team, or organization.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct CopilotSeatDetails {
17    #[serde(rename = "assignee")]
18    pub assignee: Box<models::CopilotSeatDetailsAssignee>,
19    #[serde(rename = "assigning_team", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
20    pub assigning_team: Option<Option<Box<models::CopilotSeatDetailsAssigningTeam>>>,
21    /// The pending cancellation date for the seat, in `YYYY-MM-DD` format. This will be null unless the assignee's Copilot access has been canceled during the current billing cycle. If the seat has been cancelled, this corresponds to the start of the organization's next billing cycle.
22    #[serde(rename = "pending_cancellation_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
23    pub pending_cancellation_date: Option<Option<String>>,
24    /// Timestamp of user's last GitHub Copilot activity, in ISO 8601 format.
25    #[serde(rename = "last_activity_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
26    pub last_activity_at: Option<Option<String>>,
27    /// Last editor that was used by the user for a GitHub Copilot completion.
28    #[serde(rename = "last_activity_editor", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
29    pub last_activity_editor: Option<Option<String>>,
30    /// Timestamp of when the assignee was last granted access to GitHub Copilot, in ISO 8601 format.
31    #[serde(rename = "created_at")]
32    pub created_at: String,
33    /// Timestamp of when the assignee's GitHub Copilot access was last updated, in ISO 8601 format.
34    #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
35    pub updated_at: Option<String>,
36}
37
38impl CopilotSeatDetails {
39    /// Information about a Copilot Business seat assignment for a user, team, or organization.
40    pub fn new(assignee: models::CopilotSeatDetailsAssignee, created_at: String) -> CopilotSeatDetails {
41        CopilotSeatDetails {
42            assignee: Box::new(assignee),
43            assigning_team: None,
44            pending_cancellation_date: None,
45            last_activity_at: None,
46            last_activity_editor: None,
47            created_at,
48            updated_at: None,
49        }
50    }
51}
52