openapi_github/models/
migration.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/// Migration : A migration.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Migration {
17    #[serde(rename = "id")]
18    pub id: i32,
19    #[serde(rename = "owner", deserialize_with = "Option::deserialize")]
20    pub owner: Option<Box<models::NullableSimpleUser>>,
21    #[serde(rename = "guid")]
22    pub guid: String,
23    #[serde(rename = "state")]
24    pub state: String,
25    #[serde(rename = "lock_repositories")]
26    pub lock_repositories: bool,
27    #[serde(rename = "exclude_metadata")]
28    pub exclude_metadata: bool,
29    #[serde(rename = "exclude_git_data")]
30    pub exclude_git_data: bool,
31    #[serde(rename = "exclude_attachments")]
32    pub exclude_attachments: bool,
33    #[serde(rename = "exclude_releases")]
34    pub exclude_releases: bool,
35    #[serde(rename = "exclude_owner_projects")]
36    pub exclude_owner_projects: bool,
37    #[serde(rename = "org_metadata_only")]
38    pub org_metadata_only: bool,
39    /// The repositories included in the migration. Only returned for export migrations.
40    #[serde(rename = "repositories")]
41    pub repositories: Vec<models::Repository>,
42    #[serde(rename = "url")]
43    pub url: String,
44    #[serde(rename = "created_at")]
45    pub created_at: String,
46    #[serde(rename = "updated_at")]
47    pub updated_at: String,
48    #[serde(rename = "node_id")]
49    pub node_id: String,
50    #[serde(rename = "archive_url", skip_serializing_if = "Option::is_none")]
51    pub archive_url: Option<String>,
52    /// Exclude related items from being returned in the response in order to improve performance of the request. The array can include any of: `\"repositories\"`.
53    #[serde(rename = "exclude", skip_serializing_if = "Option::is_none")]
54    pub exclude: Option<Vec<String>>,
55}
56
57impl Migration {
58    /// A migration.
59    pub fn new(id: i32, owner: Option<models::NullableSimpleUser>, guid: String, state: String, lock_repositories: bool, exclude_metadata: bool, exclude_git_data: bool, exclude_attachments: bool, exclude_releases: bool, exclude_owner_projects: bool, org_metadata_only: bool, repositories: Vec<models::Repository>, url: String, created_at: String, updated_at: String, node_id: String) -> Migration {
60        Migration {
61            id,
62            owner: owner.map(Box::new),
63            guid,
64            state,
65            lock_repositories,
66            exclude_metadata,
67            exclude_git_data,
68            exclude_attachments,
69            exclude_releases,
70            exclude_owner_projects,
71            org_metadata_only,
72            repositories,
73            url,
74            created_at,
75            updated_at,
76            node_id,
77            archive_url: None,
78            exclude: None,
79        }
80    }
81}
82