feat: add more models from swagger docs

This commit is contained in:
RobWalt 2023-08-24 18:31:37 +02:00
parent 4ac0460145
commit eb09d2ae56
No known key found for this signature in database
GPG key ID: 333C6AC0CEF0CE68
27 changed files with 375 additions and 26 deletions

View file

@ -1,15 +1,15 @@
// Activity{
// act_user User{...}
// act_user_id [...]
// comment Comment{...}
// comment_id [...]
// content [...]
// created [...]
// id [...]
// is_private [...]
// op_type [...]
// ref_name [...]
// repo Repository{...}
// repo_id [...]
// user_id [...]
// }
//Activity{
//act_user User{...}
//act_user_id integer($int64)
//comment Comment{...}
//comment_id integer($int64)
//content string
//created string($date-time)
//id integer($int64)
//is_private boolean
//op_type string
//ref_name string
//repo Repository{...}
//repo_id integer($int64)
//user_id integer($int64)
//}

View file

@ -0,0 +1,6 @@
//ActivityPub{
//description:
//ActivityPub type
//
//@context string
//}

View file

@ -1,7 +1,7 @@
// APIError{
// description:
// APIError is an api error with a message
//APIError{
//description:
//APIError is an api error with a message
//
// message [...]
// url [...]
// }
//message string
//url string
//}

View file

@ -0,0 +1,4 @@
//BlockedUser represents a blocked user.{
//block_id integer($int64)
//created_at string($date-time)
//}

View file

@ -0,0 +1,22 @@
//ChangeFileOperation{
//description:
//ChangeFileOperation for creating, updating or deleting a file
//
//content string
//new or updated file content, must be base64 encoded
//
//from_path string
//old path of the file to move
//
//operation* string
//indicates what to do with the file
//
//Enum:
//Array [ 3 ]
//path* string
//path to the existing or new file
//
//sha string
//sha is the SHA for the file that already exists, required for update or delete
//
//}

View file

@ -0,0 +1,26 @@
//ChangeFilesOptions{
//description:
//ChangeFilesOptions options for creating, updating or deleting multiple 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{...}
//dates CommitDateOptions{...}
//files* [
//x-go-name: Files
//list of file operations
//
//ChangeFileOperation{...}]
//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.
//
//}

View file

@ -0,0 +1,11 @@
//CreateForkOption{
//description:
//CreateForkOption options for creating a fork
//
//name string
//name of the forked repository
//
//organization string
//organization name, if forking into an organization
//
//}

View file

@ -5,16 +5,16 @@ pub mod organization;
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 file;
/* to-todo */ pub mod fork;
/* to-todo */ pub mod gpg_key;
/* to-todo */ pub mod hook;
/* to-todo */ pub mod issue;
/* to-todo */ pub mod issue_comment;
/* to-todo */ pub mod key;
/* to-todo */ pub mod milestone;
/* to-todo */ pub mod oath_application;
/* to-todo */ pub mod oauth_application;
/* to-todo */ pub mod pull_request;
/* to-todo */ pub mod pull_review;
/* to-todo */ pub mod pull_review_comment;
@ -22,6 +22,9 @@ pub mod access_token;
/* to-todo */ pub mod release;
/* to-todo */ pub mod repository;
/* to-todo */ pub mod request_review;
/* to-todo */ pub mod status;
/* to-todo */ pub mod tag;
/* to-todo */ pub mod team;
/* to-todo */ pub mod template_repository;
/* to-todo */ pub mod user;
/* to-todo */ pub mod wiki_page;

View file

@ -0,0 +1,20 @@
//CreateTeamOption{
//description:
//CreateTeamOption options for creating a team
//
//can_create_org_repo boolean
//description string
//includes_all_repositories boolean
//name* string
//permission string
//Enum:
//Array [ 3 ]
//units [
//x-go-name: Units
//example: List [ "repo.code", "repo.issues", "repo.ext_issues", "repo.wiki", "repo.pulls", "repo.releases", "repo.projects", "repo.ext_wiki" ]
//string]
//units_map {
//< * >: string
//}
//example: OrderedMap { "repo.code": "read", "repo.ext_issues": "none", "repo.ext_wiki": "none", "repo.issues": "write", "repo.projects": "none", "repo.pulls": "owner", "repo.releases": "none", "repo.wiki": "admin" }
//}

View file

@ -0,0 +1,20 @@
//CreateUserOption{
//description:
//CreateUserOption create user options
//
//created_at string($date-time)
//For explicitly setting the user creation timestamp. Useful when users are
//migrated from other systems. When omitted, the user's creation timestamp
//will be set to "now".
//
//email* string($email)
//full_name string
//login_name string
//must_change_password boolean
//password* string
//restricted boolean
//send_notify boolean
//source_id integer($int64)
//username* string
//visibility string
//}

10
src/types/api/cron.rs Normal file
View file

@ -0,0 +1,10 @@
//Cron{
//description:
//Cron represents a Cron task
//
//exec_times integer($int64)
//name string
//next string($date-time)
//prev string($date-time)
//schedule string
//}

View file

@ -0,0 +1,10 @@
//DeleteEmailOption{
//description:
//DeleteEmailOption options when deleting email addresses
//
//emails [
//x-go-name: Emails
//email addresses to delete
//
//string]
//}

View file

@ -0,0 +1,24 @@
//DeleteFileOptions{
//description:
//DeleteFileOptions options for deleting files (used for other File structs below)
//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{...}
//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
//
//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.
//
//}

View file

@ -5,14 +5,16 @@ 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 issue_comment;
/* 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 team;
/* to-todo */ pub mod user;
/* to-todo */ pub mod user_setting;

