openapi-github 0.1.0

OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
Documentation
/*
 * GitHub's official OpenAPI spec + Octokit extension
 *
 * OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
 *
 * The version of the OpenAPI document: 16.6.0
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// Migration : A migration.
#[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,
    /// The repositories included in the migration. Only returned for export migrations.
    #[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>,
    /// Exclude related items from being returned in the response in order to improve performance of the request. The array can include any of: `\"repositories\"`.
    #[serde(rename = "exclude", skip_serializing_if = "Option::is_none")]
    pub exclude: Option<Vec<String>>,
}

impl Migration {
    /// A 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,
        }
    }
}