feat: progress and visualize progress
This commit is contained in:
parent
01696c7e0e
commit
8cc41b7dc6
173 changed files with 3006 additions and 585 deletions
|
@ -1 +1,3 @@
|
|||
![Progress](./progress.png)
|
||||
|
||||
docs: https://codeberg.org/api/swagger#/organization/orgCreateHook
|
||||
|
|
8
calc_stats.sh
Normal file
8
calc_stats.sh
Normal file
|
@ -0,0 +1,8 @@
|
|||
ENUMERATOR=$(rg "to-todo" -c -I | paste -sd+ | bc)
|
||||
DENOMINATOR=$(rg "pub mod" ./src/types/api/ -c -I | paste -sd+ | bc)
|
||||
|
||||
echo "$ENUMERATOR.0/$DENOMINATOR.0"
|
||||
UNDONE=$(echo "scale=2; ($ENUMERATOR * 100)/$DENOMINATOR" | bc )
|
||||
DONE=$(echo "scale=2; 100 - $UNDONE" | bc)
|
||||
echo done: $DONE %
|
||||
echo undone: $UNDONE %
|
BIN
progress.png
Normal file
BIN
progress.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 33 KiB |
|
@ -1 +1,2 @@
|
|||
pub mod macros;
|
||||
pub mod types;
|
||||
|
|
113
src/macros.rs
Normal file
113
src/macros.rs
Normal file
|
@ -0,0 +1,113 @@
|
|||
// Define the macro that generates the implementation for the enum
|
||||
#[macro_export]
|
||||
macro_rules! implement_boolean_enum {
|
||||
($module_name:ident, $enum_name:ident) => {
|
||||
implement_boolean_enum!($module_name, $enum_name { Yes, No });
|
||||
};
|
||||
($module_name:ident, $enum_name:ident { $yes_variant:ident, $no_variant:ident }) => {
|
||||
pub mod $module_name {
|
||||
use clap::ValueEnum;
|
||||
use strum::{Display, EnumIs, EnumIter, EnumString};
|
||||
|
||||
#[derive(
|
||||
Debug, Clone, Copy, PartialEq, Eq, ValueEnum, Display, EnumIter, EnumString, EnumIs,
|
||||
)]
|
||||
pub enum $enum_name {
|
||||
$yes_variant,
|
||||
$no_variant,
|
||||
}
|
||||
|
||||
mod serde {
|
||||
use serde::de::Visitor;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use super::$enum_name;
|
||||
|
||||
impl Serialize for $enum_name {
|
||||
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
||||
where
|
||||
S: serde::Serializer,
|
||||
{
|
||||
serializer.serialize_bool(matches!(*self, $enum_name::$yes_variant))
|
||||
}
|
||||
}
|
||||
|
||||
struct PrivateVisitor;
|
||||
|
||||
impl<'de> Visitor<'de> for PrivateVisitor {
|
||||
type Value = $enum_name;
|
||||
|
||||
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
formatter.write_str("a boolean value (true/false)")
|
||||
}
|
||||
|
||||
fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
|
||||
where
|
||||
E: serde::de::Error,
|
||||
{
|
||||
if v {
|
||||
Ok($enum_name::$yes_variant)
|
||||
} else {
|
||||
Ok($enum_name::$no_variant)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'de> Deserialize<'de> for $enum_name {
|
||||
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
|
||||
where
|
||||
D: serde::Deserializer<'de>,
|
||||
{
|
||||
deserializer.deserialize_bool(PrivateVisitor)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mod from {
|
||||
use super::$enum_name;
|
||||
|
||||
impl Into<bool> for $enum_name {
|
||||
fn into(self) -> bool {
|
||||
match self {
|
||||
$enum_name::$yes_variant => true,
|
||||
$enum_name::$no_variant => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::$enum_name;
|
||||
|
||||
#[test]
|
||||
fn deserialize_true() {
|
||||
let input = "true";
|
||||
let val: $enum_name = serde_json::from_str(input).unwrap();
|
||||
assert_eq!($enum_name::$yes_variant, val);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn deserialize_false() {
|
||||
let input = "false";
|
||||
let val: $enum_name = serde_json::from_str(input).unwrap();
|
||||
assert_eq!($enum_name::$no_variant, val);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn serialize_true() {
|
||||
let input = $enum_name::$yes_variant;
|
||||
let val = serde_json::to_string(&input).unwrap();
|
||||
assert_eq!(val.as_str(), "true");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn serialize_false() {
|
||||
let input = $enum_name::$no_variant;
|
||||
let val = serde_json::to_string(&input).unwrap();
|
||||
assert_eq!(val.as_str(), "false");
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
9
src/types/api/access_token.rs
Normal file
9
src/types/api/access_token.rs
Normal file
|
@ -0,0 +1,9 @@
|
|||
// [AccessToken represents an API access token.{
|
||||
// id integer($int64)
|
||||
// name string
|
||||
// scopes [
|
||||
// x-go-name: Scopes
|
||||
// string]
|
||||
// sha1 string
|
||||
// token_last_eight string
|
||||
// }]
|
6
src/types/api/add/collaborator.rs
Normal file
6
src/types/api/add/collaborator.rs
Normal file
|
@ -0,0 +1,6 @@
|
|||
// AddCollaboratorOption{
|
||||
// description:
|
||||
// AddCollaboratorOption options when adding a user as a collaborator of a repository
|
||||
//
|
||||
// permission string
|
||||
// }
|
10
src/types/api/add/label.rs
Normal file
10
src/types/api/add/label.rs
Normal file
|
@ -0,0 +1,10 @@
|
|||
// IssueLabelsOption{
|
||||
// description:
|
||||
// IssueLabelsOption a collection of labels
|
||||
//
|
||||
// labels [
|
||||
// x-go-name: Labels
|
||||
// list of label IDs
|
||||
//
|
||||
// integer($int64)]
|
||||
// }
|
5
src/types/api/add/mod.rs
Normal file
5
src/types/api/add/mod.rs
Normal file
|
@ -0,0 +1,5 @@
|
|||
/* to-todo */
|
||||
pub mod collaborator;
|
||||
/* to-todo */ pub mod label;
|
||||
/* to-todo */ pub mod time;
|
||||
/* to-todo */ pub mod topic;
|
12
src/types/api/add/time.rs
Normal file
12
src/types/api/add/time.rs
Normal file
|
@ -0,0 +1,12 @@
|
|||
// AddTimeOption{
|
||||
// description:
|
||||
// AddTimeOption options for adding time to an issue
|
||||
//
|
||||
// created string($date-time)
|
||||
// time* integer($int64)
|
||||
// time in seconds
|
||||
//
|
||||
// user_name string
|
||||
// User who spent the time (optional)
|
||||
//
|
||||
// }
|
10
src/types/api/add/topic.rs
Normal file
10
src/types/api/add/topic.rs
Normal file
|
@ -0,0 +1,10 @@
|
|||
// RepoTopicOptions{
|
||||
// description:
|
||||
// RepoTopicOptions a collection of repo topic names
|
||||
//
|
||||
// topics [
|
||||
// x-go-name: Topics
|
||||
// list of topic names
|
||||
//
|
||||
// string]
|
||||
// }
|
12
src/types/api/annotated_tag.rs
Normal file
12
src/types/api/annotated_tag.rs
Normal file
|
@ -0,0 +1,12 @@
|
|||
// AnnotatedTag{
|
||||
// description:
|
||||
// AnnotatedTag represents an annotated tag
|
||||
//
|
||||
// message string
|
||||
// object AnnotatedTagObject{...}
|
||||
// sha string
|
||||
// tag string
|
||||
// tagger CommitUser contains information of a user in the context of a commit.{...}
|
||||
// url string
|
||||
// verification PayloadCommitVerification{...}
|
||||
// }
|
8
src/types/api/annotated_tag_object.rs
Normal file
8
src/types/api/annotated_tag_object.rs
Normal file
|
@ -0,0 +1,8 @@
|
|||
// AnnotatedTagObject{
|
||||
// description:
|
||||
// AnnotatedTagObject contains meta information of the tag object
|
||||
//
|
||||
// sha string
|
||||
// type string
|
||||
// url string
|
||||
// }
|
9
src/types/api/api_settings.rs
Normal file
9
src/types/api/api_settings.rs
Normal file
|
@ -0,0 +1,9 @@
|
|||
// GeneralAPISettings{
|
||||
// description:
|
||||
// GeneralAPISettings contains global api settings exposed by it
|
||||
//
|
||||
// default_git_trees_per_page integer($int64)
|
||||
// default_max_blob_size integer($int64)
|
||||
// default_paging_num integer($int64)
|
||||
// max_response_items integer($int64)
|
||||
// }
|
14
src/types/api/attachment.rs
Normal file
14
src/types/api/attachment.rs
Normal file
|
@ -0,0 +1,14 @@
|
|||
// [
|
||||
// x-go-name: Attachments
|
||||
// Attachment{
|
||||
// description:
|
||||
// Attachment a generic attachment
|
||||
//
|
||||
// browser_download_url string
|
||||
// created_at string($date-time)
|
||||
// download_count integer($int64)
|
||||
// id integer($int64)
|
||||
// name string
|
||||
// size integer($int64)
|
||||
// uuid string
|
||||
// }]
|
9
src/types/api/attachment_settings.rs
Normal file
9
src/types/api/attachment_settings.rs
Normal file
|
@ -0,0 +1,9 @@
|
|||
// GeneralAttachmentSettings{
|
||||
// description:
|
||||
// GeneralAttachmentSettings contains global Attachment settings exposed by API
|
||||
//
|
||||
// allowed_types string
|
||||
// enabled boolean
|
||||
// max_files integer($int64)
|
||||
// max_size integer($int64)
|
||||
// }
|
16
src/types/api/branch.rs
Normal file
16
src/types/api/branch.rs
Normal file
|
@ -0,0 +1,16 @@
|
|||
// [Branch{
|
||||
// description:
|
||||
// Branch represents a repository branch
|
||||
//
|
||||
// commit PayloadCommit{...}
|
||||
// effective_branch_protection_name string
|
||||
// enable_status_check boolean
|
||||
// name string
|
||||
// protected boolean
|
||||
// required_approvals integer($int64)
|
||||
// status_check_contexts [
|
||||
// x-go-name: StatusCheckContexts
|
||||
// string]
|
||||
// user_can_merge boolean
|
||||
// user_can_push boolean
|
||||
// }]
|
46
src/types/api/branch_protection.rs
Normal file
46
src/types/api/branch_protection.rs
Normal file
|
@ -0,0 +1,46 @@
|
|||
// [BranchProtection{
|
||||
// description:
|
||||
// BranchProtection represents a branch protection for a repository
|
||||
//
|
||||
// approvals_whitelist_teams [
|
||||
// x-go-name: ApprovalsWhitelistTeams
|
||||
// string]
|
||||
// approvals_whitelist_username [
|
||||
// x-go-name: ApprovalsWhitelistUsernames
|
||||
// string]
|
||||
// block_on_official_review_requests boolean
|
||||
// block_on_outdated_branch boolean
|
||||
// block_on_rejected_reviews boolean
|
||||
// branch_name string
|
||||
// Deprecated: true
|
||||
//
|
||||
// created_at string($date-time)
|
||||
// dismiss_stale_approvals boolean
|
||||
// enable_approvals_whitelist boolean
|
||||
// enable_merge_whitelist boolean
|
||||
// enable_push boolean
|
||||
// enable_push_whitelist boolean
|
||||
// enable_status_check boolean
|
||||
// merge_whitelist_teams [
|
||||
// x-go-name: MergeWhitelistTeams
|
||||
// string]
|
||||
// merge_whitelist_usernames [
|
||||
// x-go-name: MergeWhitelistUsernames
|
||||
// string]
|
||||
// protected_file_patterns string
|
||||
// push_whitelist_deploy_keys boolean
|
||||
// push_whitelist_teams [
|
||||
// x-go-name: PushWhitelistTeams
|
||||
// string]
|
||||
// push_whitelist_usernames [
|
||||
// x-go-name: PushWhitelistUsernames
|
||||
// string]
|
||||
// require_signed_commits boolean
|
||||
// required_approvals integer($int64)
|
||||
// rule_name string
|
||||
// status_check_contexts [
|
||||
// x-go-name: StatusCheckContexts
|
||||
// string]
|
||||
// unprotected_file_patterns string
|
||||
// updated_at string($date-time)
|
||||
// }]
|
14
src/types/api/changed_file.rs
Normal file
14
src/types/api/changed_file.rs
Normal file
|
@ -0,0 +1,14 @@
|
|||
// [ChangedFile{
|
||||
// description:
|
||||
// ChangedFile store information about files affected by the pull request
|
||||
//
|
||||
// additions integer($int64)
|
||||
// changes integer($int64)
|
||||
// contents_url string
|
||||
// deletions integer($int64)
|
||||
// filename string
|
||||
// html_url string
|
||||
// previous_filename string
|
||||
// raw_url string
|
||||
// status string
|
||||
// }]
|
14
src/types/api/combined_status.rs
Normal file
14
src/types/api/combined_status.rs
Normal file
|
@ -0,0 +1,14 @@
|
|||
// CombinedStatus{
|
||||
// description:
|
||||
// CombinedStatus holds the combined state of several statuses for a single commit
|
||||
//
|
||||
// commit_url string
|
||||
// repository Repository{...}
|
||||
// sha string
|
||||
// state CommitStatusState[...]
|
||||
// statuses [
|
||||
// x-go-name: Statuses
|
||||
// CommitStatus{...}]
|
||||
// total_count integer($int64)
|
||||
// url string
|
||||
// }
|
18
src/types/api/comment.rs
Normal file
18
src/types/api/comment.rs
Normal file
|
@ -0,0 +1,18 @@
|
|||
// Comment{
|
||||
// description:
|
||||
// Comment represents a comment on a commit or issue
|
||||
//
|
||||
// assets [
|
||||
// x-go-name: Attachments
|
||||
// Attachment{...}]
|
||||
// body string
|
||||
// created_at string($date-time)
|
||||
// html_url string
|
||||
// id integer($int64)
|
||||
// issue_url string
|
||||
// original_author string
|
||||
// original_author_id integer($int64)
|
||||
// pull_request_url string
|
||||
// updated_at string($date-time)
|
||||
// user User{...}
|
||||
// }]
|
16
src/types/api/commit.rs
Normal file
16
src/types/api/commit.rs
Normal file
|
@ -0,0 +1,16 @@
|
|||
// [Commit contains information generated from a Git commit.{
|
||||
// author User{...}
|
||||
// commit RepoCommit contains information of a commit in the context of a repository.{...}
|
||||
// committer User{...}
|
||||
// created string($date-time)
|
||||
// files [
|
||||
// x-go-name: Files
|
||||
// CommitAffectedFiles{...}]
|
||||
// html_url string
|
||||
// parents [
|
||||
// x-go-name: Parents
|
||||
// CommitMeta contains meta information of a commit in terms of API.{...}]
|
||||
// sha string
|
||||
// stats CommitStats{...}
|
||||
// url string
|
||||
// }]
|
6
src/types/api/commit_affected_files.rs
Normal file
6
src/types/api/commit_affected_files.rs
Normal file
|
@ -0,0 +1,6 @@
|
|||
// CommitAffectedFiles{
|
||||
// description:
|
||||
// CommitAffectedFiles store information about files affected by the commit
|
||||
//
|
||||
// filename string
|
||||
// }]
|
7
src/types/api/commit_date_options.rs
Normal file
7
src/types/api/commit_date_options.rs
Normal file
|
@ -0,0 +1,7 @@
|
|||
// CommitDateOptions{
|
||||
// description:
|
||||
// CommitDateOptions store dates for GIT_AUTHOR_DATE and GIT_COMMITTER_DATE
|
||||
//
|
||||
// author string($date-time)
|
||||
// committer string($date-time)
|
||||
// }
|
5
src/types/api/commit_meta.rs
Normal file
5
src/types/api/commit_meta.rs
Normal file
|
@ -0,0 +1,5 @@
|
|||
// CommitMeta contains meta information of a commit in terms of API.{
|
||||
// created string($date-time)
|
||||
// sha string
|
||||
// url string
|
||||
// }
|
8
src/types/api/commit_stats.rs
Normal file
8
src/types/api/commit_stats.rs
Normal file
|
@ -0,0 +1,8 @@
|
|||
// CommitStats{
|
||||
// description:
|
||||
// CommitStats is statistics for a RepoCommit
|
||||
//
|
||||
// additions integer($int64)
|
||||
// deletions integer($int64)
|
||||
// total integer($int64)
|
||||
// }
|
14
src/types/api/commit_status.rs
Normal file
14
src/types/api/commit_status.rs
Normal file
|
@ -0,0 +1,14 @@
|
|||
// CommitStatus{
|
||||
// description:
|
||||
// CommitStatus holds a single status of a single Commit
|
||||
//
|
||||
// context string
|
||||
// created_at string($date-time)
|
||||
// creator User{...}
|
||||
// description string
|
||||
// id integer($int64)
|
||||
// status CommitStatusState[...]
|
||||
// target_url string
|
||||
// updated_at string($date-time)
|
||||
// url string
|
||||
// }]
|
3
src/types/api/commit_status_state.rs
Normal file
3
src/types/api/commit_status_state.rs
Normal file
|
@ -0,0 +1,3 @@
|
|||
// CommitStatusStatestring
|
||||
// CommitStatusState holds the state of a CommitStatus
|
||||
// It can be "pending", "success", "error", "failure", and "warning"
|
5
src/types/api/commit_user.rs
Normal file
5
src/types/api/commit_user.rs
Normal file
|
@ -0,0 +1,5 @@
|
|||
// CommitUser contains information of a user in the context of a commit.{
|
||||
// date string
|
||||
// email string($email)
|
||||
// name string
|
||||
// }
|
30
src/types/api/content_response.rs
Normal file
30
src/types/api/content_response.rs
Normal file
|
@ -0,0 +1,30 @@
|
|||
// [ContentsResponse{
|
||||
// description:
|
||||
// ContentsResponse contains information about a repo's entry's (dir, file, symlink, submodule) metadata and content
|
||||
//
|
||||
// _links FileLinksResponse{...}
|
||||
// content string
|
||||
// content is populated when type is file, otherwise null
|
||||
//
|
||||
// download_url string
|
||||
// encoding string
|
||||
// encoding is populated when type is file, otherwise null
|
||||
//
|
||||
// git_url string
|
||||
// html_url string
|
||||
// last_commit_sha string
|
||||
// name string
|
||||
// path string
|
||||
// sha string
|
||||
// size integer($int64)
|
||||
// submodule_git_url string
|
||||
// submodule_git_url is populated when type is submodule, otherwise null
|
||||
//
|
||||
// target string
|
||||
// target is populated when type is symlink, otherwise null
|
||||
//
|
||||
// type string
|
||||
// type will be file, dir, symlink, or submodule
|
||||
//
|
||||
// url string
|
||||
// }]
|
7
src/types/api/create_hook_option_config.rs
Normal file
7
src/types/api/create_hook_option_config.rs
Normal file
|
@ -0,0 +1,7 @@
|
|||
// CreateHookOptionConfig{
|
||||
// description:
|
||||
// CreateHookOptionConfig has all config options in it
|
||||
// required are "content_type" and "url" Required
|
||||
//
|
||||
// < * >: string
|
||||
// }
|
9
src/types/api/creation/access_token.rs
Normal file
9
src/types/api/creation/access_token.rs
Normal file
|
@ -0,0 +1,9 @@
|
|||
// CreateAccessTokenOption{
|
||||
// description:
|
||||
// CreateAccessTokenOption options when create access token
|
||||
//
|
||||
// name* string
|
||||
// scopes [
|
||||
// x-go-name: Scopes
|
||||
// string]
|
||||
// }
|
13
src/types/api/creation/branch.rs
Normal file
13
src/types/api/creation/branch.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
// CreateBranchRepoOption{
|
||||
// description:
|
||||
// CreateBranchRepoOption options when creating a branch in a repository
|
||||
//
|
||||
// new_branch_name* string
|
||||
// uniqueItems: true
|
||||
// Name of the branch to create
|
||||
//
|
||||
// old_branch_name string
|
||||
// uniqueItems: true
|
||||
// Name of the old branch to create from
|
||||
//
|
||||
// }
|
44
src/types/api/creation/branch_protection.rs
Normal file
44
src/types/api/creation/branch_protection.rs
Normal file
|
@ -0,0 +1,44 @@
|
|||
// CreateBranchProtectionOption{
|
||||
// description:
|
||||
// CreateBranchProtectionOption options for creating a branch protection
|
||||
//
|
||||
// approvals_whitelist_teams [
|
||||
// x-go-name: ApprovalsWhitelistTeams
|
||||
// string]
|
||||
// approvals_whitelist_username [
|
||||
// x-go-name: ApprovalsWhitelistUsernames
|
||||
// string]
|
||||
// block_on_official_review_requests boolean
|
||||
// block_on_outdated_branch boolean
|
||||
// block_on_rejected_reviews boolean
|
||||
// branch_name string
|
||||
// Deprecated: true
|
||||
//
|
||||
// dismiss_stale_approvals boolean
|
||||
// enable_approvals_whitelist boolean
|
||||
// enable_merge_whitelist boolean
|
||||
// enable_push boolean
|
||||
// enable_push_whitelist boolean
|
||||
// enable_status_check boolean
|
||||
// merge_whitelist_teams [
|
||||
// x-go-name: MergeWhitelistTeams
|
||||
// string]
|
||||
// merge_whitelist_usernames [
|
||||
// x-go-name: MergeWhitelistUsernames
|
||||
// string]
|
||||
// protected_file_patterns string
|
||||
// push_whitelist_deploy_keys boolean
|
||||
// push_whitelist_teams [
|
||||
// x-go-name: PushWhitelistTeams
|
||||
// string]
|
||||
// push_whitelist_usernames [
|
||||
// x-go-name: PushWhitelistUsernames
|
||||
// string]
|
||||
// require_signed_commits boolean
|
||||
// required_approvals integer($int64)
|
||||
// rule_name string
|
||||
// status_check_contexts [
|
||||
// x-go-name: StatusCheckContexts
|
||||
// string]
|
||||
// unprotected_file_patterns string
|
||||
// }
|
6
src/types/api/creation/comment.rs
Normal file
6
src/types/api/creation/comment.rs
Normal file
|
@ -0,0 +1,6 @@
|
|||
// CreateIssueCommentOption{
|
||||
// description:
|
||||
// CreateIssueCommentOption options for creating a comment on an issue
|
||||
//
|
||||
// body* string
|
||||
// }
|
9
src/types/api/creation/commit_status.rs
Normal file
9
src/types/api/creation/commit_status.rs
Normal file
|
@ -0,0 +1,9 @@
|
|||
// CreateStatusOption{
|
||||
// description:
|
||||
// CreateStatusOption holds the information needed to create a new CommitStatus for a Commit
|
||||
//
|
||||
// context string
|
||||
// description string
|
||||
// state CommitStatusState[...]
|
||||
// target_url string
|
||||
// }
|
10
src/types/api/creation/email.rs
Normal file
10
src/types/api/creation/email.rs
Normal file
|
@ -0,0 +1,10 @@
|
|||
// CreateEmailOption{
|
||||
// description:
|
||||
// CreateEmailOption options when creating email addresses
|
||||
//
|
||||
// emails [
|
||||
// x-go-name: Emails
|
||||
// email addresses to add
|
||||
//
|
||||
// string]
|
||||
// }
|
24
src/types/api/creation/file_options.rs
Normal file
24
src/types/api/creation/file_options.rs
Normal file
|
@ -0,0 +1,24 @@
|
|||
// CreateFileOptions{
|
||||
// description:
|
||||
// CreateFileOptions options for creating files
|
||||
// Note: author and committer are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used)
|
||||
//
|
||||
// author Identity{...}
|
||||
// branch string
|
||||
// branch (optional) to base this file from. if not given, the default branch is used
|
||||
//
|
||||
// committer Identity{...}
|
||||
// content* string
|
||||
// content must be base64 encoded
|
||||
//
|
||||
// dates CommitDateOptions{...}
|
||||
// message string
|
||||
// message (optional) for the commit of this file. if not supplied, a default message will be used
|
||||
//
|
||||
// new_branch string
|
||||
// new_branch (optional) will make a new branch from branch before creating the file
|
||||
//
|
||||
// signoff boolean
|
||||
// Add a Signed-off-by trailer by the committer at the end of the commit log message.
|
||||
//
|
||||
// }
|
10
src/types/api/creation/gpg_key.rs
Normal file
10
src/types/api/creation/gpg_key.rs
Normal file
|
@ -0,0 +1,10 @@
|
|||
// CreateGPGKeyOption{
|
||||
// description:
|
||||
// CreateGPGKeyOption options create user GPG key
|
||||
//
|
||||
// armored_public_key* string
|
||||
// uniqueItems: true
|
||||
// An armored GPG key to add
|
||||
//
|
||||
// armored_signature string
|
||||
// }
|
16
src/types/api/creation/hook.rs
Normal file
16
src/types/api/creation/hook.rs
Normal file
|
@ -0,0 +1,16 @@
|
|||
// CreateHookOption{
|
||||
// description:
|
||||
// CreateHookOption options when create a hook
|
||||
//
|
||||
// active boolean
|
||||
// default: false
|
||||
// authorization_header string
|
||||
// branch_filter string
|
||||
// config* CreateHookOptionConfig{...}
|
||||
// events [
|
||||
// x-go-name: Events
|
||||
// string]
|
||||
// type* string
|
||||
// Enum:
|
||||
// [ forgejo, dingtalk, discord, gitea, gogs, msteams, slack, telegram, feishu, wechatwork, packagist ]
|
||||
// }
|
24
src/types/api/creation/issue.rs
Normal file
24
src/types/api/creation/issue.rs
Normal file
|
@ -0,0 +1,24 @@
|
|||
// CreateIssueOption{
|
||||
// description:
|
||||
// CreateIssueOption options to create one issue
|
||||
//
|
||||
// assignee string
|
||||
// deprecated
|
||||
//
|
||||
// assignees [
|
||||
// x-go-name: Assignees
|
||||
// string]
|
||||
// body string
|
||||
// closed [...]
|
||||
// due_date string($date-time)
|
||||
// labels [
|
||||
// x-go-name: Labels
|
||||
// list of label ids
|
||||
//
|
||||
// integer($int64)]
|
||||
// milestone integer($int64)
|
||||
// milestone id
|
||||
//
|
||||
// ref string
|
||||
// title* string
|
||||
// }
|
16
src/types/api/creation/key.rs
Normal file
16
src/types/api/creation/key.rs
Normal file
|
@ -0,0 +1,16 @@
|
|||
// CreateKeyOption{
|
||||
// description:
|
||||
// CreateKeyOption options when creating a key
|
||||
//
|
||||
// key* string
|
||||
// uniqueItems: true
|
||||
// An armored SSH key to add
|
||||
//
|
||||
// read_only boolean
|
||||
// Describe if the key has only read access or read/write
|
||||
//
|
||||
// title* string
|
||||
// uniqueItems: true
|
||||
// Title of the key to add
|
||||
//
|
||||
// }
|
|
@ -2,8 +2,8 @@ use std::fmt::Display;
|
|||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::types::misc::boolean_enums::is::exclusive::Exclusive;
|
||||
use crate::types::misc::color::Color;
|
||||
use crate::types::misc::exclusive::Exclusive;
|
||||
|
||||
/// CreateLabelOption represents options for creating a label.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
|
||||
|
@ -29,8 +29,8 @@ mod tests {
|
|||
use palette::rgb::Rgb;
|
||||
|
||||
use crate::types::api::creation::label::CreateLabelOption;
|
||||
use crate::types::misc::boolean_enums::is::exclusive::Exclusive;
|
||||
use crate::types::misc::color::Color;
|
||||
use crate::types::misc::exclusive::Exclusive;
|
||||
|
||||
#[test]
|
||||
fn deserialize_create_label_option() {
|
||||
|
|
11
src/types/api/creation/milestone.rs
Normal file
11
src/types/api/creation/milestone.rs
Normal file
|
@ -0,0 +1,11 @@
|
|||
// CreateMilestoneOption{
|
||||
// description:
|
||||
// CreateMilestoneOption options for creating a milestone
|
||||
//
|
||||
// description string
|
||||
// due_on string($date-time)
|
||||
// state string
|
||||
// Enum:
|
||||
// [ open, closed ]
|
||||
// title string
|
||||
// }
|
|
@ -1,2 +1,27 @@
|
|||
pub mod label;
|
||||
pub mod organization;
|
||||
|
||||
/* to-todo */
|
||||
pub mod access_token;
|
||||
/* to-todo */ pub mod branch;
|
||||
/* to-todo */ pub mod branch_protection;
|
||||
/* to-todo */ pub mod comment;
|
||||
/* to-todo */ pub mod commit_status;
|
||||
/* to-todo */ pub mod email;
|
||||
/* to-todo */ pub mod file_options;
|
||||
/* to-todo */ pub mod gpg_key;
|
||||
/* to-todo */ pub mod hook;
|
||||
/* to-todo */ pub mod issue;
|
||||
/* to-todo */ pub mod key;
|
||||
/* to-todo */ pub mod milestone;
|
||||
/* to-todo */ pub mod oath_application;
|
||||
/* to-todo */ pub mod pull_request;
|
||||
/* to-todo */ pub mod pull_review;
|
||||
/* to-todo */ pub mod pull_review_comment;
|
||||
/* to-todo */ pub mod push_mirror;
|
||||
/* to-todo */ pub mod release;
|
||||
/* to-todo */ pub mod repository;
|
||||
/* to-todo */ pub mod request_review;
|
||||
/* to-todo */ pub mod tag;
|
||||
/* to-todo */ pub mod template_repository;
|
||||
/* to-todo */ pub mod wiki_page;
|
||||
|
|
10
src/types/api/creation/oath_application.rs
Normal file
10
src/types/api/creation/oath_application.rs
Normal file
|
@ -0,0 +1,10 @@
|
|||
// CreateOAuth2ApplicationOptions{
|
||||
// description:
|
||||
// CreateOAuth2ApplicationOptions holds options to create an oauth2 application
|
||||
//
|
||||
// confidential_client boolean
|
||||
// name string
|
||||
// redirect_uris [
|
||||
// x-go-name: RedirectURIs
|
||||
// string]
|
||||
// }
|
|
@ -1,8 +1,8 @@
|
|||
use serde::{Deserialize, Serialize};
|
||||
use std::fmt::Display;
|
||||
|
||||
use crate::types::misc::team_access::RepoAdminCanChangeTeamAccess;
|
||||
use crate::types::misc::url::OptionalUrl;
|
||||
use crate::types::misc::boolean_enums::can::repo_admin_change_team_access::CanRepoAdminChangeTeamAccess;
|
||||
use crate::types::misc::optional_url::OptionalUrl;
|
||||
use crate::types::misc::visibility::Visibility;
|
||||
|
||||
/// CreateOrgOption represents options for creating an organization
|
||||
|
@ -15,7 +15,7 @@ pub struct CreateOrgOption {
|
|||
/// Location of the organization as a string
|
||||
pub location: String,
|
||||
/// Boolean flag indicating if repo admin can change team access
|
||||
pub repo_admin_change_team_access: RepoAdminCanChangeTeamAccess,
|
||||
pub repo_admin_change_team_access: CanRepoAdminChangeTeamAccess,
|
||||
/// The organization's username
|
||||
pub username: String,
|
||||
/// Visibility of the organization
|
||||
|
@ -38,8 +38,8 @@ mod tests {
|
|||
use url::Url;
|
||||
|
||||
use crate::types::api::creation::organization::CreateOrgOption;
|
||||
use crate::types::misc::team_access::RepoAdminCanChangeTeamAccess;
|
||||
use crate::types::misc::url::OptionalUrl;
|
||||
use crate::types::misc::boolean_enums::can::repo_admin_change_team_access::CanRepoAdminChangeTeamAccess;
|
||||
use crate::types::misc::optional_url::OptionalUrl;
|
||||
use crate::types::misc::visibility::Visibility;
|
||||
|
||||
#[test]
|
||||
|
@ -50,7 +50,7 @@ mod tests {
|
|||
description: String::from("Sample organization"),
|
||||
full_name: String::from("SampleOrg"),
|
||||
location: String::from("Sample City, Country"),
|
||||
repo_admin_change_team_access: RepoAdminCanChangeTeamAccess::Yes,
|
||||
repo_admin_change_team_access: CanRepoAdminChangeTeamAccess::Yes,
|
||||
username: String::from("sample_org"),
|
||||
visibility: Visibility::Public,
|
||||
website: OptionalUrl::Some(Url::from_str("https://sample.org").unwrap()),
|
||||
|
|
18
src/types/api/creation/pull_request.rs
Normal file
18
src/types/api/creation/pull_request.rs
Normal file
|
@ -0,0 +1,18 @@
|
|||
// CreatePullRequestOption{
|
||||
// description:
|
||||
// CreatePullRequestOption options when creating a pull request
|
||||
//
|
||||
// assignee string
|
||||
// assignees [
|
||||
// x-go-name: Assignees
|
||||
// string]
|
||||
// base string
|
||||
// body string
|
||||
// due_date string($date-time)
|
||||
// head string
|
||||
// labels [
|
||||
// x-go-name: Labels
|
||||
// integer($int64)]
|
||||
// milestone integer($int64)
|
||||
// title string
|
||||
// }
|
11
src/types/api/creation/pull_review.rs
Normal file
11
src/types/api/creation/pull_review.rs
Normal file
|
@ -0,0 +1,11 @@
|
|||
// CreatePullReviewOptions{
|
||||
// description:
|
||||
// CreatePullReviewOptions are options to create a pull review
|
||||
//
|
||||
// body string
|
||||
// comments [
|
||||
// x-go-name: Comments
|
||||
// CreatePullReviewComment{...}]
|
||||
// commit_id string
|
||||
// event ReviewStateType[...]
|
||||
// }
|
15
src/types/api/creation/pull_review_comment.rs
Normal file
15
src/types/api/creation/pull_review_comment.rs
Normal file
|
@ -0,0 +1,15 @@
|
|||
// CreatePullReviewComment{
|
||||
// description:
|
||||
// CreatePullReviewComment represent a review comment for creation api
|
||||
//
|
||||
// body string
|
||||
// new_position integer($int64)
|
||||
// if comment to new file line or 0
|
||||
//
|
||||
// old_position integer($int64)
|
||||
// if comment to old file line or 0
|
||||
//
|
||||
// path string
|
||||
// the tree path
|
||||
//
|
||||
// }]
|
7
src/types/api/creation/push_mirror.rs
Normal file
7
src/types/api/creation/push_mirror.rs
Normal file
|
@ -0,0 +1,7 @@
|
|||
// CreatePushMirrorOption represents need information to create a push mirror of a repository.{
|
||||
// interval string
|
||||
// remote_address string
|
||||
// remote_password string
|
||||
// remote_username string
|
||||
// sync_on_commit boolean
|
||||
// }
|
11
src/types/api/creation/release.rs
Normal file
11
src/types/api/creation/release.rs
Normal file
|
@ -0,0 +1,11 @@
|
|||
// CreateReleaseOption{
|
||||
// description:
|
||||
// CreateReleaseOption options when creating a release
|
||||
//
|
||||
// body string
|
||||
// draft boolean
|
||||
// name string
|
||||
// prerelease boolean
|
||||
// tag_name* string
|
||||
// target_commitish string
|
||||
// }
|
39
src/types/api/creation/repository.rs
Normal file
39
src/types/api/creation/repository.rs
Normal file
|
@ -0,0 +1,39 @@
|
|||
//CreateRepoOption{
|
||||
//description:
|
||||
//CreateRepoOption options when creating repository
|
||||
//
|
||||
//auto_init boolean
|
||||
//Whether the repository should be auto-initialized?
|
||||
//
|
||||
//default_branch string
|
||||
//DefaultBranch of the repository (used when initializes and in template)
|
||||
//
|
||||
//description string
|
||||
//Description of the repository to create
|
||||
//
|
||||
//gitignores string
|
||||
//Gitignores to use
|
||||
//
|
||||
//issue_labels string
|
||||
//Label-Set to use
|
||||
//
|
||||
//license string
|
||||
//License to use
|
||||
//
|
||||
//name* string
|
||||
//uniqueItems: true
|
||||
//Name of the repository to create
|
||||
//
|
||||
//private boolean
|
||||
//Whether the repository is private
|
||||
//
|
||||
//readme [...]
|
||||
//template boolean
|
||||
//Whether the repository is template
|
||||
//
|
||||
//trust_model string
|
||||
//TrustModel of the repository
|
||||
//
|
||||
//Enum:
|
||||
//[ default, collaborator, committer, collaboratorcommitter ]
|
||||
//}
|
11
src/types/api/creation/request_review.rs
Normal file
11
src/types/api/creation/request_review.rs
Normal file
|
@ -0,0 +1,11 @@
|
|||
// PullReviewRequestOptions{
|
||||
// description:
|
||||
// PullReviewRequestOptions are options to add or remove pull review requests
|
||||
//
|
||||
// reviewers [
|
||||
// x-go-name: Reviewers
|
||||
// string]
|
||||
// team_reviewers [
|
||||
// x-go-name: TeamReviewers
|
||||
// string]
|
||||
// }
|
8
src/types/api/creation/tag.rs
Normal file
8
src/types/api/creation/tag.rs
Normal file
|
@ -0,0 +1,8 @@
|
|||
// CreateTagOption{
|
||||
// description:
|
||||
// CreateTagOption options when creating a tag
|
||||
//
|
||||
// message string
|
||||
// tag_name* string
|
||||
// target string
|
||||
// }
|
39
src/types/api/creation/template_repository.rs
Normal file
39
src/types/api/creation/template_repository.rs
Normal file
|
@ -0,0 +1,39 @@
|
|||
// GenerateRepoOption{
|
||||
// description:
|
||||
// GenerateRepoOption options when creating repository using a template
|
||||
//
|
||||
// avatar boolean
|
||||
// include avatar of the template repo
|
||||
//
|
||||
// default_branch string
|
||||
// Default branch of the new repository
|
||||
//
|
||||
// description string
|
||||
// Description of the repository to create
|
||||
//
|
||||
// git_content boolean
|
||||
// include git content of default branch in template repo
|
||||
//
|
||||
// git_hooks boolean
|
||||
// include git hooks in template repo
|
||||
//
|
||||
// labels boolean
|
||||
// include labels in template repo
|
||||
//
|
||||
// name* string
|
||||
// uniqueItems: true
|
||||
// Name of the repository to create
|
||||
//
|
||||
// owner* string
|
||||
// The organization or person who will own the new repository
|
||||
//
|
||||
// private boolean
|
||||
// Whether the repository is private
|
||||
//
|
||||
// topics boolean
|
||||
// include topics in template repo
|
||||
//
|
||||
// webhooks boolean
|
||||
// include webhooks in template repo
|
||||
//
|
||||
// }
|
14
src/types/api/creation/wiki_page.rs
Normal file
14
src/types/api/creation/wiki_page.rs
Normal file
|
@ -0,0 +1,14 @@
|
|||
// CreateWikiPageOptions{
|
||||
// description:
|
||||
// CreateWikiPageOptions form for creating wiki
|
||||
//
|
||||
// content_base64 string
|
||||
// content must be base64 encoded
|
||||
//
|
||||
// message string
|
||||
// optional commit message summarizing the change
|
||||
//
|
||||
// title string
|
||||
// page title. leave empty to keep unchanged
|
||||
//
|
||||
// }
|
14
src/types/api/deploy_key.rs
Normal file
14
src/types/api/deploy_key.rs
Normal file
|
@ -0,0 +1,14 @@
|
|||
// [DeployKey{
|
||||
// description:
|
||||
// DeployKey a deploy key
|
||||
//
|
||||
// created_at string($date-time)
|
||||
// fingerprint string
|
||||
// id integer($int64)
|
||||
// key string
|
||||
// key_id integer($int64)
|
||||
// read_only boolean
|
||||
// repository Repository{...}
|
||||
// title string
|
||||
// url string
|
||||
// }]
|
7
src/types/api/dismiss_pull_review.rs
Normal file
7
src/types/api/dismiss_pull_review.rs
Normal file
|
@ -0,0 +1,7 @@
|
|||
// DismissPullReviewOptions{
|
||||
// description:
|
||||
// DismissPullReviewOptions are options to dismiss a pull review
|
||||
//
|
||||
// message string
|
||||
// priors boolean
|
||||
// }
|
6
src/types/api/edit/attachment.rs
Normal file
6
src/types/api/edit/attachment.rs
Normal file
|
@ -0,0 +1,6 @@
|
|||
// EditAttachmentOptions{
|
||||
// description:
|
||||
// EditAttachmentOptions options for editing attachments
|
||||
//
|
||||
// name string
|
||||
// }
|
40
src/types/api/edit/branch_protection.rs
Normal file
40
src/types/api/edit/branch_protection.rs
Normal file
|
@ -0,0 +1,40 @@
|
|||
// EditBranchProtectionOption{
|
||||
// description:
|
||||
// EditBranchProtectionOption options for editing a branch protection
|
||||
//
|
||||
// approvals_whitelist_teams [
|
||||
// x-go-name: ApprovalsWhitelistTeams
|
||||
// string]
|
||||
// approvals_whitelist_username [
|
||||
// x-go-name: ApprovalsWhitelistUsernames
|
||||
// string]
|
||||
// block_on_official_review_requests boolean
|
||||
// block_on_outdated_branch boolean
|
||||
// block_on_rejected_reviews boolean
|
||||
// dismiss_stale_approvals boolean
|
||||
// enable_approvals_whitelist boolean
|
||||
// enable_merge_whitelist boolean
|
||||
// enable_push boolean
|
||||
// enable_push_whitelist boolean
|
||||
// enable_status_check boolean
|
||||
// merge_whitelist_teams [
|
||||
// x-go-name: MergeWhitelistTeams
|
||||
// string]
|
||||
// merge_whitelist_usernames [
|
||||
// x-go-name: MergeWhitelistUsernames
|
||||
// string]
|
||||
// protected_file_patterns string
|
||||
// push_whitelist_deploy_keys boolean
|
||||
// push_whitelist_teams [
|
||||
// x-go-name: PushWhitelistTeams
|
||||
// string]
|
||||
// push_whitelist_usernames [
|
||||
// x-go-name: PushWhitelistUsernames
|
||||
// string]
|
||||
// require_signed_commits boolean
|
||||
// required_approvals integer($int64)
|
||||
// status_check_contexts [
|
||||
// x-go-name: StatusCheckContexts
|
||||
// string]
|
||||
// unprotected_file_patterns string
|
||||
// }
|
6
src/types/api/edit/comment.rs
Normal file
6
src/types/api/edit/comment.rs
Normal file
|
@ -0,0 +1,6 @@
|
|||
// EditIssueCommentOption{
|
||||
// description:
|
||||
// EditIssueCommentOption options for editing a comment
|
||||
//
|
||||
// body* string
|
||||
// }
|
6
src/types/api/edit/deadline.rs
Normal file
6
src/types/api/edit/deadline.rs
Normal file
|
@ -0,0 +1,6 @@
|
|||
// EditDeadlineOption{
|
||||
// description:
|
||||
// EditDeadlineOption options for creating a deadline
|
||||
//
|
||||
// due_date* string($date-time)
|
||||
// }
|
36
src/types/api/edit/file_options.rs
Normal file
36
src/types/api/edit/file_options.rs
Normal file
|
@ -0,0 +1,36 @@
|
|||
// UpdateFileOptions{
|
||||
// description:
|
||||
// UpdateFileOptions options for updating files
|
||||
// Note: author and committer are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used)
|
||||
//
|
||||
// author Identity{
|
||||
// description:
|
||||
// Identity for a person's identity like an author or committer
|
||||
//
|
||||
// email string($email)
|
||||
// name string
|
||||
// }
|
||||
// branch string
|
||||
// branch (optional) to base this file from. if not given, the default branch is used
|
||||
//
|
||||
// committer Identity{...}
|
||||
// content* string
|
||||
// content must be base64 encoded
|
||||
//
|
||||
// dates CommitDateOptions{...}
|
||||
// from_path string
|
||||
// from_path (optional) is the path of the original file which will be moved/renamed to the path in the URL
|
||||
//
|
||||
// message string
|
||||
// message (optional) for the commit of this file. if not supplied, a default message will be used
|
||||
//
|
||||
// new_branch string
|
||||
// new_branch (optional) will make a new branch from branch before creating the file
|
||||
//
|
||||
// sha* string
|
||||
// sha is the SHA for the file that already exists
|
||||
//
|
||||
// signoff boolean
|
||||
// Add a Signed-off-by trailer by the committer at the end of the commit log message.
|
||||
//
|
||||
// }
|
6
src/types/api/edit/git_hook.rs
Normal file
6
src/types/api/edit/git_hook.rs
Normal file
|
@ -0,0 +1,6 @@
|
|||
// EditGitHookOption{
|
||||
// description:
|
||||
// EditGitHookOption options when modifying one Git hook
|
||||
//
|
||||
// content string
|
||||
// }
|
|
@ -1,7 +1,7 @@
|
|||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::HashMap;
|
||||
|
||||
use crate::types::misc::active::ActiveStatus;
|
||||
use crate::types::misc::boolean_enums::is::active::IsActive;
|
||||
use crate::types::misc::header::Header;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
|
@ -9,7 +9,7 @@ pub struct EditHookOption {
|
|||
/// Description of the options when modifying a hook
|
||||
description: String,
|
||||
/// Boolean flag indicating if the hook is active
|
||||
active: ActiveStatus,
|
||||
active: IsActive,
|
||||
/// Authorization header for the hook (if required)
|
||||
authorization_header: Header,
|
||||
/// Branch filter for the hook
|
||||
|
@ -27,7 +27,7 @@ mod tests {
|
|||
use hyper::http::{HeaderName, HeaderValue};
|
||||
|
||||
use crate::types::api::edit::hook::EditHookOption;
|
||||
use crate::types::misc::active::ActiveStatus;
|
||||
use crate::types::misc::boolean_enums::is::active::IsActive;
|
||||
use crate::types::misc::header::Header;
|
||||
|
||||
#[test]
|
||||
|
@ -38,7 +38,7 @@ mod tests {
|
|||
// Example usage:
|
||||
let expected = EditHookOption {
|
||||
description: "Options when modifying a hook".to_string(),
|
||||
active: ActiveStatus::Active,
|
||||
active: IsActive::Yes,
|
||||
authorization_header: Header(hyper::HeaderMap::from_iter(std::iter::once((
|
||||
HeaderName::from_static("bearer"),
|
||||
HeaderValue::from_static("TOKEN"),
|
||||
|
|
18
src/types/api/edit/issue.rs
Normal file
18
src/types/api/edit/issue.rs
Normal file
|
@ -0,0 +1,18 @@
|
|||
// EditIssueOption{
|
||||
// description:
|
||||
// EditIssueOption options for editing an issue
|
||||
//
|
||||
// assignee string
|
||||
// deprecated
|
||||
//
|
||||
// assignees [
|
||||
// x-go-name: Assignees
|
||||
// string]
|
||||
// body string
|
||||
// due_date string($date-time)
|
||||
// milestone integer($int64)
|
||||
// ref string
|
||||
// state string
|
||||
// title string
|
||||
// unset_due_date boolean
|
||||
// }
|
|
@ -2,8 +2,8 @@ use std::fmt::Display;
|
|||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::types::misc::boolean_enums::is::exclusive::Exclusive;
|
||||
use crate::types::misc::color::Color;
|
||||
use crate::types::misc::exclusive::Exclusive;
|
||||
|
||||
/// CreateLabelOption represents options for creating a label.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
|
||||
|
@ -29,8 +29,8 @@ mod tests {
|
|||
use palette::rgb::Rgb;
|
||||
|
||||
use crate::types::api::creation::label::CreateLabelOption;
|
||||
use crate::types::misc::boolean_enums::is::exclusive::Exclusive;
|
||||
use crate::types::misc::color::Color;
|
||||
use crate::types::misc::exclusive::Exclusive;
|
||||
|
||||
#[test]
|
||||
fn deserialize_edit_label_option() {
|
||||
|
|
9
src/types/api/edit/milestone.rs
Normal file
9
src/types/api/edit/milestone.rs
Normal file
|
@ -0,0 +1,9 @@
|
|||
// EditMilestoneOption{
|
||||
// description:
|
||||
// EditMilestoneOption options for editing a milestone
|
||||
//
|
||||
// description string
|
||||
// due_on string($date-time)
|
||||
// state string
|
||||
// title string
|
||||
// }
|
|
@ -1,3 +1,18 @@
|
|||
pub mod hook;
|
||||
pub mod label;
|
||||
pub mod organization;
|
||||
|
||||
/* to-todo */
|
||||
pub mod attachment;
|
||||
/* to-todo */ pub mod branch_protection;
|
||||
/* to-todo */ pub mod comment;
|
||||
/* to-todo */ pub mod deadline;
|
||||
/* to-todo */ pub mod file_options;
|
||||
/* to-todo */ pub mod git_hook;
|
||||
/* to-todo */ pub mod issue;
|
||||
/* to-todo */ pub mod milestone;
|
||||
/* to-todo */ pub mod pull_request;
|
||||
/* to-todo */ pub mod reaction;
|
||||
/* to-todo */ pub mod release;
|
||||
/* to-todo */ pub mod repository;
|
||||
/* to-todo */ pub mod user_setting;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
use serde::{Deserialize, Serialize};
|
||||
use std::fmt::Display;
|
||||
|
||||
use crate::types::misc::team_access::RepoAdminCanChangeTeamAccess;
|
||||
use crate::types::misc::url::OptionalUrl;
|
||||
use crate::types::misc::boolean_enums::can::repo_admin_change_team_access::CanRepoAdminChangeTeamAccess;
|
||||
use crate::types::misc::optional_url::OptionalUrl;
|
||||
use crate::types::misc::visibility::Visibility;
|
||||
|
||||
/// EditOrgOption represents options for editing an organization
|
||||
|
@ -15,7 +15,7 @@ pub struct EditOrgOption {
|
|||
/// Location of the organization as a string
|
||||
pub location: String,
|
||||
/// Boolean flag indicating if repo admin can change team access
|
||||
pub repo_admin_change_team_access: RepoAdminCanChangeTeamAccess,
|
||||
pub repo_admin_change_team_access: CanRepoAdminChangeTeamAccess,
|
||||
/// Visibility of the organization
|
||||
pub visibility: Visibility,
|
||||
/// The organization's website URL (optional)
|
||||
|
@ -35,8 +35,8 @@ mod tests {
|
|||
use url::Url;
|
||||
|
||||
use crate::types::api::edit::organization::EditOrgOption;
|
||||
use crate::types::misc::team_access::RepoAdminCanChangeTeamAccess;
|
||||
use crate::types::misc::url::OptionalUrl;
|
||||
use crate::types::misc::boolean_enums::can::repo_admin_change_team_access::CanRepoAdminChangeTeamAccess;
|
||||
use crate::types::misc::optional_url::OptionalUrl;
|
||||
use crate::types::misc::visibility::Visibility;
|
||||
|
||||
#[test]
|
||||
|
@ -48,7 +48,7 @@ mod tests {
|
|||
description: String::from("Updated organization"),
|
||||
full_name: String::from("UpdatedOrg"),
|
||||
location: String::from("Updated City, Country"),
|
||||
repo_admin_change_team_access: RepoAdminCanChangeTeamAccess::No,
|
||||
repo_admin_change_team_access: CanRepoAdminChangeTeamAccess::No,
|
||||
visibility: Visibility::Private,
|
||||
website: OptionalUrl::Some(Url::from_str("https://updated.org").unwrap()),
|
||||
};
|
||||
|
|
20
src/types/api/edit/pull_request.rs
Normal file
20
src/types/api/edit/pull_request.rs
Normal file
|
@ -0,0 +1,20 @@
|
|||
// EditPullRequestOption{
|
||||
// description:
|
||||
// EditPullRequestOption options when modify pull request
|
||||
//
|
||||
// allow_maintainer_edit boolean
|
||||
// assignee string
|
||||
// assignees [
|
||||
// x-go-name: Assignees
|
||||
// string]
|
||||
// base string
|
||||
// body string
|
||||
// due_date string($date-time)
|
||||
// labels [
|
||||
// x-go-name: Labels
|
||||
// integer($int64)]
|
||||
// milestone integer($int64)
|
||||
// state string
|
||||
// title string
|
||||
// unset_due_date boolean
|
||||
// }
|