openapi_github/models/
classroom_assignment.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/// ClassroomAssignment : A GitHub Classroom assignment
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ClassroomAssignment {
17    /// Unique identifier of the repository.
18    #[serde(rename = "id")]
19    pub id: i32,
20    /// Whether an accepted assignment creates a public repository.
21    #[serde(rename = "public_repo")]
22    pub public_repo: bool,
23    /// Assignment title.
24    #[serde(rename = "title")]
25    pub title: String,
26    /// Whether it's a group assignment or individual assignment.
27    #[serde(rename = "type")]
28    pub r#type: Type,
29    /// The link that a student can use to accept the assignment.
30    #[serde(rename = "invite_link")]
31    pub invite_link: String,
32    /// Whether the invitation link is enabled. Visiting an enabled invitation link will accept the assignment.
33    #[serde(rename = "invitations_enabled")]
34    pub invitations_enabled: bool,
35    /// Sluggified name of the assignment.
36    #[serde(rename = "slug")]
37    pub slug: String,
38    /// Whether students are admins on created repository when a student accepts the assignment.
39    #[serde(rename = "students_are_repo_admins")]
40    pub students_are_repo_admins: bool,
41    /// Whether feedback pull request will be created when a student accepts the assignment.
42    #[serde(rename = "feedback_pull_requests_enabled")]
43    pub feedback_pull_requests_enabled: bool,
44    /// The maximum allowable teams for the assignment.
45    #[serde(rename = "max_teams", deserialize_with = "Option::deserialize")]
46    pub max_teams: Option<i32>,
47    /// The maximum allowable members per team.
48    #[serde(rename = "max_members", deserialize_with = "Option::deserialize")]
49    pub max_members: Option<i32>,
50    /// The selected editor for the assignment.
51    #[serde(rename = "editor")]
52    pub editor: String,
53    /// The number of students that have accepted the assignment.
54    #[serde(rename = "accepted")]
55    pub accepted: i32,
56    /// The number of students that have submitted the assignment.
57    #[serde(rename = "submitted")]
58    pub submitted: i32,
59    /// The number of students that have passed the assignment.
60    #[serde(rename = "passing")]
61    pub passing: i32,
62    /// The programming language used in the assignment.
63    #[serde(rename = "language")]
64    pub language: String,
65    /// The time at which the assignment is due.
66    #[serde(rename = "deadline", deserialize_with = "Option::deserialize")]
67    pub deadline: Option<String>,
68    #[serde(rename = "starter_code_repository")]
69    pub starter_code_repository: Box<models::SimpleClassroomRepository>,
70    #[serde(rename = "classroom")]
71    pub classroom: Box<models::Classroom>,
72}
73
74impl ClassroomAssignment {
75    /// A GitHub Classroom assignment
76    pub fn new(id: i32, public_repo: bool, title: String, r#type: Type, invite_link: String, invitations_enabled: bool, slug: String, students_are_repo_admins: bool, feedback_pull_requests_enabled: bool, max_teams: Option<i32>, max_members: Option<i32>, editor: String, accepted: i32, submitted: i32, passing: i32, language: String, deadline: Option<String>, starter_code_repository: models::SimpleClassroomRepository, classroom: models::Classroom) -> ClassroomAssignment {
77        ClassroomAssignment {
78            id,
79            public_repo,
80            title,
81            r#type,
82            invite_link,
83            invitations_enabled,
84            slug,
85            students_are_repo_admins,
86            feedback_pull_requests_enabled,
87            max_teams,
88            max_members,
89            editor,
90            accepted,
91            submitted,
92            passing,
93            language,
94            deadline,
95            starter_code_repository: Box::new(starter_code_repository),
96            classroom: Box::new(classroom),
97        }
98    }
99}
100/// Whether it's a group assignment or individual assignment.
101#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
102pub enum Type {
103    #[serde(rename = "individual")]
104    Individual,
105    #[serde(rename = "group")]
106    Group,
107}
108
109impl Default for Type {
110    fn default() -> Type {
111        Self::Individual
112    }
113}
114