/*
* 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};
/// NullableRepository : A repository on GitHub.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct NullableRepository {
/// Unique identifier of the repository
#[serde(rename = "id")]
pub id: i32,
#[serde(rename = "node_id")]
pub node_id: String,
/// The name of the repository.
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "full_name")]
pub full_name: String,
#[serde(rename = "license", deserialize_with = "Option::deserialize")]
pub license: Option<Box<models::NullableLicenseSimple>>,
#[serde(rename = "forks")]
pub forks: i32,
#[serde(rename = "permissions", skip_serializing_if = "Option::is_none")]
pub permissions: Option<Box<models::RepositoryPermissions>>,
#[serde(rename = "owner")]
pub owner: Box<models::SimpleUser>,
/// Whether the repository is private or public.
#[serde(rename = "private")]
pub private: bool,
#[serde(rename = "html_url")]
pub html_url: String,
#[serde(rename = "description", deserialize_with = "Option::deserialize")]
pub description: Option<String>,
#[serde(rename = "fork")]
pub fork: bool,
#[serde(rename = "url")]
pub url: String,
#[serde(rename = "archive_url")]
pub archive_url: String,
#[serde(rename = "assignees_url")]
pub assignees_url: String,
#[serde(rename = "blobs_url")]
pub blobs_url: String,
#[serde(rename = "branches_url")]
pub branches_url: String,
#[serde(rename = "collaborators_url")]
pub collaborators_url: String,
#[serde(rename = "comments_url")]
pub comments_url: String,
#[serde(rename = "commits_url")]
pub commits_url: String,
#[serde(rename = "compare_url")]
pub compare_url: String,
#[serde(rename = "contents_url")]
pub contents_url: String,
#[serde(rename = "contributors_url")]
pub contributors_url: String,
#[serde(rename = "deployments_url")]
pub deployments_url: String,
#[serde(rename = "downloads_url")]
pub downloads_url: String,
#[serde(rename = "events_url")]
pub events_url: String,
#[serde(rename = "forks_url")]
pub forks_url: String,
#[serde(rename = "git_commits_url")]
pub git_commits_url: String,
#[serde(rename = "git_refs_url")]
pub git_refs_url: String,
#[serde(rename = "git_tags_url")]
pub git_tags_url: String,
#[serde(rename = "git_url")]
pub git_url: String,
#[serde(rename = "issue_comment_url")]
pub issue_comment_url: String,
#[serde(rename = "issue_events_url")]
pub issue_events_url: String,
#[serde(rename = "issues_url")]
pub issues_url: String,
#[serde(rename = "keys_url")]
pub keys_url: String,
#[serde(rename = "labels_url")]
pub labels_url: String,
#[serde(rename = "languages_url")]
pub languages_url: String,
#[serde(rename = "merges_url")]
pub merges_url: String,
#[serde(rename = "milestones_url")]
pub milestones_url: String,
#[serde(rename = "notifications_url")]
pub notifications_url: String,
#[serde(rename = "pulls_url")]
pub pulls_url: String,
#[serde(rename = "releases_url")]
pub releases_url: String,
#[serde(rename = "ssh_url")]
pub ssh_url: String,
#[serde(rename = "stargazers_url")]
pub stargazers_url: String,
#[serde(rename = "statuses_url")]
pub statuses_url: String,
#[serde(rename = "subscribers_url")]
pub subscribers_url: String,
#[serde(rename = "subscription_url")]
pub subscription_url: String,
#[serde(rename = "tags_url")]
pub tags_url: String,
#[serde(rename = "teams_url")]
pub teams_url: String,
#[serde(rename = "trees_url")]
pub trees_url: String,
#[serde(rename = "clone_url")]
pub clone_url: String,
#[serde(rename = "mirror_url", deserialize_with = "Option::deserialize")]
pub mirror_url: Option<String>,
#[serde(rename = "hooks_url")]
pub hooks_url: String,
#[serde(rename = "svn_url")]
pub svn_url: String,
#[serde(rename = "homepage", deserialize_with = "Option::deserialize")]
pub homepage: Option<String>,
#[serde(rename = "language", deserialize_with = "Option::deserialize")]
pub language: Option<String>,
#[serde(rename = "forks_count")]
pub forks_count: i32,
#[serde(rename = "stargazers_count")]
pub stargazers_count: i32,
#[serde(rename = "watchers_count")]
pub watchers_count: i32,
/// The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0.
#[serde(rename = "size")]
pub size: i32,
/// The default branch of the repository.
#[serde(rename = "default_branch")]
pub default_branch: String,
#[serde(rename = "open_issues_count")]
pub open_issues_count: i32,
/// Whether this repository acts as a template that can be used to generate new repositories.
#[serde(rename = "is_template", skip_serializing_if = "Option::is_none")]
pub is_template: Option<bool>,
#[serde(rename = "topics", skip_serializing_if = "Option::is_none")]
pub topics: Option<Vec<String>>,
/// Whether issues are enabled.
#[serde(rename = "has_issues")]
pub has_issues: bool,
/// Whether projects are enabled.
#[serde(rename = "has_projects")]
pub has_projects: bool,
/// Whether the wiki is enabled.
#[serde(rename = "has_wiki")]
pub has_wiki: bool,
#[serde(rename = "has_pages")]
pub has_pages: bool,
/// Whether downloads are enabled.
#[serde(rename = "has_downloads")]
pub has_downloads: bool,
/// Whether discussions are enabled.
#[serde(rename = "has_discussions", skip_serializing_if = "Option::is_none")]
pub has_discussions: Option<bool>,
/// Whether the repository is archived.
#[serde(rename = "archived")]
pub archived: bool,
/// Returns whether or not this repository disabled.
#[serde(rename = "disabled")]
pub disabled: bool,
/// The repository visibility: public, private, or internal.
#[serde(rename = "visibility", skip_serializing_if = "Option::is_none")]
pub visibility: Option<String>,
#[serde(rename = "pushed_at", deserialize_with = "Option::deserialize")]
pub pushed_at: Option<String>,
#[serde(rename = "created_at", deserialize_with = "Option::deserialize")]
pub created_at: Option<String>,
#[serde(rename = "updated_at", deserialize_with = "Option::deserialize")]
pub updated_at: Option<String>,
/// Whether to allow rebase merges for pull requests.
#[serde(rename = "allow_rebase_merge", skip_serializing_if = "Option::is_none")]
pub allow_rebase_merge: Option<bool>,
#[serde(rename = "temp_clone_token", skip_serializing_if = "Option::is_none")]
pub temp_clone_token: Option<String>,
/// Whether to allow squash merges for pull requests.
#[serde(rename = "allow_squash_merge", skip_serializing_if = "Option::is_none")]
pub allow_squash_merge: Option<bool>,
/// Whether to allow Auto-merge to be used on pull requests.
#[serde(rename = "allow_auto_merge", skip_serializing_if = "Option::is_none")]
pub allow_auto_merge: Option<bool>,
/// Whether to delete head branches when pull requests are merged
#[serde(rename = "delete_branch_on_merge", skip_serializing_if = "Option::is_none")]
pub delete_branch_on_merge: Option<bool>,
/// Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging.
#[serde(rename = "allow_update_branch", skip_serializing_if = "Option::is_none")]
pub allow_update_branch: Option<bool>,
/// Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead.
#[serde(rename = "use_squash_pr_title_as_default", skip_serializing_if = "Option::is_none")]
pub use_squash_pr_title_as_default: Option<bool>,
/// The default value for a squash merge commit title: - `PR_TITLE` - default to the pull request's title. - `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit).
#[serde(rename = "squash_merge_commit_title", skip_serializing_if = "Option::is_none")]
pub squash_merge_commit_title: Option<SquashMergeCommitTitle>,
/// The default value for a squash merge commit message: - `PR_BODY` - default to the pull request's body. - `COMMIT_MESSAGES` - default to the branch's commit messages. - `BLANK` - default to a blank commit message.
#[serde(rename = "squash_merge_commit_message", skip_serializing_if = "Option::is_none")]
pub squash_merge_commit_message: Option<SquashMergeCommitMessage>,
/// The default value for a merge commit title. - `PR_TITLE` - default to the pull request's title. - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name).
#[serde(rename = "merge_commit_title", skip_serializing_if = "Option::is_none")]
pub merge_commit_title: Option<MergeCommitTitle>,
/// The default value for a merge commit message. - `PR_TITLE` - default to the pull request's title. - `PR_BODY` - default to the pull request's body. - `BLANK` - default to a blank commit message.
#[serde(rename = "merge_commit_message", skip_serializing_if = "Option::is_none")]
pub merge_commit_message: Option<MergeCommitMessage>,
/// Whether to allow merge commits for pull requests.
#[serde(rename = "allow_merge_commit", skip_serializing_if = "Option::is_none")]
pub allow_merge_commit: Option<bool>,
/// Whether to allow forking this repo
#[serde(rename = "allow_forking", skip_serializing_if = "Option::is_none")]
pub allow_forking: Option<bool>,
/// Whether to require contributors to sign off on web-based commits
#[serde(rename = "web_commit_signoff_required", skip_serializing_if = "Option::is_none")]
pub web_commit_signoff_required: Option<bool>,
#[serde(rename = "open_issues")]
pub open_issues: i32,
#[serde(rename = "watchers")]
pub watchers: i32,
#[serde(rename = "master_branch", skip_serializing_if = "Option::is_none")]
pub master_branch: Option<String>,
#[serde(rename = "starred_at", skip_serializing_if = "Option::is_none")]
pub starred_at: Option<String>,
/// Whether anonymous git access is enabled for this repository
#[serde(rename = "anonymous_access_enabled", skip_serializing_if = "Option::is_none")]
pub anonymous_access_enabled: Option<bool>,
}
impl NullableRepository {
/// A repository on GitHub.
pub fn new(id: i32, node_id: String, name: String, full_name: String, license: Option<models::NullableLicenseSimple>, forks: i32, owner: models::SimpleUser, private: bool, html_url: String, description: Option<String>, fork: bool, url: String, archive_url: String, assignees_url: String, blobs_url: String, branches_url: String, collaborators_url: String, comments_url: String, commits_url: String, compare_url: String, contents_url: String, contributors_url: String, deployments_url: String, downloads_url: String, events_url: String, forks_url: String, git_commits_url: String, git_refs_url: String, git_tags_url: String, git_url: String, issue_comment_url: String, issue_events_url: String, issues_url: String, keys_url: String, labels_url: String, languages_url: String, merges_url: String, milestones_url: String, notifications_url: String, pulls_url: String, releases_url: String, ssh_url: String, stargazers_url: String, statuses_url: String, subscribers_url: String, subscription_url: String, tags_url: String, teams_url: String, trees_url: String, clone_url: String, mirror_url: Option<String>, hooks_url: String, svn_url: String, homepage: Option<String>, language: Option<String>, forks_count: i32, stargazers_count: i32, watchers_count: i32, size: i32, default_branch: String, open_issues_count: i32, has_issues: bool, has_projects: bool, has_wiki: bool, has_pages: bool, has_downloads: bool, archived: bool, disabled: bool, pushed_at: Option<String>, created_at: Option<String>, updated_at: Option<String>, open_issues: i32, watchers: i32) -> NullableRepository {
NullableRepository {
id,
node_id,
name,
full_name,
license: license.map(Box::new),
forks,
permissions: None,
owner: Box::new(owner),
private,
html_url,
description,
fork,
url,
archive_url,
assignees_url,
blobs_url,
branches_url,
collaborators_url,
comments_url,
commits_url,
compare_url,
contents_url,
contributors_url,
deployments_url,
downloads_url,
events_url,
forks_url,
git_commits_url,
git_refs_url,
git_tags_url,
git_url,
issue_comment_url,
issue_events_url,
issues_url,
keys_url,
labels_url,
languages_url,
merges_url,
milestones_url,
notifications_url,
pulls_url,
releases_url,
ssh_url,
stargazers_url,
statuses_url,
subscribers_url,
subscription_url,
tags_url,
teams_url,
trees_url,
clone_url,
mirror_url,
hooks_url,
svn_url,
homepage,
language,
forks_count,
stargazers_count,
watchers_count,
size,
default_branch,
open_issues_count,
is_template: None,
topics: None,
has_issues,
has_projects,
has_wiki,
has_pages,
has_downloads,
has_discussions: None,
archived,
disabled,
visibility: None,
pushed_at,
created_at,
updated_at,
allow_rebase_merge: None,
temp_clone_token: None,
allow_squash_merge: None,
allow_auto_merge: None,
delete_branch_on_merge: None,
allow_update_branch: None,
use_squash_pr_title_as_default: None,
squash_merge_commit_title: None,
squash_merge_commit_message: None,
merge_commit_title: None,
merge_commit_message: None,
allow_merge_commit: None,
allow_forking: None,
web_commit_signoff_required: None,
open_issues,
watchers,
master_branch: None,
starred_at: None,
anonymous_access_enabled: None,
}
}
}
/// The default value for a squash merge commit title: - `PR_TITLE` - default to the pull request's title. - `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit).
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum SquashMergeCommitTitle {
#[serde(rename = "PR_TITLE")]
PrTitle,
#[serde(rename = "COMMIT_OR_PR_TITLE")]
CommitOrPrTitle,
}
impl Default for SquashMergeCommitTitle {
fn default() -> SquashMergeCommitTitle {
Self::PrTitle
}
}
/// The default value for a squash merge commit message: - `PR_BODY` - default to the pull request's body. - `COMMIT_MESSAGES` - default to the branch's commit messages. - `BLANK` - default to a blank commit message.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum SquashMergeCommitMessage {
#[serde(rename = "PR_BODY")]
PrBody,
#[serde(rename = "COMMIT_MESSAGES")]
CommitMessages,
#[serde(rename = "BLANK")]
Blank,
}
impl Default for SquashMergeCommitMessage {
fn default() -> SquashMergeCommitMessage {
Self::PrBody
}
}
/// The default value for a merge commit title. - `PR_TITLE` - default to the pull request's title. - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name).
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum MergeCommitTitle {
#[serde(rename = "PR_TITLE")]
PrTitle,
#[serde(rename = "MERGE_MESSAGE")]
MergeMessage,
}
impl Default for MergeCommitTitle {
fn default() -> MergeCommitTitle {
Self::PrTitle
}
}
/// The default value for a merge commit message. - `PR_TITLE` - default to the pull request's title. - `PR_BODY` - default to the pull request's body. - `BLANK` - default to a blank commit message.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum MergeCommitMessage {
#[serde(rename = "PR_BODY")]
PrBody,
#[serde(rename = "PR_TITLE")]
PrTitle,
#[serde(rename = "BLANK")]
Blank,
}
impl Default for MergeCommitMessage {
fn default() -> MergeCommitMessage {
Self::PrBody
}
}