View file

@ -0,0 +1,20 @@
//EditTeamOption{
//description:
//EditTeamOption options for editing a team
//
//can_create_org_repo boolean
//description string
//includes_all_repositories boolean
//name* string
//permission string
//Enum:
//[ read, write, admin ]
//units [
//x-go-name: Units
//example: List [ "repo.code", "repo.issues", "repo.ext_issues", "repo.wiki", "repo.pulls", "repo.releases", "repo.projects", "repo.ext_wiki" ]
//string]
//units_map {
//< * >: string
//}
//example: OrderedMap { "repo.code": "read", "repo.ext_issues": "none", "repo.ext_wiki": "none", "repo.issues": "write", "repo.projects": "none", "repo.pulls": "owner", "repo.releases": "none", "repo.wiki": "admin" }
//}

View file

@ -0,0 +1,23 @@
//EditUserOption{
//description:
//EditUserOption edit user options
//
//active boolean
//admin boolean
//allow_create_organization boolean
//allow_git_hook boolean
//allow_import_local boolean
//description string
//email string($email)
//full_name string
//location string
//login_name* string
//max_repo_creation integer($int64)
//must_change_password boolean
//password string
//prohibit_login boolean
//restricted boolean
//source_id* integer($int64)
//visibility string
//website string
//}

10
src/types/api/email.rs Normal file
View file

@ -0,0 +1,10 @@
//Email{
//description:
//Email an email address belonging to a user
//
//email string($email)
//primary boolean
//user_id integer($int64)
//username string
//verified boolean
//}

View file

@ -0,0 +1,25 @@
//FileCommitResponse contains information generated from a Git commit for a repo's file.{
//author CommitUser contains information of a user in the context of a commit.{
//date string
//email string($email)
//name string
//}
//committer CommitUser contains information of a user in the context of a commit.{
//date string
//email string($email)
//name string
//}
//created string($date-time)
//html_url string
//message string
//parents [
//x-go-name: Parents
//CommitMeta contains meta information of a commit in terms of API.{...}]
//sha string
//tree CommitMeta contains meta information of a commit in terms of API.{
//created string($date-time)
//sha string
//url string
//}
//url string
//}

View file

@ -0,0 +1,34 @@
//FileDeleteResponse{
//description:
//FileDeleteResponse contains information about a repo's file that was deleted
//
//commit FileCommitResponse contains information generated from a Git commit for a repo's file.{
//author CommitUser contains information of a user in the context of a commit.{
//date string
//email string($email)
//name string
//}
//committer CommitUser contains information of a user in the context of a commit.{...}
//created string($date-time)
//html_url string
//message string
//parents [
//x-go-name: Parents
//CommitMeta contains meta information of a commit in terms of API.{...}]
//sha string
//tree CommitMeta contains meta information of a commit in terms of API.{...}
//url string
//}
//content {
//}
//verification PayloadCommitVerification{
//description:
//PayloadCommitVerification represents the GPG verification of a commit
//
//payload string
//reason string
//signature string
//signer PayloadUser{...}
//verified boolean
//}
//}

View file

@ -0,0 +1,58 @@
//FileResponse{
//description:
//FileResponse contains information about a repo's file
//
//commit FileCommitResponse contains information generated from a Git commit for a repo's file.{
//author CommitUser contains information of a user in the context of a commit.{...}
//committer CommitUser contains information of a user in the context of a commit.{...}
//created string($date-time)
//html_url string
//message string
//parents [
//x-go-name: Parents
//CommitMeta contains meta information of a commit in terms of API.{...}]
//sha string
//tree CommitMeta contains meta information of a commit in terms of API.{...}
//url string
//}
//content 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
//}
//verification PayloadCommitVerification{
//description:
//PayloadCommitVerification represents the GPG verification of a commit
//
//payload string
//reason string
//signature string
//signer PayloadUser{...}
//verified boolean
//}
//}

View 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)
//}

View file

@ -15,6 +15,7 @@ pub mod user;
/* to-todo */
pub mod access_token;
/* to-todo */ pub mod activity;
/* to-todo */ pub mod activity_pub;
/* to-todo */ pub mod add;
/* to-todo */ pub mod annotated_tag;
/* to-todo */ pub mod annotated_tag_object;
@ -22,8 +23,11 @@ pub mod access_token;
/* to-todo */ pub mod api_settings;
/* to-todo */ pub mod attachment;
/* to-todo */ pub mod attachment_settings;
/* to-todo */ pub mod blocked_user;
/* to-todo */ pub mod branch;
/* to-todo */ pub mod branch_protection;
/* to-todo */ pub mod change_file_operation;
/* to-todo */ pub mod change_file_options;
/* to-todo */ pub mod changed_file;
/* to-todo */ pub mod combined_status;
/* to-todo */ pub mod comment;
@ -37,9 +41,17 @@ pub mod access_token;
/* to-todo */ pub mod commit_user;
/* to-todo */ pub mod content_response;
/* to-todo */ pub mod create_hook_option_config;
/* to-todo */ pub mod cron;
/* to-todo */ pub mod delete_email;
/* to-todo */ pub mod delete_file;
/* to-todo */ pub mod deploy_key;
/* to-todo */ pub mod dismiss_pull_review;
/* to-todo */ pub mod email;
/* to-todo */ pub mod file_commit_response;
/* to-todo */ pub mod file_delete_response;
/* to-todo */ pub mod file_link_response;
/* to-todo */ pub mod file_response;
/* to-todo */ pub mod general_api_settings;
/* to-todo */ pub mod git_blob;
/* to-todo */ pub mod git_entry;
/* to-todo */ pub mod git_hook;