openapi_github/models/
runner_label.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/// RunnerLabel : A label for a self hosted runner
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct RunnerLabel {
17    /// Unique identifier of the label.
18    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
19    pub id: Option<i32>,
20    /// Name of the label.
21    #[serde(rename = "name")]
22    pub name: String,
23    /// The type of label. Read-only labels are applied automatically when the runner is configured.
24    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
25    pub r#type: Option<Type>,
26}
27
28impl RunnerLabel {
29    /// A label for a self hosted runner
30    pub fn new(name: String) -> RunnerLabel {
31        RunnerLabel {
32            id: None,
33            name,
34            r#type: None,
35        }
36    }
37}
38/// The type of label. Read-only labels are applied automatically when the runner is configured.
39#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
40pub enum Type {
41    #[serde(rename = "read-only")]
42    ReadOnly,
43    #[serde(rename = "custom")]
44    Custom,
45}
46
47impl Default for Type {
48    fn default() -> Type {
49        Self::ReadOnly
50    }
51}
52