use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Migration {
#[serde(rename = "id")]
pub id: i32,
#[serde(rename = "owner", deserialize_with = "Option::deserialize")]
pub owner: Option<Box<models::NullableSimpleUser>>,
#[serde(rename = "guid")]
pub guid: String,
#[serde(rename = "state")]
pub state: String,
#[serde(rename = "lock_repositories")]
pub lock_repositories: bool,
#[serde(rename = "exclude_metadata")]
pub exclude_metadata: bool,
#[serde(rename = "exclude_git_data")]
pub exclude_git_data: bool,
#[serde(rename = "exclude_attachments")]
pub exclude_attachments: bool,
#[serde(rename = "exclude_releases")]
pub exclude_releases: bool,
#[serde(rename = "exclude_owner_projects")]
pub exclude_owner_projects: bool,
#[serde(rename = "org_metadata_only")]
pub org_metadata_only: bool,
#[serde(rename = "repositories")]
pub repositories: Vec<models::Repository>,
#[serde(rename = "url")]
pub url: String,
#[serde(rename = "created_at")]
pub created_at: String,
#[serde(rename = "updated_at")]
pub updated_at: String,
#[serde(rename = "node_id")]
pub node_id: String,
#[serde(rename = "archive_url", skip_serializing_if = "Option::is_none")]
pub archive_url: Option<String>,
#[serde(rename = "exclude", skip_serializing_if = "Option::is_none")]
pub exclude: Option<Vec<String>>,
}
impl Migration {
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 {
Migration {
id,
owner: owner.map(Box::new),
guid,
state,
lock_repositories,
exclude_metadata,
exclude_git_data,
exclude_attachments,
exclude_releases,
exclude_owner_projects,
org_metadata_only,
repositories,
url,
created_at,
updated_at,
node_id,
archive_url: None,
exclude: None,
}
}
}