openapi_github/models/
nullable_codespace_machine.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/// NullableCodespaceMachine : A description of the machine powering a codespace.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct NullableCodespaceMachine {
17    /// The name of the machine.
18    #[serde(rename = "name")]
19    pub name: String,
20    /// The display name of the machine includes cores, memory, and storage.
21    #[serde(rename = "display_name")]
22    pub display_name: String,
23    /// The operating system of the machine.
24    #[serde(rename = "operating_system")]
25    pub operating_system: String,
26    /// How much storage is available to the codespace.
27    #[serde(rename = "storage_in_bytes")]
28    pub storage_in_bytes: i32,
29    /// How much memory is available to the codespace.
30    #[serde(rename = "memory_in_bytes")]
31    pub memory_in_bytes: i32,
32    /// How many cores are available to the codespace.
33    #[serde(rename = "cpus")]
34    pub cpus: i32,
35    /// Whether a prebuild is currently available when creating a codespace for this machine and repository. If a branch was not specified as a ref, the default branch will be assumed. Value will be \"null\" if prebuilds are not supported or prebuild availability could not be determined. Value will be \"none\" if no prebuild is available. Latest values \"ready\" and \"in_progress\" indicate the prebuild availability status.
36    #[serde(rename = "prebuild_availability", deserialize_with = "Option::deserialize")]
37    pub prebuild_availability: Option<PrebuildAvailability>,
38}
39
40impl NullableCodespaceMachine {
41    /// A description of the machine powering a codespace.
42    pub fn new(name: String, display_name: String, operating_system: String, storage_in_bytes: i32, memory_in_bytes: i32, cpus: i32, prebuild_availability: Option<PrebuildAvailability>) -> NullableCodespaceMachine {
43        NullableCodespaceMachine {
44            name,
45            display_name,
46            operating_system,
47            storage_in_bytes,
48            memory_in_bytes,
49            cpus,
50            prebuild_availability,
51        }
52    }
53}
54/// Whether a prebuild is currently available when creating a codespace for this machine and repository. If a branch was not specified as a ref, the default branch will be assumed. Value will be \"null\" if prebuilds are not supported or prebuild availability could not be determined. Value will be \"none\" if no prebuild is available. Latest values \"ready\" and \"in_progress\" indicate the prebuild availability status.
55#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
56pub enum PrebuildAvailability {
57    #[serde(rename = "none")]
58    None,
59    #[serde(rename = "ready")]
60    Ready,
61    #[serde(rename = "in_progress")]
62    InProgress,
63}
64
65impl Default for PrebuildAvailability {
66    fn default() -> PrebuildAvailability {
67        Self::None
68    }
69}
70