From 5c65d623c1caa2c932702fe9cc3c22f9b943fcc7 Mon Sep 17 00:00:00 2001 From: edisonxiang Date: Wed, 25 Sep 2019 10:56:14 +0800 Subject: [PATCH] add go-gitee sdk --- .gitignore | 24 + .swagger-codegen-ignore | 23 + .swagger-codegen/VERSION | 1 + README.md | 318 +- api/swagger.yaml | 15948 +++++++++++++++++++++++++ api_activity.go | 3430 ++++++ api_enterprises.go | 1608 +++ api_gists.go | 1918 +++ api_git_data.go | 238 + api_issues.go | 2306 ++++ api_labels.go | 1225 ++ api_milestones.go | 573 + api_miscellaneous.go | 752 ++ api_organizations.go | 1377 +++ api_pull_requests.go | 2122 ++++ api_repositories.go | 5927 +++++++++ api_search.go | 557 + api_users.go | 1796 +++ api_webhooks.go | 679 ++ client.go | 503 + configuration.go | 72 + docs/ActivityApi.md | 1340 +++ docs/Blob.md | 14 + docs/Branch.md | 13 + docs/Code.md | 26 + docs/CodeComment.md | 13 + docs/CodeForks.md | 14 + docs/CodeForksHistory.md | 28 + docs/Commit.md | 15 + docs/CommitContent.md | 11 + docs/Compare.md | 13 + docs/CompleteBranch.md | 14 + docs/Content.md | 20 + docs/ContentBasic.md | 18 + docs/Contributor.md | 12 + docs/EnterpriseBasic.md | 14 + docs/EnterpriseMember.md | 16 + docs/EnterprisesApi.md | 632 + docs/Event.md | 17 + docs/GistsApi.md | 755 ++ docs/GitDataApi.md | 93 + docs/Group.md | 17 + docs/GroupDetail.md | 29 + docs/GroupMember.md | 16 + docs/Hook.md | 21 + docs/Issue.md | 36 + docs/IssuesApi.md | 827 ++ docs/Label.md | 14 + docs/LabelsApi.md | 512 + docs/Milestone.md | 21 + docs/MilestonesApi.md | 231 + docs/MiscellaneousApi.md | 346 + docs/Namespace.md | 15 + docs/NamespaceMini.md | 14 + docs/Note.md | 16 + docs/OperateLog.md | 14 + docs/OrganizationsApi.md | 525 + docs/ProgramBasic.md | 14 + docs/Project.md | 67 + docs/ProjectBasic.md | 24 + docs/ProjectMember.md | 27 + docs/ProjectMemberPermission.md | 27 + docs/PullRequest.md | 39 + docs/PullRequestComments.md | 23 + docs/PullRequestCommits.md | 17 + docs/PullRequestFiles.md | 17 + docs/PullRequestsApi.md | 854 ++ docs/Release.md | 18 + docs/RepoCommit.md | 18 + docs/RepositoriesApi.md | 2389 ++++ docs/SearchApi.md | 187 + docs/SshKey.md | 14 + docs/SshKeyBasic.md | 11 + docs/Tag.md | 11 + docs/Tree.md | 13 + docs/User.md | 37 + docs/UserBasic.md | 26 + docs/UserMessage.md | 16 + docs/UserMessageList.md | 11 + docs/UserMini.md | 15 + docs/UserNotification.md | 21 + docs/UserNotificationCount.md | 12 + docs/UserNotificationList.md | 11 + docs/UserNotificationNamespace.md | 12 + docs/UserNotificationSubject.md | 13 + docs/UsersApi.md | 701 ++ docs/WebhooksApi.md | 274 + docs/WeekReport.md | 20 + git_push.sh | 52 + model_blob.go | 19 + model_branch.go | 18 + model_code.go | 31 + model_code_comment.go | 18 + model_code_forks.go | 19 + model_code_forks_history.go | 33 + model_commit.go | 19 + model_commit_content.go | 16 + model_compare.go | 18 + model_complete_branch.go | 19 + model_content.go | 25 + model_content_basic.go | 22 + model_contributor.go | 17 + model_enterprise_basic.go | 19 + model_enterprise_member.go | 21 + model_event.go | 23 + model_group.go | 22 + model_group_detail.go | 34 + model_group_member.go | 21 + model_hook.go | 26 + model_issue.go | 45 + model_label.go | 19 + model_milestone.go | 30 + model_namespace.go | 20 + model_namespace_mini.go | 18 + model_note.go | 21 + model_operate_log.go | 19 + model_program_basic.go | 18 + model_project.go | 72 + model_project_basic.go | 28 + model_project_member.go | 32 + model_project_member_permission.go | 32 + model_pull_request.go | 44 + model_pull_request_comments.go | 28 + model_pull_request_commits.go | 22 + model_pull_request_files.go | 22 + model_release.go | 27 + model_repo_commit.go | 23 + model_ssh_key.go | 19 + model_ssh_key_basic.go | 16 + model_tag.go | 16 + model_tree.go | 18 + model_user.go | 42 + model_user_basic.go | 31 + model_user_message.go | 22 + model_user_message_list.go | 17 + model_user_mini.go | 19 + model_user_notification.go | 29 + model_user_notification_count.go | 20 + model_user_notification_list.go | 17 + model_user_notification_namespace.go | 16 + model_user_notification_subject.go | 17 + model_week_report.go | 25 + response.go | 43 + 143 files changed, 53442 insertions(+), 5 deletions(-) create mode 100644 .gitignore create mode 100644 .swagger-codegen-ignore create mode 100644 .swagger-codegen/VERSION create mode 100644 api/swagger.yaml create mode 100644 api_activity.go create mode 100644 api_enterprises.go create mode 100644 api_gists.go create mode 100644 api_git_data.go create mode 100644 api_issues.go create mode 100644 api_labels.go create mode 100644 api_milestones.go create mode 100644 api_miscellaneous.go create mode 100644 api_organizations.go create mode 100644 api_pull_requests.go create mode 100644 api_repositories.go create mode 100644 api_search.go create mode 100644 api_users.go create mode 100644 api_webhooks.go create mode 100644 client.go create mode 100644 configuration.go create mode 100644 docs/ActivityApi.md create mode 100644 docs/Blob.md create mode 100644 docs/Branch.md create mode 100644 docs/Code.md create mode 100644 docs/CodeComment.md create mode 100644 docs/CodeForks.md create mode 100644 docs/CodeForksHistory.md create mode 100644 docs/Commit.md create mode 100644 docs/CommitContent.md create mode 100644 docs/Compare.md create mode 100644 docs/CompleteBranch.md create mode 100644 docs/Content.md create mode 100644 docs/ContentBasic.md create mode 100644 docs/Contributor.md create mode 100644 docs/EnterpriseBasic.md create mode 100644 docs/EnterpriseMember.md create mode 100644 docs/EnterprisesApi.md create mode 100644 docs/Event.md create mode 100644 docs/GistsApi.md create mode 100644 docs/GitDataApi.md create mode 100644 docs/Group.md create mode 100644 docs/GroupDetail.md create mode 100644 docs/GroupMember.md create mode 100644 docs/Hook.md create mode 100644 docs/Issue.md create mode 100644 docs/IssuesApi.md create mode 100644 docs/Label.md create mode 100644 docs/LabelsApi.md create mode 100644 docs/Milestone.md create mode 100644 docs/MilestonesApi.md create mode 100644 docs/MiscellaneousApi.md create mode 100644 docs/Namespace.md create mode 100644 docs/NamespaceMini.md create mode 100644 docs/Note.md create mode 100644 docs/OperateLog.md create mode 100644 docs/OrganizationsApi.md create mode 100644 docs/ProgramBasic.md create mode 100644 docs/Project.md create mode 100644 docs/ProjectBasic.md create mode 100644 docs/ProjectMember.md create mode 100644 docs/ProjectMemberPermission.md create mode 100644 docs/PullRequest.md create mode 100644 docs/PullRequestComments.md create mode 100644 docs/PullRequestCommits.md create mode 100644 docs/PullRequestFiles.md create mode 100644 docs/PullRequestsApi.md create mode 100644 docs/Release.md create mode 100644 docs/RepoCommit.md create mode 100644 docs/RepositoriesApi.md create mode 100644 docs/SearchApi.md create mode 100644 docs/SshKey.md create mode 100644 docs/SshKeyBasic.md create mode 100644 docs/Tag.md create mode 100644 docs/Tree.md create mode 100644 docs/User.md create mode 100644 docs/UserBasic.md create mode 100644 docs/UserMessage.md create mode 100644 docs/UserMessageList.md create mode 100644 docs/UserMini.md create mode 100644 docs/UserNotification.md create mode 100644 docs/UserNotificationCount.md create mode 100644 docs/UserNotificationList.md create mode 100644 docs/UserNotificationNamespace.md create mode 100644 docs/UserNotificationSubject.md create mode 100644 docs/UsersApi.md create mode 100644 docs/WebhooksApi.md create mode 100644 docs/WeekReport.md create mode 100644 git_push.sh create mode 100644 model_blob.go create mode 100644 model_branch.go create mode 100644 model_code.go create mode 100644 model_code_comment.go create mode 100644 model_code_forks.go create mode 100644 model_code_forks_history.go create mode 100644 model_commit.go create mode 100644 model_commit_content.go create mode 100644 model_compare.go create mode 100644 model_complete_branch.go create mode 100644 model_content.go create mode 100644 model_content_basic.go create mode 100644 model_contributor.go create mode 100644 model_enterprise_basic.go create mode 100644 model_enterprise_member.go create mode 100644 model_event.go create mode 100644 model_group.go create mode 100644 model_group_detail.go create mode 100644 model_group_member.go create mode 100644 model_hook.go create mode 100644 model_issue.go create mode 100644 model_label.go create mode 100644 model_milestone.go create mode 100644 model_namespace.go create mode 100644 model_namespace_mini.go create mode 100644 model_note.go create mode 100644 model_operate_log.go create mode 100644 model_program_basic.go create mode 100644 model_project.go create mode 100644 model_project_basic.go create mode 100644 model_project_member.go create mode 100644 model_project_member_permission.go create mode 100644 model_pull_request.go create mode 100644 model_pull_request_comments.go create mode 100644 model_pull_request_commits.go create mode 100644 model_pull_request_files.go create mode 100644 model_release.go create mode 100644 model_repo_commit.go create mode 100644 model_ssh_key.go create mode 100644 model_ssh_key_basic.go create mode 100644 model_tag.go create mode 100644 model_tree.go create mode 100644 model_user.go create mode 100644 model_user_basic.go create mode 100644 model_user_message.go create mode 100644 model_user_message_list.go create mode 100644 model_user_mini.go create mode 100644 model_user_notification.go create mode 100644 model_user_notification_count.go create mode 100644 model_user_notification_list.go create mode 100644 model_user_notification_namespace.go create mode 100644 model_user_notification_subject.go create mode 100644 model_week_report.go create mode 100644 response.go diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..daf913b --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/.swagger-codegen-ignore b/.swagger-codegen-ignore new file mode 100644 index 0000000..c5fa491 --- /dev/null +++ b/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/.swagger-codegen/VERSION b/.swagger-codegen/VERSION new file mode 100644 index 0000000..752a79e --- /dev/null +++ b/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.4.8 \ No newline at end of file diff --git a/README.md b/README.md index 816af25..39407f3 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,318 @@ -# go-gitee +# Go API client for gitee -## Introduction +No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) -go-gitee is the go sdk of gitee api +## Overview +This API client was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [swagger-spec](https://github.com/swagger-api/swagger-spec) from a remote server, you can easily generate an API client. + +- API version: 5.3.2 +- Package version: 1.0.0 +- Build package: io.swagger.codegen.languages.GoClientCodegen + +## Installation +Put the package under your project folder and add the following in import: +```golang +import "./gitee" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://gitee.com/api* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*ActivityApi* | [**DeleteV5UserStarredOwnerRepo**](docs/ActivityApi.md#deletev5userstarredownerrepo) | **Delete** /v5/user/starred/{owner}/{repo} | 取消 star 一个仓库 +*ActivityApi* | [**DeleteV5UserSubscriptionsOwnerRepo**](docs/ActivityApi.md#deletev5usersubscriptionsownerrepo) | **Delete** /v5/user/subscriptions/{owner}/{repo} | 取消 watch 一个仓库 +*ActivityApi* | [**GetV5Events**](docs/ActivityApi.md#getv5events) | **Get** /v5/events | 获取站内所有公开动态 +*ActivityApi* | [**GetV5NetworksOwnerRepoEvents**](docs/ActivityApi.md#getv5networksownerrepoevents) | **Get** /v5/networks/{owner}/{repo}/events | 列出仓库的所有公开动态 +*ActivityApi* | [**GetV5NotificationsCount**](docs/ActivityApi.md#getv5notificationscount) | **Get** /v5/notifications/count | 获取授权用户的通知数 +*ActivityApi* | [**GetV5NotificationsMessages**](docs/ActivityApi.md#getv5notificationsmessages) | **Get** /v5/notifications/messages | 列出授权用户的所有私信 +*ActivityApi* | [**GetV5NotificationsMessagesId**](docs/ActivityApi.md#getv5notificationsmessagesid) | **Get** /v5/notifications/messages/{id} | 获取一条私信 +*ActivityApi* | [**GetV5NotificationsThreads**](docs/ActivityApi.md#getv5notificationsthreads) | **Get** /v5/notifications/threads | 列出授权用户的所有通知 +*ActivityApi* | [**GetV5NotificationsThreadsId**](docs/ActivityApi.md#getv5notificationsthreadsid) | **Get** /v5/notifications/threads/{id} | 获取一条通知 +*ActivityApi* | [**GetV5OrgsOrgEvents**](docs/ActivityApi.md#getv5orgsorgevents) | **Get** /v5/orgs/{org}/events | 列出组织的公开动态 +*ActivityApi* | [**GetV5ReposOwnerRepoEvents**](docs/ActivityApi.md#getv5reposownerrepoevents) | **Get** /v5/repos/{owner}/{repo}/events | 列出仓库的所有动态 +*ActivityApi* | [**GetV5ReposOwnerRepoNotifications**](docs/ActivityApi.md#getv5reposownerreponotifications) | **Get** /v5/repos/{owner}/{repo}/notifications | 列出一个仓库里的通知 +*ActivityApi* | [**GetV5ReposOwnerRepoStargazers**](docs/ActivityApi.md#getv5reposownerrepostargazers) | **Get** /v5/repos/{owner}/{repo}/stargazers | 列出 star 了仓库的用户 +*ActivityApi* | [**GetV5ReposOwnerRepoSubscribers**](docs/ActivityApi.md#getv5reposownerreposubscribers) | **Get** /v5/repos/{owner}/{repo}/subscribers | 列出 watch 了仓库的用户 +*ActivityApi* | [**GetV5UserStarred**](docs/ActivityApi.md#getv5userstarred) | **Get** /v5/user/starred | 列出授权用户 star 了的仓库 +*ActivityApi* | [**GetV5UserStarredOwnerRepo**](docs/ActivityApi.md#getv5userstarredownerrepo) | **Get** /v5/user/starred/{owner}/{repo} | 检查授权用户是否 star 了一个仓库 +*ActivityApi* | [**GetV5UserSubscriptions**](docs/ActivityApi.md#getv5usersubscriptions) | **Get** /v5/user/subscriptions | 列出授权用户 watch 了的仓库 +*ActivityApi* | [**GetV5UserSubscriptionsOwnerRepo**](docs/ActivityApi.md#getv5usersubscriptionsownerrepo) | **Get** /v5/user/subscriptions/{owner}/{repo} | 检查授权用户是否 watch 了一个仓库 +*ActivityApi* | [**GetV5UsersUsernameEvents**](docs/ActivityApi.md#getv5usersusernameevents) | **Get** /v5/users/{username}/events | 列出用户的动态 +*ActivityApi* | [**GetV5UsersUsernameEventsOrgsOrg**](docs/ActivityApi.md#getv5usersusernameeventsorgsorg) | **Get** /v5/users/{username}/events/orgs/{org} | 列出用户所属组织的动态 +*ActivityApi* | [**GetV5UsersUsernameEventsPublic**](docs/ActivityApi.md#getv5usersusernameeventspublic) | **Get** /v5/users/{username}/events/public | 列出用户的公开动态 +*ActivityApi* | [**GetV5UsersUsernameReceivedEvents**](docs/ActivityApi.md#getv5usersusernamereceivedevents) | **Get** /v5/users/{username}/received_events | 列出一个用户收到的动态 +*ActivityApi* | [**GetV5UsersUsernameReceivedEventsPublic**](docs/ActivityApi.md#getv5usersusernamereceivedeventspublic) | **Get** /v5/users/{username}/received_events/public | 列出一个用户收到的公开动态 +*ActivityApi* | [**GetV5UsersUsernameStarred**](docs/ActivityApi.md#getv5usersusernamestarred) | **Get** /v5/users/{username}/starred | 列出用户 star 了的仓库 +*ActivityApi* | [**GetV5UsersUsernameSubscriptions**](docs/ActivityApi.md#getv5usersusernamesubscriptions) | **Get** /v5/users/{username}/subscriptions | 列出用户 watch 了的仓库 +*ActivityApi* | [**PatchV5NotificationsMessagesId**](docs/ActivityApi.md#patchv5notificationsmessagesid) | **Patch** /v5/notifications/messages/{id} | 标记一条私信为已读 +*ActivityApi* | [**PatchV5NotificationsThreadsId**](docs/ActivityApi.md#patchv5notificationsthreadsid) | **Patch** /v5/notifications/threads/{id} | 标记一条通知为已读 +*ActivityApi* | [**PostV5NotificationsMessages**](docs/ActivityApi.md#postv5notificationsmessages) | **Post** /v5/notifications/messages | 发送私信给指定用户 +*ActivityApi* | [**PutV5NotificationsMessages**](docs/ActivityApi.md#putv5notificationsmessages) | **Put** /v5/notifications/messages | 标记所有私信为已读 +*ActivityApi* | [**PutV5NotificationsThreads**](docs/ActivityApi.md#putv5notificationsthreads) | **Put** /v5/notifications/threads | 标记所有通知为已读 +*ActivityApi* | [**PutV5ReposOwnerRepoNotifications**](docs/ActivityApi.md#putv5reposownerreponotifications) | **Put** /v5/repos/{owner}/{repo}/notifications | 标记一个仓库里的通知为已读 +*ActivityApi* | [**PutV5UserStarredOwnerRepo**](docs/ActivityApi.md#putv5userstarredownerrepo) | **Put** /v5/user/starred/{owner}/{repo} | star 一个仓库 +*ActivityApi* | [**PutV5UserSubscriptionsOwnerRepo**](docs/ActivityApi.md#putv5usersubscriptionsownerrepo) | **Put** /v5/user/subscriptions/{owner}/{repo} | watch 一个仓库 +*EnterprisesApi* | [**DeleteV5EnterprisesEnterpriseMembersUsername**](docs/EnterprisesApi.md#deletev5enterprisesenterprisemembersusername) | **Delete** /v5/enterprises/{enterprise}/members/{username} | 移除企业成员 +*EnterprisesApi* | [**DeleteV5EnterprisesEnterpriseWeekReportsReportIdCommentsId**](docs/EnterprisesApi.md#deletev5enterprisesenterpriseweekreportsreportidcommentsid) | **Delete** /v5/enterprises/{enterprise}/week_reports/{report_id}/comments/{id} | 删除周报某个评论 +*EnterprisesApi* | [**GetV5EnterprisesEnterprise**](docs/EnterprisesApi.md#getv5enterprisesenterprise) | **Get** /v5/enterprises/{enterprise} | 获取一个企业 +*EnterprisesApi* | [**GetV5EnterprisesEnterpriseMembers**](docs/EnterprisesApi.md#getv5enterprisesenterprisemembers) | **Get** /v5/enterprises/{enterprise}/members | 列出企业的所有成员 +*EnterprisesApi* | [**GetV5EnterprisesEnterpriseMembersUsername**](docs/EnterprisesApi.md#getv5enterprisesenterprisemembersusername) | **Get** /v5/enterprises/{enterprise}/members/{username} | 获取企业的一个成员 +*EnterprisesApi* | [**GetV5EnterprisesEnterpriseUsersUsernameWeekReports**](docs/EnterprisesApi.md#getv5enterprisesenterpriseusersusernameweekreports) | **Get** /v5/enterprises/{enterprise}/users/{username}/week_reports | 个人周报列表 +*EnterprisesApi* | [**GetV5EnterprisesEnterpriseWeekReports**](docs/EnterprisesApi.md#getv5enterprisesenterpriseweekreports) | **Get** /v5/enterprises/{enterprise}/week_reports | 企业成员周报列表 +*EnterprisesApi* | [**GetV5EnterprisesEnterpriseWeekReportsId**](docs/EnterprisesApi.md#getv5enterprisesenterpriseweekreportsid) | **Get** /v5/enterprises/{enterprise}/week_reports/{id} | 周报详情 +*EnterprisesApi* | [**GetV5EnterprisesEnterpriseWeekReportsIdComments**](docs/EnterprisesApi.md#getv5enterprisesenterpriseweekreportsidcomments) | **Get** /v5/enterprises/{enterprise}/week_reports/{id}/comments | 某个周报评论列表 +*EnterprisesApi* | [**GetV5UserEnterprises**](docs/EnterprisesApi.md#getv5userenterprises) | **Get** /v5/user/enterprises | 列出授权用户所属的企业 +*EnterprisesApi* | [**PatchV5EnterprisesEnterpriseWeekReportId**](docs/EnterprisesApi.md#patchv5enterprisesenterpriseweekreportid) | **Patch** /v5/enterprises/{enterprise}/week_report/{id} | 编辑周报 +*EnterprisesApi* | [**PostV5EnterprisesEnterpriseMembers**](docs/EnterprisesApi.md#postv5enterprisesenterprisemembers) | **Post** /v5/enterprises/{enterprise}/members | 添加或邀请企业成员 +*EnterprisesApi* | [**PostV5EnterprisesEnterpriseWeekReport**](docs/EnterprisesApi.md#postv5enterprisesenterpriseweekreport) | **Post** /v5/enterprises/{enterprise}/week_report | 新建周报 +*EnterprisesApi* | [**PostV5EnterprisesEnterpriseWeekReportsIdComment**](docs/EnterprisesApi.md#postv5enterprisesenterpriseweekreportsidcomment) | **Post** /v5/enterprises/{enterprise}/week_reports/{id}/comment | 评论周报 +*EnterprisesApi* | [**PutV5EnterprisesEnterpriseMembersUsername**](docs/EnterprisesApi.md#putv5enterprisesenterprisemembersusername) | **Put** /v5/enterprises/{enterprise}/members/{username} | 修改企业成员权限或备注 +*GistsApi* | [**DeleteV5GistsGistIdCommentsId**](docs/GistsApi.md#deletev5gistsgistidcommentsid) | **Delete** /v5/gists/{gist_id}/comments/{id} | 删除代码片段的评论 +*GistsApi* | [**DeleteV5GistsId**](docs/GistsApi.md#deletev5gistsid) | **Delete** /v5/gists/{id} | 删除指定代码片段 +*GistsApi* | [**DeleteV5GistsIdStar**](docs/GistsApi.md#deletev5gistsidstar) | **Delete** /v5/gists/{id}/star | 取消Star代码片段 +*GistsApi* | [**GetV5Gists**](docs/GistsApi.md#getv5gists) | **Get** /v5/gists | 获取代码片段 +*GistsApi* | [**GetV5GistsGistIdComments**](docs/GistsApi.md#getv5gistsgistidcomments) | **Get** /v5/gists/{gist_id}/comments | 获取代码片段的评论 +*GistsApi* | [**GetV5GistsGistIdCommentsId**](docs/GistsApi.md#getv5gistsgistidcommentsid) | **Get** /v5/gists/{gist_id}/comments/{id} | 获取单条代码片段的评论 +*GistsApi* | [**GetV5GistsId**](docs/GistsApi.md#getv5gistsid) | **Get** /v5/gists/{id} | 获取单条代码片段 +*GistsApi* | [**GetV5GistsIdCommits**](docs/GistsApi.md#getv5gistsidcommits) | **Get** /v5/gists/{id}/commits | 获取代码片段的commit +*GistsApi* | [**GetV5GistsIdForks**](docs/GistsApi.md#getv5gistsidforks) | **Get** /v5/gists/{id}/forks | 获取 Fork 了指定代码片段的列表 +*GistsApi* | [**GetV5GistsIdStar**](docs/GistsApi.md#getv5gistsidstar) | **Get** /v5/gists/{id}/star | 判断代码片段是否已Star +*GistsApi* | [**GetV5GistsPublic**](docs/GistsApi.md#getv5gistspublic) | **Get** /v5/gists/public | 获取公开的代码片段 +*GistsApi* | [**GetV5GistsStarred**](docs/GistsApi.md#getv5gistsstarred) | **Get** /v5/gists/starred | 获取用户Star的代码片段 +*GistsApi* | [**GetV5UsersUsernameGists**](docs/GistsApi.md#getv5usersusernamegists) | **Get** /v5/users/{username}/gists | 获取指定用户的公开代码片段 +*GistsApi* | [**PatchV5GistsGistIdCommentsId**](docs/GistsApi.md#patchv5gistsgistidcommentsid) | **Patch** /v5/gists/{gist_id}/comments/{id} | 修改代码片段的评论 +*GistsApi* | [**PatchV5GistsId**](docs/GistsApi.md#patchv5gistsid) | **Patch** /v5/gists/{id} | 修改代码片段 +*GistsApi* | [**PostV5Gists**](docs/GistsApi.md#postv5gists) | **Post** /v5/gists | 创建代码片段 +*GistsApi* | [**PostV5GistsGistIdComments**](docs/GistsApi.md#postv5gistsgistidcomments) | **Post** /v5/gists/{gist_id}/comments | 增加代码片段的评论 +*GistsApi* | [**PostV5GistsIdForks**](docs/GistsApi.md#postv5gistsidforks) | **Post** /v5/gists/{id}/forks | Fork代码片段 +*GistsApi* | [**PutV5GistsIdStar**](docs/GistsApi.md#putv5gistsidstar) | **Put** /v5/gists/{id}/star | Star代码片段 +*GitDataApi* | [**GetV5ReposOwnerRepoGitBlobsSha**](docs/GitDataApi.md#getv5reposownerrepogitblobssha) | **Get** /v5/repos/{owner}/{repo}/git/blobs/{sha} | 获取文件Blob +*GitDataApi* | [**GetV5ReposOwnerRepoGitTreesSha**](docs/GitDataApi.md#getv5reposownerrepogittreessha) | **Get** /v5/repos/{owner}/{repo}/git/trees/{sha} | 获取目录Tree +*IssuesApi* | [**DeleteV5ReposOwnerRepoIssuesCommentsId**](docs/IssuesApi.md#deletev5reposownerrepoissuescommentsid) | **Delete** /v5/repos/{owner}/{repo}/issues/comments/{id} | 删除Issue某条评论 +*IssuesApi* | [**GetV5EnterprisesEnterpriseIssues**](docs/IssuesApi.md#getv5enterprisesenterpriseissues) | **Get** /v5/enterprises/{enterprise}/issues | 获取某个企业的所有Issues +*IssuesApi* | [**GetV5EnterprisesEnterpriseIssuesNumber**](docs/IssuesApi.md#getv5enterprisesenterpriseissuesnumber) | **Get** /v5/enterprises/{enterprise}/issues/{number} | 获取企业的某个Issue +*IssuesApi* | [**GetV5EnterprisesEnterpriseIssuesNumberComments**](docs/IssuesApi.md#getv5enterprisesenterpriseissuesnumbercomments) | **Get** /v5/enterprises/{enterprise}/issues/{number}/comments | 获取企业某个Issue所有评论 +*IssuesApi* | [**GetV5EnterprisesEnterpriseIssuesNumberLabels**](docs/IssuesApi.md#getv5enterprisesenterpriseissuesnumberlabels) | **Get** /v5/enterprises/{enterprise}/issues/{number}/labels | 获取企业某个Issue所有标签 +*IssuesApi* | [**GetV5Issues**](docs/IssuesApi.md#getv5issues) | **Get** /v5/issues | 获取当前授权用户的所有Issues +*IssuesApi* | [**GetV5OrgsOrgIssues**](docs/IssuesApi.md#getv5orgsorgissues) | **Get** /v5/orgs/{org}/issues | 获取当前用户某个组织的Issues +*IssuesApi* | [**GetV5ReposOwnerIssuesNumberOperateLogs**](docs/IssuesApi.md#getv5reposownerissuesnumberoperatelogs) | **Get** /v5/repos/{owner}/issues/{number}/operate_logs | 获取某个Issue下的操作日志 +*IssuesApi* | [**GetV5ReposOwnerRepoIssues**](docs/IssuesApi.md#getv5reposownerrepoissues) | **Get** /v5/repos/{owner}/{repo}/issues | 仓库的所有Issues +*IssuesApi* | [**GetV5ReposOwnerRepoIssuesComments**](docs/IssuesApi.md#getv5reposownerrepoissuescomments) | **Get** /v5/repos/{owner}/{repo}/issues/comments | 获取仓库所有Issue的评论 +*IssuesApi* | [**GetV5ReposOwnerRepoIssuesCommentsId**](docs/IssuesApi.md#getv5reposownerrepoissuescommentsid) | **Get** /v5/repos/{owner}/{repo}/issues/comments/{id} | 获取仓库Issue某条评论 +*IssuesApi* | [**GetV5ReposOwnerRepoIssuesNumber**](docs/IssuesApi.md#getv5reposownerrepoissuesnumber) | **Get** /v5/repos/{owner}/{repo}/issues/{number} | 仓库的某个Issue +*IssuesApi* | [**GetV5ReposOwnerRepoIssuesNumberComments**](docs/IssuesApi.md#getv5reposownerrepoissuesnumbercomments) | **Get** /v5/repos/{owner}/{repo}/issues/{number}/comments | 获取仓库某个Issue所有的评论 +*IssuesApi* | [**GetV5UserIssues**](docs/IssuesApi.md#getv5userissues) | **Get** /v5/user/issues | 获取授权用户的所有Issues +*IssuesApi* | [**PatchV5ReposOwnerIssuesNumber**](docs/IssuesApi.md#patchv5reposownerissuesnumber) | **Patch** /v5/repos/{owner}/issues/{number} | 更新Issue +*IssuesApi* | [**PatchV5ReposOwnerRepoIssuesCommentsId**](docs/IssuesApi.md#patchv5reposownerrepoissuescommentsid) | **Patch** /v5/repos/{owner}/{repo}/issues/comments/{id} | 更新Issue某条评论 +*IssuesApi* | [**PostV5ReposOwnerIssues**](docs/IssuesApi.md#postv5reposownerissues) | **Post** /v5/repos/{owner}/issues | 创建Issue +*IssuesApi* | [**PostV5ReposOwnerRepoIssuesNumberComments**](docs/IssuesApi.md#postv5reposownerrepoissuesnumbercomments) | **Post** /v5/repos/{owner}/{repo}/issues/{number}/comments | 创建某个Issue评论 +*LabelsApi* | [**DeleteV5ReposOwnerRepoIssuesNumberLabels**](docs/LabelsApi.md#deletev5reposownerrepoissuesnumberlabels) | **Delete** /v5/repos/{owner}/{repo}/issues/{number}/labels | 删除Issue所有标签 +*LabelsApi* | [**DeleteV5ReposOwnerRepoIssuesNumberLabelsName**](docs/LabelsApi.md#deletev5reposownerrepoissuesnumberlabelsname) | **Delete** /v5/repos/{owner}/{repo}/issues/{number}/labels/{name} | 删除Issue标签 +*LabelsApi* | [**DeleteV5ReposOwnerRepoLabelsName**](docs/LabelsApi.md#deletev5reposownerrepolabelsname) | **Delete** /v5/repos/{owner}/{repo}/labels/{name} | 删除一个仓库任务标签 +*LabelsApi* | [**GetV5EnterprisesEnterpriseLabels**](docs/LabelsApi.md#getv5enterprisesenterpriselabels) | **Get** /v5/enterprises/{enterprise}/labels | 获取企业所有标签 +*LabelsApi* | [**GetV5EnterprisesEnterpriseLabelsName**](docs/LabelsApi.md#getv5enterprisesenterpriselabelsname) | **Get** /v5/enterprises/{enterprise}/labels/{name} | 获取企业某个标签 +*LabelsApi* | [**GetV5ReposOwnerRepoIssuesNumberLabels**](docs/LabelsApi.md#getv5reposownerrepoissuesnumberlabels) | **Get** /v5/repos/{owner}/{repo}/issues/{number}/labels | 获取仓库任务的所有标签 +*LabelsApi* | [**GetV5ReposOwnerRepoLabels**](docs/LabelsApi.md#getv5reposownerrepolabels) | **Get** /v5/repos/{owner}/{repo}/labels | 获取仓库所有任务标签 +*LabelsApi* | [**GetV5ReposOwnerRepoLabelsName**](docs/LabelsApi.md#getv5reposownerrepolabelsname) | **Get** /v5/repos/{owner}/{repo}/labels/{name} | 根据标签名称获取单个标签 +*LabelsApi* | [**PatchV5ReposOwnerRepoLabelsOriginalName**](docs/LabelsApi.md#patchv5reposownerrepolabelsoriginalname) | **Patch** /v5/repos/{owner}/{repo}/labels/{original_name} | 更新一个仓库任务标签 +*LabelsApi* | [**PostV5ReposOwnerRepoIssuesNumberLabels**](docs/LabelsApi.md#postv5reposownerrepoissuesnumberlabels) | **Post** /v5/repos/{owner}/{repo}/issues/{number}/labels | 创建Issue标签 +*LabelsApi* | [**PostV5ReposOwnerRepoLabels**](docs/LabelsApi.md#postv5reposownerrepolabels) | **Post** /v5/repos/{owner}/{repo}/labels | 创建仓库任务标签 +*LabelsApi* | [**PutV5ReposOwnerRepoIssuesNumberLabels**](docs/LabelsApi.md#putv5reposownerrepoissuesnumberlabels) | **Put** /v5/repos/{owner}/{repo}/issues/{number}/labels | 替换Issue所有标签 +*MilestonesApi* | [**DeleteV5ReposOwnerRepoMilestonesNumber**](docs/MilestonesApi.md#deletev5reposownerrepomilestonesnumber) | **Delete** /v5/repos/{owner}/{repo}/milestones/{number} | 删除仓库单个里程碑 +*MilestonesApi* | [**GetV5ReposOwnerRepoMilestones**](docs/MilestonesApi.md#getv5reposownerrepomilestones) | **Get** /v5/repos/{owner}/{repo}/milestones | 获取仓库所有里程碑 +*MilestonesApi* | [**GetV5ReposOwnerRepoMilestonesNumber**](docs/MilestonesApi.md#getv5reposownerrepomilestonesnumber) | **Get** /v5/repos/{owner}/{repo}/milestones/{number} | 获取仓库单个里程碑 +*MilestonesApi* | [**PatchV5ReposOwnerRepoMilestonesNumber**](docs/MilestonesApi.md#patchv5reposownerrepomilestonesnumber) | **Patch** /v5/repos/{owner}/{repo}/milestones/{number} | 更新仓库里程碑 +*MilestonesApi* | [**PostV5ReposOwnerRepoMilestones**](docs/MilestonesApi.md#postv5reposownerrepomilestones) | **Post** /v5/repos/{owner}/{repo}/milestones | 创建仓库里程碑 +*MiscellaneousApi* | [**GetV5Emojis**](docs/MiscellaneousApi.md#getv5emojis) | **Get** /v5/emojis | 列出可使用的 Emoji +*MiscellaneousApi* | [**GetV5GitignoreTemplates**](docs/MiscellaneousApi.md#getv5gitignoretemplates) | **Get** /v5/gitignore/templates | 列出可使用的 .gitignore 模板 +*MiscellaneousApi* | [**GetV5GitignoreTemplatesName**](docs/MiscellaneousApi.md#getv5gitignoretemplatesname) | **Get** /v5/gitignore/templates/{name} | 获取一个 .gitignore 模板 +*MiscellaneousApi* | [**GetV5GitignoreTemplatesNameRaw**](docs/MiscellaneousApi.md#getv5gitignoretemplatesnameraw) | **Get** /v5/gitignore/templates/{name}/raw | 获取一个 .gitignore 模板原始文件 +*MiscellaneousApi* | [**GetV5Licenses**](docs/MiscellaneousApi.md#getv5licenses) | **Get** /v5/licenses | 列出可使用的开源许可协议 +*MiscellaneousApi* | [**GetV5LicensesLicense**](docs/MiscellaneousApi.md#getv5licenseslicense) | **Get** /v5/licenses/{license} | 获取一个开源许可协议 +*MiscellaneousApi* | [**GetV5LicensesLicenseRaw**](docs/MiscellaneousApi.md#getv5licenseslicenseraw) | **Get** /v5/licenses/{license}/raw | 获取一个开源许可协议原始文件 +*MiscellaneousApi* | [**GetV5ReposOwnerRepoLicense**](docs/MiscellaneousApi.md#getv5reposownerrepolicense) | **Get** /v5/repos/{owner}/{repo}/license | 获取一个仓库使用的开源许可协议 +*MiscellaneousApi* | [**PostV5Markdown**](docs/MiscellaneousApi.md#postv5markdown) | **Post** /v5/markdown | 渲染 Markdown 文本 +*OrganizationsApi* | [**DeleteV5OrgsOrgMembershipsUsername**](docs/OrganizationsApi.md#deletev5orgsorgmembershipsusername) | **Delete** /v5/orgs/{org}/memberships/{username} | 移除授权用户所管理组织中的成员 +*OrganizationsApi* | [**DeleteV5UserMembershipsOrgsOrg**](docs/OrganizationsApi.md#deletev5usermembershipsorgsorg) | **Delete** /v5/user/memberships/orgs/{org} | 退出一个组织 +*OrganizationsApi* | [**GetV5OrgsOrg**](docs/OrganizationsApi.md#getv5orgsorg) | **Get** /v5/orgs/{org} | 获取一个组织 +*OrganizationsApi* | [**GetV5OrgsOrgMembers**](docs/OrganizationsApi.md#getv5orgsorgmembers) | **Get** /v5/orgs/{org}/members | 列出一个组织的所有成员 +*OrganizationsApi* | [**GetV5OrgsOrgMembershipsUsername**](docs/OrganizationsApi.md#getv5orgsorgmembershipsusername) | **Get** /v5/orgs/{org}/memberships/{username} | 获取授权用户所属组织的一个成员 +*OrganizationsApi* | [**GetV5UserMembershipsOrgs**](docs/OrganizationsApi.md#getv5usermembershipsorgs) | **Get** /v5/user/memberships/orgs | 列出授权用户在所属组织的成员资料 +*OrganizationsApi* | [**GetV5UserMembershipsOrgsOrg**](docs/OrganizationsApi.md#getv5usermembershipsorgsorg) | **Get** /v5/user/memberships/orgs/{org} | 获取授权用户在一个组织的成员资料 +*OrganizationsApi* | [**GetV5UserOrgs**](docs/OrganizationsApi.md#getv5userorgs) | **Get** /v5/user/orgs | 列出授权用户所属的组织 +*OrganizationsApi* | [**GetV5UsersUsernameOrgs**](docs/OrganizationsApi.md#getv5usersusernameorgs) | **Get** /v5/users/{username}/orgs | 列出用户所属的组织 +*OrganizationsApi* | [**PatchV5OrgsOrg**](docs/OrganizationsApi.md#patchv5orgsorg) | **Patch** /v5/orgs/{org} | 更新授权用户所管理的组织资料 +*OrganizationsApi* | [**PatchV5UserMembershipsOrgsOrg**](docs/OrganizationsApi.md#patchv5usermembershipsorgsorg) | **Patch** /v5/user/memberships/orgs/{org} | 更新授权用户在一个组织的成员资料 +*OrganizationsApi* | [**PostV5UsersOrganization**](docs/OrganizationsApi.md#postv5usersorganization) | **Post** /v5/users/organization | 创建组织 +*OrganizationsApi* | [**PutV5OrgsOrgMembershipsUsername**](docs/OrganizationsApi.md#putv5orgsorgmembershipsusername) | **Put** /v5/orgs/{org}/memberships/{username} | 增加或更新授权用户所管理组织的成员 +*PullRequestsApi* | [**DeleteV5ReposOwnerRepoPullsCommentsId**](docs/PullRequestsApi.md#deletev5reposownerrepopullscommentsid) | **Delete** /v5/repos/{owner}/{repo}/pulls/comments/{id} | 删除评论 +*PullRequestsApi* | [**DeleteV5ReposOwnerRepoPullsNumberAssignees**](docs/PullRequestsApi.md#deletev5reposownerrepopullsnumberassignees) | **Delete** /v5/repos/{owner}/{repo}/pulls/{number}/assignees | 取消用户审查 Pull Request +*PullRequestsApi* | [**DeleteV5ReposOwnerRepoPullsNumberTesters**](docs/PullRequestsApi.md#deletev5reposownerrepopullsnumbertesters) | **Delete** /v5/repos/{owner}/{repo}/pulls/{number}/testers | 取消用户测试 Pull Request +*PullRequestsApi* | [**GetV5ReposOwnerRepoPulls**](docs/PullRequestsApi.md#getv5reposownerrepopulls) | **Get** /v5/repos/{owner}/{repo}/pulls | 获取Pull Request列表 +*PullRequestsApi* | [**GetV5ReposOwnerRepoPullsComments**](docs/PullRequestsApi.md#getv5reposownerrepopullscomments) | **Get** /v5/repos/{owner}/{repo}/pulls/comments | 获取该仓库下的所有Pull Request评论 +*PullRequestsApi* | [**GetV5ReposOwnerRepoPullsCommentsId**](docs/PullRequestsApi.md#getv5reposownerrepopullscommentsid) | **Get** /v5/repos/{owner}/{repo}/pulls/comments/{id} | 获取Pull Request的某个评论 +*PullRequestsApi* | [**GetV5ReposOwnerRepoPullsNumber**](docs/PullRequestsApi.md#getv5reposownerrepopullsnumber) | **Get** /v5/repos/{owner}/{repo}/pulls/{number} | 获取单个Pull Request +*PullRequestsApi* | [**GetV5ReposOwnerRepoPullsNumberComments**](docs/PullRequestsApi.md#getv5reposownerrepopullsnumbercomments) | **Get** /v5/repos/{owner}/{repo}/pulls/{number}/comments | 获取某个Pull Request的所有评论 +*PullRequestsApi* | [**GetV5ReposOwnerRepoPullsNumberCommits**](docs/PullRequestsApi.md#getv5reposownerrepopullsnumbercommits) | **Get** /v5/repos/{owner}/{repo}/pulls/{number}/commits | 获取某Pull Request的所有Commit信息。最多显示250条Commit +*PullRequestsApi* | [**GetV5ReposOwnerRepoPullsNumberFiles**](docs/PullRequestsApi.md#getv5reposownerrepopullsnumberfiles) | **Get** /v5/repos/{owner}/{repo}/pulls/{number}/files | Pull Request Commit文件列表。最多显示300条diff +*PullRequestsApi* | [**GetV5ReposOwnerRepoPullsNumberMerge**](docs/PullRequestsApi.md#getv5reposownerrepopullsnumbermerge) | **Get** /v5/repos/{owner}/{repo}/pulls/{number}/merge | 判断Pull Request是否已经合并 +*PullRequestsApi* | [**GetV5ReposOwnerRepoPullsNumberOperateLogs**](docs/PullRequestsApi.md#getv5reposownerrepopullsnumberoperatelogs) | **Get** /v5/repos/{owner}/{repo}/pulls/{number}/operate_logs | 获取某个Pull Request的操作日志 +*PullRequestsApi* | [**PatchV5ReposOwnerRepoPullsCommentsId**](docs/PullRequestsApi.md#patchv5reposownerrepopullscommentsid) | **Patch** /v5/repos/{owner}/{repo}/pulls/comments/{id} | 编辑评论 +*PullRequestsApi* | [**PatchV5ReposOwnerRepoPullsNumber**](docs/PullRequestsApi.md#patchv5reposownerrepopullsnumber) | **Patch** /v5/repos/{owner}/{repo}/pulls/{number} | 更新Pull Request信息 +*PullRequestsApi* | [**PostV5ReposOwnerRepoPulls**](docs/PullRequestsApi.md#postv5reposownerrepopulls) | **Post** /v5/repos/{owner}/{repo}/pulls | 创建Pull Request +*PullRequestsApi* | [**PostV5ReposOwnerRepoPullsNumberAssignees**](docs/PullRequestsApi.md#postv5reposownerrepopullsnumberassignees) | **Post** /v5/repos/{owner}/{repo}/pulls/{number}/assignees | 指派用户审查 Pull Request +*PullRequestsApi* | [**PostV5ReposOwnerRepoPullsNumberComments**](docs/PullRequestsApi.md#postv5reposownerrepopullsnumbercomments) | **Post** /v5/repos/{owner}/{repo}/pulls/{number}/comments | 提交Pull Request评论 +*PullRequestsApi* | [**PostV5ReposOwnerRepoPullsNumberTesters**](docs/PullRequestsApi.md#postv5reposownerrepopullsnumbertesters) | **Post** /v5/repos/{owner}/{repo}/pulls/{number}/testers | 指派用户测试 Pull Request +*PullRequestsApi* | [**PutV5ReposOwnerRepoPullsNumberMerge**](docs/PullRequestsApi.md#putv5reposownerrepopullsnumbermerge) | **Put** /v5/repos/{owner}/{repo}/pulls/{number}/merge | 合并Pull Request +*RepositoriesApi* | [**DeleteV5ReposOwnerRepo**](docs/RepositoriesApi.md#deletev5reposownerrepo) | **Delete** /v5/repos/{owner}/{repo} | 删除一个仓库 +*RepositoriesApi* | [**DeleteV5ReposOwnerRepoBranchesBranchProtection**](docs/RepositoriesApi.md#deletev5reposownerrepobranchesbranchprotection) | **Delete** /v5/repos/{owner}/{repo}/branches/{branch}/protection | 取消保护分支的设置 +*RepositoriesApi* | [**DeleteV5ReposOwnerRepoCollaboratorsUsername**](docs/RepositoriesApi.md#deletev5reposownerrepocollaboratorsusername) | **Delete** /v5/repos/{owner}/{repo}/collaborators/{username} | 移除仓库成员 +*RepositoriesApi* | [**DeleteV5ReposOwnerRepoCommentsId**](docs/RepositoriesApi.md#deletev5reposownerrepocommentsid) | **Delete** /v5/repos/{owner}/{repo}/comments/{id} | 删除Commit评论 +*RepositoriesApi* | [**DeleteV5ReposOwnerRepoContentsPath**](docs/RepositoriesApi.md#deletev5reposownerrepocontentspath) | **Delete** /v5/repos/{owner}/{repo}/contents/{path} | 删除文件 +*RepositoriesApi* | [**DeleteV5ReposOwnerRepoKeysEnableId**](docs/RepositoriesApi.md#deletev5reposownerrepokeysenableid) | **Delete** /v5/repos/{owner}/{repo}/keys/enable/{id} | 停用仓库公钥 +*RepositoriesApi* | [**DeleteV5ReposOwnerRepoKeysId**](docs/RepositoriesApi.md#deletev5reposownerrepokeysid) | **Delete** /v5/repos/{owner}/{repo}/keys/{id} | 删除一个仓库公钥 +*RepositoriesApi* | [**DeleteV5ReposOwnerRepoReleasesId**](docs/RepositoriesApi.md#deletev5reposownerreporeleasesid) | **Delete** /v5/repos/{owner}/{repo}/releases/{id} | 删除仓库Release +*RepositoriesApi* | [**GetV5EnterprisesEnterpriseRepos**](docs/RepositoriesApi.md#getv5enterprisesenterpriserepos) | **Get** /v5/enterprises/{enterprise}/repos | 获取企业的所有仓库 +*RepositoriesApi* | [**GetV5OrgsOrgRepos**](docs/RepositoriesApi.md#getv5orgsorgrepos) | **Get** /v5/orgs/{org}/repos | 获取一个组织的仓库 +*RepositoriesApi* | [**GetV5ReposOwnerRepo**](docs/RepositoriesApi.md#getv5reposownerrepo) | **Get** /v5/repos/{owner}/{repo} | 获取用户的某个仓库 +*RepositoriesApi* | [**GetV5ReposOwnerRepoBranches**](docs/RepositoriesApi.md#getv5reposownerrepobranches) | **Get** /v5/repos/{owner}/{repo}/branches | 获取所有分支 +*RepositoriesApi* | [**GetV5ReposOwnerRepoBranchesBranch**](docs/RepositoriesApi.md#getv5reposownerrepobranchesbranch) | **Get** /v5/repos/{owner}/{repo}/branches/{branch} | 获取单个分支 +*RepositoriesApi* | [**GetV5ReposOwnerRepoCollaborators**](docs/RepositoriesApi.md#getv5reposownerrepocollaborators) | **Get** /v5/repos/{owner}/{repo}/collaborators | 获取仓库的所有成员 +*RepositoriesApi* | [**GetV5ReposOwnerRepoCollaboratorsUsername**](docs/RepositoriesApi.md#getv5reposownerrepocollaboratorsusername) | **Get** /v5/repos/{owner}/{repo}/collaborators/{username} | 判断用户是否为仓库成员 +*RepositoriesApi* | [**GetV5ReposOwnerRepoCollaboratorsUsernamePermission**](docs/RepositoriesApi.md#getv5reposownerrepocollaboratorsusernamepermission) | **Get** /v5/repos/{owner}/{repo}/collaborators/{username}/permission | 查看仓库成员的权限 +*RepositoriesApi* | [**GetV5ReposOwnerRepoComments**](docs/RepositoriesApi.md#getv5reposownerrepocomments) | **Get** /v5/repos/{owner}/{repo}/comments | 获取仓库的Commit评论 +*RepositoriesApi* | [**GetV5ReposOwnerRepoCommentsId**](docs/RepositoriesApi.md#getv5reposownerrepocommentsid) | **Get** /v5/repos/{owner}/{repo}/comments/{id} | 获取仓库的某条Commit评论 +*RepositoriesApi* | [**GetV5ReposOwnerRepoCommits**](docs/RepositoriesApi.md#getv5reposownerrepocommits) | **Get** /v5/repos/{owner}/{repo}/commits | 仓库的所有提交 +*RepositoriesApi* | [**GetV5ReposOwnerRepoCommitsRefComments**](docs/RepositoriesApi.md#getv5reposownerrepocommitsrefcomments) | **Get** /v5/repos/{owner}/{repo}/commits/{ref}/comments | 获取单个Commit的评论 +*RepositoriesApi* | [**GetV5ReposOwnerRepoCommitsSha**](docs/RepositoriesApi.md#getv5reposownerrepocommitssha) | **Get** /v5/repos/{owner}/{repo}/commits/{sha} | 仓库的某个提交 +*RepositoriesApi* | [**GetV5ReposOwnerRepoCompareBaseHead**](docs/RepositoriesApi.md#getv5reposownerrepocomparebasehead) | **Get** /v5/repos/{owner}/{repo}/compare/{base}...{head} | 两个Commits之间对比的版本差异 +*RepositoriesApi* | [**GetV5ReposOwnerRepoContentsPath**](docs/RepositoriesApi.md#getv5reposownerrepocontentspath) | **Get** /v5/repos/{owner}/{repo}/contents(/{path}) | 获取仓库具体路径下的内容 +*RepositoriesApi* | [**GetV5ReposOwnerRepoContributors**](docs/RepositoriesApi.md#getv5reposownerrepocontributors) | **Get** /v5/repos/{owner}/{repo}/contributors | 获取仓库贡献者 +*RepositoriesApi* | [**GetV5ReposOwnerRepoForks**](docs/RepositoriesApi.md#getv5reposownerrepoforks) | **Get** /v5/repos/{owner}/{repo}/forks | 查看仓库的Forks +*RepositoriesApi* | [**GetV5ReposOwnerRepoKeys**](docs/RepositoriesApi.md#getv5reposownerrepokeys) | **Get** /v5/repos/{owner}/{repo}/keys | 获取仓库已部署的公钥 +*RepositoriesApi* | [**GetV5ReposOwnerRepoKeysAvailable**](docs/RepositoriesApi.md#getv5reposownerrepokeysavailable) | **Get** /v5/repos/{owner}/{repo}/keys/available | 获取仓库可部署的公钥 +*RepositoriesApi* | [**GetV5ReposOwnerRepoKeysId**](docs/RepositoriesApi.md#getv5reposownerrepokeysid) | **Get** /v5/repos/{owner}/{repo}/keys/{id} | 获取仓库的单个公钥 +*RepositoriesApi* | [**GetV5ReposOwnerRepoPages**](docs/RepositoriesApi.md#getv5reposownerrepopages) | **Get** /v5/repos/{owner}/{repo}/pages | 获取Pages信息 +*RepositoriesApi* | [**GetV5ReposOwnerRepoReadme**](docs/RepositoriesApi.md#getv5reposownerreporeadme) | **Get** /v5/repos/{owner}/{repo}/readme | 获取仓库README +*RepositoriesApi* | [**GetV5ReposOwnerRepoReleases**](docs/RepositoriesApi.md#getv5reposownerreporeleases) | **Get** /v5/repos/{owner}/{repo}/releases | 获取仓库的所有Releases +*RepositoriesApi* | [**GetV5ReposOwnerRepoReleasesId**](docs/RepositoriesApi.md#getv5reposownerreporeleasesid) | **Get** /v5/repos/{owner}/{repo}/releases/{id} | 获取仓库的单个Releases +*RepositoriesApi* | [**GetV5ReposOwnerRepoReleasesLatest**](docs/RepositoriesApi.md#getv5reposownerreporeleaseslatest) | **Get** /v5/repos/{owner}/{repo}/releases/latest | 获取仓库的最后更新的Release +*RepositoriesApi* | [**GetV5ReposOwnerRepoReleasesTagsTag**](docs/RepositoriesApi.md#getv5reposownerreporeleasestagstag) | **Get** /v5/repos/{owner}/{repo}/releases/tags/{tag} | 根据Tag名称获取仓库的Release +*RepositoriesApi* | [**GetV5ReposOwnerRepoTags**](docs/RepositoriesApi.md#getv5reposownerrepotags) | **Get** /v5/repos/{owner}/{repo}/tags | 列出仓库所有的tags +*RepositoriesApi* | [**GetV5UserRepos**](docs/RepositoriesApi.md#getv5userrepos) | **Get** /v5/user/repos | 列出授权用户的所有仓库 +*RepositoriesApi* | [**GetV5UsersUsernameRepos**](docs/RepositoriesApi.md#getv5usersusernamerepos) | **Get** /v5/users/{username}/repos | 获取某个用户的公开仓库 +*RepositoriesApi* | [**PatchV5ReposOwnerRepo**](docs/RepositoriesApi.md#patchv5reposownerrepo) | **Patch** /v5/repos/{owner}/{repo} | 更新仓库设置 +*RepositoriesApi* | [**PatchV5ReposOwnerRepoCommentsId**](docs/RepositoriesApi.md#patchv5reposownerrepocommentsid) | **Patch** /v5/repos/{owner}/{repo}/comments/{id} | 更新Commit评论 +*RepositoriesApi* | [**PatchV5ReposOwnerRepoReleasesId**](docs/RepositoriesApi.md#patchv5reposownerreporeleasesid) | **Patch** /v5/repos/{owner}/{repo}/releases/{id} | 更新仓库Release +*RepositoriesApi* | [**PostV5EnterprisesEnterpriseRepos**](docs/RepositoriesApi.md#postv5enterprisesenterpriserepos) | **Post** /v5/enterprises/{enterprise}/repos | 创建企业仓库 +*RepositoriesApi* | [**PostV5OrgsOrgRepos**](docs/RepositoriesApi.md#postv5orgsorgrepos) | **Post** /v5/orgs/{org}/repos | 创建组织仓库 +*RepositoriesApi* | [**PostV5ReposOwnerRepoBranches**](docs/RepositoriesApi.md#postv5reposownerrepobranches) | **Post** /v5/repos/{owner}/{repo}/branches | 创建分支 +*RepositoriesApi* | [**PostV5ReposOwnerRepoCommitsShaComments**](docs/RepositoriesApi.md#postv5reposownerrepocommitsshacomments) | **Post** /v5/repos/{owner}/{repo}/commits/{sha}/comments | 创建Commit评论 +*RepositoriesApi* | [**PostV5ReposOwnerRepoContentsPath**](docs/RepositoriesApi.md#postv5reposownerrepocontentspath) | **Post** /v5/repos/{owner}/{repo}/contents/{path} | 新建文件 +*RepositoriesApi* | [**PostV5ReposOwnerRepoForks**](docs/RepositoriesApi.md#postv5reposownerrepoforks) | **Post** /v5/repos/{owner}/{repo}/forks | Fork一个仓库 +*RepositoriesApi* | [**PostV5ReposOwnerRepoKeys**](docs/RepositoriesApi.md#postv5reposownerrepokeys) | **Post** /v5/repos/{owner}/{repo}/keys | 为仓库添加公钥 +*RepositoriesApi* | [**PostV5ReposOwnerRepoPagesBuilds**](docs/RepositoriesApi.md#postv5reposownerrepopagesbuilds) | **Post** /v5/repos/{owner}/{repo}/pages/builds | 请求建立Pages +*RepositoriesApi* | [**PostV5ReposOwnerRepoReleases**](docs/RepositoriesApi.md#postv5reposownerreporeleases) | **Post** /v5/repos/{owner}/{repo}/releases | 创建仓库Release +*RepositoriesApi* | [**PostV5UserRepos**](docs/RepositoriesApi.md#postv5userrepos) | **Post** /v5/user/repos | 创建一个仓库 +*RepositoriesApi* | [**PutV5ReposOwnerRepoBranchesBranchProtection**](docs/RepositoriesApi.md#putv5reposownerrepobranchesbranchprotection) | **Put** /v5/repos/{owner}/{repo}/branches/{branch}/protection | 设置分支保护 +*RepositoriesApi* | [**PutV5ReposOwnerRepoClear**](docs/RepositoriesApi.md#putv5reposownerrepoclear) | **Put** /v5/repos/{owner}/{repo}/clear | 清空一个仓库 +*RepositoriesApi* | [**PutV5ReposOwnerRepoCollaboratorsUsername**](docs/RepositoriesApi.md#putv5reposownerrepocollaboratorsusername) | **Put** /v5/repos/{owner}/{repo}/collaborators/{username} | 添加仓库成员 +*RepositoriesApi* | [**PutV5ReposOwnerRepoContentsPath**](docs/RepositoriesApi.md#putv5reposownerrepocontentspath) | **Put** /v5/repos/{owner}/{repo}/contents/{path} | 更新文件 +*RepositoriesApi* | [**PutV5ReposOwnerRepoKeysEnableId**](docs/RepositoriesApi.md#putv5reposownerrepokeysenableid) | **Put** /v5/repos/{owner}/{repo}/keys/enable/{id} | 启用仓库公钥 +*SearchApi* | [**GetV5SearchGists**](docs/SearchApi.md#getv5searchgists) | **Get** /v5/search/gists | 搜索代码片段 +*SearchApi* | [**GetV5SearchIssues**](docs/SearchApi.md#getv5searchissues) | **Get** /v5/search/issues | 搜索 Issues +*SearchApi* | [**GetV5SearchRepositories**](docs/SearchApi.md#getv5searchrepositories) | **Get** /v5/search/repositories | 搜索仓库 +*SearchApi* | [**GetV5SearchUsers**](docs/SearchApi.md#getv5searchusers) | **Get** /v5/search/users | 搜索用户 +*UsersApi* | [**DeleteV5UserFollowingUsername**](docs/UsersApi.md#deletev5userfollowingusername) | **Delete** /v5/user/following/{username} | 取消关注一个用户 +*UsersApi* | [**DeleteV5UserKeysId**](docs/UsersApi.md#deletev5userkeysid) | **Delete** /v5/user/keys/{id} | 删除一个公钥 +*UsersApi* | [**GetV5User**](docs/UsersApi.md#getv5user) | **Get** /v5/user | 获取授权用户的资料 +*UsersApi* | [**GetV5UserFollowers**](docs/UsersApi.md#getv5userfollowers) | **Get** /v5/user/followers | 列出授权用户的关注者 +*UsersApi* | [**GetV5UserFollowing**](docs/UsersApi.md#getv5userfollowing) | **Get** /v5/user/following | 列出授权用户正关注的用户 +*UsersApi* | [**GetV5UserFollowingUsername**](docs/UsersApi.md#getv5userfollowingusername) | **Get** /v5/user/following/{username} | 检查授权用户是否关注了一个用户 +*UsersApi* | [**GetV5UserKeys**](docs/UsersApi.md#getv5userkeys) | **Get** /v5/user/keys | 列出授权用户的所有公钥 +*UsersApi* | [**GetV5UserKeysId**](docs/UsersApi.md#getv5userkeysid) | **Get** /v5/user/keys/{id} | 获取一个公钥 +*UsersApi* | [**GetV5UserNamespace**](docs/UsersApi.md#getv5usernamespace) | **Get** /v5/user/namespace | 获取授权用户的一个 Namespace +*UsersApi* | [**GetV5UserNamespaces**](docs/UsersApi.md#getv5usernamespaces) | **Get** /v5/user/namespaces | 列出授权用户所有的 Namespace +*UsersApi* | [**GetV5UsersUsername**](docs/UsersApi.md#getv5usersusername) | **Get** /v5/users/{username} | 获取一个用户 +*UsersApi* | [**GetV5UsersUsernameFollowers**](docs/UsersApi.md#getv5usersusernamefollowers) | **Get** /v5/users/{username}/followers | 列出指定用户的关注者 +*UsersApi* | [**GetV5UsersUsernameFollowing**](docs/UsersApi.md#getv5usersusernamefollowing) | **Get** /v5/users/{username}/following | 列出指定用户正在关注的用户 +*UsersApi* | [**GetV5UsersUsernameFollowingTargetUser**](docs/UsersApi.md#getv5usersusernamefollowingtargetuser) | **Get** /v5/users/{username}/following/{target_user} | 检查指定用户是否关注目标用户 +*UsersApi* | [**GetV5UsersUsernameKeys**](docs/UsersApi.md#getv5usersusernamekeys) | **Get** /v5/users/{username}/keys | 列出指定用户的所有公钥 +*UsersApi* | [**PatchV5User**](docs/UsersApi.md#patchv5user) | **Patch** /v5/user | 更新授权用户的资料 +*UsersApi* | [**PostV5UserKeys**](docs/UsersApi.md#postv5userkeys) | **Post** /v5/user/keys | 添加一个公钥 +*UsersApi* | [**PutV5UserFollowingUsername**](docs/UsersApi.md#putv5userfollowingusername) | **Put** /v5/user/following/{username} | 关注一个用户 +*WebhooksApi* | [**DeleteV5ReposOwnerRepoHooksId**](docs/WebhooksApi.md#deletev5reposownerrepohooksid) | **Delete** /v5/repos/{owner}/{repo}/hooks/{id} | 删除一个仓库WebHook +*WebhooksApi* | [**GetV5ReposOwnerRepoHooks**](docs/WebhooksApi.md#getv5reposownerrepohooks) | **Get** /v5/repos/{owner}/{repo}/hooks | 列出仓库的WebHooks +*WebhooksApi* | [**GetV5ReposOwnerRepoHooksId**](docs/WebhooksApi.md#getv5reposownerrepohooksid) | **Get** /v5/repos/{owner}/{repo}/hooks/{id} | 获取仓库单个WebHook +*WebhooksApi* | [**PatchV5ReposOwnerRepoHooksId**](docs/WebhooksApi.md#patchv5reposownerrepohooksid) | **Patch** /v5/repos/{owner}/{repo}/hooks/{id} | 更新一个仓库WebHook +*WebhooksApi* | [**PostV5ReposOwnerRepoHooks**](docs/WebhooksApi.md#postv5reposownerrepohooks) | **Post** /v5/repos/{owner}/{repo}/hooks | 创建一个仓库WebHook +*WebhooksApi* | [**PostV5ReposOwnerRepoHooksIdTests**](docs/WebhooksApi.md#postv5reposownerrepohooksidtests) | **Post** /v5/repos/{owner}/{repo}/hooks/{id}/tests | 测试WebHook是否发送成功 + + +## Documentation For Models + + - [Blob](docs/Blob.md) + - [Branch](docs/Branch.md) + - [Code](docs/Code.md) + - [CodeComment](docs/CodeComment.md) + - [CodeForks](docs/CodeForks.md) + - [CodeForksHistory](docs/CodeForksHistory.md) + - [Commit](docs/Commit.md) + - [CommitContent](docs/CommitContent.md) + - [Compare](docs/Compare.md) + - [CompleteBranch](docs/CompleteBranch.md) + - [Content](docs/Content.md) + - [ContentBasic](docs/ContentBasic.md) + - [Contributor](docs/Contributor.md) + - [EnterpriseBasic](docs/EnterpriseBasic.md) + - [EnterpriseMember](docs/EnterpriseMember.md) + - [Event](docs/Event.md) + - [Group](docs/Group.md) + - [GroupDetail](docs/GroupDetail.md) + - [GroupMember](docs/GroupMember.md) + - [Hook](docs/Hook.md) + - [Issue](docs/Issue.md) + - [Label](docs/Label.md) + - [Milestone](docs/Milestone.md) + - [Namespace](docs/Namespace.md) + - [NamespaceMini](docs/NamespaceMini.md) + - [Note](docs/Note.md) + - [OperateLog](docs/OperateLog.md) + - [ProgramBasic](docs/ProgramBasic.md) + - [Project](docs/Project.md) + - [ProjectBasic](docs/ProjectBasic.md) + - [ProjectMember](docs/ProjectMember.md) + - [ProjectMemberPermission](docs/ProjectMemberPermission.md) + - [PullRequest](docs/PullRequest.md) + - [PullRequestComments](docs/PullRequestComments.md) + - [PullRequestCommits](docs/PullRequestCommits.md) + - [PullRequestFiles](docs/PullRequestFiles.md) + - [Release](docs/Release.md) + - [RepoCommit](docs/RepoCommit.md) + - [SshKey](docs/SshKey.md) + - [SshKeyBasic](docs/SshKeyBasic.md) + - [Tag](docs/Tag.md) + - [Tree](docs/Tree.md) + - [User](docs/User.md) + - [UserBasic](docs/UserBasic.md) + - [UserMessage](docs/UserMessage.md) + - [UserMessageList](docs/UserMessageList.md) + - [UserMini](docs/UserMini.md) + - [UserNotification](docs/UserNotification.md) + - [UserNotificationCount](docs/UserNotificationCount.md) + - [UserNotificationList](docs/UserNotificationList.md) + - [UserNotificationNamespace](docs/UserNotificationNamespace.md) + - [UserNotificationSubject](docs/UserNotificationSubject.md) + - [WeekReport](docs/WeekReport.md) + + +## Documentation For Authorization + Endpoints do not require authorization. + + +## Author -## License -See the [LICENSE](LICENSE) file for details. diff --git a/api/swagger.yaml b/api/swagger.yaml new file mode 100644 index 0000000..c8ddcab --- /dev/null +++ b/api/swagger.yaml @@ -0,0 +1,15948 @@ +--- +swagger: "2.0" +info: + version: "5.3.2" + title: "码云 Open API" +host: "gitee.com" +basePath: "/api" +tags: +- name: "Repositories" + description: "Operations about Repositories" +- name: "Git Data" + description: "Operations about Git Data" +- name: "Issues" + description: "Operations about Issues" +- name: "Labels" + description: "Operations about Labels" +- name: "Milestones" + description: "Operations about Milestones" +- name: "Miscellaneous" + description: "Operations about Miscellaneous" +- name: "Pull Requests" + description: "Operations about Pull Requests" +- name: "Webhooks" + description: "Operations about Webhooks" +- name: "Activity" + description: "Operations about Activities" +- name: "Users" + description: "Operations about Users" +- name: "Organizations" + description: "Operations about Organizations" +- name: "Enterprises" + description: "Operations about Enterprises" +- name: "Gists" + description: "Operations about Gists" +- name: "Search" + description: "Operations about Searches" +produces: +- "application/json" +- "text/plain" +paths: + /v5/repos/{owner}/{repo}/branches: + get: + tags: + - "Repositories" + summary: "获取所有分支" + description: "获取所有分支" + operationId: "getV5ReposOwnerRepoBranches" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Branch" + post: + tags: + - "Repositories" + summary: "创建分支" + description: "创建分支" + operationId: "postV5ReposOwnerRepoBranches" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "refs" + in: "formData" + description: "起点名称, 默认:master" + required: true + type: "string" + default: "master" + x-exportParamName: "Refs" + - name: "branch_name" + in: "formData" + description: "新创建的分支名称" + required: true + type: "string" + x-exportParamName: "BranchName" + responses: + 201: + description: "返回格式" + schema: + $ref: "#/definitions/CompleteBranch" + /v5/repos/{owner}/{repo}/branches/{branch}: + get: + tags: + - "Repositories" + summary: "获取单个分支" + description: "获取单个分支" + operationId: "getV5ReposOwnerRepoBranchesBranch" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "branch" + in: "path" + description: "分支名称" + required: true + type: "string" + x-exportParamName: "Branch" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/CompleteBranch" + /v5/repos/{owner}/{repo}/branches/{branch}/protection: + put: + tags: + - "Repositories" + summary: "设置分支保护" + description: "设置分支保护" + operationId: "putV5ReposOwnerRepoBranchesBranchProtection" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "branch" + in: "path" + description: "分支名称" + required: true + type: "string" + x-exportParamName: "Branch" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/CompleteBranch" + delete: + tags: + - "Repositories" + summary: "取消保护分支的设置" + description: "取消保护分支的设置" + operationId: "deleteV5ReposOwnerRepoBranchesBranchProtection" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "branch" + in: "path" + description: "分支名称" + required: true + type: "string" + x-exportParamName: "Branch" + responses: + 204: + description: "取消保护分支的设置" + /v5/repos/{owner}/{repo}/commits: + get: + tags: + - "Repositories" + summary: "仓库的所有提交" + description: "仓库的所有提交" + operationId: "getV5ReposOwnerRepoCommits" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "sha" + in: "query" + description: "提交起始的SHA值或者分支名. 默认: 仓库的默认分支" + required: false + type: "string" + x-exportParamName: "Sha" + x-optionalDataType: "String" + - name: "path" + in: "query" + description: "包含该文件的提交" + required: false + type: "string" + x-exportParamName: "Path" + x-optionalDataType: "String" + - name: "author" + in: "query" + description: "提交作者的邮箱或个人空间地址(username/login)" + required: false + type: "string" + x-exportParamName: "Author" + x-optionalDataType: "String" + - name: "since" + in: "query" + description: "提交的起始时间,时间格式为 ISO 8601" + required: false + type: "string" + x-exportParamName: "Since" + x-optionalDataType: "String" + - name: "until" + in: "query" + description: "提交的最后时间,时间格式为 ISO 8601" + required: false + type: "string" + x-exportParamName: "Until" + x-optionalDataType: "String" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/RepoCommit" + /v5/repos/{owner}/{repo}/commits/{sha}: + get: + tags: + - "Repositories" + summary: "仓库的某个提交" + description: "仓库的某个提交" + operationId: "getV5ReposOwnerRepoCommitsSha" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "sha" + in: "path" + description: "提交的SHA值或者分支名" + required: true + type: "string" + x-exportParamName: "Sha" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/RepoCommit" + /v5/repos/{owner}/{repo}/compare/{base}...{head}: + get: + tags: + - "Repositories" + summary: "两个Commits之间对比的版本差异" + description: "两个Commits之间对比的版本差异" + operationId: "getV5ReposOwnerRepoCompareBase...Head" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "base" + in: "path" + description: "Commit提交的SHA值或者分支名作为对比起点" + required: true + type: "string" + x-exportParamName: "Base" + - name: "head" + in: "path" + description: "Commit提交的SHA值或者分支名作为对比终点" + required: true + type: "string" + x-exportParamName: "Head" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Compare" + /v5/repos/{owner}/{repo}/keys: + get: + tags: + - "Repositories" + summary: "获取仓库已部署的公钥" + description: "获取仓库已部署的公钥" + operationId: "getV5ReposOwnerRepoKeys" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/SSHKey" + post: + tags: + - "Repositories" + summary: "为仓库添加公钥" + description: "为仓库添加公钥" + operationId: "postV5ReposOwnerRepoKeys" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "key" + in: "formData" + description: "公钥内容" + required: true + type: "string" + x-exportParamName: "Key" + - name: "title" + in: "formData" + description: "公钥名称" + required: true + type: "string" + x-exportParamName: "Title" + responses: + 201: + description: "返回格式" + schema: + $ref: "#/definitions/SSHKey" + /v5/repos/{owner}/{repo}/keys/available: + get: + tags: + - "Repositories" + summary: "获取仓库可部署的公钥" + description: "获取仓库可部署的公钥" + operationId: "getV5ReposOwnerRepoKeysAvailable" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/SSHKeyBasic" + /v5/repos/{owner}/{repo}/keys/enable/{id}: + put: + tags: + - "Repositories" + summary: "启用仓库公钥" + description: "启用仓库公钥" + operationId: "putV5ReposOwnerRepoKeysEnableId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "id" + in: "path" + description: "公钥 ID" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Id" + responses: + 204: + description: "已启用" + 403: + description: "没有启用权限" + delete: + tags: + - "Repositories" + summary: "停用仓库公钥" + description: "停用仓库公钥" + operationId: "deleteV5ReposOwnerRepoKeysEnableId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "id" + in: "path" + description: "公钥 ID" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Id" + responses: + 204: + description: "已停用" + 404: + description: "没有相关公钥" + /v5/repos/{owner}/{repo}/keys/{id}: + get: + tags: + - "Repositories" + summary: "获取仓库的单个公钥" + description: "获取仓库的单个公钥" + operationId: "getV5ReposOwnerRepoKeysId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "id" + in: "path" + description: "公钥 ID" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Id" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/SSHKey" + delete: + tags: + - "Repositories" + summary: "删除一个仓库公钥" + description: "删除一个仓库公钥" + operationId: "deleteV5ReposOwnerRepoKeysId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "id" + in: "path" + description: "公钥 ID" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Id" + responses: + 204: + description: "删除一个仓库公钥" + /v5/repos/{owner}/{repo}/readme: + get: + tags: + - "Repositories" + summary: "获取仓库README" + description: "获取仓库README" + operationId: "getV5ReposOwnerRepoReadme" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "ref" + in: "query" + description: "分支、tag或commit。默认: 仓库的默认分支(通常是master)" + required: false + type: "string" + x-exportParamName: "Ref" + x-optionalDataType: "String" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Content" + /v5/repos/{owner}/{repo}/contents(/{path}): + get: + tags: + - "Repositories" + summary: "获取仓库具体路径下的内容" + description: "获取仓库具体路径下的内容" + operationId: "getV5ReposOwnerRepoContents(Path)" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "path" + in: "path" + description: "文件的路径" + required: true + type: "string" + x-exportParamName: "Path" + - name: "ref" + in: "query" + description: "分支、tag或commit。默认: 仓库的默认分支(通常是master)" + required: false + type: "string" + x-exportParamName: "Ref" + x-optionalDataType: "String" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Content" + /v5/repos/{owner}/{repo}/contents/{path}: + post: + tags: + - "Repositories" + summary: "新建文件" + description: "新建文件" + operationId: "postV5ReposOwnerRepoContentsPath" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "path" + in: "path" + description: "文件的路径" + required: true + type: "string" + x-exportParamName: "Path" + - name: "content" + in: "formData" + description: "文件内容, 要用 base64 编码" + required: true + type: "string" + x-exportParamName: "Content" + - name: "message" + in: "formData" + description: "提交信息" + required: true + type: "string" + x-exportParamName: "Message" + - name: "branch" + in: "formData" + description: "分支名称。默认为仓库对默认分支" + required: false + type: "string" + x-exportParamName: "Branch" + x-optionalDataType: "String" + - name: "committer[name]" + in: "formData" + description: "Committer的名字,默认为当前用户的名字" + required: false + type: "string" + x-exportParamName: "CommitterName" + x-optionalDataType: "String" + - name: "committer[email]" + in: "formData" + description: "Committer的邮箱,默认为当前用户的邮箱" + required: false + type: "string" + x-exportParamName: "CommitterEmail" + x-optionalDataType: "String" + - name: "author[name]" + in: "formData" + description: "Author的名字,默认为当前用户的名字" + required: false + type: "string" + x-exportParamName: "AuthorName" + x-optionalDataType: "String" + - name: "author[email]" + in: "formData" + description: "Author的邮箱,默认为当前用户的邮箱" + required: false + type: "string" + x-exportParamName: "AuthorEmail" + x-optionalDataType: "String" + responses: + 201: + description: "返回格式" + schema: + $ref: "#/definitions/CommitContent" + put: + tags: + - "Repositories" + summary: "更新文件" + description: "更新文件" + operationId: "putV5ReposOwnerRepoContentsPath" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "path" + in: "path" + description: "文件的路径" + required: true + type: "string" + x-exportParamName: "Path" + - name: "content" + in: "formData" + description: "文件内容, 要用 base64 编码" + required: true + type: "string" + x-exportParamName: "Content" + - name: "sha" + in: "formData" + description: "文件的 Blob SHA,可通过 [获取仓库具体路径下的内容] API 获取" + required: true + type: "string" + x-exportParamName: "Sha" + - name: "message" + in: "formData" + description: "提交信息" + required: true + type: "string" + x-exportParamName: "Message" + - name: "branch" + in: "formData" + description: "分支名称。默认为仓库对默认分支" + required: false + type: "string" + x-exportParamName: "Branch" + x-optionalDataType: "String" + - name: "committer[name]" + in: "formData" + description: "Committer的名字,默认为当前用户的名字" + required: false + type: "string" + x-exportParamName: "CommitterName" + x-optionalDataType: "String" + - name: "committer[email]" + in: "formData" + description: "Committer的邮箱,默认为当前用户的邮箱" + required: false + type: "string" + x-exportParamName: "CommitterEmail" + x-optionalDataType: "String" + - name: "author[name]" + in: "formData" + description: "Author的名字,默认为当前用户的名字" + required: false + type: "string" + x-exportParamName: "AuthorName" + x-optionalDataType: "String" + - name: "author[email]" + in: "formData" + description: "Author的邮箱,默认为当前用户的邮箱" + required: false + type: "string" + x-exportParamName: "AuthorEmail" + x-optionalDataType: "String" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/CommitContent" + delete: + tags: + - "Repositories" + summary: "删除文件" + description: "删除文件" + operationId: "deleteV5ReposOwnerRepoContentsPath" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "path" + in: "path" + description: "文件的路径" + required: true + type: "string" + x-exportParamName: "Path" + - name: "sha" + in: "query" + description: "文件的 Blob SHA,可通过 [获取仓库具体路径下的内容] API 获取" + required: true + type: "string" + x-exportParamName: "Sha" + - name: "message" + in: "query" + description: "提交信息" + required: true + type: "string" + x-exportParamName: "Message" + - name: "branch" + in: "query" + description: "分支名称。默认为仓库对默认分支" + required: false + type: "string" + x-exportParamName: "Branch" + x-optionalDataType: "String" + - name: "committer[name]" + in: "query" + description: "Committer的名字,默认为当前用户的名字" + required: false + type: "string" + x-exportParamName: "CommitterName" + x-optionalDataType: "String" + - name: "committer[email]" + in: "query" + description: "Committer的邮箱,默认为当前用户的邮箱" + required: false + type: "string" + x-exportParamName: "CommitterEmail" + x-optionalDataType: "String" + - name: "author[name]" + in: "query" + description: "Author的名字,默认为当前用户的名字" + required: false + type: "string" + x-exportParamName: "AuthorName" + x-optionalDataType: "String" + - name: "author[email]" + in: "query" + description: "Author的邮箱,默认为当前用户的邮箱" + required: false + type: "string" + x-exportParamName: "AuthorEmail" + x-optionalDataType: "String" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/CommitContent" + /v5/repos/{owner}/{repo}/git/blobs/{sha}: + get: + tags: + - "Git Data" + summary: "获取文件Blob" + description: "获取文件Blob" + operationId: "getV5ReposOwnerRepoGitBlobsSha" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "sha" + in: "path" + description: "文件的 Blob SHA,可通过 [获取仓库具体路径下的内容] API 获取" + required: true + type: "string" + x-exportParamName: "Sha" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Blob" + 404: + description: "没有相关数据" + /v5/repos/{owner}/{repo}/git/trees/{sha}: + get: + tags: + - "Git Data" + summary: "获取目录Tree" + description: "获取目录Tree" + operationId: "getV5ReposOwnerRepoGitTreesSha" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "sha" + in: "path" + description: "可以是分支名(如master)、Commit或者目录Tree的SHA值" + required: true + type: "string" + x-exportParamName: "Sha" + - name: "recursive" + in: "query" + description: "赋值为1递归获取目录" + required: false + type: "integer" + format: "int32" + x-exportParamName: "Recursive" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Tree" + 404: + description: "没有相关数据" + 422: + description: "SHA值必须为Commit或Tree的" + /v5/repos/{owner}/{repo}/issues: + get: + tags: + - "Issues" + summary: "仓库的所有Issues" + description: "仓库的所有Issues" + operationId: "getV5ReposOwnerRepoIssues" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "state" + in: "query" + description: "Issue的状态: open(开启的), progressing(进行中), closed(关闭的), rejected(\ + 拒绝的)。 默认: open" + required: false + type: "string" + default: "open" + enum: + - "open" + - "progressing" + - "closed" + - "rejected" + - "all" + x-exportParamName: "State" + x-optionalDataType: "String" + - name: "labels" + in: "query" + description: "用逗号分开的标签。如: bug,performance" + required: false + type: "string" + x-exportParamName: "Labels" + x-optionalDataType: "String" + - name: "sort" + in: "query" + description: "排序依据: 创建时间(created),更新时间(updated_at)。默认: created_at" + required: false + type: "string" + default: "created" + enum: + - "created" + - "updated" + x-exportParamName: "Sort" + x-optionalDataType: "String" + - name: "direction" + in: "query" + description: "排序方式: 升序(asc),降序(desc)。默认: desc" + required: false + type: "string" + default: "desc" + enum: + - "asc" + - "desc" + x-exportParamName: "Direction" + x-optionalDataType: "String" + - name: "since" + in: "query" + description: "起始的更新时间,要求时间格式为 ISO 8601" + required: false + type: "string" + x-exportParamName: "Since" + x-optionalDataType: "String" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + - name: "schedule" + in: "query" + description: "计划开始日期,格式:20181006T173008+80-20181007T173008+80(区间),或者 -20181007T173008+80(\ + 小于20181007T173008+80),或者 20181006T173008+80-(大于20181006T173008+80),要求时间格\ + 式为20181006T173008+80" + required: false + type: "string" + x-exportParamName: "Schedule" + x-optionalDataType: "String" + - name: "deadline" + in: "query" + description: "计划截止日期,格式同上" + required: false + type: "string" + x-exportParamName: "Deadline" + x-optionalDataType: "String" + - name: "created_at" + in: "query" + description: "任务创建时间,格式同上" + required: false + type: "string" + x-exportParamName: "CreatedAt" + x-optionalDataType: "String" + - name: "finished_at" + in: "query" + description: "任务完成时间,即任务最后一次转为已完成状态的时间点。格式同上" + required: false + type: "string" + x-exportParamName: "FinishedAt" + x-optionalDataType: "String" + - name: "milestone" + in: "query" + description: "根据里程碑标题。none为没里程碑的,*为所有带里程碑的" + required: false + type: "string" + x-exportParamName: "Milestone" + x-optionalDataType: "String" + - name: "assignee" + in: "query" + description: "用户的username。 none为没指派者, *为所有带有指派者的" + required: false + type: "string" + x-exportParamName: "Assignee" + x-optionalDataType: "String" + - name: "creator" + in: "query" + description: "创建Issues的用户username" + required: false + type: "string" + x-exportParamName: "Creator" + x-optionalDataType: "String" + - name: "program" + in: "query" + description: "所属项目名称。none为没有所属项目,*为所有带所属项目的" + required: false + type: "string" + x-exportParamName: "Program" + x-optionalDataType: "String" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Issue" + /v5/repos/{owner}/{repo}/issues/{number}: + get: + tags: + - "Issues" + summary: "仓库的某个Issue" + description: "仓库的某个Issue" + operationId: "getV5ReposOwnerRepoIssuesNumber" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "number" + in: "path" + description: "Issue 编号(区分大小写,无需添加 # 号)" + required: true + type: "string" + x-exportParamName: "Number" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Issue" + /v5/repos/{owner}/issues: + post: + tags: + - "Issues" + summary: "创建Issue" + description: "创建Issue" + operationId: "postV5ReposOwnerIssues" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "formData" + description: "仓库路径(path)" + required: false + type: "string" + x-exportParamName: "Repo" + x-optionalDataType: "String" + - name: "title" + in: "formData" + description: "Issue标题" + required: true + type: "string" + x-exportParamName: "Title" + - name: "issue_type" + in: "formData" + description: "企业自定义任务类型,非企业默认任务类型为“任务”" + required: false + type: "string" + x-exportParamName: "IssueType" + x-optionalDataType: "String" + - name: "body" + in: "formData" + description: "Issue描述" + required: false + type: "string" + x-exportParamName: "Body" + x-optionalDataType: "String" + - name: "assignee" + in: "formData" + description: "Issue负责人的username" + required: false + type: "string" + x-exportParamName: "Assignee" + x-optionalDataType: "String" + - name: "milestone" + in: "formData" + description: "里程碑序号" + required: false + type: "integer" + format: "int32" + x-exportParamName: "Milestone" + x-optionalDataType: "Int32" + - name: "labels" + in: "formData" + description: "用逗号分开的标签,名称要求长度在 2-20 之间且非特殊字符。如: bug,performance" + required: false + type: "string" + x-exportParamName: "Labels" + x-optionalDataType: "String" + - name: "program" + in: "formData" + description: "项目ID" + required: false + type: "string" + x-exportParamName: "Program" + x-optionalDataType: "String" + responses: + 201: + description: "返回格式" + schema: + $ref: "#/definitions/Issue" + /v5/repos/{owner}/issues/{number}: + patch: + tags: + - "Issues" + summary: "更新Issue" + description: "更新Issue" + operationId: "patchV5ReposOwnerIssuesNumber" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "formData" + description: "仓库路径(path)" + required: false + type: "string" + x-exportParamName: "Repo" + x-optionalDataType: "String" + - name: "title" + in: "formData" + description: "Issue标题" + required: false + type: "string" + x-exportParamName: "Title" + x-optionalDataType: "String" + - name: "number" + in: "path" + description: "Issue 编号(区分大小写,无需添加 # 号)" + required: true + type: "string" + x-exportParamName: "Number" + - name: "state" + in: "formData" + description: "Issue 状态,open(开启的)、progressing(进行中)、closed(关闭的)" + required: false + type: "string" + enum: + - "open" + - "progressing" + - "closed" + x-exportParamName: "State" + x-optionalDataType: "String" + - name: "body" + in: "formData" + description: "Issue描述" + required: false + type: "string" + x-exportParamName: "Body" + x-optionalDataType: "String" + - name: "assignee" + in: "formData" + description: "Issue负责人的username" + required: false + type: "string" + x-exportParamName: "Assignee" + x-optionalDataType: "String" + - name: "milestone" + in: "formData" + description: "里程碑序号" + required: false + type: "integer" + format: "int32" + x-exportParamName: "Milestone" + x-optionalDataType: "Int32" + - name: "labels" + in: "formData" + description: "用逗号分开的标签,名称要求长度在 2-20 之间且非特殊字符。如: bug,performance" + required: false + type: "string" + x-exportParamName: "Labels" + x-optionalDataType: "String" + - name: "program" + in: "formData" + description: "项目ID" + required: false + type: "string" + x-exportParamName: "Program" + x-optionalDataType: "String" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Issue" + /v5/repos/{owner}/issues/{number}/operate_logs: + get: + tags: + - "Issues" + summary: "获取某个Issue下的操作日志" + description: "获取某个Issue下的操作日志" + operationId: "getV5ReposOwnerIssuesNumberOperateLogs" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "query" + description: "仓库路径(path)" + required: false + type: "string" + x-exportParamName: "Repo" + x-optionalDataType: "String" + - name: "number" + in: "path" + description: "Issue 编号(区分大小写,无需添加 # 号)" + required: true + type: "string" + x-exportParamName: "Number" + - name: "sort" + in: "query" + description: "按递增(asc)或递减(desc)排序,默认:递减" + required: false + type: "string" + default: "desc" + enum: + - "desc" + - "asc" + x-exportParamName: "Sort" + x-optionalDataType: "String" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/OperateLog" + /v5/repos/{owner}/{repo}/labels: + get: + tags: + - "Labels" + summary: "获取仓库所有任务标签" + description: "获取仓库所有任务标签" + operationId: "getV5ReposOwnerRepoLabels" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Label" + post: + tags: + - "Labels" + summary: "创建仓库任务标签" + description: "创建仓库任务标签" + operationId: "postV5ReposOwnerRepoLabels" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "name" + in: "formData" + description: "标签名称" + required: true + type: "string" + x-exportParamName: "Name" + - name: "color" + in: "formData" + description: "标签颜色。为6位的数字,如: 000000" + required: true + type: "string" + x-exportParamName: "Color" + responses: + 201: + description: "返回格式" + schema: + $ref: "#/definitions/Label" + /v5/repos/{owner}/{repo}/labels/{name}: + get: + tags: + - "Labels" + summary: "根据标签名称获取单个标签" + description: "根据标签名称获取单个标签" + operationId: "getV5ReposOwnerRepoLabelsName" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "name" + in: "path" + description: "标签名称" + required: true + type: "string" + x-exportParamName: "Name" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Label" + delete: + tags: + - "Labels" + summary: "删除一个仓库任务标签" + description: "删除一个仓库任务标签" + operationId: "deleteV5ReposOwnerRepoLabelsName" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "name" + in: "path" + description: "标签名称" + required: true + type: "string" + x-exportParamName: "Name" + responses: + 204: + description: "删除一个仓库任务标签" + /v5/repos/{owner}/{repo}/labels/{original_name}: + patch: + tags: + - "Labels" + summary: "更新一个仓库任务标签" + description: "更新一个仓库任务标签" + operationId: "patchV5ReposOwnerRepoLabelsOriginalName" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "original_name" + in: "path" + description: "标签原有名称" + required: true + type: "string" + x-exportParamName: "OriginalName" + - name: "name" + in: "formData" + description: "标签新名称" + required: false + type: "string" + x-exportParamName: "Name" + x-optionalDataType: "String" + - name: "color" + in: "formData" + description: "标签新颜色" + required: false + type: "string" + x-exportParamName: "Color" + x-optionalDataType: "String" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Label" + /v5/repos/{owner}/{repo}/issues/{number}/labels: + get: + tags: + - "Labels" + summary: "获取仓库任务的所有标签" + description: "获取仓库任务的所有标签" + operationId: "getV5ReposOwnerRepoIssuesNumberLabels" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "number" + in: "path" + description: "Issue 编号(区分大小写,无需添加 # 号)" + required: true + type: "string" + x-exportParamName: "Number" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Label" + post: + tags: + - "Labels" + summary: "创建Issue标签" + description: "创建Issue标签\n 需要在请求的body里填上数组,元素为标签的名字。如: [\"performance\", \"bug\"\ + ]" + operationId: "postV5ReposOwnerRepoIssuesNumberLabels" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "number" + in: "path" + description: "Issue 编号(区分大小写,无需添加 # 号)" + required: true + type: "string" + x-exportParamName: "Number" + - name: "body" + in: "formData" + description: "标签名数组,如: [\"feat\", \"bug\"]" + required: false + type: "array" + items: + type: "string" + collectionFormat: "multi" + x-exportParamName: "Body" + responses: + 201: + description: "返回格式" + schema: + $ref: "#/definitions/Label" + put: + tags: + - "Labels" + summary: "替换Issue所有标签" + description: "替换Issue所有标签\n 需要在请求的body里填上数组,元素为标签的名字。如: [\"performance\", \"\ + bug\"]" + operationId: "putV5ReposOwnerRepoIssuesNumberLabels" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "number" + in: "path" + description: "Issue 编号(区分大小写,无需添加 # 号)" + required: true + type: "string" + x-exportParamName: "Number" + - name: "body" + in: "formData" + description: "标签名数组,如: [\"feat\", \"bug\"]" + required: false + type: "array" + items: + type: "string" + collectionFormat: "multi" + x-exportParamName: "Body" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Label" + delete: + tags: + - "Labels" + summary: "删除Issue所有标签" + description: "删除Issue所有标签" + operationId: "deleteV5ReposOwnerRepoIssuesNumberLabels" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "number" + in: "path" + description: "Issue 编号(区分大小写,无需添加 # 号)" + required: true + type: "string" + x-exportParamName: "Number" + responses: + 204: + description: "删除Issue所有标签" + /v5/repos/{owner}/{repo}/issues/{number}/labels/{name}: + delete: + tags: + - "Labels" + summary: "删除Issue标签" + description: "删除Issue标签" + operationId: "deleteV5ReposOwnerRepoIssuesNumberLabelsName" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "number" + in: "path" + description: "Issue 编号(区分大小写,无需添加 # 号)" + required: true + type: "string" + x-exportParamName: "Number" + - name: "name" + in: "path" + description: "标签名称" + required: true + type: "string" + x-exportParamName: "Name" + responses: + 204: + description: "删除Issue标签" + /v5/repos/{owner}/{repo}/milestones: + get: + tags: + - "Milestones" + summary: "获取仓库所有里程碑" + description: "获取仓库所有里程碑" + operationId: "getV5ReposOwnerRepoMilestones" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "state" + in: "query" + description: "里程碑状态: open, closed, all。默认: open" + required: false + type: "string" + default: "open" + enum: + - "open" + - "closed" + - "all" + x-exportParamName: "State" + x-optionalDataType: "String" + - name: "sort" + in: "query" + description: "排序方式: due_on" + required: false + type: "string" + default: "due_on" + enum: + - "due_on" + x-exportParamName: "Sort" + x-optionalDataType: "String" + - name: "direction" + in: "query" + description: "升序(asc)或是降序(desc)。默认: asc" + required: false + type: "string" + x-exportParamName: "Direction" + x-optionalDataType: "String" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Milestone" + post: + tags: + - "Milestones" + summary: "创建仓库里程碑" + description: "创建仓库里程碑" + operationId: "postV5ReposOwnerRepoMilestones" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "title" + in: "formData" + description: "里程碑标题" + required: true + type: "string" + x-exportParamName: "Title" + - name: "state" + in: "formData" + description: "里程碑状态: open, closed, all。默认: open" + required: false + type: "string" + default: "open" + enum: + - "open" + - "closed" + - "all" + x-exportParamName: "State" + x-optionalDataType: "String" + - name: "description" + in: "formData" + description: "里程碑具体描述" + required: false + type: "string" + x-exportParamName: "Description" + x-optionalDataType: "String" + - name: "due_on" + in: "formData" + description: "里程碑的截止日期" + required: true + type: "string" + x-exportParamName: "DueOn" + responses: + 201: + description: "返回格式" + schema: + $ref: "#/definitions/Milestone" + /v5/repos/{owner}/{repo}/milestones/{number}: + get: + tags: + - "Milestones" + summary: "获取仓库单个里程碑" + description: "获取仓库单个里程碑" + operationId: "getV5ReposOwnerRepoMilestonesNumber" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "number" + in: "path" + description: "里程碑序号(id)" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Number" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Milestone" + delete: + tags: + - "Milestones" + summary: "删除仓库单个里程碑" + description: "删除仓库单个里程碑" + operationId: "deleteV5ReposOwnerRepoMilestonesNumber" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "number" + in: "path" + description: "里程碑序号(id)" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Number" + responses: + 204: + description: "删除仓库单个里程碑" + patch: + tags: + - "Milestones" + summary: "更新仓库里程碑" + description: "更新仓库里程碑" + operationId: "patchV5ReposOwnerRepoMilestonesNumber" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "number" + in: "path" + description: "里程碑序号(id)" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Number" + - name: "title" + in: "formData" + description: "里程碑标题" + required: true + type: "string" + x-exportParamName: "Title" + - name: "state" + in: "formData" + description: "里程碑状态: open, closed, all。默认: open" + required: false + type: "string" + default: "open" + enum: + - "open" + - "closed" + - "all" + x-exportParamName: "State" + x-optionalDataType: "String" + - name: "description" + in: "formData" + description: "里程碑具体描述" + required: false + type: "string" + x-exportParamName: "Description" + x-optionalDataType: "String" + - name: "due_on" + in: "formData" + description: "里程碑的截止日期" + required: true + type: "string" + x-exportParamName: "DueOn" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Milestone" + /v5/repos/{owner}/{repo}/license: + get: + tags: + - "Miscellaneous" + summary: "获取一个仓库使用的开源许可协议" + description: "获取一个仓库使用的开源许可协议" + operationId: "getV5ReposOwnerRepoLicense" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + responses: + 200: + description: "获取一个仓库使用的开源许可协议" + 404: + description: "没有相关数据" + /v5/repos/{owner}/{repo}/comments: + get: + tags: + - "Repositories" + summary: "获取仓库的Commit评论" + description: "获取仓库的Commit评论" + operationId: "getV5ReposOwnerRepoComments" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Note" + /v5/repos/{owner}/{repo}/commits/{ref}/comments: + get: + tags: + - "Repositories" + summary: "获取单个Commit的评论" + description: "获取单个Commit的评论" + operationId: "getV5ReposOwnerRepoCommitsRefComments" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "ref" + in: "path" + description: "Commit的Reference" + required: true + type: "string" + x-exportParamName: "Ref" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Note" + 404: + description: "没有相关数据" + /v5/repos/{owner}/{repo}/comments/{id}: + get: + tags: + - "Repositories" + summary: "获取仓库的某条Commit评论" + description: "获取仓库的某条Commit评论" + operationId: "getV5ReposOwnerRepoCommentsId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "id" + in: "path" + description: "评论的ID" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Id" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Note" + 404: + description: "没有相关数据" + delete: + tags: + - "Repositories" + summary: "删除Commit评论" + description: "删除Commit评论" + operationId: "deleteV5ReposOwnerRepoCommentsId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "id" + in: "path" + description: "评论的ID" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Id" + responses: + 204: + description: "删除Commit评论" + patch: + tags: + - "Repositories" + summary: "更新Commit评论" + description: "更新Commit评论" + operationId: "patchV5ReposOwnerRepoCommentsId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "id" + in: "path" + description: "评论的ID" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Id" + - name: "body" + in: "formData" + description: "评论的内容" + required: true + type: "string" + x-exportParamName: "Body" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Note" + 404: + description: "没有相关数据" + /v5/repos/{owner}/{repo}/commits/{sha}/comments: + post: + tags: + - "Repositories" + summary: "创建Commit评论" + description: "创建Commit评论" + operationId: "postV5ReposOwnerRepoCommitsShaComments" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "sha" + in: "path" + description: "评论的sha值" + required: true + type: "string" + x-exportParamName: "Sha" + - name: "body" + in: "formData" + description: "评论的内容" + required: true + type: "string" + x-exportParamName: "Body" + - name: "path" + in: "formData" + description: "文件的相对路径" + required: false + type: "string" + x-exportParamName: "Path" + x-optionalDataType: "String" + - name: "position" + in: "formData" + description: "Diff的相对行数" + required: false + type: "integer" + format: "int32" + x-exportParamName: "Position" + x-optionalDataType: "Int32" + responses: + 201: + description: "返回格式" + schema: + $ref: "#/definitions/Note" + 404: + description: "没有相关数据" + /v5/repos/{owner}/{repo}/issues/comments: + get: + tags: + - "Issues" + summary: "获取仓库所有Issue的评论" + description: "获取仓库所有Issue的评论" + operationId: "getV5ReposOwnerRepoIssuesComments" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "sort" + in: "query" + description: "Either created or updated. Default: created" + required: false + type: "string" + default: "created" + enum: + - "created" + - "updated" + x-exportParamName: "Sort" + x-optionalDataType: "String" + - name: "direction" + in: "query" + description: "Either asc or desc. Ignored without the sort parameter." + required: false + type: "string" + default: "asc" + enum: + - "asc" + - "desc" + x-exportParamName: "Direction" + x-optionalDataType: "String" + - name: "since" + in: "query" + description: "Only comments updated at or after this time are returned.\n\ + \ This is a timestamp in ISO\ + \ 8601 format: YYYY-MM-DDTHH:MM:SSZ" + required: false + type: "string" + x-exportParamName: "Since" + x-optionalDataType: "String" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Note" + /v5/repos/{owner}/{repo}/issues/{number}/comments: + get: + tags: + - "Issues" + summary: "获取仓库某个Issue所有的评论" + description: "获取仓库某个Issue所有的评论" + operationId: "getV5ReposOwnerRepoIssuesNumberComments" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "number" + in: "path" + description: "Issue 编号(区分大小写,无需添加 # 号)" + required: true + type: "string" + x-exportParamName: "Number" + - name: "since" + in: "query" + description: "Only comments updated at or after this time are returned.\n\ + \ This is a timestamp in ISO\ + \ 8601 format: YYYY-MM-DDTHH:MM:SSZ" + required: false + type: "string" + x-exportParamName: "Since" + x-optionalDataType: "String" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Note" + 404: + description: "没有相关数据" + post: + tags: + - "Issues" + summary: "创建某个Issue评论" + description: "创建某个Issue评论" + operationId: "postV5ReposOwnerRepoIssuesNumberComments" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "number" + in: "path" + description: "Issue 编号(区分大小写,无需添加 # 号)" + required: true + type: "string" + x-exportParamName: "Number" + - name: "body" + in: "formData" + description: "The contents of the comment." + required: true + type: "string" + x-exportParamName: "Body" + responses: + 201: + description: "返回格式" + schema: + $ref: "#/definitions/Note" + /v5/repos/{owner}/{repo}/issues/comments/{id}: + get: + tags: + - "Issues" + summary: "获取仓库Issue某条评论" + description: "获取仓库Issue某条评论" + operationId: "getV5ReposOwnerRepoIssuesCommentsId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "id" + in: "path" + description: "评论的ID" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Id" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Note" + 404: + description: "没有相关数据" + delete: + tags: + - "Issues" + summary: "删除Issue某条评论" + description: "删除Issue某条评论" + operationId: "deleteV5ReposOwnerRepoIssuesCommentsId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "id" + in: "path" + description: "评论的ID" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Id" + responses: + 204: + description: "删除Issue某条评论" + patch: + tags: + - "Issues" + summary: "更新Issue某条评论" + description: "更新Issue某条评论" + operationId: "patchV5ReposOwnerRepoIssuesCommentsId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "id" + in: "path" + description: "评论的ID" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Id" + - name: "body" + in: "formData" + description: "The contents of the comment." + required: true + type: "string" + x-exportParamName: "Body" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Note" + /v5/repos/{owner}/{repo}/pages: + get: + tags: + - "Repositories" + summary: "获取Pages信息" + description: "获取Pages信息" + operationId: "getV5ReposOwnerRepoPages" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + responses: + 200: + description: "获取Pages信息" + /v5/repos/{owner}/{repo}/pages/builds: + post: + tags: + - "Repositories" + summary: "请求建立Pages" + description: "请求建立Pages" + operationId: "postV5ReposOwnerRepoPagesBuilds" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + responses: + 201: + description: "请求建立Pages" + /v5/repos/{owner}/{repo}: + get: + tags: + - "Repositories" + summary: "获取用户的某个仓库" + description: "获取用户的某个仓库" + operationId: "getV5ReposOwnerRepo" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Project" + delete: + tags: + - "Repositories" + summary: "删除一个仓库" + description: "删除一个仓库" + operationId: "deleteV5ReposOwnerRepo" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + responses: + 204: + description: "删除一个仓库" + patch: + tags: + - "Repositories" + summary: "更新仓库设置" + description: "更新仓库设置" + operationId: "patchV5ReposOwnerRepo" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "name" + in: "formData" + description: "仓库名称" + required: true + type: "string" + x-exportParamName: "Name" + - name: "description" + in: "formData" + description: "仓库描述" + required: false + type: "string" + x-exportParamName: "Description" + x-optionalDataType: "String" + - name: "homepage" + in: "formData" + description: "主页(eg: https://gitee.com)" + required: false + type: "string" + x-exportParamName: "Homepage" + x-optionalDataType: "String" + - name: "has_issues" + in: "formData" + description: "允许提Issue与否。默认: 允许(true)" + required: false + type: "boolean" + default: true + x-exportParamName: "HasIssues" + x-optionalDataType: "Bool" + - name: "has_wiki" + in: "formData" + description: "提供Wiki与否。默认: 提供(true)" + required: false + type: "boolean" + default: true + x-exportParamName: "HasWiki" + x-optionalDataType: "Bool" + - name: "private" + in: "formData" + description: "仓库公开或私有。" + required: false + type: "boolean" + x-exportParamName: "Private" + x-optionalDataType: "Bool" + - name: "default_branch" + in: "formData" + description: "更新默认分支" + required: false + type: "string" + x-exportParamName: "DefaultBranch" + x-optionalDataType: "String" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Project" + /v5/repos/{owner}/{repo}/contributors: + get: + tags: + - "Repositories" + summary: "获取仓库贡献者" + description: "获取仓库贡献者" + operationId: "getV5ReposOwnerRepoContributors" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Contributor" + /v5/repos/{owner}/{repo}/tags: + get: + tags: + - "Repositories" + summary: "列出仓库所有的tags" + description: "列出仓库所有的tags" + operationId: "getV5ReposOwnerRepoTags" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Tag" + /v5/repos/{owner}/{repo}/clear: + put: + tags: + - "Repositories" + summary: "清空一个仓库" + description: "清空一个仓库" + operationId: "putV5ReposOwnerRepoClear" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + responses: + 204: + description: "清空仓库成功" + /v5/repos/{owner}/{repo}/collaborators: + get: + tags: + - "Repositories" + summary: "获取仓库的所有成员" + description: "获取仓库的所有成员" + operationId: "getV5ReposOwnerRepoCollaborators" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/ProjectMember" + /v5/repos/{owner}/{repo}/collaborators/{username}: + get: + tags: + - "Repositories" + summary: "判断用户是否为仓库成员" + description: "判断用户是否为仓库成员" + operationId: "getV5ReposOwnerRepoCollaboratorsUsername" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "username" + in: "path" + description: "用户名(username/login)" + required: true + type: "string" + x-exportParamName: "Username" + responses: + 204: + description: "用户为仓库成员" + put: + tags: + - "Repositories" + summary: "添加仓库成员" + description: "添加仓库成员" + operationId: "putV5ReposOwnerRepoCollaboratorsUsername" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "username" + in: "path" + description: "用户名(username/login)" + required: true + type: "string" + x-exportParamName: "Username" + - name: "permission" + in: "formData" + description: "成员权限: 拉代码(pull),推代码(push),管理员(admin)。默认: push" + required: true + type: "string" + default: "push" + enum: + - "pull" + - "push" + - "admin" + x-exportParamName: "Permission" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/ProjectMember" + delete: + tags: + - "Repositories" + summary: "移除仓库成员" + description: "移除仓库成员" + operationId: "deleteV5ReposOwnerRepoCollaboratorsUsername" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "username" + in: "path" + description: "用户名(username/login)" + required: true + type: "string" + x-exportParamName: "Username" + responses: + 204: + description: "移除仓库成员" + /v5/repos/{owner}/{repo}/collaborators/{username}/permission: + get: + tags: + - "Repositories" + summary: "查看仓库成员的权限" + description: "查看仓库成员的权限" + operationId: "getV5ReposOwnerRepoCollaboratorsUsernamePermission" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "username" + in: "path" + description: "用户名(username/login)" + required: true + type: "string" + x-exportParamName: "Username" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/ProjectMemberPermission" + /v5/repos/{owner}/{repo}/forks: + get: + tags: + - "Repositories" + summary: "查看仓库的Forks" + description: "查看仓库的Forks" + operationId: "getV5ReposOwnerRepoForks" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "sort" + in: "query" + description: "排序方式: fork的时间(newest, oldest),star的人数(stargazers)" + required: false + type: "string" + default: "newest" + enum: + - "newest" + - "oldest" + - "stargazers" + x-exportParamName: "Sort" + x-optionalDataType: "String" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Project" + 403: + description: "没有权限" + 404: + description: "没有相关数据" + post: + tags: + - "Repositories" + summary: "Fork一个仓库" + description: "Fork一个仓库" + operationId: "postV5ReposOwnerRepoForks" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "organization" + in: "formData" + description: "组织空间地址,不填写默认Fork到用户个人空间地址" + required: false + type: "string" + x-exportParamName: "Organization" + x-optionalDataType: "String" + responses: + 201: + description: "返回格式" + schema: + $ref: "#/definitions/Project" + /v5/repos/{owner}/{repo}/pulls: + get: + tags: + - "Pull Requests" + summary: "获取Pull Request列表" + description: "获取Pull Request列表" + operationId: "getV5ReposOwnerRepoPulls" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "state" + in: "query" + description: "可选。Pull Request 状态" + required: false + type: "string" + default: "open" + enum: + - "open" + - "closed" + - "merged" + - "all" + x-exportParamName: "State" + x-optionalDataType: "String" + - name: "head" + in: "query" + description: "可选。Pull Request 提交的源分支。格式:branch 或者:username:branch" + required: false + type: "string" + x-exportParamName: "Head" + x-optionalDataType: "String" + - name: "base" + in: "query" + description: "可选。Pull Request 提交目标分支的名称。" + required: false + type: "string" + x-exportParamName: "Base" + x-optionalDataType: "String" + - name: "sort" + in: "query" + description: "可选。排序字段,默认按创建时间" + required: false + type: "string" + default: "created" + enum: + - "created" + - "updated" + - "popularity" + - "long-running" + x-exportParamName: "Sort" + x-optionalDataType: "String" + - name: "direction" + in: "query" + description: "可选。升序/降序" + required: false + type: "string" + default: "desc" + enum: + - "asc" + - "desc" + x-exportParamName: "Direction" + x-optionalDataType: "String" + - name: "milestone_number" + in: "query" + description: "可选。里程碑序号(id)" + required: false + type: "integer" + format: "int32" + x-exportParamName: "MilestoneNumber" + x-optionalDataType: "Int32" + - name: "labels" + in: "query" + description: "用逗号分开的标签。如: bug,performance" + required: false + type: "string" + x-exportParamName: "Labels" + x-optionalDataType: "String" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/PullRequest" + post: + tags: + - "Pull Requests" + summary: "创建Pull Request" + description: "创建Pull Request" + operationId: "postV5ReposOwnerRepoPulls" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "title" + in: "formData" + description: "必填。Pull Request 标题" + required: true + type: "string" + x-exportParamName: "Title" + - name: "head" + in: "formData" + description: "必填。Pull Request 提交的源分支。格式:branch 或者:username:branch" + required: true + type: "string" + x-exportParamName: "Head" + - name: "base" + in: "formData" + description: "必填。Pull Request 提交目标分支的名称" + required: true + type: "string" + x-exportParamName: "Base" + - name: "body" + in: "formData" + description: "可选。Pull Request 内容" + required: false + type: "string" + x-exportParamName: "Body" + x-optionalDataType: "String" + - name: "milestone_number" + in: "formData" + description: "可选。里程碑序号(id)" + required: false + type: "integer" + format: "int32" + x-exportParamName: "MilestoneNumber" + x-optionalDataType: "Int32" + - name: "labels" + in: "formData" + description: "用逗号分开的标签,名称要求长度在 2-20 之间且非特殊字符。如: bug,performance" + required: false + type: "string" + x-exportParamName: "Labels" + x-optionalDataType: "String" + - name: "issue" + in: "formData" + description: "可选。Pull Request的标题和内容可以根据指定的Issue Id自动填充" + required: false + type: "string" + x-exportParamName: "Issue" + x-optionalDataType: "String" + - name: "assignees" + in: "formData" + description: "可选。审查人员username,可多个,半角逗号分隔,如:(username1,username2)" + required: false + type: "string" + x-exportParamName: "Assignees" + x-optionalDataType: "String" + - name: "testers" + in: "formData" + description: "可选。测试人员username,可多个,半角逗号分隔,如:(username1,username2)" + required: false + type: "string" + x-exportParamName: "Testers" + x-optionalDataType: "String" + - name: "prune_source_branch" + in: "formData" + description: "可选。合并PR后是否删除源分支,默认false(不删除)" + required: false + type: "boolean" + x-exportParamName: "PruneSourceBranch" + x-optionalDataType: "Bool" + responses: + 201: + description: "返回格式" + schema: + $ref: "#/definitions/PullRequest" + /v5/repos/{owner}/{repo}/pulls/comments: + get: + tags: + - "Pull Requests" + summary: "获取该仓库下的所有Pull Request评论" + description: "获取该仓库下的所有Pull Request评论" + operationId: "getV5ReposOwnerRepoPullsComments" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "sort" + in: "query" + description: "可选。按创建时间/更新时间排序" + required: false + type: "string" + default: "created" + enum: + - "created" + - "updated" + x-exportParamName: "Sort" + x-optionalDataType: "String" + - name: "direction" + in: "query" + description: "可选。升序/降序" + required: false + type: "string" + default: "desc" + enum: + - "asc" + - "desc" + x-exportParamName: "Direction" + x-optionalDataType: "String" + - name: "since" + in: "query" + description: "起始的更新时间,要求时间格式为 ISO 8601" + required: false + type: "string" + x-exportParamName: "Since" + x-optionalDataType: "String" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/PullRequestComments" + /v5/repos/{owner}/{repo}/pulls/{number}: + get: + tags: + - "Pull Requests" + summary: "获取单个Pull Request" + description: "获取单个Pull Request" + operationId: "getV5ReposOwnerRepoPullsNumber" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "number" + in: "path" + description: "第几个PR,即本仓库PR的序数" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Number" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/PullRequest" + patch: + tags: + - "Pull Requests" + summary: "更新Pull Request信息" + description: "更新Pull Request信息" + operationId: "patchV5ReposOwnerRepoPullsNumber" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "number" + in: "path" + description: "第几个PR,即本仓库PR的序数" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Number" + - name: "title" + in: "formData" + description: "可选。Pull Request 标题" + required: false + type: "string" + x-exportParamName: "Title" + x-optionalDataType: "String" + - name: "body" + in: "formData" + description: "可选。Pull Request 内容" + required: false + type: "string" + x-exportParamName: "Body" + x-optionalDataType: "String" + - name: "state" + in: "formData" + description: "可选。Pull Request 状态" + required: false + type: "string" + enum: + - "open" + - "closed" + x-exportParamName: "State" + x-optionalDataType: "String" + - name: "milestone_number" + in: "formData" + description: "可选。里程碑序号(id)" + required: false + type: "integer" + format: "int32" + x-exportParamName: "MilestoneNumber" + x-optionalDataType: "Int32" + - name: "labels" + in: "formData" + description: "用逗号分开的标签,名称要求长度在 2-20 之间且非特殊字符。如: bug,performance" + required: false + type: "string" + x-exportParamName: "Labels" + x-optionalDataType: "String" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/PullRequest" + /v5/repos/{owner}/{repo}/pulls/{number}/operate_logs: + get: + tags: + - "Pull Requests" + summary: "获取某个Pull Request的操作日志" + description: "获取某个Pull Request的操作日志" + operationId: "getV5ReposOwnerRepoPullsNumberOperateLogs" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "number" + in: "path" + description: "第几个PR,即本仓库PR的序数" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Number" + - name: "sort" + in: "query" + description: "按递增(asc)或递减(desc)排序,默认:递减" + required: false + type: "string" + default: "desc" + enum: + - "desc" + - "asc" + x-exportParamName: "Sort" + x-optionalDataType: "String" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/OperateLog" + /v5/repos/{owner}/{repo}/pulls/{number}/commits: + get: + tags: + - "Pull Requests" + summary: "获取某Pull Request的所有Commit信息。最多显示250条Commit" + description: "获取某Pull Request的所有Commit信息。最多显示250条Commit" + operationId: "getV5ReposOwnerRepoPullsNumberCommits" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "number" + in: "path" + description: "第几个PR,即本仓库PR的序数" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Number" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/PullRequestCommits" + /v5/repos/{owner}/{repo}/pulls/{number}/files: + get: + tags: + - "Pull Requests" + summary: "Pull Request Commit文件列表。最多显示300条diff" + description: "Pull Request Commit文件列表。最多显示300条diff" + operationId: "getV5ReposOwnerRepoPullsNumberFiles" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "number" + in: "path" + description: "第几个PR,即本仓库PR的序数" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Number" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/PullRequestFiles" + /v5/repos/{owner}/{repo}/pulls/{number}/merge: + get: + tags: + - "Pull Requests" + summary: "判断Pull Request是否已经合并" + description: "判断Pull Request是否已经合并" + operationId: "getV5ReposOwnerRepoPullsNumberMerge" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "number" + in: "path" + description: "第几个PR,即本仓库PR的序数" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Number" + responses: + 204: + description: "Pull Request已经合并" + 404: + description: "Pull Request未合并或不存在" + put: + tags: + - "Pull Requests" + summary: "合并Pull Request" + description: "合并Pull Request" + operationId: "putV5ReposOwnerRepoPullsNumberMerge" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "number" + in: "path" + description: "第几个PR,即本仓库PR的序数" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Number" + - name: "merge_method" + in: "formData" + description: "可选。合并PR的方法,merge(合并所有提交)和 squash(扁平化分支合并)。默认为merge。" + required: false + type: "string" + default: "merge" + enum: + - "merge" + - "squash" + x-exportParamName: "MergeMethod" + x-optionalDataType: "String" + - name: "prune_source_branch" + in: "formData" + description: "可选。合并PR后是否删除源分支,默认false(不删除)" + required: false + type: "boolean" + x-exportParamName: "PruneSourceBranch" + x-optionalDataType: "Bool" + - name: "title" + in: "formData" + description: "可选。合并标题,默认为PR的标题" + required: false + type: "string" + x-exportParamName: "Title" + x-optionalDataType: "String" + - name: "description" + in: "formData" + description: "可选。合并描述,默认为 \"Merge pull request !{pr_id} from {author}/{source_branch}\"\ + ,与页面显示的默认一致。" + required: false + type: "string" + x-exportParamName: "Description" + x-optionalDataType: "String" + responses: + 200: + description: "合并Pull Request" + /v5/repos/{owner}/{repo}/pulls/{number}/assignees: + post: + tags: + - "Pull Requests" + summary: "指派用户审查 Pull Request" + description: "指派用户审查 Pull Request" + operationId: "postV5ReposOwnerRepoPullsNumberAssignees" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "number" + in: "path" + description: "第几个PR,即本仓库PR的序数" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Number" + - name: "assignees" + in: "formData" + description: "用户的个人空间地址, 以 , 分隔" + required: true + type: "string" + x-exportParamName: "Assignees" + responses: + 201: + description: "返回格式" + schema: + $ref: "#/definitions/PullRequest" + delete: + tags: + - "Pull Requests" + summary: "取消用户审查 Pull Request" + description: "取消用户审查 Pull Request" + operationId: "deleteV5ReposOwnerRepoPullsNumberAssignees" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "number" + in: "path" + description: "第几个PR,即本仓库PR的序数" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Number" + - name: "assignees" + in: "query" + description: "用户的个人空间地址, 以 , 分隔" + required: true + type: "string" + x-exportParamName: "Assignees" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/PullRequest" + /v5/repos/{owner}/{repo}/pulls/{number}/testers: + post: + tags: + - "Pull Requests" + summary: "指派用户测试 Pull Request" + description: "指派用户测试 Pull Request" + operationId: "postV5ReposOwnerRepoPullsNumberTesters" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "number" + in: "path" + description: "第几个PR,即本仓库PR的序数" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Number" + - name: "testers" + in: "formData" + description: "用户的个人空间地址, 以 , 分隔" + required: true + type: "string" + x-exportParamName: "Testers" + responses: + 201: + description: "返回格式" + schema: + $ref: "#/definitions/PullRequest" + delete: + tags: + - "Pull Requests" + summary: "取消用户测试 Pull Request" + description: "取消用户测试 Pull Request" + operationId: "deleteV5ReposOwnerRepoPullsNumberTesters" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "number" + in: "path" + description: "第几个PR,即本仓库PR的序数" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Number" + - name: "testers" + in: "query" + description: "用户的个人空间地址, 以 , 分隔" + required: true + type: "string" + x-exportParamName: "Testers" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/PullRequest" + /v5/repos/{owner}/{repo}/pulls/{number}/comments: + get: + tags: + - "Pull Requests" + summary: "获取某个Pull Request的所有评论" + description: "获取某个Pull Request的所有评论" + operationId: "getV5ReposOwnerRepoPullsNumberComments" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "number" + in: "path" + description: "第几个PR,即本仓库PR的序数" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Number" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/PullRequestComments" + post: + tags: + - "Pull Requests" + summary: "提交Pull Request评论" + description: "提交Pull Request评论" + operationId: "postV5ReposOwnerRepoPullsNumberComments" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "number" + in: "path" + description: "第几个PR,即本仓库PR的序数" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Number" + - name: "body" + in: "formData" + description: "必填。评论内容" + required: true + type: "string" + x-exportParamName: "Body" + - name: "commit_id" + in: "formData" + description: "可选。PR代码评论的commit id" + required: false + type: "string" + x-exportParamName: "CommitId" + x-optionalDataType: "String" + - name: "path" + in: "formData" + description: "可选。PR代码评论的文件名" + required: false + type: "string" + x-exportParamName: "Path" + x-optionalDataType: "String" + - name: "position" + in: "formData" + description: "可选。PR代码评论diff中的行数" + required: false + type: "integer" + format: "int32" + x-exportParamName: "Position" + x-optionalDataType: "Int32" + responses: + 201: + description: "返回格式" + schema: + $ref: "#/definitions/PullRequestComments" + /v5/repos/{owner}/{repo}/pulls/comments/{id}: + get: + tags: + - "Pull Requests" + summary: "获取Pull Request的某个评论" + description: "获取Pull Request的某个评论" + operationId: "getV5ReposOwnerRepoPullsCommentsId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "id" + in: "path" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Id" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/PullRequestComments" + delete: + tags: + - "Pull Requests" + summary: "删除评论" + description: "删除评论" + operationId: "deleteV5ReposOwnerRepoPullsCommentsId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "id" + in: "path" + description: "评论的ID" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Id" + responses: + 204: + description: "删除评论" + patch: + tags: + - "Pull Requests" + summary: "编辑评论" + description: "编辑评论" + operationId: "patchV5ReposOwnerRepoPullsCommentsId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "id" + in: "path" + description: "评论的ID" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Id" + - name: "body" + in: "formData" + description: "必填。评论内容" + required: true + type: "string" + x-exportParamName: "Body" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/PullRequestComments" + /v5/repos/{owner}/{repo}/releases: + get: + tags: + - "Repositories" + summary: "获取仓库的所有Releases" + description: "获取仓库的所有Releases" + operationId: "getV5ReposOwnerRepoReleases" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Release" + post: + tags: + - "Repositories" + summary: "创建仓库Release" + description: "创建仓库Release" + operationId: "postV5ReposOwnerRepoReleases" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "tag_name" + in: "formData" + description: "Tag 名称, 提倡以v字母为前缀做为Release名称,例如v1.0或者v2.3.4" + required: true + type: "string" + x-exportParamName: "TagName" + - name: "name" + in: "formData" + description: "Release 名称" + required: true + type: "string" + x-exportParamName: "Name" + - name: "body" + in: "formData" + description: "Release 描述" + required: true + type: "string" + x-exportParamName: "Body" + - name: "prerelease" + in: "formData" + description: "是否为预览版本。默认: false(非预览版本)" + required: false + type: "boolean" + x-exportParamName: "Prerelease" + x-optionalDataType: "Bool" + - name: "target_commitish" + in: "formData" + description: "分支名称或者commit SHA, 默认是当前默认分支" + required: true + type: "string" + x-exportParamName: "TargetCommitish" + responses: + 201: + description: "返回格式" + schema: + $ref: "#/definitions/Release" + /v5/repos/{owner}/{repo}/releases/{id}: + get: + tags: + - "Repositories" + summary: "获取仓库的单个Releases" + description: "获取仓库的单个Releases" + operationId: "getV5ReposOwnerRepoReleasesId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "id" + in: "path" + description: "发行版本的ID" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Id" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Release" + delete: + tags: + - "Repositories" + summary: "删除仓库Release" + description: "删除仓库Release" + operationId: "deleteV5ReposOwnerRepoReleasesId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "id" + in: "path" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Id" + responses: + 204: + description: "删除仓库Release" + patch: + tags: + - "Repositories" + summary: "更新仓库Release" + description: "更新仓库Release" + operationId: "patchV5ReposOwnerRepoReleasesId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "tag_name" + in: "formData" + description: "Tag 名称, 提倡以v字母为前缀做为Release名称,例如v1.0或者v2.3.4" + required: true + type: "string" + x-exportParamName: "TagName" + - name: "name" + in: "formData" + description: "Release 名称" + required: true + type: "string" + x-exportParamName: "Name" + - name: "body" + in: "formData" + description: "Release 描述" + required: true + type: "string" + x-exportParamName: "Body" + - name: "prerelease" + in: "formData" + description: "是否为预览版本。默认: false(非预览版本)" + required: false + type: "boolean" + x-exportParamName: "Prerelease" + x-optionalDataType: "Bool" + - name: "id" + in: "path" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Id" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Release" + /v5/repos/{owner}/{repo}/releases/latest: + get: + tags: + - "Repositories" + summary: "获取仓库的最后更新的Release" + description: "获取仓库的最后更新的Release" + operationId: "getV5ReposOwnerRepoReleasesLatest" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Release" + /v5/repos/{owner}/{repo}/releases/tags/{tag}: + get: + tags: + - "Repositories" + summary: "根据Tag名称获取仓库的Release" + description: "根据Tag名称获取仓库的Release" + operationId: "getV5ReposOwnerRepoReleasesTagsTag" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "tag" + in: "path" + description: "Tag 名称" + required: true + type: "string" + x-exportParamName: "Tag" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Release" + /v5/repos/{owner}/{repo}/hooks: + get: + tags: + - "Webhooks" + summary: "列出仓库的WebHooks" + description: "列出仓库的WebHooks" + operationId: "getV5ReposOwnerRepoHooks" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Hook" + post: + tags: + - "Webhooks" + summary: "创建一个仓库WebHook" + description: "创建一个仓库WebHook" + operationId: "postV5ReposOwnerRepoHooks" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "url" + in: "formData" + description: "远程HTTP URL" + required: true + type: "string" + x-exportParamName: "Url" + - name: "password" + in: "formData" + description: "请求URL时会带上该密码,防止URL被恶意请求" + required: false + type: "string" + x-exportParamName: "Password" + x-optionalDataType: "String" + - name: "push_events" + in: "formData" + description: "Push代码到仓库" + required: false + type: "boolean" + default: true + x-exportParamName: "PushEvents" + x-optionalDataType: "Bool" + - name: "tag_push_events" + in: "formData" + description: "提交Tag到仓库" + required: false + type: "boolean" + x-exportParamName: "TagPushEvents" + x-optionalDataType: "Bool" + - name: "issues_events" + in: "formData" + description: "创建/关闭Issue" + required: false + type: "boolean" + x-exportParamName: "IssuesEvents" + x-optionalDataType: "Bool" + - name: "note_events" + in: "formData" + description: "评论了Issue/代码等等" + required: false + type: "boolean" + x-exportParamName: "NoteEvents" + x-optionalDataType: "Bool" + - name: "merge_requests_events" + in: "formData" + description: "合并请求和合并后" + required: false + type: "boolean" + x-exportParamName: "MergeRequestsEvents" + x-optionalDataType: "Bool" + responses: + 201: + description: "返回格式" + schema: + $ref: "#/definitions/Hook" + /v5/repos/{owner}/{repo}/hooks/{id}: + get: + tags: + - "Webhooks" + summary: "获取仓库单个WebHook" + description: "获取仓库单个WebHook" + operationId: "getV5ReposOwnerRepoHooksId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "id" + in: "path" + description: "Webhook的ID" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Id" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Hook" + delete: + tags: + - "Webhooks" + summary: "删除一个仓库WebHook" + description: "删除一个仓库WebHook" + operationId: "deleteV5ReposOwnerRepoHooksId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "id" + in: "path" + description: "Webhook的ID" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Id" + responses: + 204: + description: "删除一个仓库WebHook" + patch: + tags: + - "Webhooks" + summary: "更新一个仓库WebHook" + description: "更新一个仓库WebHook" + operationId: "patchV5ReposOwnerRepoHooksId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "id" + in: "path" + description: "Webhook的ID" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Id" + - name: "url" + in: "formData" + description: "远程HTTP URL" + required: true + type: "string" + x-exportParamName: "Url" + - name: "password" + in: "formData" + description: "请求URL时会带上该密码,防止URL被恶意请求" + required: false + type: "string" + x-exportParamName: "Password" + x-optionalDataType: "String" + - name: "push_events" + in: "formData" + description: "Push代码到仓库" + required: false + type: "boolean" + default: true + x-exportParamName: "PushEvents" + x-optionalDataType: "Bool" + - name: "tag_push_events" + in: "formData" + description: "提交Tag到仓库" + required: false + type: "boolean" + x-exportParamName: "TagPushEvents" + x-optionalDataType: "Bool" + - name: "issues_events" + in: "formData" + description: "创建/关闭Issue" + required: false + type: "boolean" + x-exportParamName: "IssuesEvents" + x-optionalDataType: "Bool" + - name: "note_events" + in: "formData" + description: "评论了Issue/代码等等" + required: false + type: "boolean" + x-exportParamName: "NoteEvents" + x-optionalDataType: "Bool" + - name: "merge_requests_events" + in: "formData" + description: "合并请求和合并后" + required: false + type: "boolean" + x-exportParamName: "MergeRequestsEvents" + x-optionalDataType: "Bool" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Hook" + /v5/repos/{owner}/{repo}/hooks/{id}/tests: + post: + tags: + - "Webhooks" + summary: "测试WebHook是否发送成功" + description: "测试WebHook是否发送成功" + operationId: "postV5ReposOwnerRepoHooksIdTests" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "id" + in: "path" + description: "Webhook的ID" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Id" + responses: + 204: + description: "测试发送成功" + /v5/repos/{owner}/{repo}/stargazers: + get: + tags: + - "Activity" + summary: "列出 star 了仓库的用户" + description: "列出 star 了仓库的用户" + operationId: "getV5ReposOwnerRepoStargazers" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/UserBasic" + 403: + description: "没有权限" + 404: + description: "没有相关数据" + /v5/repos/{owner}/{repo}/subscribers: + get: + tags: + - "Activity" + summary: "列出 watch 了仓库的用户" + description: "列出 watch 了仓库的用户" + operationId: "getV5ReposOwnerRepoSubscribers" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/UserBasic" + 403: + description: "没有权限" + 404: + description: "没有相关数据" + /v5/repos/{owner}/{repo}/events: + get: + tags: + - "Activity" + summary: "列出仓库的所有动态" + description: "列出仓库的所有动态" + operationId: "getV5ReposOwnerRepoEvents" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Event" + 403: + description: "没有权限" + 404: + description: "没有相关数据" + /v5/repos/{owner}/{repo}/notifications: + get: + tags: + - "Activity" + summary: "列出一个仓库里的通知" + description: "列出一个仓库里的通知" + operationId: "getV5ReposOwnerRepoNotifications" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "unread" + in: "query" + description: "是否只获取未读消息,默认:否" + required: false + type: "boolean" + x-exportParamName: "Unread" + x-optionalDataType: "Bool" + - name: "participating" + in: "query" + description: "是否只获取自己直接参与的消息,默认:否" + required: false + type: "boolean" + x-exportParamName: "Participating" + x-optionalDataType: "Bool" + - name: "type" + in: "query" + description: "筛选指定类型的通知,all:所有,event:事件通知,referer:@ 通知" + required: false + type: "string" + default: "all" + enum: + - "all" + - "event" + - "referer" + x-exportParamName: "Type_" + x-optionalDataType: "String" + - name: "since" + in: "query" + description: "只获取在给定时间后更新的消息,要求时间格式为 ISO 8601" + required: false + type: "string" + x-exportParamName: "Since" + x-optionalDataType: "String" + - name: "before" + in: "query" + description: "只获取在给定时间前更新的消息,要求时间格式为 ISO 8601" + required: false + type: "string" + x-exportParamName: "Before" + x-optionalDataType: "String" + - name: "ids" + in: "query" + description: "指定一组通知 ID,以 , 分隔" + required: false + type: "string" + x-exportParamName: "Ids" + x-optionalDataType: "String" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/UserNotificationList" + 403: + description: "没有权限" + 404: + description: "没有相关数据" + put: + tags: + - "Activity" + summary: "标记一个仓库里的通知为已读" + description: "标记一个仓库里的通知为已读" + operationId: "putV5ReposOwnerRepoNotifications" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "ids" + in: "formData" + description: "指定一组通知 ID,以 , 分隔" + required: false + type: "string" + x-exportParamName: "Ids" + x-optionalDataType: "String" + responses: + 205: + description: "执行成功" + 403: + description: "没有权限" + /v5/user/keys: + get: + tags: + - "Users" + summary: "列出授权用户的所有公钥" + description: "列出授权用户的所有公钥" + operationId: "getV5UserKeys" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/SSHKey" + post: + tags: + - "Users" + summary: "添加一个公钥" + description: "添加一个公钥" + operationId: "postV5UserKeys" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "key" + in: "formData" + description: "公钥内容" + required: true + type: "string" + x-exportParamName: "Key" + - name: "title" + in: "formData" + description: "公钥名称" + required: true + type: "string" + x-exportParamName: "Title" + responses: + 201: + description: "返回格式" + schema: + $ref: "#/definitions/SSHKey" + 400: + description: "数据不合法" + /v5/user/keys/{id}: + get: + tags: + - "Users" + summary: "获取一个公钥" + description: "获取一个公钥" + operationId: "getV5UserKeysId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "id" + in: "path" + description: "公钥 ID" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Id" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/SSHKey" + 404: + description: "没有相关数据" + delete: + tags: + - "Users" + summary: "删除一个公钥" + description: "删除一个公钥" + operationId: "deleteV5UserKeysId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "id" + in: "path" + description: "公钥 ID" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Id" + responses: + 204: + description: "执行成功" + 404: + description: "没有相关数据" + /v5/user/orgs: + get: + tags: + - "Organizations" + summary: "列出授权用户所属的组织" + description: "列出授权用户所属的组织" + operationId: "getV5UserOrgs" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + - name: "admin" + in: "query" + description: "只列出授权用户管理的组织" + required: false + type: "boolean" + x-exportParamName: "Admin" + x-optionalDataType: "Bool" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Group" + /v5/user/issues: + get: + tags: + - "Issues" + summary: "获取授权用户的所有Issues" + description: "获取授权用户的所有Issues" + operationId: "getV5UserIssues" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "filter" + in: "query" + description: "筛选参数: 授权用户负责的(assigned),授权用户创建的(created),包含前两者的(all)。默认: assigned" + required: false + type: "string" + default: "assigned" + enum: + - "assigned" + - "created" + - "all" + x-exportParamName: "Filter" + x-optionalDataType: "String" + - name: "state" + in: "query" + description: "Issue的状态: open(开启的), progressing(进行中), closed(关闭的), rejected(\ + 拒绝的)。 默认: open" + required: false + type: "string" + default: "open" + enum: + - "open" + - "progressing" + - "closed" + - "rejected" + - "all" + x-exportParamName: "State" + x-optionalDataType: "String" + - name: "labels" + in: "query" + description: "用逗号分开的标签。如: bug,performance" + required: false + type: "string" + x-exportParamName: "Labels" + x-optionalDataType: "String" + - name: "sort" + in: "query" + description: "排序依据: 创建时间(created),更新时间(updated_at)。默认: created_at" + required: false + type: "string" + default: "created" + enum: + - "created" + - "updated" + x-exportParamName: "Sort" + x-optionalDataType: "String" + - name: "direction" + in: "query" + description: "排序方式: 升序(asc),降序(desc)。默认: desc" + required: false + type: "string" + default: "desc" + enum: + - "asc" + - "desc" + x-exportParamName: "Direction" + x-optionalDataType: "String" + - name: "since" + in: "query" + description: "起始的更新时间,要求时间格式为 ISO 8601" + required: false + type: "string" + x-exportParamName: "Since" + x-optionalDataType: "String" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + - name: "schedule" + in: "query" + description: "计划开始日期,格式:20181006T173008+80-20181007T173008+80(区间),或者 -20181007T173008+80(\ + 小于20181007T173008+80),或者 20181006T173008+80-(大于20181006T173008+80),要求时间格\ + 式为20181006T173008+80" + required: false + type: "string" + x-exportParamName: "Schedule" + x-optionalDataType: "String" + - name: "deadline" + in: "query" + description: "计划截止日期,格式同上" + required: false + type: "string" + x-exportParamName: "Deadline" + x-optionalDataType: "String" + - name: "created_at" + in: "query" + description: "任务创建时间,格式同上" + required: false + type: "string" + x-exportParamName: "CreatedAt" + x-optionalDataType: "String" + - name: "finished_at" + in: "query" + description: "任务完成时间,即任务最后一次转为已完成状态的时间点。格式同上" + required: false + type: "string" + x-exportParamName: "FinishedAt" + x-optionalDataType: "String" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Issue" + /v5/user/repos: + get: + tags: + - "Repositories" + summary: "列出授权用户的所有仓库" + description: "列出授权用户的所有仓库" + operationId: "getV5UserRepos" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "visibility" + in: "query" + description: "公开(public)、私有(private)或者所有(all),默认: 所有(all)" + required: false + type: "string" + enum: + - "private" + - "public" + - "all" + x-exportParamName: "Visibility" + x-optionalDataType: "String" + - name: "affiliation" + in: "query" + description: "owner(授权用户拥有的仓库)、collaborator(授权用户为仓库成员)、organization_member(授\ + 权用户为仓库所在组织并有访问仓库权限)、enterprise_member(授权用户所在企业并有访问仓库权限)、admin(所有有权限的,包括所\ + 管理的组织中所有仓库、所管理的企业的所有仓库)。\n 可以用逗号分隔符组合。如: owner, organization_member\ + \ 或 owner, collaborator, organization_member" + required: false + type: "string" + x-exportParamName: "Affiliation" + x-optionalDataType: "String" + - name: "type" + in: "query" + description: "筛选用户仓库: 其创建(owner)、个人(personal)、其为成员(member)、公开(public)、私有(private),\ + 不能与 visibility 或 affiliation 参数一并使用,否则会报 422 错误" + required: false + type: "string" + enum: + - "all" + - "owner" + - "personal" + - "member" + - "public" + - "private" + x-exportParamName: "Type_" + x-optionalDataType: "String" + - name: "sort" + in: "query" + description: "排序方式: 创建时间(created),更新时间(updated),最后推送时间(pushed),仓库所属与名称(full_name)。\ + 默认: full_name" + required: false + type: "string" + default: "full_name" + enum: + - "created" + - "updated" + - "pushed" + - "full_name" + x-exportParamName: "Sort" + x-optionalDataType: "String" + - name: "direction" + in: "query" + description: "如果sort参数为full_name,用升序(asc)。否则降序(desc)" + required: false + type: "string" + enum: + - "asc" + - "desc" + x-exportParamName: "Direction" + x-optionalDataType: "String" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Project" + post: + tags: + - "Repositories" + summary: "创建一个仓库" + description: "创建一个仓库" + operationId: "postV5UserRepos" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "name" + in: "formData" + description: "仓库名称" + required: true + type: "string" + x-exportParamName: "Name" + - name: "description" + in: "formData" + description: "仓库描述" + required: false + type: "string" + x-exportParamName: "Description" + x-optionalDataType: "String" + - name: "homepage" + in: "formData" + description: "主页(eg: https://gitee.com)" + required: false + type: "string" + x-exportParamName: "Homepage" + x-optionalDataType: "String" + - name: "has_issues" + in: "formData" + description: "允许提Issue与否。默认: 允许(true)" + required: false + type: "boolean" + default: true + x-exportParamName: "HasIssues" + x-optionalDataType: "Bool" + - name: "has_wiki" + in: "formData" + description: "提供Wiki与否。默认: 提供(true)" + required: false + type: "boolean" + default: true + x-exportParamName: "HasWiki" + x-optionalDataType: "Bool" + - name: "auto_init" + in: "formData" + description: "值为true时则会用README初始化仓库。默认: 不初始化(false)" + required: false + type: "boolean" + x-exportParamName: "AutoInit" + x-optionalDataType: "Bool" + - name: "gitignore_template" + in: "formData" + description: "Git Ingore模版" + required: false + type: "string" + enum: + - "Actionscript" + - "Ada" + - "Agda" + - "Android" + - "AppEngine" + - "AppceleratorTitanium" + - "ArchLinuxPackages" + - "Autotools" + - "C" + - "C++" + - "CFWheels" + - "CMake" + - "CUDA" + - "CakePHP" + - "ChefCookbook" + - "Clojure" + - "CodeIgniter" + - "CommonLisp" + - "Composer" + - "Concrete5" + - "Coq" + - "CraftCMS" + - "D" + - "DM" + - "Dart" + - "Delphi" + - "Drupal" + - "EPiServer" + - "Eagle" + - "Elisp" + - "Elixir" + - "Elm" + - "Erlang" + - "ExpressionEngine" + - "ExtJs" + - "Fancy" + - "Finale" + - "Flutter" + - "ForceDotCom" + - "Fortran" + - "FuelPHP" + - "GWT" + - "Gcov" + - "GitBook" + - "Global/Anjuta" + - "Global/Ansible" + - "Global/Archives" + - "Global/Backup" + - "Global/Bazaar" + - "Global/BricxCC" + - "Global/CVS" + - "Global/Calabash" + - "Global/Cloud9" + - "Global/CodeKit" + - "Global/DartEditor" + - "Global/Diff" + - "Global/Dreamweaver" + - "Global/Dropbox" + - "Global/Eclipse" + - "Global/EiffelStudio" + - "Global/Emacs" + - "Global/Ensime" + - "Global/Espresso" + - "Global/FlexBuilder" + - "Global/GPG" + - "Global/Images" + - "Global/JDeveloper" + - "Global/JEnv" + - "Global/JetBrains" + - "Global/KDevelop4" + - "Global/Kate" + - "Global/Lazarus" + - "Global/LibreOffice" + - "Global/Linux" + - "Global/LyX" + - "Global/MATLAB" + - "Global/Mercurial" + - "Global/MicrosoftOffice" + - "Global/ModelSim" + - "Global/Momentics" + - "Global/MonoDevelop" + - "Global/NetBeans" + - "Global/Ninja" + - "Global/NotepadPP" + - "Global/Octave" + - "Global/Otto" + - "Global/PSoCCreator" + - "Global/Patch" + - "Global/PuTTY" + - "Global/Redcar" + - "Global/Redis" + - "Global/SBT" + - "Global/SVN" + - "Global/SlickEdit" + - "Global/Stata" + - "Global/SublimeText" + - "Global/SynopsysVCS" + - "Global/Tags" + - "Global/TextMate" + - "Global/TortoiseGit" + - "Global/Vagrant" + - "Global/Vim" + - "Global/VirtualEnv" + - "Global/Virtuoso" + - "Global/VisualStudioCode" + - "Global/WebMethods" + - "Global/Windows" + - "Global/Xcode" + - "Global/XilinxISE" + - "Global/macOS" + - "Go" + - "Godot" + - "Gradle" + - "Grails" + - "Haskell" + - "IGORPro" + - "Idris" + - "JBoss" + - "Java" + - "Jekyll" + - "Joomla" + - "Julia" + - "KiCad" + - "Kohana" + - "Kotlin" + - "LabVIEW" + - "Laravel" + - "Leiningen" + - "LemonStand" + - "Lilypond" + - "Lithium" + - "Lua" + - "Magento" + - "Maven" + - "Mercury" + - "MetaProgrammingSystem" + - "MiniProgram" + - "Nanoc" + - "Nim" + - "Node" + - "OCaml" + - "Objective-C" + - "Opa" + - "OpenCart" + - "OracleForms" + - "Packer" + - "Perl" + - "Perl6" + - "Phalcon" + - "PlayFramework" + - "Plone" + - "Prestashop" + - "Processing" + - "PureScript" + - "Python" + - "Qooxdoo" + - "Qt" + - "R" + - "ROS" + - "Rails" + - "RhodesRhomobile" + - "Ruby" + - "Rust" + - "SCons" + - "Sass" + - "Scala" + - "Scheme" + - "Scrivener" + - "Sdcc" + - "SeamGen" + - "SketchUp" + - "Smalltalk" + - "Stella" + - "SugarCRM" + - "Swift" + - "Symfony" + - "SymphonyCMS" + - "TeX" + - "Terraform" + - "Textpattern" + - "TurboGears2" + - "Typo3" + - "Umbraco" + - "Unity" + - "UnrealEngine" + - "VVVV" + - "VisualStudio" + - "Waf" + - "WordPress" + - "Xojo" + - "Yeoman" + - "Yii" + - "ZendFramework" + - "Zephir" + x-exportParamName: "GitignoreTemplate" + x-optionalDataType: "String" + - name: "license_template" + in: "formData" + description: "License模版" + required: false + type: "string" + enum: + - "MulanPSL-1.0" + - "AFL-3.0" + - "AGPL-3.0" + - "Apache-2.0" + - "Artistic-2.0" + - "BSD-2-Clause" + - "BSD-3-Clause" + - "BSD-3-Clause-Clear" + - "BSL-1.0" + - "CC-BY-4.0" + - "CC-BY-SA-4.0" + - "CC0-1.0" + - "ECL-2.0" + - "EPL-1.0" + - "EUPL-1.1" + - "GPL-2.0" + - "GPL-3.0" + - "ISC" + - "LGPL-2.1" + - "LGPL-3.0" + - "LPPL-1.3c" + - "MIT" + - "MPL-2.0" + - "MS-PL" + - "MS-RL" + - "NCSA" + - "OFL-1.1" + - "OSL-3.0" + - "PostgreSQL" + - "Unlicense" + - "WTFPL" + - "Zlib" + x-exportParamName: "LicenseTemplate" + x-optionalDataType: "String" + - name: "private" + in: "formData" + description: "仓库公开或私有。默认: 公开(false)" + required: false + type: "boolean" + x-exportParamName: "Private" + x-optionalDataType: "Bool" + responses: + 201: + description: "返回格式" + schema: + $ref: "#/definitions/Project" + /v5/user: + get: + tags: + - "Users" + summary: "获取授权用户的资料" + description: "获取授权用户的资料" + operationId: "getV5User" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/User" + 404: + description: "没有相关数据" + patch: + tags: + - "Users" + summary: "更新授权用户的资料" + description: "更新授权用户的资料" + operationId: "patchV5User" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "name" + in: "formData" + description: "昵称" + required: false + type: "string" + x-exportParamName: "Name" + x-optionalDataType: "String" + - name: "blog" + in: "formData" + description: "微博链接" + required: false + type: "string" + x-exportParamName: "Blog" + x-optionalDataType: "String" + - name: "weibo" + in: "formData" + description: "博客站点" + required: false + type: "string" + x-exportParamName: "Weibo" + x-optionalDataType: "String" + - name: "bio" + in: "formData" + description: "自我介绍" + required: false + type: "string" + x-exportParamName: "Bio" + x-optionalDataType: "String" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/User" + /v5/user/followers: + get: + tags: + - "Users" + summary: "列出授权用户的关注者" + description: "列出授权用户的关注者" + operationId: "getV5UserFollowers" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/UserBasic" + /v5/user/following: + get: + tags: + - "Users" + summary: "列出授权用户正关注的用户" + description: "列出授权用户正关注的用户" + operationId: "getV5UserFollowing" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/UserBasic" + /v5/user/namespaces: + get: + tags: + - "Users" + summary: "列出授权用户所有的 Namespace" + description: "列出授权用户所有的 Namespace" + operationId: "getV5UserNamespaces" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "mode" + in: "query" + description: "参与方式: project(所有参与仓库的namepsce)、intrant(所加入的namespace)、all(包含\ + 前两者),默认(intrant)" + required: false + type: "string" + enum: + - "project" + - "intrant" + - "all" + x-exportParamName: "Mode" + x-optionalDataType: "String" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Namespace" + /v5/user/namespace: + get: + tags: + - "Users" + summary: "获取授权用户的一个 Namespace" + description: "获取授权用户的一个 Namespace" + operationId: "getV5UserNamespace" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "path" + in: "query" + description: "Namespace path" + required: true + type: "string" + x-exportParamName: "Path" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Namespace" + /v5/user/starred: + get: + tags: + - "Activity" + summary: "列出授权用户 star 了的仓库" + description: "列出授权用户 star 了的仓库" + operationId: "getV5UserStarred" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "sort" + in: "query" + description: "根据仓库创建时间(created)或最后推送时间(updated)进行排序,默认:创建时间" + required: false + type: "string" + default: "created" + enum: + - "created" + - "last_push" + x-exportParamName: "Sort" + x-optionalDataType: "String" + - name: "direction" + in: "query" + description: "按递增(asc)或递减(desc)排序,默认:递减" + required: false + type: "string" + default: "desc" + enum: + - "asc" + - "desc" + x-exportParamName: "Direction" + x-optionalDataType: "String" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Project" + 404: + description: "没有相关数据" + /v5/user/subscriptions: + get: + tags: + - "Activity" + summary: "列出授权用户 watch 了的仓库" + description: "列出授权用户 watch 了的仓库" + operationId: "getV5UserSubscriptions" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "sort" + in: "query" + description: "根据仓库创建时间(created)或最后推送时间(updated)进行排序,默认:创建时间" + required: false + type: "string" + default: "created" + enum: + - "created" + - "last_push" + x-exportParamName: "Sort" + x-optionalDataType: "String" + - name: "direction" + in: "query" + description: "按递增(asc)或递减(desc)排序,默认:递减" + required: false + type: "string" + default: "desc" + enum: + - "asc" + - "desc" + x-exportParamName: "Direction" + x-optionalDataType: "String" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Project" + /v5/user/enterprises: + get: + tags: + - "Enterprises" + summary: "列出授权用户所属的企业" + description: "列出授权用户所属的企业" + operationId: "getV5UserEnterprises" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + - name: "admin" + in: "query" + description: "只列出授权用户管理的企业" + required: false + type: "boolean" + default: true + x-exportParamName: "Admin" + x-optionalDataType: "Bool" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/EnterpriseBasic" + /v5/user/memberships/orgs: + get: + tags: + - "Organizations" + summary: "列出授权用户在所属组织的成员资料" + description: "列出授权用户在所属组织的成员资料" + operationId: "getV5UserMembershipsOrgs" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "active" + in: "query" + description: "根据成员是否已激活进行筛选资料,缺省返回所有资料" + required: false + type: "boolean" + x-exportParamName: "Active" + x-optionalDataType: "Bool" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/GroupMember" + /v5/user/memberships/orgs/{org}: + get: + tags: + - "Organizations" + summary: "获取授权用户在一个组织的成员资料" + description: "获取授权用户在一个组织的成员资料" + operationId: "getV5UserMembershipsOrgsOrg" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "org" + in: "path" + description: "组织的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Org" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/GroupMember" + 403: + description: "没有权限" + 404: + description: "没有相关数据" + delete: + tags: + - "Organizations" + summary: "退出一个组织" + description: "退出一个组织" + operationId: "deleteV5UserMembershipsOrgsOrg" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "org" + in: "path" + description: "组织的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Org" + responses: + 204: + description: "执行成功" + 404: + description: "没有相关数据" + patch: + tags: + - "Organizations" + summary: "更新授权用户在一个组织的成员资料" + description: "更新授权用户在一个组织的成员资料" + operationId: "patchV5UserMembershipsOrgsOrg" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "org" + in: "path" + description: "组织的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Org" + - name: "remark" + in: "formData" + description: "在组织中的备注信息" + required: false + type: "string" + x-exportParamName: "Remark" + x-optionalDataType: "String" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/GroupMember" + 403: + description: "没有权限" + 404: + description: "没有相关数据" + /v5/user/following/{username}: + get: + tags: + - "Users" + summary: "检查授权用户是否关注了一个用户" + description: "检查授权用户是否关注了一个用户" + operationId: "getV5UserFollowingUsername" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "username" + in: "path" + description: "用户名(username/login)" + required: true + type: "string" + x-exportParamName: "Username" + responses: + 204: + description: "已关注" + 404: + description: "没有相关数据" + put: + tags: + - "Users" + summary: "关注一个用户" + description: "关注一个用户" + operationId: "putV5UserFollowingUsername" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "username" + in: "path" + description: "用户名(username/login)" + required: true + type: "string" + x-exportParamName: "Username" + responses: + 204: + description: "执行成功" + delete: + tags: + - "Users" + summary: "取消关注一个用户" + description: "取消关注一个用户" + operationId: "deleteV5UserFollowingUsername" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "username" + in: "path" + description: "用户名(username/login)" + required: true + type: "string" + x-exportParamName: "Username" + responses: + 204: + description: "执行成功" + /v5/user/starred/{owner}/{repo}: + get: + tags: + - "Activity" + summary: "检查授权用户是否 star 了一个仓库" + description: "检查授权用户是否 star 了一个仓库" + operationId: "getV5UserStarredOwnerRepo" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + responses: + 204: + description: "已经 star 了仓库" + 404: + description: "没有相关数据" + put: + tags: + - "Activity" + summary: "star 一个仓库" + description: "star 一个仓库" + operationId: "putV5UserStarredOwnerRepo" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + responses: + 204: + description: "执行成功" + 400: + description: "数据不合法" + delete: + tags: + - "Activity" + summary: "取消 star 一个仓库" + description: "取消 star 一个仓库" + operationId: "deleteV5UserStarredOwnerRepo" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + responses: + 204: + description: "执行成功" + /v5/user/subscriptions/{owner}/{repo}: + get: + tags: + - "Activity" + summary: "检查授权用户是否 watch 了一个仓库" + description: "检查授权用户是否 watch 了一个仓库" + operationId: "getV5UserSubscriptionsOwnerRepo" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + responses: + 204: + description: "已经 watch 了仓库" + 404: + description: "没有相关数据" + put: + tags: + - "Activity" + summary: "watch 一个仓库" + description: "watch 一个仓库" + operationId: "putV5UserSubscriptionsOwnerRepo" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "watch_type" + in: "formData" + description: "watch策略, watching: 关注所有动态, releases_only: 仅关注版本发行动态, ignoring:\ + \ 关注但不提醒动态" + required: true + type: "string" + default: "watching" + enum: + - "watching" + - "releases_only" + - "ignoring" + x-exportParamName: "WatchType" + responses: + 204: + description: "执行成功" + 400: + description: "数据不合法" + delete: + tags: + - "Activity" + summary: "取消 watch 一个仓库" + description: "取消 watch 一个仓库" + operationId: "deleteV5UserSubscriptionsOwnerRepo" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + responses: + 204: + description: "执行成功" + /v5/gists: + get: + tags: + - "Gists" + summary: "获取代码片段" + description: "获取代码片段" + operationId: "getV5Gists" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "since" + in: "query" + description: "起始的更新时间,要求时间格式为 ISO 8601" + required: false + type: "string" + x-exportParamName: "Since" + x-optionalDataType: "String" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Code" + post: + tags: + - "Gists" + summary: "创建代码片段" + description: "创建代码片段" + operationId: "postV5Gists" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "files" + in: "formData" + description: "Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String\ + \ file contents\" } }" + required: true + type: "file" + x-exportParamName: "Files" + - name: "description" + in: "formData" + description: "代码片段描述,1~30个字符" + required: true + type: "string" + x-exportParamName: "Description" + - name: "public" + in: "formData" + description: "公开/私有,默认: 私有" + required: false + type: "boolean" + x-exportParamName: "Public" + x-optionalDataType: "Bool" + responses: + 201: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/CodeForksHistory" + /v5/gists/public: + get: + tags: + - "Gists" + summary: "获取公开的代码片段" + description: "获取公开的代码片段" + operationId: "getV5GistsPublic" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "since" + in: "query" + description: "起始的更新时间,要求时间格式为 ISO 8601" + required: false + type: "string" + x-exportParamName: "Since" + x-optionalDataType: "String" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Code" + /v5/gists/starred: + get: + tags: + - "Gists" + summary: "获取用户Star的代码片段" + description: "获取用户Star的代码片段" + operationId: "getV5GistsStarred" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "since" + in: "query" + description: "起始的更新时间,要求时间格式为 ISO 8601" + required: false + type: "string" + x-exportParamName: "Since" + x-optionalDataType: "String" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Code" + /v5/gists/{gist_id}/comments: + get: + tags: + - "Gists" + summary: "获取代码片段的评论" + description: "获取代码片段的评论" + operationId: "getV5GistsGistIdComments" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "gist_id" + in: "path" + description: "代码片段的ID" + required: true + type: "string" + x-exportParamName: "GistId" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/CodeComment" + post: + tags: + - "Gists" + summary: "增加代码片段的评论" + description: "增加代码片段的评论" + operationId: "postV5GistsGistIdComments" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "gist_id" + in: "path" + description: "代码片段的ID" + required: true + type: "string" + x-exportParamName: "GistId" + - name: "body" + in: "formData" + description: "评论内容" + required: true + type: "string" + x-exportParamName: "Body" + responses: + 201: + description: "返回格式" + schema: + $ref: "#/definitions/CodeComment" + /v5/gists/{gist_id}/comments/{id}: + get: + tags: + - "Gists" + summary: "获取单条代码片段的评论" + description: "获取单条代码片段的评论" + operationId: "getV5GistsGistIdCommentsId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "gist_id" + in: "path" + description: "代码片段的ID" + required: true + type: "string" + x-exportParamName: "GistId" + - name: "id" + in: "path" + description: "评论的ID" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Id" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/CodeComment" + delete: + tags: + - "Gists" + summary: "删除代码片段的评论" + description: "删除代码片段的评论" + operationId: "deleteV5GistsGistIdCommentsId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "gist_id" + in: "path" + description: "代码片段的ID" + required: true + type: "string" + x-exportParamName: "GistId" + - name: "id" + in: "path" + description: "评论的ID" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Id" + responses: + 204: + description: "删除代码片段的评论" + patch: + tags: + - "Gists" + summary: "修改代码片段的评论" + description: "修改代码片段的评论" + operationId: "patchV5GistsGistIdCommentsId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "gist_id" + in: "path" + description: "代码片段的ID" + required: true + type: "string" + x-exportParamName: "GistId" + - name: "id" + in: "path" + description: "评论的ID" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Id" + - name: "body" + in: "formData" + description: "评论内容" + required: true + type: "string" + x-exportParamName: "Body" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/CodeComment" + /v5/gists/{id}: + get: + tags: + - "Gists" + summary: "获取单条代码片段" + description: "获取单条代码片段" + operationId: "getV5GistsId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "id" + in: "path" + description: "代码片段的ID" + required: true + type: "string" + x-exportParamName: "Id" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/CodeForksHistory" + delete: + tags: + - "Gists" + summary: "删除指定代码片段" + description: "删除指定代码片段" + operationId: "deleteV5GistsId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "id" + in: "path" + description: "代码片段的ID" + required: true + type: "string" + x-exportParamName: "Id" + responses: + 204: + description: "删除指定代码片段" + patch: + tags: + - "Gists" + summary: "修改代码片段" + description: "修改代码片段" + operationId: "patchV5GistsId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "id" + in: "path" + description: "代码片段的ID" + required: true + type: "string" + x-exportParamName: "Id" + - name: "files" + in: "formData" + description: "Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String\ + \ file contents\" } }" + required: false + type: "file" + x-exportParamName: "Files" + - name: "description" + in: "formData" + description: "代码片段描述,1~30个字符" + required: false + type: "string" + x-exportParamName: "Description" + x-optionalDataType: "String" + - name: "public" + in: "formData" + description: "公开/私有,默认: 私有" + required: false + type: "boolean" + x-exportParamName: "Public" + x-optionalDataType: "Bool" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/CodeForksHistory" + /v5/gists/{id}/commits: + get: + tags: + - "Gists" + summary: "获取代码片段的commit" + description: "获取代码片段的commit" + operationId: "getV5GistsIdCommits" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "id" + in: "path" + description: "代码片段的ID" + required: true + type: "string" + x-exportParamName: "Id" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/CodeForksHistory" + /v5/gists/{id}/star: + get: + tags: + - "Gists" + summary: "判断代码片段是否已Star" + description: "判断代码片段是否已Star" + operationId: "getV5GistsIdStar" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "id" + in: "path" + description: "代码片段的ID" + required: true + type: "string" + x-exportParamName: "Id" + responses: + 204: + description: "判断代码片段是否已Star" + put: + tags: + - "Gists" + summary: "Star代码片段" + description: "Star代码片段" + operationId: "putV5GistsIdStar" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "id" + in: "path" + description: "代码片段的ID" + required: true + type: "string" + x-exportParamName: "Id" + responses: + 204: + description: "Star代码片段" + delete: + tags: + - "Gists" + summary: "取消Star代码片段" + description: "取消Star代码片段" + operationId: "deleteV5GistsIdStar" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "id" + in: "path" + description: "代码片段的ID" + required: true + type: "string" + x-exportParamName: "Id" + responses: + 204: + description: "取消Star代码片段" + /v5/gists/{id}/forks: + get: + tags: + - "Gists" + summary: "获取 Fork 了指定代码片段的列表" + description: "获取 Fork 了指定代码片段的列表" + operationId: "getV5GistsIdForks" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "id" + in: "path" + description: "代码片段的ID" + required: true + type: "string" + x-exportParamName: "Id" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/CodeForks" + post: + tags: + - "Gists" + summary: "Fork代码片段" + description: "Fork代码片段" + operationId: "postV5GistsIdForks" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "id" + in: "path" + description: "代码片段的ID" + required: true + type: "string" + x-exportParamName: "Id" + responses: + 201: + description: "Fork代码片段" + /v5/users/{username}/gists: + get: + tags: + - "Gists" + summary: "获取指定用户的公开代码片段" + description: "获取指定用户的公开代码片段" + operationId: "getV5UsersUsernameGists" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "username" + in: "path" + description: "用户名(username/login)" + required: true + type: "string" + x-exportParamName: "Username" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Code" + /v5/users/{username}/orgs: + get: + tags: + - "Organizations" + summary: "列出用户所属的组织" + description: "列出用户所属的组织" + operationId: "getV5UsersUsernameOrgs" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "username" + in: "path" + description: "用户名(username/login)" + required: true + type: "string" + x-exportParamName: "Username" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Group" + /v5/users/organization: + post: + tags: + - "Organizations" + summary: "创建组织" + description: "创建组织" + operationId: "postV5UsersOrganization" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "name" + in: "formData" + description: "组织名称" + required: true + type: "string" + x-exportParamName: "Name" + - name: "org" + in: "formData" + description: "组织的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Org" + - name: "description" + in: "formData" + description: "组织描述" + required: false + type: "string" + x-exportParamName: "Description" + x-optionalDataType: "String" + responses: + 201: + description: "返回格式" + schema: + $ref: "#/definitions/Group" + 403: + description: "没有权限" + /v5/users/{username}/repos: + get: + tags: + - "Repositories" + summary: "获取某个用户的公开仓库" + description: "获取某个用户的公开仓库" + operationId: "getV5UsersUsernameRepos" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "username" + in: "path" + description: "用户名(username/login)" + required: true + type: "string" + x-exportParamName: "Username" + - name: "type" + in: "query" + description: "用户创建的仓库(owner),用户个人仓库(personal),用户为仓库成员(member),所有(all)。默认:\ + \ 所有(all)" + required: false + type: "string" + default: "all" + enum: + - "all" + - "owner" + - "personal" + - "member" + x-exportParamName: "Type_" + x-optionalDataType: "String" + - name: "sort" + in: "query" + description: "排序方式: 创建时间(created),更新时间(updated),最后推送时间(pushed),仓库所属与名称(full_name)。\ + 默认: full_name" + required: false + type: "string" + default: "full_name" + enum: + - "created" + - "updated" + - "pushed" + - "full_name" + x-exportParamName: "Sort" + x-optionalDataType: "String" + - name: "direction" + in: "query" + description: "如果sort参数为full_name,用升序(asc)。否则降序(desc)" + required: false + type: "string" + enum: + - "asc" + - "desc" + x-exportParamName: "Direction" + x-optionalDataType: "String" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Project" + /v5/users/{username}: + get: + tags: + - "Users" + summary: "获取一个用户" + description: "获取一个用户" + operationId: "getV5UsersUsername" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "username" + in: "path" + description: "用户名(username/login)" + required: true + type: "string" + x-exportParamName: "Username" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/User" + 404: + description: "没有相关数据" + /v5/users/{username}/followers: + get: + tags: + - "Users" + summary: "列出指定用户的关注者" + description: "列出指定用户的关注者" + operationId: "getV5UsersUsernameFollowers" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "username" + in: "path" + description: "用户名(username/login)" + required: true + type: "string" + x-exportParamName: "Username" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/UserBasic" + 404: + description: "没有相关数据" + /v5/users/{username}/following: + get: + tags: + - "Users" + summary: "列出指定用户正在关注的用户" + description: "列出指定用户正在关注的用户" + operationId: "getV5UsersUsernameFollowing" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "username" + in: "path" + description: "用户名(username/login)" + required: true + type: "string" + x-exportParamName: "Username" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/UserBasic" + 404: + description: "没有相关数据" + /v5/users/{username}/following/{target_user}: + get: + tags: + - "Users" + summary: "检查指定用户是否关注目标用户" + description: "检查指定用户是否关注目标用户" + operationId: "getV5UsersUsernameFollowingTargetUser" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "username" + in: "path" + description: "用户名(username/login)" + required: true + type: "string" + x-exportParamName: "Username" + - name: "target_user" + in: "path" + description: "目标用户的用户名(username/login)" + required: true + type: "string" + x-exportParamName: "TargetUser" + responses: + 204: + description: "已关注目标用户" + 404: + description: "没有相关数据" + /v5/users/{username}/keys: + get: + tags: + - "Users" + summary: "列出指定用户的所有公钥" + description: "列出指定用户的所有公钥" + operationId: "getV5UsersUsernameKeys" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "username" + in: "path" + description: "用户名(username/login)" + required: true + type: "string" + x-exportParamName: "Username" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/SSHKeyBasic" + 404: + description: "没有相关数据" + /v5/users/{username}/starred: + get: + tags: + - "Activity" + summary: "列出用户 star 了的仓库" + description: "列出用户 star 了的仓库" + operationId: "getV5UsersUsernameStarred" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "username" + in: "path" + description: "用户名(username/login)" + required: true + type: "string" + x-exportParamName: "Username" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + - name: "sort" + in: "query" + description: "根据仓库创建时间(created)或最后推送时间(updated)进行排序,默认:创建时间" + required: false + type: "string" + default: "created" + enum: + - "created" + - "last_push" + x-exportParamName: "Sort" + x-optionalDataType: "String" + - name: "direction" + in: "query" + description: "按递增(asc)或递减(desc)排序,默认:递减" + required: false + type: "string" + default: "desc" + enum: + - "asc" + - "desc" + x-exportParamName: "Direction" + x-optionalDataType: "String" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Project" + 404: + description: "没有相关数据" + /v5/users/{username}/subscriptions: + get: + tags: + - "Activity" + summary: "列出用户 watch 了的仓库" + description: "列出用户 watch 了的仓库" + operationId: "getV5UsersUsernameSubscriptions" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "username" + in: "path" + description: "用户名(username/login)" + required: true + type: "string" + x-exportParamName: "Username" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + - name: "sort" + in: "query" + description: "根据仓库创建时间(created)或最后推送时间(updated)进行排序,默认:创建时间" + required: false + type: "string" + default: "created" + enum: + - "created" + - "last_push" + x-exportParamName: "Sort" + x-optionalDataType: "String" + - name: "direction" + in: "query" + description: "按递增(asc)或递减(desc)排序,默认:递减" + required: false + type: "string" + default: "desc" + enum: + - "asc" + - "desc" + x-exportParamName: "Direction" + x-optionalDataType: "String" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Project" + 404: + description: "没有相关数据" + /v5/users/{username}/received_events: + get: + tags: + - "Activity" + summary: "列出一个用户收到的动态" + description: "列出一个用户收到的动态" + operationId: "getV5UsersUsernameReceivedEvents" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "username" + in: "path" + description: "用户名(username/login)" + required: true + type: "string" + x-exportParamName: "Username" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Event" + 404: + description: "没有相关数据" + /v5/users/{username}/received_events/public: + get: + tags: + - "Activity" + summary: "列出一个用户收到的公开动态" + description: "列出一个用户收到的公开动态" + operationId: "getV5UsersUsernameReceivedEventsPublic" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "username" + in: "path" + description: "用户名(username/login)" + required: true + type: "string" + x-exportParamName: "Username" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Event" + 404: + description: "没有相关数据" + /v5/users/{username}/events: + get: + tags: + - "Activity" + summary: "列出用户的动态" + description: "列出用户的动态" + operationId: "getV5UsersUsernameEvents" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "username" + in: "path" + description: "用户名(username/login)" + required: true + type: "string" + x-exportParamName: "Username" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Event" + 404: + description: "没有相关数据" + /v5/users/{username}/events/public: + get: + tags: + - "Activity" + summary: "列出用户的公开动态" + description: "列出用户的公开动态" + operationId: "getV5UsersUsernameEventsPublic" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "username" + in: "path" + description: "用户名(username/login)" + required: true + type: "string" + x-exportParamName: "Username" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Event" + 404: + description: "没有相关数据" + /v5/users/{username}/events/orgs/{org}: + get: + tags: + - "Activity" + summary: "列出用户所属组织的动态" + description: "列出用户所属组织的动态" + operationId: "getV5UsersUsernameEventsOrgsOrg" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "username" + in: "path" + description: "用户名(username/login)" + required: true + type: "string" + x-exportParamName: "Username" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + - name: "org" + in: "path" + description: "组织的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Org" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Event" + 403: + description: "没有权限" + 404: + description: "没有相关数据" + /v5/orgs/{org}: + get: + tags: + - "Organizations" + summary: "获取一个组织" + description: "获取一个组织" + operationId: "getV5OrgsOrg" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "org" + in: "path" + description: "组织的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Org" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Group" + 403: + description: "没有权限" + 404: + description: "没有相关数据" + patch: + tags: + - "Organizations" + summary: "更新授权用户所管理的组织资料" + description: "更新授权用户所管理的组织资料" + operationId: "patchV5OrgsOrg" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "org" + in: "path" + description: "组织的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Org" + - name: "email" + in: "formData" + description: "组织公开的邮箱地址" + required: false + type: "string" + x-exportParamName: "Email" + x-optionalDataType: "String" + - name: "location" + in: "formData" + description: "组织所在地" + required: false + type: "string" + x-exportParamName: "Location" + x-optionalDataType: "String" + - name: "name" + in: "formData" + description: "组织名称" + required: false + type: "string" + x-exportParamName: "Name" + x-optionalDataType: "String" + - name: "description" + in: "formData" + description: "组织简介" + required: false + type: "string" + x-exportParamName: "Description" + x-optionalDataType: "String" + - name: "html_url" + in: "formData" + description: "组织站点" + required: false + type: "string" + x-exportParamName: "HtmlUrl" + x-optionalDataType: "String" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/GroupDetail" + 400: + description: "数据不合法" + 403: + description: "没有权限" + 404: + description: "没有相关数据" + /v5/orgs/{org}/members: + get: + tags: + - "Organizations" + summary: "列出一个组织的所有成员" + description: "列出一个组织的所有成员" + operationId: "getV5OrgsOrgMembers" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "org" + in: "path" + description: "组织的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Org" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + - name: "role" + in: "query" + description: "根据角色筛选成员" + required: false + type: "string" + default: "all" + enum: + - "all" + - "admin" + - "member" + x-exportParamName: "Role" + x-optionalDataType: "String" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/UserBasic" + 403: + description: "没有权限" + 404: + description: "没有相关数据" + /v5/orgs/{org}/issues: + get: + tags: + - "Issues" + summary: "获取当前用户某个组织的Issues" + description: "获取当前用户某个组织的Issues" + operationId: "getV5OrgsOrgIssues" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "filter" + in: "query" + description: "筛选参数: 授权用户负责的(assigned),授权用户创建的(created),包含前两者的(all)。默认: assigned" + required: false + type: "string" + default: "assigned" + enum: + - "assigned" + - "created" + - "all" + x-exportParamName: "Filter" + x-optionalDataType: "String" + - name: "state" + in: "query" + description: "Issue的状态: open(开启的), progressing(进行中), closed(关闭的), rejected(\ + 拒绝的)。 默认: open" + required: false + type: "string" + default: "open" + enum: + - "open" + - "progressing" + - "closed" + - "rejected" + - "all" + x-exportParamName: "State" + x-optionalDataType: "String" + - name: "labels" + in: "query" + description: "用逗号分开的标签。如: bug,performance" + required: false + type: "string" + x-exportParamName: "Labels" + x-optionalDataType: "String" + - name: "sort" + in: "query" + description: "排序依据: 创建时间(created),更新时间(updated_at)。默认: created_at" + required: false + type: "string" + default: "created" + enum: + - "created" + - "updated" + x-exportParamName: "Sort" + x-optionalDataType: "String" + - name: "direction" + in: "query" + description: "排序方式: 升序(asc),降序(desc)。默认: desc" + required: false + type: "string" + default: "desc" + enum: + - "asc" + - "desc" + x-exportParamName: "Direction" + x-optionalDataType: "String" + - name: "since" + in: "query" + description: "起始的更新时间,要求时间格式为 ISO 8601" + required: false + type: "string" + x-exportParamName: "Since" + x-optionalDataType: "String" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + - name: "schedule" + in: "query" + description: "计划开始日期,格式:20181006T173008+80-20181007T173008+80(区间),或者 -20181007T173008+80(\ + 小于20181007T173008+80),或者 20181006T173008+80-(大于20181006T173008+80),要求时间格\ + 式为20181006T173008+80" + required: false + type: "string" + x-exportParamName: "Schedule" + x-optionalDataType: "String" + - name: "deadline" + in: "query" + description: "计划截止日期,格式同上" + required: false + type: "string" + x-exportParamName: "Deadline" + x-optionalDataType: "String" + - name: "created_at" + in: "query" + description: "任务创建时间,格式同上" + required: false + type: "string" + x-exportParamName: "CreatedAt" + x-optionalDataType: "String" + - name: "finished_at" + in: "query" + description: "任务完成时间,即任务最后一次转为已完成状态的时间点。格式同上" + required: false + type: "string" + x-exportParamName: "FinishedAt" + x-optionalDataType: "String" + - name: "org" + in: "path" + description: "组织的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Org" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Issue" + /v5/orgs/{org}/repos: + get: + tags: + - "Repositories" + summary: "获取一个组织的仓库" + description: "获取一个组织的仓库" + operationId: "getV5OrgsOrgRepos" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "org" + in: "path" + description: "组织的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Org" + - name: "type" + in: "query" + description: "筛选仓库的类型,可以是 all, public, private。默认: all" + required: false + type: "string" + default: "all" + enum: + - "all" + - "public" + - "private" + x-exportParamName: "Type_" + x-optionalDataType: "String" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Project" + post: + tags: + - "Repositories" + summary: "创建组织仓库" + description: "创建组织仓库" + operationId: "postV5OrgsOrgRepos" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "name" + in: "formData" + description: "仓库名称" + required: true + type: "string" + x-exportParamName: "Name" + - name: "description" + in: "formData" + description: "仓库描述" + required: false + type: "string" + x-exportParamName: "Description" + x-optionalDataType: "String" + - name: "homepage" + in: "formData" + description: "主页(eg: https://gitee.com)" + required: false + type: "string" + x-exportParamName: "Homepage" + x-optionalDataType: "String" + - name: "has_issues" + in: "formData" + description: "允许提Issue与否。默认: 允许(true)" + required: false + type: "boolean" + default: true + x-exportParamName: "HasIssues" + x-optionalDataType: "Bool" + - name: "has_wiki" + in: "formData" + description: "提供Wiki与否。默认: 提供(true)" + required: false + type: "boolean" + default: true + x-exportParamName: "HasWiki" + x-optionalDataType: "Bool" + - name: "org" + in: "path" + description: "组织的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Org" + - name: "public" + in: "formData" + description: "仓库开源类型。0(私有), 1(外部开源), 2(内部开源),注:与private互斥,以public为主。" + required: false + type: "integer" + format: "int32" + enum: + - 0 + - 1 + - 2 + x-exportParamName: "Public" + x-optionalDataType: "Int32" + - name: "private" + in: "formData" + description: "仓库公开或私有。默认: 公开(false),注:与public互斥,以public为主。" + required: false + type: "boolean" + x-exportParamName: "Private" + x-optionalDataType: "Bool" + - name: "auto_init" + in: "formData" + description: "值为true时则会用README初始化仓库。默认: 不初始化(false)" + required: false + type: "boolean" + x-exportParamName: "AutoInit" + x-optionalDataType: "Bool" + - name: "gitignore_template" + in: "formData" + description: "Git Ingore模版" + required: false + type: "string" + enum: + - "Actionscript" + - "Ada" + - "Agda" + - "Android" + - "AppEngine" + - "AppceleratorTitanium" + - "ArchLinuxPackages" + - "Autotools" + - "C" + - "C++" + - "CFWheels" + - "CMake" + - "CUDA" + - "CakePHP" + - "ChefCookbook" + - "Clojure" + - "CodeIgniter" + - "CommonLisp" + - "Composer" + - "Concrete5" + - "Coq" + - "CraftCMS" + - "D" + - "DM" + - "Dart" + - "Delphi" + - "Drupal" + - "EPiServer" + - "Eagle" + - "Elisp" + - "Elixir" + - "Elm" + - "Erlang" + - "ExpressionEngine" + - "ExtJs" + - "Fancy" + - "Finale" + - "Flutter" + - "ForceDotCom" + - "Fortran" + - "FuelPHP" + - "GWT" + - "Gcov" + - "GitBook" + - "Global/Anjuta" + - "Global/Ansible" + - "Global/Archives" + - "Global/Backup" + - "Global/Bazaar" + - "Global/BricxCC" + - "Global/CVS" + - "Global/Calabash" + - "Global/Cloud9" + - "Global/CodeKit" + - "Global/DartEditor" + - "Global/Diff" + - "Global/Dreamweaver" + - "Global/Dropbox" + - "Global/Eclipse" + - "Global/EiffelStudio" + - "Global/Emacs" + - "Global/Ensime" + - "Global/Espresso" + - "Global/FlexBuilder" + - "Global/GPG" + - "Global/Images" + - "Global/JDeveloper" + - "Global/JEnv" + - "Global/JetBrains" + - "Global/KDevelop4" + - "Global/Kate" + - "Global/Lazarus" + - "Global/LibreOffice" + - "Global/Linux" + - "Global/LyX" + - "Global/MATLAB" + - "Global/Mercurial" + - "Global/MicrosoftOffice" + - "Global/ModelSim" + - "Global/Momentics" + - "Global/MonoDevelop" + - "Global/NetBeans" + - "Global/Ninja" + - "Global/NotepadPP" + - "Global/Octave" + - "Global/Otto" + - "Global/PSoCCreator" + - "Global/Patch" + - "Global/PuTTY" + - "Global/Redcar" + - "Global/Redis" + - "Global/SBT" + - "Global/SVN" + - "Global/SlickEdit" + - "Global/Stata" + - "Global/SublimeText" + - "Global/SynopsysVCS" + - "Global/Tags" + - "Global/TextMate" + - "Global/TortoiseGit" + - "Global/Vagrant" + - "Global/Vim" + - "Global/VirtualEnv" + - "Global/Virtuoso" + - "Global/VisualStudioCode" + - "Global/WebMethods" + - "Global/Windows" + - "Global/Xcode" + - "Global/XilinxISE" + - "Global/macOS" + - "Go" + - "Godot" + - "Gradle" + - "Grails" + - "Haskell" + - "IGORPro" + - "Idris" + - "JBoss" + - "Java" + - "Jekyll" + - "Joomla" + - "Julia" + - "KiCad" + - "Kohana" + - "Kotlin" + - "LabVIEW" + - "Laravel" + - "Leiningen" + - "LemonStand" + - "Lilypond" + - "Lithium" + - "Lua" + - "Magento" + - "Maven" + - "Mercury" + - "MetaProgrammingSystem" + - "MiniProgram" + - "Nanoc" + - "Nim" + - "Node" + - "OCaml" + - "Objective-C" + - "Opa" + - "OpenCart" + - "OracleForms" + - "Packer" + - "Perl" + - "Perl6" + - "Phalcon" + - "PlayFramework" + - "Plone" + - "Prestashop" + - "Processing" + - "PureScript" + - "Python" + - "Qooxdoo" + - "Qt" + - "R" + - "ROS" + - "Rails" + - "RhodesRhomobile" + - "Ruby" + - "Rust" + - "SCons" + - "Sass" + - "Scala" + - "Scheme" + - "Scrivener" + - "Sdcc" + - "SeamGen" + - "SketchUp" + - "Smalltalk" + - "Stella" + - "SugarCRM" + - "Swift" + - "Symfony" + - "SymphonyCMS" + - "TeX" + - "Terraform" + - "Textpattern" + - "TurboGears2" + - "Typo3" + - "Umbraco" + - "Unity" + - "UnrealEngine" + - "VVVV" + - "VisualStudio" + - "Waf" + - "WordPress" + - "Xojo" + - "Yeoman" + - "Yii" + - "ZendFramework" + - "Zephir" + x-exportParamName: "GitignoreTemplate" + x-optionalDataType: "String" + - name: "license_template" + in: "formData" + description: "License模版" + required: false + type: "string" + enum: + - "MulanPSL-1.0" + - "AFL-3.0" + - "AGPL-3.0" + - "Apache-2.0" + - "Artistic-2.0" + - "BSD-2-Clause" + - "BSD-3-Clause" + - "BSD-3-Clause-Clear" + - "BSL-1.0" + - "CC-BY-4.0" + - "CC-BY-SA-4.0" + - "CC0-1.0" + - "ECL-2.0" + - "EPL-1.0" + - "EUPL-1.1" + - "GPL-2.0" + - "GPL-3.0" + - "ISC" + - "LGPL-2.1" + - "LGPL-3.0" + - "LPPL-1.3c" + - "MIT" + - "MPL-2.0" + - "MS-PL" + - "MS-RL" + - "NCSA" + - "OFL-1.1" + - "OSL-3.0" + - "PostgreSQL" + - "Unlicense" + - "WTFPL" + - "Zlib" + x-exportParamName: "LicenseTemplate" + x-optionalDataType: "String" + responses: + 201: + description: "返回格式" + schema: + $ref: "#/definitions/Project" + /v5/orgs/{org}/memberships/{username}: + get: + tags: + - "Organizations" + summary: "获取授权用户所属组织的一个成员" + description: "获取授权用户所属组织的一个成员" + operationId: "getV5OrgsOrgMembershipsUsername" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "org" + in: "path" + description: "组织的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Org" + - name: "username" + in: "path" + description: "用户名(username/login)" + required: true + type: "string" + x-exportParamName: "Username" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/GroupMember" + 404: + description: "没有相关数据" + put: + tags: + - "Organizations" + summary: "增加或更新授权用户所管理组织的成员" + description: "增加或更新授权用户所管理组织的成员" + operationId: "putV5OrgsOrgMembershipsUsername" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "org" + in: "path" + description: "组织的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Org" + - name: "username" + in: "path" + description: "用户名(username/login)" + required: true + type: "string" + x-exportParamName: "Username" + - name: "role" + in: "formData" + description: "设置用户在组织的角色" + required: false + type: "string" + default: "member" + enum: + - "admin" + - "member" + x-exportParamName: "Role" + x-optionalDataType: "String" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/GroupMember" + 400: + description: "数据不合法" + 403: + description: "没有权限" + 404: + description: "没有相关数据" + delete: + tags: + - "Organizations" + summary: "移除授权用户所管理组织中的成员" + description: "移除授权用户所管理组织中的成员" + operationId: "deleteV5OrgsOrgMembershipsUsername" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "org" + in: "path" + description: "组织的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Org" + - name: "username" + in: "path" + description: "用户名(username/login)" + required: true + type: "string" + x-exportParamName: "Username" + responses: + 204: + description: "执行成功" + 403: + description: "没有权限" + 404: + description: "没有相关数据" + /v5/orgs/{org}/events: + get: + tags: + - "Activity" + summary: "列出组织的公开动态" + description: "列出组织的公开动态" + operationId: "getV5OrgsOrgEvents" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "org" + in: "path" + description: "组织的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Org" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Event" + 403: + description: "没有权限" + 404: + description: "没有相关数据" + /v5/issues: + get: + tags: + - "Issues" + summary: "获取当前授权用户的所有Issues" + description: "获取当前授权用户的所有Issues" + operationId: "getV5Issues" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "filter" + in: "query" + description: "筛选参数: 授权用户负责的(assigned),授权用户创建的(created),包含前两者的(all)。默认: assigned" + required: false + type: "string" + default: "assigned" + enum: + - "assigned" + - "created" + - "all" + x-exportParamName: "Filter" + x-optionalDataType: "String" + - name: "state" + in: "query" + description: "Issue的状态: open(开启的), progressing(进行中), closed(关闭的), rejected(\ + 拒绝的)。 默认: open" + required: false + type: "string" + default: "open" + enum: + - "open" + - "progressing" + - "closed" + - "rejected" + - "all" + x-exportParamName: "State" + x-optionalDataType: "String" + - name: "labels" + in: "query" + description: "用逗号分开的标签。如: bug,performance" + required: false + type: "string" + x-exportParamName: "Labels" + x-optionalDataType: "String" + - name: "sort" + in: "query" + description: "排序依据: 创建时间(created),更新时间(updated_at)。默认: created_at" + required: false + type: "string" + default: "created" + enum: + - "created" + - "updated" + x-exportParamName: "Sort" + x-optionalDataType: "String" + - name: "direction" + in: "query" + description: "排序方式: 升序(asc),降序(desc)。默认: desc" + required: false + type: "string" + default: "desc" + enum: + - "asc" + - "desc" + x-exportParamName: "Direction" + x-optionalDataType: "String" + - name: "since" + in: "query" + description: "起始的更新时间,要求时间格式为 ISO 8601" + required: false + type: "string" + x-exportParamName: "Since" + x-optionalDataType: "String" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + - name: "schedule" + in: "query" + description: "计划开始日期,格式:20181006T173008+80-20181007T173008+80(区间),或者 -20181007T173008+80(\ + 小于20181007T173008+80),或者 20181006T173008+80-(大于20181006T173008+80),要求时间格\ + 式为20181006T173008+80" + required: false + type: "string" + x-exportParamName: "Schedule" + x-optionalDataType: "String" + - name: "deadline" + in: "query" + description: "计划截止日期,格式同上" + required: false + type: "string" + x-exportParamName: "Deadline" + x-optionalDataType: "String" + - name: "created_at" + in: "query" + description: "任务创建时间,格式同上" + required: false + type: "string" + x-exportParamName: "CreatedAt" + x-optionalDataType: "String" + - name: "finished_at" + in: "query" + description: "任务完成时间,即任务最后一次转为已完成状态的时间点。格式同上" + required: false + type: "string" + x-exportParamName: "FinishedAt" + x-optionalDataType: "String" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Issue" + /v5/enterprises/{enterprise}/issues: + get: + tags: + - "Issues" + summary: "获取某个企业的所有Issues" + description: "获取某个企业的所有Issues" + operationId: "getV5EnterprisesEnterpriseIssues" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "enterprise" + in: "path" + description: "企业的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Enterprise" + - name: "state" + in: "query" + description: "Issue的状态: open(开启的), progressing(进行中), closed(关闭的), rejected(\ + 拒绝的)。 默认: open" + required: false + type: "string" + default: "open" + enum: + - "open" + - "progressing" + - "closed" + - "rejected" + - "all" + x-exportParamName: "State" + x-optionalDataType: "String" + - name: "labels" + in: "query" + description: "用逗号分开的标签。如: bug,performance" + required: false + type: "string" + x-exportParamName: "Labels" + x-optionalDataType: "String" + - name: "sort" + in: "query" + description: "排序依据: 创建时间(created),更新时间(updated_at)。默认: created_at" + required: false + type: "string" + default: "created" + enum: + - "created" + - "updated" + x-exportParamName: "Sort" + x-optionalDataType: "String" + - name: "direction" + in: "query" + description: "排序方式: 升序(asc),降序(desc)。默认: desc" + required: false + type: "string" + default: "desc" + enum: + - "asc" + - "desc" + x-exportParamName: "Direction" + x-optionalDataType: "String" + - name: "since" + in: "query" + description: "起始的更新时间,要求时间格式为 ISO 8601" + required: false + type: "string" + x-exportParamName: "Since" + x-optionalDataType: "String" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + - name: "schedule" + in: "query" + description: "计划开始日期,格式:20181006T173008+80-20181007T173008+80(区间),或者 -20181007T173008+80(\ + 小于20181007T173008+80),或者 20181006T173008+80-(大于20181006T173008+80),要求时间格\ + 式为20181006T173008+80" + required: false + type: "string" + x-exportParamName: "Schedule" + x-optionalDataType: "String" + - name: "deadline" + in: "query" + description: "计划截止日期,格式同上" + required: false + type: "string" + x-exportParamName: "Deadline" + x-optionalDataType: "String" + - name: "created_at" + in: "query" + description: "任务创建时间,格式同上" + required: false + type: "string" + x-exportParamName: "CreatedAt" + x-optionalDataType: "String" + - name: "finished_at" + in: "query" + description: "任务完成时间,即任务最后一次转为已完成状态的时间点。格式同上" + required: false + type: "string" + x-exportParamName: "FinishedAt" + x-optionalDataType: "String" + - name: "milestone" + in: "query" + description: "根据里程碑标题。none为没里程碑的,*为所有带里程碑的" + required: false + type: "string" + x-exportParamName: "Milestone" + x-optionalDataType: "String" + - name: "assignee" + in: "query" + description: "用户的username。 none为没指派者, *为所有带有指派者的" + required: false + type: "string" + x-exportParamName: "Assignee" + x-optionalDataType: "String" + - name: "creator" + in: "query" + description: "创建Issues的用户username" + required: false + type: "string" + x-exportParamName: "Creator" + x-optionalDataType: "String" + - name: "program" + in: "query" + description: "所属项目名称。none为没所属有项目的,*为所有带所属项目的" + required: false + type: "string" + x-exportParamName: "Program" + x-optionalDataType: "String" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Issue" + /v5/enterprises/{enterprise}: + get: + tags: + - "Enterprises" + summary: "获取一个企业" + description: "获取一个企业" + operationId: "getV5EnterprisesEnterprise" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "enterprise" + in: "path" + description: "企业的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Enterprise" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/EnterpriseBasic" + 403: + description: "没有权限" + 404: + description: "没有相关数据" + /v5/enterprises/{enterprise}/members: + get: + tags: + - "Enterprises" + summary: "列出企业的所有成员" + description: "列出企业的所有成员" + operationId: "getV5EnterprisesEnterpriseMembers" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "enterprise" + in: "path" + description: "企业的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Enterprise" + - name: "role" + in: "query" + description: "根据角色筛选成员" + required: false + type: "string" + default: "all" + enum: + - "all" + - "admin" + - "member" + x-exportParamName: "Role" + x-optionalDataType: "String" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/EnterpriseMember" + 403: + description: "没有权限" + 404: + description: "没有相关数据" + post: + tags: + - "Enterprises" + summary: "添加或邀请企业成员" + description: "添加或邀请企业成员" + operationId: "postV5EnterprisesEnterpriseMembers" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "enterprise" + in: "path" + description: "企业的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Enterprise" + - name: "username" + in: "formData" + description: "需要邀请的码云用户名(username/login),username,email至少填写一个" + required: false + type: "string" + x-exportParamName: "Username" + x-optionalDataType: "String" + - name: "email" + in: "formData" + description: "要添加邮箱地址,若该邮箱未注册则自动创建帐号。username,email至少填写一个" + required: false + type: "string" + x-exportParamName: "Email" + x-optionalDataType: "String" + - name: "outsourced" + in: "formData" + description: "是否企业外包成员,默认:否" + required: false + type: "boolean" + x-exportParamName: "Outsourced" + x-optionalDataType: "Bool" + - name: "role" + in: "formData" + description: "企业角色,默认普通成员" + required: false + type: "string" + default: "member" + enum: + - "admin" + - "member" + x-exportParamName: "Role" + x-optionalDataType: "String" + - name: "name" + in: "formData" + description: "企业成员真实姓名(备注)" + required: false + type: "string" + x-exportParamName: "Name" + x-optionalDataType: "String" + responses: + 204: + description: "执行成功" + 403: + description: "没有权限" + 404: + description: "没有相关数据" + /v5/enterprises/{enterprise}/week_reports/{id}/comments: + get: + tags: + - "Enterprises" + summary: "某个周报评论列表" + description: "某个周报评论列表" + operationId: "getV5EnterprisesEnterpriseWeekReportsIdComments" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "enterprise" + in: "path" + description: "企业的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Enterprise" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + - name: "id" + in: "path" + description: "周报ID" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Id" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Note" + /v5/enterprises/{enterprise}/week_reports/{id}/comment: + post: + tags: + - "Enterprises" + summary: "评论周报" + description: "评论周报" + operationId: "postV5EnterprisesEnterpriseWeekReportsIdComment" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "enterprise" + in: "path" + description: "企业的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Enterprise" + - name: "id" + in: "path" + description: "周报ID" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Id" + - name: "body" + in: "formData" + description: "评论的内容" + required: true + type: "string" + x-exportParamName: "Body" + responses: + 201: + description: "返回格式" + schema: + $ref: "#/definitions/Note" + /v5/enterprises/{enterprise}/week_reports/{report_id}/comments/{id}: + delete: + tags: + - "Enterprises" + summary: "删除周报某个评论" + description: "删除周报某个评论" + operationId: "deleteV5EnterprisesEnterpriseWeekReportsReportIdCommentsId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "enterprise" + in: "path" + description: "企业的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Enterprise" + - name: "report_id" + in: "path" + description: "周报ID" + required: true + type: "integer" + format: "int32" + x-exportParamName: "ReportId" + - name: "id" + in: "path" + description: "评论ID" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Id" + responses: + 204: + description: "删除周报某个评论" + /v5/enterprises/{enterprise}/users/{username}/week_reports: + get: + tags: + - "Enterprises" + summary: "个人周报列表" + description: "个人周报列表" + operationId: "getV5EnterprisesEnterpriseUsersUsernameWeekReports" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "enterprise" + in: "path" + description: "企业的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Enterprise" + - name: "username" + in: "path" + description: "用户名(username/login)" + required: true + type: "string" + x-exportParamName: "Username" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/WeekReport" + /v5/enterprises/{enterprise}/week_reports: + get: + tags: + - "Enterprises" + summary: "企业成员周报列表" + description: "企业成员周报列表" + operationId: "getV5EnterprisesEnterpriseWeekReports" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "enterprise" + in: "path" + description: "企业的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Enterprise" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + - name: "username" + in: "query" + description: "用户名(username/login)" + required: false + type: "string" + x-exportParamName: "Username" + x-optionalDataType: "String" + - name: "year" + in: "query" + description: "周报所属年" + required: false + type: "integer" + format: "int32" + x-exportParamName: "Year" + x-optionalDataType: "Int32" + - name: "week_index" + in: "query" + description: "周报所属周" + required: false + type: "integer" + format: "int32" + x-exportParamName: "WeekIndex" + x-optionalDataType: "Int32" + - name: "date" + in: "query" + description: "周报日期(格式:2019-03-25)" + required: false + type: "string" + x-exportParamName: "Date" + x-optionalDataType: "String" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/WeekReport" + /v5/enterprises/{enterprise}/week_reports/{id}: + get: + tags: + - "Enterprises" + summary: "周报详情" + description: "周报详情" + operationId: "getV5EnterprisesEnterpriseWeekReportsId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "enterprise" + in: "path" + description: "企业的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Enterprise" + - name: "id" + in: "path" + description: "周报ID" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Id" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/WeekReport" + /v5/enterprises/{enterprise}/week_report/{id}: + patch: + tags: + - "Enterprises" + summary: "编辑周报" + description: "编辑周报" + operationId: "patchV5EnterprisesEnterpriseWeekReportId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "enterprise" + in: "path" + description: "企业的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Enterprise" + - name: "id" + in: "path" + description: "周报ID" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Id" + - name: "content" + in: "formData" + description: "周报内容" + required: true + type: "string" + x-exportParamName: "Content" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/WeekReport" + /v5/enterprises/{enterprise}/week_report: + post: + tags: + - "Enterprises" + summary: "新建周报" + description: "新建周报" + operationId: "postV5EnterprisesEnterpriseWeekReport" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "enterprise" + in: "path" + description: "企业的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Enterprise" + - name: "year" + in: "formData" + description: "周报所属年" + required: true + type: "integer" + format: "int32" + x-exportParamName: "Year" + - name: "content" + in: "formData" + description: "周报内容" + required: true + type: "string" + x-exportParamName: "Content" + - name: "week_index" + in: "formData" + description: "周报所属周" + required: true + type: "integer" + format: "int32" + x-exportParamName: "WeekIndex" + - name: "username" + in: "formData" + description: "用户名(username/login)" + required: true + type: "string" + x-exportParamName: "Username" + - name: "date" + in: "formData" + description: "周报日期(格式:2019-03-25)" + required: false + type: "string" + x-exportParamName: "Date" + x-optionalDataType: "String" + responses: + 201: + description: "返回格式" + schema: + $ref: "#/definitions/WeekReport" + /v5/enterprises/{enterprise}/issues/{number}: + get: + tags: + - "Issues" + summary: "获取企业的某个Issue" + description: "获取企业的某个Issue" + operationId: "getV5EnterprisesEnterpriseIssuesNumber" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "enterprise" + in: "path" + description: "企业的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Enterprise" + - name: "number" + in: "path" + description: "Issue 编号(区分大小写,无需添加 # 号)" + required: true + type: "string" + x-exportParamName: "Number" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Issue" + /v5/enterprises/{enterprise}/issues/{number}/comments: + get: + tags: + - "Issues" + summary: "获取企业某个Issue所有评论" + description: "获取企业某个Issue所有评论" + operationId: "getV5EnterprisesEnterpriseIssuesNumberComments" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "enterprise" + in: "path" + description: "企业的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Enterprise" + - name: "number" + in: "path" + description: "Issue 编号(区分大小写,无需添加 # 号)" + required: true + type: "string" + x-exportParamName: "Number" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Note" + /v5/enterprises/{enterprise}/issues/{number}/labels: + get: + tags: + - "Issues" + summary: "获取企业某个Issue所有标签" + description: "获取企业某个Issue所有标签" + operationId: "getV5EnterprisesEnterpriseIssuesNumberLabels" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "enterprise" + in: "path" + description: "企业的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Enterprise" + - name: "number" + in: "path" + description: "Issue 编号(区分大小写,无需添加 # 号)" + required: true + type: "string" + x-exportParamName: "Number" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Label" + /v5/enterprises/{enterprise}/labels: + get: + tags: + - "Labels" + summary: "获取企业所有标签" + description: "获取企业所有标签" + operationId: "getV5EnterprisesEnterpriseLabels" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "enterprise" + in: "path" + description: "企业的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Enterprise" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Label" + /v5/enterprises/{enterprise}/labels/{name}: + get: + tags: + - "Labels" + summary: "获取企业某个标签" + description: "获取企业某个标签" + operationId: "getV5EnterprisesEnterpriseLabelsName" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "enterprise" + in: "path" + description: "企业的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Enterprise" + - name: "name" + in: "path" + description: "标签名称" + required: true + type: "string" + x-exportParamName: "Name" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Label" + /v5/enterprises/{enterprise}/repos: + get: + tags: + - "Repositories" + summary: "获取企业的所有仓库" + description: "获取企业的所有仓库" + operationId: "getV5EnterprisesEnterpriseRepos" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "enterprise" + in: "path" + description: "企业的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Enterprise" + - name: "type" + in: "query" + description: "筛选仓库的类型,可以是 all, public, internal, private。默认: all" + required: false + type: "string" + default: "all" + enum: + - "all" + - "public" + - "internal" + - "private" + x-exportParamName: "Type_" + x-optionalDataType: "String" + - name: "direct" + in: "query" + description: "只获取直属仓库,默认: false" + required: false + type: "boolean" + x-exportParamName: "Direct" + x-optionalDataType: "Bool" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/Project" + post: + tags: + - "Repositories" + summary: "创建企业仓库" + description: "创建企业仓库" + operationId: "postV5EnterprisesEnterpriseRepos" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "name" + in: "formData" + description: "仓库名称" + required: true + type: "string" + x-exportParamName: "Name" + - name: "description" + in: "formData" + description: "仓库描述" + required: false + type: "string" + x-exportParamName: "Description" + x-optionalDataType: "String" + - name: "homepage" + in: "formData" + description: "主页(eg: https://gitee.com)" + required: false + type: "string" + x-exportParamName: "Homepage" + x-optionalDataType: "String" + - name: "has_issues" + in: "formData" + description: "允许提Issue与否。默认: 允许(true)" + required: false + type: "boolean" + default: true + x-exportParamName: "HasIssues" + x-optionalDataType: "Bool" + - name: "has_wiki" + in: "formData" + description: "提供Wiki与否。默认: 提供(true)" + required: false + type: "boolean" + default: true + x-exportParamName: "HasWiki" + x-optionalDataType: "Bool" + - name: "enterprise" + in: "path" + description: "企业的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Enterprise" + - name: "auto_init" + in: "formData" + description: "值为true时则会用README初始化仓库。默认: 不初始化(false)" + required: false + type: "boolean" + x-exportParamName: "AutoInit" + x-optionalDataType: "Bool" + - name: "gitignore_template" + in: "formData" + description: "Git Ingore模版" + required: false + type: "string" + enum: + - "Actionscript" + - "Ada" + - "Agda" + - "Android" + - "AppEngine" + - "AppceleratorTitanium" + - "ArchLinuxPackages" + - "Autotools" + - "C" + - "C++" + - "CFWheels" + - "CMake" + - "CUDA" + - "CakePHP" + - "ChefCookbook" + - "Clojure" + - "CodeIgniter" + - "CommonLisp" + - "Composer" + - "Concrete5" + - "Coq" + - "CraftCMS" + - "D" + - "DM" + - "Dart" + - "Delphi" + - "Drupal" + - "EPiServer" + - "Eagle" + - "Elisp" + - "Elixir" + - "Elm" + - "Erlang" + - "ExpressionEngine" + - "ExtJs" + - "Fancy" + - "Finale" + - "Flutter" + - "ForceDotCom" + - "Fortran" + - "FuelPHP" + - "GWT" + - "Gcov" + - "GitBook" + - "Global/Anjuta" + - "Global/Ansible" + - "Global/Archives" + - "Global/Backup" + - "Global/Bazaar" + - "Global/BricxCC" + - "Global/CVS" + - "Global/Calabash" + - "Global/Cloud9" + - "Global/CodeKit" + - "Global/DartEditor" + - "Global/Diff" + - "Global/Dreamweaver" + - "Global/Dropbox" + - "Global/Eclipse" + - "Global/EiffelStudio" + - "Global/Emacs" + - "Global/Ensime" + - "Global/Espresso" + - "Global/FlexBuilder" + - "Global/GPG" + - "Global/Images" + - "Global/JDeveloper" + - "Global/JEnv" + - "Global/JetBrains" + - "Global/KDevelop4" + - "Global/Kate" + - "Global/Lazarus" + - "Global/LibreOffice" + - "Global/Linux" + - "Global/LyX" + - "Global/MATLAB" + - "Global/Mercurial" + - "Global/MicrosoftOffice" + - "Global/ModelSim" + - "Global/Momentics" + - "Global/MonoDevelop" + - "Global/NetBeans" + - "Global/Ninja" + - "Global/NotepadPP" + - "Global/Octave" + - "Global/Otto" + - "Global/PSoCCreator" + - "Global/Patch" + - "Global/PuTTY" + - "Global/Redcar" + - "Global/Redis" + - "Global/SBT" + - "Global/SVN" + - "Global/SlickEdit" + - "Global/Stata" + - "Global/SublimeText" + - "Global/SynopsysVCS" + - "Global/Tags" + - "Global/TextMate" + - "Global/TortoiseGit" + - "Global/Vagrant" + - "Global/Vim" + - "Global/VirtualEnv" + - "Global/Virtuoso" + - "Global/VisualStudioCode" + - "Global/WebMethods" + - "Global/Windows" + - "Global/Xcode" + - "Global/XilinxISE" + - "Global/macOS" + - "Go" + - "Godot" + - "Gradle" + - "Grails" + - "Haskell" + - "IGORPro" + - "Idris" + - "JBoss" + - "Java" + - "Jekyll" + - "Joomla" + - "Julia" + - "KiCad" + - "Kohana" + - "Kotlin" + - "LabVIEW" + - "Laravel" + - "Leiningen" + - "LemonStand" + - "Lilypond" + - "Lithium" + - "Lua" + - "Magento" + - "Maven" + - "Mercury" + - "MetaProgrammingSystem" + - "MiniProgram" + - "Nanoc" + - "Nim" + - "Node" + - "OCaml" + - "Objective-C" + - "Opa" + - "OpenCart" + - "OracleForms" + - "Packer" + - "Perl" + - "Perl6" + - "Phalcon" + - "PlayFramework" + - "Plone" + - "Prestashop" + - "Processing" + - "PureScript" + - "Python" + - "Qooxdoo" + - "Qt" + - "R" + - "ROS" + - "Rails" + - "RhodesRhomobile" + - "Ruby" + - "Rust" + - "SCons" + - "Sass" + - "Scala" + - "Scheme" + - "Scrivener" + - "Sdcc" + - "SeamGen" + - "SketchUp" + - "Smalltalk" + - "Stella" + - "SugarCRM" + - "Swift" + - "Symfony" + - "SymphonyCMS" + - "TeX" + - "Terraform" + - "Textpattern" + - "TurboGears2" + - "Typo3" + - "Umbraco" + - "Unity" + - "UnrealEngine" + - "VVVV" + - "VisualStudio" + - "Waf" + - "WordPress" + - "Xojo" + - "Yeoman" + - "Yii" + - "ZendFramework" + - "Zephir" + x-exportParamName: "GitignoreTemplate" + x-optionalDataType: "String" + - name: "license_template" + in: "formData" + description: "License模版" + required: false + type: "string" + enum: + - "MulanPSL-1.0" + - "AFL-3.0" + - "AGPL-3.0" + - "Apache-2.0" + - "Artistic-2.0" + - "BSD-2-Clause" + - "BSD-3-Clause" + - "BSD-3-Clause-Clear" + - "BSL-1.0" + - "CC-BY-4.0" + - "CC-BY-SA-4.0" + - "CC0-1.0" + - "ECL-2.0" + - "EPL-1.0" + - "EUPL-1.1" + - "GPL-2.0" + - "GPL-3.0" + - "ISC" + - "LGPL-2.1" + - "LGPL-3.0" + - "LPPL-1.3c" + - "MIT" + - "MPL-2.0" + - "MS-PL" + - "MS-RL" + - "NCSA" + - "OFL-1.1" + - "OSL-3.0" + - "PostgreSQL" + - "Unlicense" + - "WTFPL" + - "Zlib" + x-exportParamName: "LicenseTemplate" + x-optionalDataType: "String" + - name: "private" + in: "formData" + description: "仓库开源类型。0(私有), 1(外部开源), 2(内部开源)。默认: 0" + required: false + type: "integer" + default: 0 + format: "int32" + enum: + - 0 + - 1 + - 2 + x-exportParamName: "Private" + x-optionalDataType: "Int32" + - name: "outsourced" + in: "formData" + description: "值为true值为外包仓库, false值为内部仓库。默认: 内部仓库(false)" + required: false + type: "boolean" + x-exportParamName: "Outsourced" + x-optionalDataType: "Bool" + - name: "project_creator" + in: "formData" + description: "负责人的username" + required: false + type: "string" + x-exportParamName: "ProjectCreator" + x-optionalDataType: "String" + - name: "members" + in: "formData" + description: "用逗号分开的仓库成员。如: member1,member2" + required: false + type: "string" + x-exportParamName: "Members" + x-optionalDataType: "String" + responses: + 201: + description: "返回格式" + schema: + $ref: "#/definitions/Project" + /v5/enterprises/{enterprise}/members/{username}: + get: + tags: + - "Enterprises" + summary: "获取企业的一个成员" + description: "获取企业的一个成员" + operationId: "getV5EnterprisesEnterpriseMembersUsername" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "enterprise" + in: "path" + description: "企业的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Enterprise" + - name: "username" + in: "path" + description: "用户名(username/login)" + required: true + type: "string" + x-exportParamName: "Username" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/EnterpriseMember" + 404: + description: "没有相关数据" + put: + tags: + - "Enterprises" + summary: "修改企业成员权限或备注" + description: "修改企业成员权限或备注" + operationId: "putV5EnterprisesEnterpriseMembersUsername" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "enterprise" + in: "path" + description: "企业的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Enterprise" + - name: "username" + in: "path" + description: "用户名(username/login)" + required: true + type: "string" + x-exportParamName: "Username" + - name: "outsourced" + in: "formData" + description: "是否企业外包成员,默认:否" + required: false + type: "boolean" + x-exportParamName: "Outsourced" + x-optionalDataType: "Bool" + - name: "role" + in: "formData" + description: "企业角色,默认普通成员" + required: false + type: "string" + default: "member" + enum: + - "admin" + - "member" + x-exportParamName: "Role" + x-optionalDataType: "String" + - name: "active" + in: "formData" + description: "是否可访问企业资源,默认:是。(若选否则禁止该用户访问企业资源)" + required: false + type: "boolean" + default: true + x-exportParamName: "Active" + x-optionalDataType: "Bool" + - name: "name" + in: "formData" + description: "企业成员真实姓名(备注)" + required: false + type: "string" + x-exportParamName: "Name" + x-optionalDataType: "String" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/EnterpriseMember" + 400: + description: "数据不合法" + 403: + description: "没有权限" + 404: + description: "没有相关数据" + delete: + tags: + - "Enterprises" + summary: "移除企业成员" + description: "移除企业成员" + operationId: "deleteV5EnterprisesEnterpriseMembersUsername" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "enterprise" + in: "path" + description: "企业的路径(path/login)" + required: true + type: "string" + x-exportParamName: "Enterprise" + - name: "username" + in: "path" + description: "用户名(username/login)" + required: true + type: "string" + x-exportParamName: "Username" + responses: + 204: + description: "执行成功" + 403: + description: "没有权限" + 404: + description: "没有相关数据" + /v5/gitignore/templates: + get: + tags: + - "Miscellaneous" + summary: "列出可使用的 .gitignore 模板" + description: "列出可使用的 .gitignore 模板" + operationId: "getV5GitignoreTemplates" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + responses: + 200: + description: "列出可使用的 .gitignore 模板" + /v5/gitignore/templates/{name}: + get: + tags: + - "Miscellaneous" + summary: "获取一个 .gitignore 模板" + description: "获取一个 .gitignore 模板" + operationId: "getV5GitignoreTemplatesName" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "name" + in: "path" + description: ".gitignore 模板名" + required: true + type: "string" + enum: + - "Actionscript" + - "Ada" + - "Agda" + - "Android" + - "AppEngine" + - "AppceleratorTitanium" + - "ArchLinuxPackages" + - "Autotools" + - "C" + - "C++" + - "CFWheels" + - "CMake" + - "CUDA" + - "CakePHP" + - "ChefCookbook" + - "Clojure" + - "CodeIgniter" + - "CommonLisp" + - "Composer" + - "Concrete5" + - "Coq" + - "CraftCMS" + - "D" + - "DM" + - "Dart" + - "Delphi" + - "Drupal" + - "EPiServer" + - "Eagle" + - "Elisp" + - "Elixir" + - "Elm" + - "Erlang" + - "ExpressionEngine" + - "ExtJs" + - "Fancy" + - "Finale" + - "Flutter" + - "ForceDotCom" + - "Fortran" + - "FuelPHP" + - "GWT" + - "Gcov" + - "GitBook" + - "Anjuta" + - "Ansible" + - "Archives" + - "Backup" + - "Bazaar" + - "BricxCC" + - "CVS" + - "Calabash" + - "Cloud9" + - "CodeKit" + - "DartEditor" + - "Diff" + - "Dreamweaver" + - "Dropbox" + - "Eclipse" + - "EiffelStudio" + - "Emacs" + - "Ensime" + - "Espresso" + - "FlexBuilder" + - "GPG" + - "Images" + - "JDeveloper" + - "JEnv" + - "JetBrains" + - "KDevelop4" + - "Kate" + - "Lazarus" + - "LibreOffice" + - "Linux" + - "LyX" + - "MATLAB" + - "Mercurial" + - "MicrosoftOffice" + - "ModelSim" + - "Momentics" + - "MonoDevelop" + - "NetBeans" + - "Ninja" + - "NotepadPP" + - "Octave" + - "Otto" + - "PSoCCreator" + - "Patch" + - "PuTTY" + - "Redcar" + - "Redis" + - "SBT" + - "SVN" + - "SlickEdit" + - "Stata" + - "SublimeText" + - "SynopsysVCS" + - "Tags" + - "TextMate" + - "TortoiseGit" + - "Vagrant" + - "Vim" + - "VirtualEnv" + - "Virtuoso" + - "VisualStudioCode" + - "WebMethods" + - "Windows" + - "Xcode" + - "XilinxISE" + - "macOS" + - "Go" + - "Godot" + - "Gradle" + - "Grails" + - "Haskell" + - "IGORPro" + - "Idris" + - "JBoss" + - "Java" + - "Jekyll" + - "Joomla" + - "Julia" + - "KiCad" + - "Kohana" + - "Kotlin" + - "LabVIEW" + - "Laravel" + - "Leiningen" + - "LemonStand" + - "Lilypond" + - "Lithium" + - "Lua" + - "Magento" + - "Maven" + - "Mercury" + - "MetaProgrammingSystem" + - "MiniProgram" + - "Nanoc" + - "Nim" + - "Node" + - "OCaml" + - "Objective-C" + - "Opa" + - "OpenCart" + - "OracleForms" + - "Packer" + - "Perl" + - "Perl6" + - "Phalcon" + - "PlayFramework" + - "Plone" + - "Prestashop" + - "Processing" + - "PureScript" + - "Python" + - "Qooxdoo" + - "Qt" + - "R" + - "ROS" + - "Rails" + - "RhodesRhomobile" + - "Ruby" + - "Rust" + - "SCons" + - "Sass" + - "Scala" + - "Scheme" + - "Scrivener" + - "Sdcc" + - "SeamGen" + - "SketchUp" + - "Smalltalk" + - "Stella" + - "SugarCRM" + - "Swift" + - "Symfony" + - "SymphonyCMS" + - "TeX" + - "Terraform" + - "Textpattern" + - "TurboGears2" + - "Typo3" + - "Umbraco" + - "Unity" + - "UnrealEngine" + - "VVVV" + - "VisualStudio" + - "Waf" + - "WordPress" + - "Xojo" + - "Yeoman" + - "Yii" + - "ZendFramework" + - "Zephir" + x-exportParamName: "Name" + responses: + 200: + description: "获取一个 .gitignore 模板" + /v5/gitignore/templates/{name}/raw: + get: + tags: + - "Miscellaneous" + summary: "获取一个 .gitignore 模板原始文件" + description: "获取一个 .gitignore 模板原始文件" + operationId: "getV5GitignoreTemplatesNameRaw" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "name" + in: "path" + description: ".gitignore 模板名" + required: true + type: "string" + enum: + - "Actionscript" + - "Ada" + - "Agda" + - "Android" + - "AppEngine" + - "AppceleratorTitanium" + - "ArchLinuxPackages" + - "Autotools" + - "C" + - "C++" + - "CFWheels" + - "CMake" + - "CUDA" + - "CakePHP" + - "ChefCookbook" + - "Clojure" + - "CodeIgniter" + - "CommonLisp" + - "Composer" + - "Concrete5" + - "Coq" + - "CraftCMS" + - "D" + - "DM" + - "Dart" + - "Delphi" + - "Drupal" + - "EPiServer" + - "Eagle" + - "Elisp" + - "Elixir" + - "Elm" + - "Erlang" + - "ExpressionEngine" + - "ExtJs" + - "Fancy" + - "Finale" + - "Flutter" + - "ForceDotCom" + - "Fortran" + - "FuelPHP" + - "GWT" + - "Gcov" + - "GitBook" + - "Anjuta" + - "Ansible" + - "Archives" + - "Backup" + - "Bazaar" + - "BricxCC" + - "CVS" + - "Calabash" + - "Cloud9" + - "CodeKit" + - "DartEditor" + - "Diff" + - "Dreamweaver" + - "Dropbox" + - "Eclipse" + - "EiffelStudio" + - "Emacs" + - "Ensime" + - "Espresso" + - "FlexBuilder" + - "GPG" + - "Images" + - "JDeveloper" + - "JEnv" + - "JetBrains" + - "KDevelop4" + - "Kate" + - "Lazarus" + - "LibreOffice" + - "Linux" + - "LyX" + - "MATLAB" + - "Mercurial" + - "MicrosoftOffice" + - "ModelSim" + - "Momentics" + - "MonoDevelop" + - "NetBeans" + - "Ninja" + - "NotepadPP" + - "Octave" + - "Otto" + - "PSoCCreator" + - "Patch" + - "PuTTY" + - "Redcar" + - "Redis" + - "SBT" + - "SVN" + - "SlickEdit" + - "Stata" + - "SublimeText" + - "SynopsysVCS" + - "Tags" + - "TextMate" + - "TortoiseGit" + - "Vagrant" + - "Vim" + - "VirtualEnv" + - "Virtuoso" + - "VisualStudioCode" + - "WebMethods" + - "Windows" + - "Xcode" + - "XilinxISE" + - "macOS" + - "Go" + - "Godot" + - "Gradle" + - "Grails" + - "Haskell" + - "IGORPro" + - "Idris" + - "JBoss" + - "Java" + - "Jekyll" + - "Joomla" + - "Julia" + - "KiCad" + - "Kohana" + - "Kotlin" + - "LabVIEW" + - "Laravel" + - "Leiningen" + - "LemonStand" + - "Lilypond" + - "Lithium" + - "Lua" + - "Magento" + - "Maven" + - "Mercury" + - "MetaProgrammingSystem" + - "MiniProgram" + - "Nanoc" + - "Nim" + - "Node" + - "OCaml" + - "Objective-C" + - "Opa" + - "OpenCart" + - "OracleForms" + - "Packer" + - "Perl" + - "Perl6" + - "Phalcon" + - "PlayFramework" + - "Plone" + - "Prestashop" + - "Processing" + - "PureScript" + - "Python" + - "Qooxdoo" + - "Qt" + - "R" + - "ROS" + - "Rails" + - "RhodesRhomobile" + - "Ruby" + - "Rust" + - "SCons" + - "Sass" + - "Scala" + - "Scheme" + - "Scrivener" + - "Sdcc" + - "SeamGen" + - "SketchUp" + - "Smalltalk" + - "Stella" + - "SugarCRM" + - "Swift" + - "Symfony" + - "SymphonyCMS" + - "TeX" + - "Terraform" + - "Textpattern" + - "TurboGears2" + - "Typo3" + - "Umbraco" + - "Unity" + - "UnrealEngine" + - "VVVV" + - "VisualStudio" + - "Waf" + - "WordPress" + - "Xojo" + - "Yeoman" + - "Yii" + - "ZendFramework" + - "Zephir" + x-exportParamName: "Name" + responses: + 200: + description: "获取一个 .gitignore 模板原始文件" + /v5/licenses: + get: + tags: + - "Miscellaneous" + summary: "列出可使用的开源许可协议" + description: "列出可使用的开源许可协议" + operationId: "getV5Licenses" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + responses: + 200: + description: "列出可使用的开源许可协议" + /v5/licenses/{license}: + get: + tags: + - "Miscellaneous" + summary: "获取一个开源许可协议" + description: "获取一个开源许可协议" + operationId: "getV5LicensesLicense" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "license" + in: "path" + description: "协议名称" + required: true + type: "string" + enum: + - "MulanPSL-1.0" + - "AFL-3.0" + - "AGPL-3.0" + - "Apache-2.0" + - "Artistic-2.0" + - "BSD-2-Clause" + - "BSD-3-Clause" + - "BSD-3-Clause-Clear" + - "BSL-1.0" + - "CC-BY-4.0" + - "CC-BY-SA-4.0" + - "CC0-1.0" + - "ECL-2.0" + - "EPL-1.0" + - "EUPL-1.1" + - "GPL-2.0" + - "GPL-3.0" + - "ISC" + - "LGPL-2.1" + - "LGPL-3.0" + - "LPPL-1.3c" + - "MIT" + - "MPL-2.0" + - "MS-PL" + - "MS-RL" + - "NCSA" + - "OFL-1.1" + - "OSL-3.0" + - "PostgreSQL" + - "Unlicense" + - "WTFPL" + - "Zlib" + x-exportParamName: "License" + responses: + 200: + description: "获取一个开源许可协议" + /v5/licenses/{license}/raw: + get: + tags: + - "Miscellaneous" + summary: "获取一个开源许可协议原始文件" + description: "获取一个开源许可协议原始文件" + operationId: "getV5LicensesLicenseRaw" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "license" + in: "path" + description: "协议名称" + required: true + type: "string" + enum: + - "MulanPSL-1.0" + - "AFL-3.0" + - "AGPL-3.0" + - "Apache-2.0" + - "Artistic-2.0" + - "BSD-2-Clause" + - "BSD-3-Clause" + - "BSD-3-Clause-Clear" + - "BSL-1.0" + - "CC-BY-4.0" + - "CC-BY-SA-4.0" + - "CC0-1.0" + - "ECL-2.0" + - "EPL-1.0" + - "EUPL-1.1" + - "GPL-2.0" + - "GPL-3.0" + - "ISC" + - "LGPL-2.1" + - "LGPL-3.0" + - "LPPL-1.3c" + - "MIT" + - "MPL-2.0" + - "MS-PL" + - "MS-RL" + - "NCSA" + - "OFL-1.1" + - "OSL-3.0" + - "PostgreSQL" + - "Unlicense" + - "WTFPL" + - "Zlib" + x-exportParamName: "License" + responses: + 200: + description: "获取一个开源许可协议原始文件" + /v5/markdown: + post: + tags: + - "Miscellaneous" + summary: "渲染 Markdown 文本" + description: "渲染 Markdown 文本" + operationId: "postV5Markdown" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "text" + in: "formData" + description: "Markdown 文本" + required: true + type: "string" + x-exportParamName: "Text" + responses: + 201: + description: "渲染 Markdown 文本" + /v5/events: + get: + tags: + - "Activity" + summary: "获取站内所有公开动态" + description: "获取站内所有公开动态" + operationId: "getV5Events" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回数据" + schema: + type: "array" + items: + $ref: "#/definitions/Event" + /v5/networks/{owner}/{repo}/events: + get: + tags: + - "Activity" + summary: "列出仓库的所有公开动态" + description: "列出仓库的所有公开动态" + operationId: "getV5NetworksOwnerRepoEvents" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "owner" + in: "path" + description: "仓库所属空间地址(企业、组织或个人的地址path)" + required: true + type: "string" + x-exportParamName: "Owner" + - name: "repo" + in: "path" + description: "仓库路径(path)" + required: true + type: "string" + x-exportParamName: "Repo" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Event" + 403: + description: "没有权限" + 404: + description: "没有相关数据" + /v5/search/repositories: + get: + tags: + - "Search" + summary: "搜索仓库" + description: "搜索仓库" + operationId: "getV5SearchRepositories" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "q" + in: "query" + description: "搜索关键字" + required: true + type: "string" + x-exportParamName: "Q" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + - name: "owner" + in: "query" + description: "筛选指定空间地址(企业、组织或个人的地址 path) 的仓库" + required: false + type: "string" + x-exportParamName: "Owner" + x-optionalDataType: "String" + - name: "fork" + in: "query" + description: "是否搜索含 fork 的仓库,默认:否" + required: false + type: "boolean" + x-exportParamName: "Fork" + x-optionalDataType: "Bool" + - name: "language" + in: "query" + description: "筛选指定语言的仓库" + required: false + type: "string" + enum: + - "Java" + - "JavaScript" + - "PHP" + - "Python" + - "Android" + - "Objective-C" + - "C#" + - "Go" + - "C++" + - "HTML" + - "C" + - "NodeJS" + - "Swift" + - "Ruby" + - "TypeScript" + - "Shell" + - "CSS" + - "Docker" + - "Lua" + - "Dart" + - "Scala" + - "Matlab" + - "Delphi" + - "ASP" + - "TeX/LaTeX" + - "Visual Basic" + - "ActionScript" + - "Groovy" + - "Erlang" + - "R" + - "Rust" + - "Verilog" + - "VimL" + - "Perl" + - "QML" + - "Arduino" + - "Assembly" + - "Pascal" + - "Clojure" + - "Emacs Lisp" + - "FORTRAN" + - "CoffeeScript" + - "PowerShell" + - "AutoHotkey" + - "Elixir" + - "VHDL" + - "D" + - "Haskell" + - "M" + - "Julia" + - "Scheme" + - "Common Lisp" + - "XSLT" + - "Logos" + - "DOT" + - "Racket" + - "OCaml" + - "Puppet" + - "Haxe" + - "Coq" + - "LiveScript" + - "Vala" + - "Nemerle" + - "Prolog" + - "Smalltalk" + - "Eiffel" + - "Standard ML" + - "eC" + - "Ada" + - "Slash" + - "Scilab" + - "Awk" + - "ColdFusion" + - "微信" + - "Crystal" + - "Kotlin" + - "SQL" + - "Lisp" + - "XML" + - "C/C++" + - "HTML/CSS" + - "易语言" + - "汇编" + - "其他" + - "Zephir" + - "Pawn" + x-exportParamName: "Language" + x-optionalDataType: "String" + - name: "sort" + in: "query" + description: "排序字段,created_at(创建时间)、last_push_at(更新时间)、stars_count(收藏数)、forks_count(Fork\ + \ 数)、watches_count(关注数),默认为最佳匹配" + required: false + type: "string" + enum: + - "created_at" + - "last_push_at" + - "stars_count" + - "forks_count" + - "watches_count" + x-exportParamName: "Sort" + x-optionalDataType: "String" + - name: "order" + in: "query" + description: "排序顺序: desc(default)、asc" + required: false + type: "string" + default: "desc" + enum: + - "asc" + - "desc" + x-exportParamName: "Order" + x-optionalDataType: "String" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Project" + /v5/search/issues: + get: + tags: + - "Search" + summary: "搜索 Issues" + description: "搜索 Issues" + operationId: "getV5SearchIssues" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "q" + in: "query" + description: "搜索关键字" + required: true + type: "string" + x-exportParamName: "Q" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + - name: "repo" + in: "query" + description: "筛选指定仓库 (path, e.g. oschina/git-osc) 的 issues" + required: false + type: "string" + x-exportParamName: "Repo" + x-optionalDataType: "String" + - name: "language" + in: "query" + description: "筛选指定语言的 issues" + required: false + type: "string" + enum: + - "Java" + - "JavaScript" + - "PHP" + - "Python" + - "Android" + - "Objective-C" + - "C#" + - "Go" + - "C++" + - "HTML" + - "C" + - "NodeJS" + - "Swift" + - "Ruby" + - "TypeScript" + - "Shell" + - "CSS" + - "Docker" + - "Lua" + - "Dart" + - "Scala" + - "Matlab" + - "Delphi" + - "ASP" + - "TeX/LaTeX" + - "Visual Basic" + - "ActionScript" + - "Groovy" + - "Erlang" + - "R" + - "Rust" + - "Verilog" + - "VimL" + - "Perl" + - "QML" + - "Arduino" + - "Assembly" + - "Pascal" + - "Clojure" + - "Emacs Lisp" + - "FORTRAN" + - "CoffeeScript" + - "PowerShell" + - "AutoHotkey" + - "Elixir" + - "VHDL" + - "D" + - "Haskell" + - "M" + - "Julia" + - "Scheme" + - "Common Lisp" + - "XSLT" + - "Logos" + - "DOT" + - "Racket" + - "OCaml" + - "Puppet" + - "Haxe" + - "Coq" + - "LiveScript" + - "Vala" + - "Nemerle" + - "Prolog" + - "Smalltalk" + - "Eiffel" + - "Standard ML" + - "eC" + - "Ada" + - "Slash" + - "Scilab" + - "Awk" + - "ColdFusion" + - "微信" + - "Crystal" + - "Kotlin" + - "SQL" + - "Lisp" + - "XML" + - "C/C++" + - "HTML/CSS" + - "易语言" + - "汇编" + - "其他" + - "Zephir" + - "Pawn" + x-exportParamName: "Language" + x-optionalDataType: "String" + - name: "label" + in: "query" + description: "筛选指定标签的 issues" + required: false + type: "string" + x-exportParamName: "Label" + x-optionalDataType: "String" + - name: "state" + in: "query" + description: "筛选指定状态的 issues, open(开启)、closed(完成)、rejected(拒绝)" + required: false + type: "string" + enum: + - "open" + - "progressing" + - "closed" + - "rejected" + x-exportParamName: "State" + x-optionalDataType: "String" + - name: "author" + in: "query" + description: "筛选指定创建者 (username/login) 的 issues" + required: false + type: "string" + x-exportParamName: "Author" + x-optionalDataType: "String" + - name: "assignee" + in: "query" + description: "筛选指定负责人 (username/login) 的 issues" + required: false + type: "string" + x-exportParamName: "Assignee" + x-optionalDataType: "String" + - name: "sort" + in: "query" + description: "排序字段,created_at(创建时间)、last_push_at(更新时间)、notes_count(评论数),默认\ + 为最佳匹配" + required: false + type: "string" + enum: + - "created_at" + - "updated_at" + - "notes_count" + x-exportParamName: "Sort" + x-optionalDataType: "String" + - name: "order" + in: "query" + description: "排序顺序: desc(default)、asc" + required: false + type: "string" + default: "desc" + enum: + - "asc" + - "desc" + x-exportParamName: "Order" + x-optionalDataType: "String" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Issue" + /v5/search/gists: + get: + tags: + - "Search" + summary: "搜索代码片段" + description: "搜索代码片段" + operationId: "getV5SearchGists" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "q" + in: "query" + description: "搜索关键字" + required: true + type: "string" + x-exportParamName: "Q" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + - name: "language" + in: "query" + description: "筛选指定语言的代码片段" + required: false + type: "string" + enum: + - "Java" + - "Zephir" + - "Pawn" + - "PHP" + - "JavaScript" + - "C#" + - "C/C++" + - "Python" + - "Ruby" + - "Go" + - "Perl" + - "ASP" + - "Objective-C" + - "HTML" + - "CSS" + - "TypeScript" + - "Shell" + - "Erlang" + - "Kotlin" + - "Swift" + - "Rust" + - "Lua" + - "Assembly" + - "Pascal" + - "Scala" + - "ActionScript" + - "Groovy" + - "Clojure" + - "Matlab" + - "VimL" + - "R" + - "Lisp" + - "SQL" + - "XML" + - "易语言" + - "Smalltalk" + - "其他" + - "C" + - "CoffeeScript" + - "C++" + - "AutoHotkey" + - "Arduino" + - "Common Lisp" + - "Scheme" + - "FORTRAN" + - "Verilog" + - "Puppet" + - "XSLT" + - "Delphi" + - "eC" + - "D" + - "Haskell" + - "Visual Basic" + - "PowerShell" + - "Emacs Lisp" + - "Racket" + - "OCaml" + - "Vala" + - "Ada" + - "Dart" + - "M" + - "ColdFusion" + - "Awk" + - "LiveScript" + - "Slash" + - "Julia" + - "Nemerle" + - "Elixir" + - "VHDL" + - "TeX/LaTeX" + - "Standard ML" + - "Haxe" + - "Eiffel" + - "DOT" + - "Scilab" + - "Prolog" + - "NodeJS" + - "Android" + - "Coq" + - "Logos" + - "QML" + - "Docker" + - "微信" + - "Crystal" + - "HTML/CSS" + - "汇编" + x-exportParamName: "Language" + x-optionalDataType: "String" + - name: "owner" + in: "query" + description: "筛选所属用户 (username/login) 的代码片段" + required: false + type: "string" + x-exportParamName: "Owner" + x-optionalDataType: "String" + - name: "sort" + in: "query" + description: "排序字段,created_at(创建时间)、updated_at(更新时间)、notes_count(评论数)、stars_count(收\ + 藏数)、forks_count(Fork 数),默认为最佳匹配" + required: false + type: "string" + enum: + - "created_at" + - "updated_at" + - "notes_count" + - "stars_count" + - "forks_count" + x-exportParamName: "Sort" + x-optionalDataType: "String" + - name: "order" + in: "query" + description: "排序顺序: desc(default)、asc" + required: false + type: "string" + default: "desc" + enum: + - "asc" + - "desc" + x-exportParamName: "Order" + x-optionalDataType: "String" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/Code" + /v5/search/users: + get: + tags: + - "Search" + summary: "搜索用户" + description: "搜索用户" + operationId: "getV5SearchUsers" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "q" + in: "query" + description: "搜索关键字" + required: true + type: "string" + x-exportParamName: "Q" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + - name: "sort" + in: "query" + description: "排序字段,joined_at(注册时间),默认为最佳匹配" + required: false + type: "string" + enum: + - "joined_at" + x-exportParamName: "Sort" + x-optionalDataType: "String" + - name: "order" + in: "query" + description: "排序顺序: desc(default)、asc" + required: false + type: "string" + default: "desc" + enum: + - "asc" + - "desc" + x-exportParamName: "Order" + x-optionalDataType: "String" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/User" + /v5/notifications/count: + get: + tags: + - "Activity" + summary: "获取授权用户的通知数" + description: "获取授权用户的通知数" + operationId: "getV5NotificationsCount" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "unread" + in: "query" + description: "是否只获取未读消息,默认:否" + required: false + type: "boolean" + x-exportParamName: "Unread" + x-optionalDataType: "Bool" + responses: + 200: + description: "返回数据" + schema: + $ref: "#/definitions/UserNotificationCount" + /v5/notifications/threads: + get: + tags: + - "Activity" + summary: "列出授权用户的所有通知" + description: "列出授权用户的所有通知" + operationId: "getV5NotificationsThreads" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "unread" + in: "query" + description: "是否只获取未读消息,默认:否" + required: false + type: "boolean" + x-exportParamName: "Unread" + x-optionalDataType: "Bool" + - name: "participating" + in: "query" + description: "是否只获取自己直接参与的消息,默认:否" + required: false + type: "boolean" + x-exportParamName: "Participating" + x-optionalDataType: "Bool" + - name: "type" + in: "query" + description: "筛选指定类型的通知,all:所有,event:事件通知,referer:@ 通知" + required: false + type: "string" + default: "all" + enum: + - "all" + - "event" + - "referer" + x-exportParamName: "Type_" + x-optionalDataType: "String" + - name: "since" + in: "query" + description: "只获取在给定时间后更新的消息,要求时间格式为 ISO 8601" + required: false + type: "string" + x-exportParamName: "Since" + x-optionalDataType: "String" + - name: "before" + in: "query" + description: "只获取在给定时间前更新的消息,要求时间格式为 ISO 8601" + required: false + type: "string" + x-exportParamName: "Before" + x-optionalDataType: "String" + - name: "ids" + in: "query" + description: "指定一组通知 ID,以 , 分隔" + required: false + type: "string" + x-exportParamName: "Ids" + x-optionalDataType: "String" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回数据" + schema: + type: "array" + items: + $ref: "#/definitions/UserNotificationList" + put: + tags: + - "Activity" + summary: "标记所有通知为已读" + description: "标记所有通知为已读" + operationId: "putV5NotificationsThreads" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "ids" + in: "formData" + description: "指定一组通知 ID,以 , 分隔" + required: false + type: "string" + x-exportParamName: "Ids" + x-optionalDataType: "String" + responses: + 205: + description: "执行成功" + /v5/notifications/threads/{id}: + get: + tags: + - "Activity" + summary: "获取一条通知" + description: "获取一条通知" + operationId: "getV5NotificationsThreadsId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "id" + in: "path" + description: "通知的 ID" + required: true + type: "string" + x-exportParamName: "Id" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/UserNotification" + 404: + description: "没有相关数据" + patch: + tags: + - "Activity" + summary: "标记一条通知为已读" + description: "标记一条通知为已读" + operationId: "patchV5NotificationsThreadsId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "id" + in: "path" + description: "通知的 ID" + required: true + type: "string" + x-exportParamName: "Id" + responses: + 205: + description: "执行成功" + 404: + description: "没有相关数据" + /v5/notifications/messages: + get: + tags: + - "Activity" + summary: "列出授权用户的所有私信" + description: "列出授权用户的所有私信" + operationId: "getV5NotificationsMessages" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "unread" + in: "query" + description: "是否只显示未读私信,默认:否" + required: false + type: "boolean" + x-exportParamName: "Unread" + x-optionalDataType: "Bool" + - name: "since" + in: "query" + description: "只获取在给定时间后更新的私信,要求时间格式为 ISO 8601" + required: false + type: "string" + x-exportParamName: "Since" + x-optionalDataType: "String" + - name: "before" + in: "query" + description: "只获取在给定时间前更新的私信,要求时间格式为 ISO 8601" + required: false + type: "string" + x-exportParamName: "Before" + x-optionalDataType: "String" + - name: "ids" + in: "query" + description: "指定一组私信 ID,以 , 分隔" + required: false + type: "string" + x-exportParamName: "Ids" + x-optionalDataType: "String" + - name: "page" + in: "query" + description: "当前的页码" + required: false + type: "integer" + default: 1 + format: "int32" + x-exportParamName: "Page" + x-optionalDataType: "Int32" + - name: "per_page" + in: "query" + description: "每页的数量,最大为 100" + required: false + type: "integer" + default: 20 + format: "int32" + x-exportParamName: "PerPage" + x-optionalDataType: "Int32" + responses: + 200: + description: "返回格式" + schema: + type: "array" + items: + $ref: "#/definitions/UserMessageList" + post: + tags: + - "Activity" + summary: "发送私信给指定用户" + description: "发送私信给指定用户" + operationId: "postV5NotificationsMessages" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "username" + in: "formData" + description: "用户名(username/login)" + required: true + type: "string" + x-exportParamName: "Username" + - name: "content" + in: "formData" + description: "私信内容" + required: true + type: "string" + x-exportParamName: "Content" + responses: + 201: + description: "返回格式" + schema: + $ref: "#/definitions/UserMessage" + 400: + description: "数据不合法" + 404: + description: "没有相关数据" + put: + tags: + - "Activity" + summary: "标记所有私信为已读" + description: "标记所有私信为已读" + operationId: "putV5NotificationsMessages" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "ids" + in: "formData" + description: "指定一组私信 ID,以 , 分隔" + required: false + type: "string" + x-exportParamName: "Ids" + x-optionalDataType: "String" + responses: + 205: + description: "执行成功" + /v5/notifications/messages/{id}: + get: + tags: + - "Activity" + summary: "获取一条私信" + description: "获取一条私信" + operationId: "getV5NotificationsMessagesId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "id" + in: "path" + description: "私信的 ID" + required: true + type: "string" + x-exportParamName: "Id" + responses: + 200: + description: "返回格式" + schema: + $ref: "#/definitions/UserMessage" + 404: + description: "没有相关数据" + patch: + tags: + - "Activity" + summary: "标记一条私信为已读" + description: "标记一条私信为已读" + operationId: "patchV5NotificationsMessagesId" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "formData" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + - name: "id" + in: "path" + description: "私信的 ID" + required: true + type: "string" + x-exportParamName: "Id" + responses: + 205: + description: "执行成功" + 404: + description: "没有相关数据" + /v5/emojis: + get: + tags: + - "Miscellaneous" + summary: "列出可使用的 Emoji" + description: "列出可使用的 Emoji" + operationId: "getV5Emojis" + consumes: + - "application/json" + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "access_token" + in: "query" + description: "用户授权码" + required: false + type: "string" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + responses: + 200: + description: "列出可使用的 Emoji" +definitions: + Branch: + type: "object" + properties: + name: + type: "string" + commit: + type: "string" + protected: + type: "string" + protection_url: + type: "string" + description: "获取所有分支" + example: + protected: "protected" + name: "name" + commit: "commit" + protection_url: "protection_url" + CompleteBranch: + type: "object" + properties: + name: + type: "string" + commit: + type: "string" + _links: + type: "string" + protected: + type: "string" + protection_url: + type: "string" + description: "创建分支" + example: + protected: "protected" + _links: "_links" + name: "name" + commit: "commit" + protection_url: "protection_url" + RepoCommit: + type: "object" + properties: + url: + type: "string" + sha: + type: "string" + html_url: + type: "string" + comments_url: + type: "string" + commit: + type: "string" + author: + type: "string" + committer: + type: "string" + parents: + type: "string" + stats: + type: "string" + description: "仓库的某个提交" + example: + committer: "committer" + stats: "stats" + author: "author" + html_url: "html_url" + comments_url: "comments_url" + commit: "commit" + sha: "sha" + url: "url" + parents: "parents" + Compare: + type: "object" + properties: + base_commit: + type: "string" + merge_base_commit: + type: "string" + commits: + type: "string" + files: + type: "string" + description: "两个Commits之间对比的版本差异" + example: + base_commit: "base_commit" + commits: "commits" + files: "files" + merge_base_commit: "merge_base_commit" + SSHKey: + type: "object" + properties: + id: + type: "string" + key: + type: "string" + url: + type: "string" + title: + type: "string" + created_at: + type: "string" + description: "获取一个公钥" + example: + created_at: "created_at" + id: "id" + title: "title" + key: "key" + url: "url" + SSHKeyBasic: + type: "object" + properties: + id: + type: "string" + key: + type: "string" + description: "列出指定用户的所有公钥" + example: + id: "id" + key: "key" + Content: + type: "object" + properties: + type: + type: "string" + encoding: + type: "string" + size: + type: "string" + name: + type: "string" + path: + type: "string" + content: + type: "string" + sha: + type: "string" + url: + type: "string" + html_url: + type: "string" + download_url: + type: "string" + _links: + type: "string" + description: "获取仓库具体路径下的内容" + example: + path: "path" + size: "size" + _links: "_links" + html_url: "html_url" + name: "name" + download_url: "download_url" + type: "type" + encoding: "encoding" + sha: "sha" + content: "content" + url: "url" + CommitContent: + type: "object" + properties: + content: + $ref: "#/definitions/ContentBasic" + commit: + $ref: "#/definitions/Commit" + description: "删除文件" + example: + commit: + committer: "committer" + author: "author" + tree: "tree" + message: "message" + sha: "sha" + parents: "parents" + content: + path: "path" + size: "size" + _links: "_links" + html_url: "html_url" + name: "name" + download_url: "download_url" + type: "type" + sha: "sha" + url: "url" + ContentBasic: + type: "object" + properties: + name: + type: "string" + path: + type: "string" + size: + type: "string" + sha: + type: "string" + type: + type: "string" + url: + type: "string" + html_url: + type: "string" + download_url: + type: "string" + _links: + type: "string" + example: + path: "path" + size: "size" + _links: "_links" + html_url: "html_url" + name: "name" + download_url: "download_url" + type: "type" + sha: "sha" + url: "url" + Commit: + type: "object" + properties: + sha: + type: "string" + author: + type: "string" + committer: + type: "string" + message: + type: "string" + tree: + type: "string" + parents: + type: "string" + example: + committer: "committer" + author: "author" + tree: "tree" + message: "message" + sha: "sha" + parents: "parents" + Blob: + type: "object" + properties: + sha: + type: "string" + size: + type: "string" + url: + type: "string" + content: + type: "string" + encoding: + type: "string" + description: "获取文件Blob" + example: + size: "size" + encoding: "encoding" + sha: "sha" + url: "url" + content: "content" + Tree: + type: "object" + properties: + sha: + type: "string" + url: + type: "string" + tree: + type: "string" + truncated: + type: "string" + description: "获取目录Tree" + example: + tree: "tree" + truncated: "truncated" + sha: "sha" + url: "url" + Issue: + type: "object" + properties: + id: + type: "integer" + format: "int32" + url: + type: "string" + repository_url: + type: "string" + labels_url: + type: "string" + comments_url: + type: "string" + html_url: + type: "string" + parent_url: + type: "string" + number: + type: "string" + state: + type: "string" + title: + type: "string" + body: + type: "string" + body_html: + type: "string" + user: + type: "string" + labels: + $ref: "#/definitions/Label" + assignee: + $ref: "#/definitions/UserBasic" + collaborators: + $ref: "#/definitions/UserBasic" + repository: + type: "string" + milestone: + $ref: "#/definitions/Milestone" + created_at: + type: "string" + format: "date-time" + updated_at: + type: "string" + format: "date-time" + plan_started_at: + type: "string" + format: "date-time" + deadline: + type: "string" + format: "date-time" + finished_at: + type: "string" + format: "date-time" + scheduled_time: + type: "string" + comments: + type: "integer" + format: "int32" + issue_type: + type: "string" + program: + $ref: "#/definitions/ProgramBasic" + description: "搜索 Issues" + example: + body_html: "body_html" + finished_at: "2000-01-23T04:56:07.000+00:00" + created_at: "2000-01-23T04:56:07.000+00:00" + program: + author: "author" + name: "name" + description: "description" + id: "id" + assignee: "assignee" + title: "title" + body: "body" + repository: "repository" + scheduled_time: "scheduled_time" + labels_url: "labels_url" + number: "number" + updated_at: "2000-01-23T04:56:07.000+00:00" + comments_url: "comments_url" + collaborators: + gists_url: "gists_url" + repos_url: "repos_url" + following_url: "following_url" + starred_url: "starred_url" + login: "login" + followers_url: "followers_url" + type: "type" + url: "url" + subscriptions_url: "subscriptions_url" + received_events_url: "received_events_url" + avatar_url: "avatar_url" + events_url: "events_url" + html_url: "html_url" + name: "name" + site_admin: "site_admin" + id: 5 + organizations_url: "organizations_url" + id: 0 + repository_url: "repository_url" + state: "state" + deadline: "2000-01-23T04:56:07.000+00:00" + comments: 3 + issue_type: "issue_type" + url: "url" + labels: + color: "color" + name: "name" + repository_id: 1 + id: 6 + url: "url" + milestone: + number: 5 + updated_at: "2000-01-23T04:56:07.000+00:00" + html_url: "html_url" + description: "description" + created_at: "2000-01-23T04:56:07.000+00:00" + repository_id: 2 + state: "state" + title: "title" + open_issues: 7 + closed_issues: 9 + url: "url" + due_on: "2000-01-23T04:56:07.000+00:00" + parent_url: "parent_url" + plan_started_at: "2000-01-23T04:56:07.000+00:00" + html_url: "html_url" + assignee: + gists_url: "gists_url" + repos_url: "repos_url" + following_url: "following_url" + starred_url: "starred_url" + login: "login" + followers_url: "followers_url" + type: "type" + url: "url" + subscriptions_url: "subscriptions_url" + received_events_url: "received_events_url" + avatar_url: "avatar_url" + events_url: "events_url" + html_url: "html_url" + name: "name" + site_admin: "site_admin" + id: 5 + organizations_url: "organizations_url" + user: "user" + Label: + type: "object" + properties: + id: + type: "integer" + format: "int32" + name: + type: "string" + color: + type: "string" + repository_id: + type: "integer" + format: "int32" + url: + type: "string" + description: "获取企业某个标签" + example: + color: "color" + name: "name" + repository_id: 1 + id: 6 + url: "url" + UserBasic: + type: "object" + properties: + id: + type: "integer" + format: "int32" + login: + type: "string" + name: + type: "string" + avatar_url: + type: "string" + url: + type: "string" + html_url: + type: "string" + followers_url: + type: "string" + following_url: + type: "string" + gists_url: + type: "string" + starred_url: + type: "string" + subscriptions_url: + type: "string" + organizations_url: + type: "string" + repos_url: + type: "string" + events_url: + type: "string" + received_events_url: + type: "string" + type: + type: "string" + site_admin: + type: "string" + description: "列出一个组织的所有成员" + example: + gists_url: "gists_url" + repos_url: "repos_url" + following_url: "following_url" + starred_url: "starred_url" + login: "login" + followers_url: "followers_url" + type: "type" + url: "url" + subscriptions_url: "subscriptions_url" + received_events_url: "received_events_url" + avatar_url: "avatar_url" + events_url: "events_url" + html_url: "html_url" + name: "name" + site_admin: "site_admin" + id: 5 + organizations_url: "organizations_url" + Milestone: + type: "object" + properties: + url: + type: "string" + html_url: + type: "string" + number: + type: "integer" + format: "int32" + repository_id: + type: "integer" + format: "int32" + state: + type: "string" + title: + type: "string" + description: + type: "string" + updated_at: + type: "string" + format: "date-time" + created_at: + type: "string" + format: "date-time" + open_issues: + type: "integer" + format: "int32" + closed_issues: + type: "integer" + format: "int32" + due_on: + type: "string" + format: "date-time" + description: "更新仓库里程碑" + example: + number: 5 + updated_at: "2000-01-23T04:56:07.000+00:00" + html_url: "html_url" + description: "description" + created_at: "2000-01-23T04:56:07.000+00:00" + repository_id: 2 + state: "state" + title: "title" + open_issues: 7 + closed_issues: 9 + url: "url" + due_on: "2000-01-23T04:56:07.000+00:00" + ProgramBasic: + type: "object" + properties: + id: + type: "string" + name: + type: "string" + description: + type: "string" + assignee: + type: "string" + author: + type: "string" + example: + author: "author" + name: "name" + description: "description" + id: "id" + assignee: "assignee" + OperateLog: + type: "object" + properties: + id: + type: "string" + icon: + type: "string" + user: + type: "string" + content: + type: "string" + created_at: + type: "string" + description: "获取某个Pull Request的操作日志" + example: + icon: "icon" + created_at: "created_at" + id: "id" + user: "user" + content: "content" + Note: + type: "object" + properties: + id: + type: "string" + body: + type: "string" + body_html: + type: "string" + user: + type: "string" + source: + type: "string" + created_at: + type: "string" + target: + type: "string" + description: "获取企业某个Issue所有评论" + example: + body_html: "body_html" + created_at: "created_at" + id: "id" + source: "source" + body: "body" + user: "user" + target: "target" + Project: + type: "object" + properties: + id: + type: "integer" + format: "int32" + full_name: + type: "string" + human_name: + type: "string" + url: + type: "string" + namespace: + type: "object" + properties: {} + path: + type: "string" + name: + type: "string" + owner: + type: "string" + description: + type: "string" + private: + type: "string" + public: + type: "string" + internal: + type: "string" + fork: + type: "string" + html_url: + type: "string" + ssh_url: + type: "string" + forks_url: + type: "string" + keys_url: + type: "string" + collaborators_url: + type: "string" + hooks_url: + type: "string" + branches_url: + type: "string" + tags_url: + type: "string" + blobs_url: + type: "string" + stargazers_url: + type: "string" + contributors_url: + type: "string" + commits_url: + type: "string" + comments_url: + type: "string" + issue_comment_url: + type: "string" + issues_url: + type: "string" + pulls_url: + type: "string" + milestones_url: + type: "string" + notifications_url: + type: "string" + labels_url: + type: "string" + releases_url: + type: "string" + recommend: + type: "string" + homepage: + type: "string" + language: + type: "string" + forks_count: + type: "string" + stargazers_count: + type: "string" + watchers_count: + type: "string" + default_branch: + type: "string" + open_issues_count: + type: "integer" + format: "int32" + has_issues: + type: "string" + has_wiki: + type: "string" + pull_requests_enabled: + type: "string" + has_page: + type: "string" + license: + type: "string" + outsourced: + type: "string" + project_creator: + type: "string" + members: + type: "string" + pushed_at: + type: "string" + created_at: + type: "string" + updated_at: + type: "string" + parent: + $ref: "#/definitions/Project" + paas: + type: "string" + stared: + type: "string" + watched: + type: "string" + permission: + type: "string" + relation: + type: "string" + description: "搜索仓库" + example: + human_name: "human_name" + stargazers_count: "stargazers_count" + pushed_at: "pushed_at" + language: "language" + branches_url: "branches_url" + issue_comment_url: "issue_comment_url" + relation: "relation" + labels_url: "labels_url" + path: "path" + releases_url: "releases_url" + members: "members" + id: 0 + pull_requests_enabled: "pull_requests_enabled" + forks_url: "forks_url" + project_creator: "project_creator" + ssh_url: "ssh_url" + license: "license" + watched: "watched" + full_name: "full_name" + html_url: "html_url" + collaborators_url: "collaborators_url" + name: "name" + outsourced: "outsourced" + pulls_url: "pulls_url" + default_branch: "default_branch" + hooks_url: "hooks_url" + stared: "stared" + tags_url: "tags_url" + private: "private" + internal: "internal" + contributors_url: "contributors_url" + notifications_url: "notifications_url" + open_issues_count: 6 + description: "description" + created_at: "created_at" + recommend: "recommend" + keys_url: "keys_url" + has_wiki: "has_wiki" + public: "public" + updated_at: "updated_at" + paas: "paas" + comments_url: "comments_url" + stargazers_url: "stargazers_url" + owner: "owner" + commits_url: "commits_url" + blobs_url: "blobs_url" + permission: "permission" + has_issues: "has_issues" + url: "url" + milestones_url: "milestones_url" + fork: "fork" + issues_url: "issues_url" + has_page: "has_page" + namespace: "{}" + watchers_count: "watchers_count" + homepage: "homepage" + forks_count: "forks_count" + Contributor: + type: "object" + properties: + email: + type: "string" + name: + type: "string" + contributions: + type: "string" + description: "获取仓库贡献者" + example: + contributions: "contributions" + name: "name" + email: "email" + Tag: + type: "object" + properties: + name: + type: "string" + commit: + type: "string" + description: "列出仓库所有的tags" + example: + name: "name" + commit: "commit" + ProjectMember: + type: "object" + properties: + id: + type: "integer" + format: "int32" + login: + type: "string" + name: + type: "string" + avatar_url: + type: "string" + url: + type: "string" + html_url: + type: "string" + followers_url: + type: "string" + following_url: + type: "string" + gists_url: + type: "string" + starred_url: + type: "string" + subscriptions_url: + type: "string" + organizations_url: + type: "string" + repos_url: + type: "string" + events_url: + type: "string" + received_events_url: + type: "string" + type: + type: "string" + site_admin: + type: "string" + permissions: + type: "string" + description: "添加仓库成员" + example: + gists_url: "gists_url" + repos_url: "repos_url" + following_url: "following_url" + starred_url: "starred_url" + login: "login" + followers_url: "followers_url" + type: "type" + url: "url" + subscriptions_url: "subscriptions_url" + received_events_url: "received_events_url" + avatar_url: "avatar_url" + events_url: "events_url" + permissions: "permissions" + html_url: "html_url" + name: "name" + site_admin: "site_admin" + id: 0 + organizations_url: "organizations_url" + ProjectMemberPermission: + type: "object" + properties: + id: + type: "integer" + format: "int32" + login: + type: "string" + name: + type: "string" + avatar_url: + type: "string" + url: + type: "string" + html_url: + type: "string" + followers_url: + type: "string" + following_url: + type: "string" + gists_url: + type: "string" + starred_url: + type: "string" + subscriptions_url: + type: "string" + organizations_url: + type: "string" + repos_url: + type: "string" + events_url: + type: "string" + received_events_url: + type: "string" + type: + type: "string" + site_admin: + type: "string" + permission: + type: "string" + description: "查看仓库成员的权限" + example: + gists_url: "gists_url" + repos_url: "repos_url" + following_url: "following_url" + starred_url: "starred_url" + permission: "permission" + login: "login" + followers_url: "followers_url" + type: "type" + url: "url" + subscriptions_url: "subscriptions_url" + received_events_url: "received_events_url" + avatar_url: "avatar_url" + events_url: "events_url" + html_url: "html_url" + name: "name" + site_admin: "site_admin" + id: 0 + organizations_url: "organizations_url" + PullRequest: + type: "object" + properties: + id: + type: "string" + url: + type: "string" + html_url: + type: "string" + diff_url: + type: "string" + patch_url: + type: "string" + issue_url: + type: "string" + commits_url: + type: "string" + review_comments_url: + type: "string" + review_comment_url: + type: "string" + comments_url: + type: "string" + statuses_url: + type: "string" + number: + type: "string" + state: + type: "string" + title: + type: "string" + body: + type: "string" + body_html: + type: "string" + assignees: + type: "array" + items: + type: "string" + testers: + type: "array" + items: + type: "string" + milestone: + $ref: "#/definitions/Milestone" + labels: + $ref: "#/definitions/Label" + locked: + type: "string" + created_at: + type: "string" + updated_at: + type: "string" + closed_at: + type: "string" + merged_at: + type: "string" + mergeable: + type: "string" + head: + type: "string" + base: + type: "string" + _links: + type: "string" + user: + type: "string" + description: "取消用户测试 Pull Request" + example: + issue_url: "issue_url" + body_html: "body_html" + _links: "_links" + diff_url: "diff_url" + assignees: + - "assignees" + - "assignees" + created_at: "created_at" + title: "title" + body: "body" + head: "head" + number: "number" + mergeable: "mergeable" + patch_url: "patch_url" + updated_at: "updated_at" + comments_url: "comments_url" + review_comment_url: "review_comment_url" + id: "id" + state: "state" + locked: "locked" + commits_url: "commits_url" + testers: + - "testers" + - "testers" + closed_at: "closed_at" + statuses_url: "statuses_url" + merged_at: "merged_at" + url: "url" + labels: + color: "color" + name: "name" + repository_id: 1 + id: 6 + url: "url" + milestone: + number: 5 + updated_at: "2000-01-23T04:56:07.000+00:00" + html_url: "html_url" + description: "description" + created_at: "2000-01-23T04:56:07.000+00:00" + repository_id: 2 + state: "state" + title: "title" + open_issues: 7 + closed_issues: 9 + url: "url" + due_on: "2000-01-23T04:56:07.000+00:00" + html_url: "html_url" + review_comments_url: "review_comments_url" + user: "user" + base: "base" + PullRequestComments: + type: "object" + properties: + url: + type: "string" + id: + type: "string" + path: + type: "string" + position: + type: "string" + original_position: + type: "string" + commit_id: + type: "string" + original_commit_id: + type: "string" + user: + type: "string" + body: + type: "string" + created_at: + type: "string" + updated_at: + type: "string" + html_url: + type: "string" + pull_request_url: + type: "string" + _links: + type: "string" + description: "编辑评论" + example: + original_commit_id: "original_commit_id" + _links: "_links" + created_at: "created_at" + pull_request_url: "pull_request_url" + body: "body" + url: "url" + path: "path" + original_position: "original_position" + updated_at: "updated_at" + html_url: "html_url" + id: "id" + position: "position" + commit_id: "commit_id" + user: "user" + PullRequestCommits: + type: "object" + properties: + url: + type: "string" + sha: + type: "string" + html_url: + type: "string" + comments_url: + type: "string" + commit: + type: "string" + author: + type: "string" + committer: + type: "string" + parents: + type: "string" + description: "获取某Pull Request的所有Commit信息。最多显示250条Commit" + example: + committer: "committer" + author: "author" + html_url: "html_url" + comments_url: "comments_url" + commit: "commit" + sha: "sha" + url: "url" + parents: "parents" + PullRequestFiles: + type: "object" + properties: + sha: + type: "string" + filename: + type: "string" + status: + type: "string" + additions: + type: "string" + deletions: + type: "string" + blob_url: + type: "string" + raw_url: + type: "string" + patch: + type: "string" + description: "Pull Request Commit文件列表。最多显示300条diff" + example: + patch: "patch" + filename: "filename" + additions: "additions" + deletions: "deletions" + sha: "sha" + blob_url: "blob_url" + raw_url: "raw_url" + status: "status" + Release: + type: "object" + properties: + id: + type: "integer" + format: "int32" + tag_name: + type: "string" + target_commitish: + type: "string" + prerelease: + type: "string" + name: + type: "string" + body: + type: "string" + author: + type: "string" + created_at: + type: "string" + format: "date-time" + assets: + type: "string" + description: "更新仓库Release" + example: + assets: "assets" + tag_name: "tag_name" + prerelease: "prerelease" + author: "author" + target_commitish: "target_commitish" + name: "name" + created_at: "2000-01-23T04:56:07.000+00:00" + id: 0 + body: "body" + Hook: + type: "object" + properties: + id: + type: "string" + url: + type: "string" + created_at: + type: "string" + password: + type: "string" + project_id: + type: "string" + result: + type: "string" + result_code: + type: "string" + push_events: + type: "string" + tag_push_events: + type: "string" + issues_events: + type: "string" + note_events: + type: "string" + merge_requests_events: + type: "string" + description: "更新一个仓库WebHook" + example: + result: "result" + push_events: "push_events" + tag_push_events: "tag_push_events" + password: "password" + project_id: "project_id" + issues_events: "issues_events" + created_at: "created_at" + result_code: "result_code" + merge_requests_events: "merge_requests_events" + id: "id" + note_events: "note_events" + url: "url" + Event: + type: "object" + properties: + id: + type: "integer" + format: "int32" + type: + type: "string" + actor: + type: "string" + repo: + type: "string" + org: + type: "string" + public: + type: "string" + created_at: + type: "string" + payload: + type: "object" + description: "不同类型动态的内容" + properties: {} + description: "列出仓库的所有公开动态" + example: + actor: "actor" + public: "public" + org: "org" + payload: "{}" + repo: "repo" + created_at: "created_at" + id: 0 + type: "type" + UserNotificationList: + type: "object" + properties: + total_count: + type: "integer" + format: "int32" + list: + type: "array" + description: "通知列表" + items: + $ref: "#/definitions/UserNotification" + description: "列出授权用户的所有通知" + example: + total_count: 0 + list: + - actor: + gists_url: "gists_url" + repos_url: "repos_url" + following_url: "following_url" + starred_url: "starred_url" + login: "login" + followers_url: "followers_url" + type: "type" + url: "url" + subscriptions_url: "subscriptions_url" + received_events_url: "received_events_url" + avatar_url: "avatar_url" + events_url: "events_url" + html_url: "html_url" + name: "name" + site_admin: "site_admin" + id: 5 + organizations_url: "organizations_url" + updated_at: "updated_at" + unread: "unread" + subject: + latest_comment_url: "latest_comment_url" + title: "title" + type: "type" + url: "url" + html_url: "html_url" + mute: "mute" + id: 6 + type: "type" + repository: + owner: "owner" + human_name: "human_name" + private: "private" + internal: "internal" + ssh_url: "ssh_url" + description: "description" + url: "url" + path: "path" + fork: "fork" + full_name: "full_name" + public: "public" + html_url: "html_url" + namespace: "{}" + name: "name" + id: 1 + content: "content" + url: "url" + namespaces: + - html_url: "html_url" + name: "name" + type: "type" + - html_url: "html_url" + name: "name" + type: "type" + - actor: + gists_url: "gists_url" + repos_url: "repos_url" + following_url: "following_url" + starred_url: "starred_url" + login: "login" + followers_url: "followers_url" + type: "type" + url: "url" + subscriptions_url: "subscriptions_url" + received_events_url: "received_events_url" + avatar_url: "avatar_url" + events_url: "events_url" + html_url: "html_url" + name: "name" + site_admin: "site_admin" + id: 5 + organizations_url: "organizations_url" + updated_at: "updated_at" + unread: "unread" + subject: + latest_comment_url: "latest_comment_url" + title: "title" + type: "type" + url: "url" + html_url: "html_url" + mute: "mute" + id: 6 + type: "type" + repository: + owner: "owner" + human_name: "human_name" + private: "private" + internal: "internal" + ssh_url: "ssh_url" + description: "description" + url: "url" + path: "path" + fork: "fork" + full_name: "full_name" + public: "public" + html_url: "html_url" + namespace: "{}" + name: "name" + id: 1 + content: "content" + url: "url" + namespaces: + - html_url: "html_url" + name: "name" + type: "type" + - html_url: "html_url" + name: "name" + type: "type" + UserNotification: + type: "object" + properties: + id: + type: "integer" + format: "int32" + content: + type: "string" + type: + type: "string" + unread: + type: "string" + mute: + type: "string" + updated_at: + type: "string" + url: + type: "string" + html_url: + type: "string" + actor: + description: "通知发送者" + $ref: "#/definitions/UserBasic" + repository: + $ref: "#/definitions/ProjectBasic" + subject: + description: "通知直接关联对象" + $ref: "#/definitions/UserNotificationSubject" + namespaces: + type: "array" + description: "通知次级关联对象" + items: + $ref: "#/definitions/UserNotificationNamespace" + description: "获取一条通知" + example: + actor: + gists_url: "gists_url" + repos_url: "repos_url" + following_url: "following_url" + starred_url: "starred_url" + login: "login" + followers_url: "followers_url" + type: "type" + url: "url" + subscriptions_url: "subscriptions_url" + received_events_url: "received_events_url" + avatar_url: "avatar_url" + events_url: "events_url" + html_url: "html_url" + name: "name" + site_admin: "site_admin" + id: 5 + organizations_url: "organizations_url" + updated_at: "updated_at" + unread: "unread" + subject: + latest_comment_url: "latest_comment_url" + title: "title" + type: "type" + url: "url" + html_url: "html_url" + mute: "mute" + id: 6 + type: "type" + repository: + owner: "owner" + human_name: "human_name" + private: "private" + internal: "internal" + ssh_url: "ssh_url" + description: "description" + url: "url" + path: "path" + fork: "fork" + full_name: "full_name" + public: "public" + html_url: "html_url" + namespace: "{}" + name: "name" + id: 1 + content: "content" + url: "url" + namespaces: + - html_url: "html_url" + name: "name" + type: "type" + - html_url: "html_url" + name: "name" + type: "type" + ProjectBasic: + type: "object" + properties: + id: + type: "integer" + format: "int32" + full_name: + type: "string" + human_name: + type: "string" + url: + type: "string" + namespace: + type: "object" + properties: {} + path: + type: "string" + name: + type: "string" + owner: + type: "string" + description: + type: "string" + private: + type: "string" + public: + type: "string" + internal: + type: "string" + fork: + type: "string" + html_url: + type: "string" + ssh_url: + type: "string" + example: + owner: "owner" + human_name: "human_name" + private: "private" + internal: "internal" + ssh_url: "ssh_url" + description: "description" + url: "url" + path: "path" + fork: "fork" + full_name: "full_name" + public: "public" + html_url: "html_url" + namespace: "{}" + name: "name" + id: 1 + UserNotificationSubject: + type: "object" + properties: + title: + type: "string" + url: + type: "string" + latest_comment_url: + type: "string" + type: + type: "string" + example: + latest_comment_url: "latest_comment_url" + title: "title" + type: "type" + url: "url" + UserNotificationNamespace: + type: "object" + properties: + name: + type: "string" + html_url: + type: "string" + type: + type: "string" + example: + html_url: "html_url" + name: "name" + type: "type" + Group: + type: "object" + properties: + id: + type: "integer" + format: "int32" + login: + type: "string" + url: + type: "string" + avatar_url: + type: "string" + repos_url: + type: "string" + events_url: + type: "string" + members_url: + type: "string" + description: + type: "string" + description: "获取一个组织" + example: + avatar_url: "avatar_url" + repos_url: "repos_url" + events_url: "events_url" + members_url: "members_url" + description: "description" + id: 0 + login: "login" + url: "url" + User: + type: "object" + properties: + id: + type: "integer" + format: "int32" + login: + type: "string" + name: + type: "string" + avatar_url: + type: "string" + url: + type: "string" + html_url: + type: "string" + followers_url: + type: "string" + following_url: + type: "string" + gists_url: + type: "string" + starred_url: + type: "string" + subscriptions_url: + type: "string" + organizations_url: + type: "string" + repos_url: + type: "string" + events_url: + type: "string" + received_events_url: + type: "string" + type: + type: "string" + site_admin: + type: "string" + blog: + type: "string" + weibo: + type: "string" + bio: + type: "string" + public_repos: + type: "string" + public_gists: + type: "string" + followers: + type: "string" + following: + type: "string" + stared: + type: "string" + watched: + type: "string" + created_at: + type: "string" + updated_at: + type: "string" + description: "搜索用户" + example: + gists_url: "gists_url" + repos_url: "repos_url" + following_url: "following_url" + bio: "bio" + created_at: "created_at" + login: "login" + type: "type" + blog: "blog" + subscriptions_url: "subscriptions_url" + weibo: "weibo" + updated_at: "updated_at" + site_admin: "site_admin" + id: 0 + public_repos: "public_repos" + organizations_url: "organizations_url" + starred_url: "starred_url" + followers_url: "followers_url" + public_gists: "public_gists" + url: "url" + received_events_url: "received_events_url" + watched: "watched" + followers: "followers" + avatar_url: "avatar_url" + events_url: "events_url" + html_url: "html_url" + following: "following" + name: "name" + stared: "stared" + Namespace: + type: "object" + properties: + id: + type: "integer" + format: "int32" + type: + type: "string" + name: + type: "string" + path: + type: "string" + html_url: + type: "string" + parent: + $ref: "#/definitions/NamespaceMini" + description: "获取授权用户的一个 Namespace" + example: + path: "path" + parent: + path: "path" + html_url: "html_url" + name: "name" + id: 6 + type: "type" + html_url: "html_url" + name: "name" + id: 0 + type: "type" + NamespaceMini: + type: "object" + properties: + id: + type: "integer" + format: "int32" + type: + type: "string" + name: + type: "string" + path: + type: "string" + html_url: + type: "string" + example: + path: "path" + html_url: "html_url" + name: "name" + id: 6 + type: "type" + EnterpriseBasic: + type: "object" + properties: + id: + type: "integer" + format: "int32" + path: + type: "string" + name: + type: "string" + url: + type: "string" + avatar_url: + type: "string" + description: "获取一个企业" + example: + path: "path" + avatar_url: "avatar_url" + name: "name" + id: 0 + url: "url" + GroupMember: + type: "object" + properties: + url: + type: "string" + active: + type: "string" + remark: + type: "string" + role: + type: "string" + organization_url: + type: "string" + organization: + $ref: "#/definitions/Group" + user: + type: "string" + description: "增加或更新授权用户所管理组织的成员" + example: + organization_url: "organization_url" + role: "role" + organization: + avatar_url: "avatar_url" + repos_url: "repos_url" + events_url: "events_url" + members_url: "members_url" + description: "description" + id: 0 + login: "login" + url: "url" + active: "active" + remark: "remark" + user: "user" + url: "url" + Code: + type: "object" + properties: + url: + type: "string" + forks_url: + type: "string" + commits_url: + type: "string" + id: + type: "string" + description: + type: "string" + public: + type: "string" + owner: + type: "string" + user: + type: "string" + files: + type: "string" + truncated: + type: "string" + html_url: + type: "string" + comments: + type: "string" + comments_url: + type: "string" + git_pull_url: + type: "string" + git_push_url: + type: "string" + created_at: + type: "string" + updated_at: + type: "string" + description: "搜索代码片段" + example: + owner: "owner" + commits_url: "commits_url" + comments: "comments" + forks_url: "forks_url" + git_push_url: "git_push_url" + description: "description" + truncated: "truncated" + created_at: "created_at" + url: "url" + public: "public" + updated_at: "updated_at" + html_url: "html_url" + comments_url: "comments_url" + git_pull_url: "git_pull_url" + files: "files" + id: "id" + user: "user" + CodeForksHistory: + type: "object" + properties: + url: + type: "string" + forks_url: + type: "string" + commits_url: + type: "string" + id: + type: "string" + description: + type: "string" + public: + type: "string" + owner: + type: "string" + user: + type: "string" + files: + type: "string" + truncated: + type: "string" + html_url: + type: "string" + comments: + type: "string" + comments_url: + type: "string" + git_pull_url: + type: "string" + git_push_url: + type: "string" + created_at: + type: "string" + updated_at: + type: "string" + forks: + type: "string" + history: + type: "string" + description: "获取代码片段的commit" + example: + owner: "owner" + forks: "forks" + commits_url: "commits_url" + comments: "comments" + forks_url: "forks_url" + git_push_url: "git_push_url" + description: "description" + truncated: "truncated" + created_at: "created_at" + history: "history" + url: "url" + public: "public" + updated_at: "updated_at" + html_url: "html_url" + comments_url: "comments_url" + git_pull_url: "git_pull_url" + files: "files" + id: "id" + user: "user" + CodeComment: + type: "object" + properties: + id: + type: "string" + body: + type: "string" + created_at: + type: "string" + updated_at: + type: "string" + description: "修改代码片段的评论" + example: + updated_at: "updated_at" + created_at: "created_at" + id: "id" + body: "body" + CodeForks: + type: "object" + properties: + user: + type: "string" + url: + type: "string" + id: + type: "string" + created_at: + type: "string" + updated_at: + type: "string" + description: "获取 Fork 了指定代码片段的列表" + example: + updated_at: "updated_at" + created_at: "created_at" + id: "id" + user: "user" + url: "url" + GroupDetail: + type: "object" + properties: + id: + type: "integer" + format: "int32" + login: + type: "string" + url: + type: "string" + avatar_url: + type: "string" + repos_url: + type: "string" + events_url: + type: "string" + members_url: + type: "string" + description: + type: "string" + name: + type: "string" + created_at: + type: "string" + type: + type: "string" + location: + type: "string" + email: + type: "string" + html_url: + type: "string" + public: + type: "string" + enterprise: + type: "string" + members: + type: "string" + public_repos: + type: "string" + private_repos: + type: "string" + owner: + type: "string" + description: "更新授权用户所管理的组织资料" + example: + owner: "owner" + repos_url: "repos_url" + members_url: "members_url" + enterprise: "enterprise" + description: "description" + created_at: "created_at" + login: "login" + type: "type" + url: "url" + private_repos: "private_repos" + avatar_url: "avatar_url" + public: "public" + events_url: "events_url" + html_url: "html_url" + members: "members" + name: "name" + location: "location" + id: 0 + public_repos: "public_repos" + email: "email" + EnterpriseMember: + type: "object" + properties: + url: + type: "string" + active: + type: "string" + remark: + type: "string" + role: + type: "string" + outsourced: + type: "string" + enterprise: + $ref: "#/definitions/EnterpriseBasic" + user: + type: "string" + description: "修改企业成员权限或备注" + example: + role: "role" + enterprise: + path: "path" + avatar_url: "avatar_url" + name: "name" + id: 0 + url: "url" + outsourced: "outsourced" + active: "active" + remark: "remark" + user: "user" + url: "url" + WeekReport: + type: "object" + properties: + id: + type: "integer" + format: "int32" + content: + type: "string" + content_html: + type: "string" + year: + type: "string" + month: + type: "string" + week_index: + type: "string" + week_begin: + type: "string" + week_end: + type: "string" + created_at: + type: "string" + updated_at: + type: "string" + user: + $ref: "#/definitions/UserMini" + description: "新建周报" + example: + month: "month" + updated_at: "updated_at" + year: "year" + created_at: "created_at" + id: 0 + week_index: "week_index" + week_begin: "week_begin" + week_end: "week_end" + user: + avatar_url: "avatar_url" + html_url: "html_url" + name: "name" + id: 6 + login: "login" + url: "url" + content: "content" + content_html: "content_html" + UserMini: + type: "object" + properties: + id: + type: "integer" + format: "int32" + login: + type: "string" + name: + type: "string" + avatar_url: + type: "string" + url: + type: "string" + html_url: + type: "string" + example: + avatar_url: "avatar_url" + html_url: "html_url" + name: "name" + id: 6 + login: "login" + url: "url" + UserNotificationCount: + type: "object" + properties: + total_count: + type: "integer" + format: "int32" + description: "通知总数" + notification_count: + type: "integer" + format: "int32" + description: "通知数量" + message_count: + type: "integer" + format: "int32" + description: "私信数量" + description: "获取授权用户的通知数" + example: + total_count: 0 + notification_count: 6 + message_count: 1 + UserMessageList: + type: "object" + properties: + total_count: + type: "integer" + format: "int32" + list: + type: "array" + description: "私信列表" + items: + $ref: "#/definitions/UserMessage" + description: "列出授权用户的所有私信" + example: + total_count: 0 + list: + - updated_at: "updated_at" + sender: + gists_url: "gists_url" + repos_url: "repos_url" + following_url: "following_url" + starred_url: "starred_url" + login: "login" + followers_url: "followers_url" + type: "type" + url: "url" + subscriptions_url: "subscriptions_url" + received_events_url: "received_events_url" + avatar_url: "avatar_url" + events_url: "events_url" + html_url: "html_url" + name: "name" + site_admin: "site_admin" + id: 5 + organizations_url: "organizations_url" + unread: "unread" + html_url: "html_url" + id: 6 + content: "content" + url: "url" + - updated_at: "updated_at" + sender: + gists_url: "gists_url" + repos_url: "repos_url" + following_url: "following_url" + starred_url: "starred_url" + login: "login" + followers_url: "followers_url" + type: "type" + url: "url" + subscriptions_url: "subscriptions_url" + received_events_url: "received_events_url" + avatar_url: "avatar_url" + events_url: "events_url" + html_url: "html_url" + name: "name" + site_admin: "site_admin" + id: 5 + organizations_url: "organizations_url" + unread: "unread" + html_url: "html_url" + id: 6 + content: "content" + url: "url" + UserMessage: + type: "object" + properties: + id: + type: "integer" + format: "int32" + sender: + description: "发送者" + $ref: "#/definitions/UserBasic" + unread: + type: "string" + content: + type: "string" + updated_at: + type: "string" + url: + type: "string" + html_url: + type: "string" + description: "获取一条私信" + example: + updated_at: "updated_at" + sender: + gists_url: "gists_url" + repos_url: "repos_url" + following_url: "following_url" + starred_url: "starred_url" + login: "login" + followers_url: "followers_url" + type: "type" + url: "url" + subscriptions_url: "subscriptions_url" + received_events_url: "received_events_url" + avatar_url: "avatar_url" + events_url: "events_url" + html_url: "html_url" + name: "name" + site_admin: "site_admin" + id: 5 + organizations_url: "organizations_url" + unread: "unread" + html_url: "html_url" + id: 6 + content: "content" + url: "url" diff --git a/api_activity.go b/api_activity.go new file mode 100644 index 0000000..8165b90 --- /dev/null +++ b/api_activity.go @@ -0,0 +1,3430 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type ActivityApiService service + +/* +ActivityApiService 取消 star 一个仓库 +取消 star 一个仓库 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *DeleteV5UserStarredOwnerRepoOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type DeleteV5UserStarredOwnerRepoOpts struct { + AccessToken optional.String +} + +func (a *ActivityApiService) DeleteV5UserStarredOwnerRepo(ctx context.Context, owner string, repo string, localVarOptionals *DeleteV5UserStarredOwnerRepoOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/user/starred/{owner}/{repo}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +ActivityApiService 取消 watch 一个仓库 +取消 watch 一个仓库 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *DeleteV5UserSubscriptionsOwnerRepoOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type DeleteV5UserSubscriptionsOwnerRepoOpts struct { + AccessToken optional.String +} + +func (a *ActivityApiService) DeleteV5UserSubscriptionsOwnerRepo(ctx context.Context, owner string, repo string, localVarOptionals *DeleteV5UserSubscriptionsOwnerRepoOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/user/subscriptions/{owner}/{repo}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +ActivityApiService 获取站内所有公开动态 +获取站内所有公开动态 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *GetV5EventsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []Event +*/ + +type GetV5EventsOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *ActivityApiService) GetV5Events(ctx context.Context, localVarOptionals *GetV5EventsOpts) ([]Event, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Event + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/events" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Event + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ActivityApiService 列出仓库的所有公开动态 +列出仓库的所有公开动态 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *GetV5NetworksOwnerRepoEventsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []Event +*/ + +type GetV5NetworksOwnerRepoEventsOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *ActivityApiService) GetV5NetworksOwnerRepoEvents(ctx context.Context, owner string, repo string, localVarOptionals *GetV5NetworksOwnerRepoEventsOpts) ([]Event, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Event + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/networks/{owner}/{repo}/events" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Event + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ActivityApiService 获取授权用户的通知数 +获取授权用户的通知数 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *GetV5NotificationsCountOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Unread" (optional.Bool) - 是否只获取未读消息,默认:否 + +@return UserNotificationCount +*/ + +type GetV5NotificationsCountOpts struct { + AccessToken optional.String + Unread optional.Bool +} + +func (a *ActivityApiService) GetV5NotificationsCount(ctx context.Context, localVarOptionals *GetV5NotificationsCountOpts) (UserNotificationCount, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue UserNotificationCount + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/notifications/count" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Unread.IsSet() { + localVarQueryParams.Add("unread", parameterToString(localVarOptionals.Unread.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v UserNotificationCount + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ActivityApiService 列出授权用户的所有私信 +列出授权用户的所有私信 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *GetV5NotificationsMessagesOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Unread" (optional.Bool) - 是否只显示未读私信,默认:否 + * @param "Since" (optional.String) - 只获取在给定时间后更新的私信,要求时间格式为 ISO 8601 + * @param "Before" (optional.String) - 只获取在给定时间前更新的私信,要求时间格式为 ISO 8601 + * @param "Ids" (optional.String) - 指定一组私信 ID,以 , 分隔 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []UserMessageList +*/ + +type GetV5NotificationsMessagesOpts struct { + AccessToken optional.String + Unread optional.Bool + Since optional.String + Before optional.String + Ids optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *ActivityApiService) GetV5NotificationsMessages(ctx context.Context, localVarOptionals *GetV5NotificationsMessagesOpts) ([]UserMessageList, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []UserMessageList + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/notifications/messages" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Unread.IsSet() { + localVarQueryParams.Add("unread", parameterToString(localVarOptionals.Unread.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Since.IsSet() { + localVarQueryParams.Add("since", parameterToString(localVarOptionals.Since.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Before.IsSet() { + localVarQueryParams.Add("before", parameterToString(localVarOptionals.Before.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Ids.IsSet() { + localVarQueryParams.Add("ids", parameterToString(localVarOptionals.Ids.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []UserMessageList + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ActivityApiService 获取一条私信 +获取一条私信 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id 私信的 ID + * @param optional nil or *GetV5NotificationsMessagesIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return UserMessage +*/ + +type GetV5NotificationsMessagesIdOpts struct { + AccessToken optional.String +} + +func (a *ActivityApiService) GetV5NotificationsMessagesId(ctx context.Context, id string, localVarOptionals *GetV5NotificationsMessagesIdOpts) (UserMessage, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue UserMessage + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/notifications/messages/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v UserMessage + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ActivityApiService 列出授权用户的所有通知 +列出授权用户的所有通知 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *GetV5NotificationsThreadsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Unread" (optional.Bool) - 是否只获取未读消息,默认:否 + * @param "Participating" (optional.Bool) - 是否只获取自己直接参与的消息,默认:否 + * @param "Type_" (optional.String) - 筛选指定类型的通知,all:所有,event:事件通知,referer:@ 通知 + * @param "Since" (optional.String) - 只获取在给定时间后更新的消息,要求时间格式为 ISO 8601 + * @param "Before" (optional.String) - 只获取在给定时间前更新的消息,要求时间格式为 ISO 8601 + * @param "Ids" (optional.String) - 指定一组通知 ID,以 , 分隔 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []UserNotificationList +*/ + +type GetV5NotificationsThreadsOpts struct { + AccessToken optional.String + Unread optional.Bool + Participating optional.Bool + Type_ optional.String + Since optional.String + Before optional.String + Ids optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *ActivityApiService) GetV5NotificationsThreads(ctx context.Context, localVarOptionals *GetV5NotificationsThreadsOpts) ([]UserNotificationList, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []UserNotificationList + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/notifications/threads" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Unread.IsSet() { + localVarQueryParams.Add("unread", parameterToString(localVarOptionals.Unread.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Participating.IsSet() { + localVarQueryParams.Add("participating", parameterToString(localVarOptionals.Participating.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Type_.IsSet() { + localVarQueryParams.Add("type", parameterToString(localVarOptionals.Type_.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Since.IsSet() { + localVarQueryParams.Add("since", parameterToString(localVarOptionals.Since.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Before.IsSet() { + localVarQueryParams.Add("before", parameterToString(localVarOptionals.Before.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Ids.IsSet() { + localVarQueryParams.Add("ids", parameterToString(localVarOptionals.Ids.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []UserNotificationList + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ActivityApiService 获取一条通知 +获取一条通知 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id 通知的 ID + * @param optional nil or *GetV5NotificationsThreadsIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return UserNotification +*/ + +type GetV5NotificationsThreadsIdOpts struct { + AccessToken optional.String +} + +func (a *ActivityApiService) GetV5NotificationsThreadsId(ctx context.Context, id string, localVarOptionals *GetV5NotificationsThreadsIdOpts) (UserNotification, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue UserNotification + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/notifications/threads/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v UserNotification + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ActivityApiService 列出组织的公开动态 +列出组织的公开动态 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param org 组织的路径(path/login) + * @param optional nil or *GetV5OrgsOrgEventsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []Event +*/ + +type GetV5OrgsOrgEventsOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *ActivityApiService) GetV5OrgsOrgEvents(ctx context.Context, org string, localVarOptionals *GetV5OrgsOrgEventsOpts) ([]Event, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Event + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/orgs/{org}/events" + localVarPath = strings.Replace(localVarPath, "{"+"org"+"}", fmt.Sprintf("%v", org), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Event + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ActivityApiService 列出仓库的所有动态 +列出仓库的所有动态 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *GetV5ReposOwnerRepoEventsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []Event +*/ + +type GetV5ReposOwnerRepoEventsOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *ActivityApiService) GetV5ReposOwnerRepoEvents(ctx context.Context, owner string, repo string, localVarOptionals *GetV5ReposOwnerRepoEventsOpts) ([]Event, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Event + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/events" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Event + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ActivityApiService 列出一个仓库里的通知 +列出一个仓库里的通知 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *GetV5ReposOwnerRepoNotificationsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Unread" (optional.Bool) - 是否只获取未读消息,默认:否 + * @param "Participating" (optional.Bool) - 是否只获取自己直接参与的消息,默认:否 + * @param "Type_" (optional.String) - 筛选指定类型的通知,all:所有,event:事件通知,referer:@ 通知 + * @param "Since" (optional.String) - 只获取在给定时间后更新的消息,要求时间格式为 ISO 8601 + * @param "Before" (optional.String) - 只获取在给定时间前更新的消息,要求时间格式为 ISO 8601 + * @param "Ids" (optional.String) - 指定一组通知 ID,以 , 分隔 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []UserNotificationList +*/ + +type GetV5ReposOwnerRepoNotificationsOpts struct { + AccessToken optional.String + Unread optional.Bool + Participating optional.Bool + Type_ optional.String + Since optional.String + Before optional.String + Ids optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *ActivityApiService) GetV5ReposOwnerRepoNotifications(ctx context.Context, owner string, repo string, localVarOptionals *GetV5ReposOwnerRepoNotificationsOpts) ([]UserNotificationList, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []UserNotificationList + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/notifications" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Unread.IsSet() { + localVarQueryParams.Add("unread", parameterToString(localVarOptionals.Unread.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Participating.IsSet() { + localVarQueryParams.Add("participating", parameterToString(localVarOptionals.Participating.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Type_.IsSet() { + localVarQueryParams.Add("type", parameterToString(localVarOptionals.Type_.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Since.IsSet() { + localVarQueryParams.Add("since", parameterToString(localVarOptionals.Since.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Before.IsSet() { + localVarQueryParams.Add("before", parameterToString(localVarOptionals.Before.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Ids.IsSet() { + localVarQueryParams.Add("ids", parameterToString(localVarOptionals.Ids.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []UserNotificationList + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ActivityApiService 列出 star 了仓库的用户 +列出 star 了仓库的用户 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *GetV5ReposOwnerRepoStargazersOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []UserBasic +*/ + +type GetV5ReposOwnerRepoStargazersOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *ActivityApiService) GetV5ReposOwnerRepoStargazers(ctx context.Context, owner string, repo string, localVarOptionals *GetV5ReposOwnerRepoStargazersOpts) ([]UserBasic, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []UserBasic + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/stargazers" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []UserBasic + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ActivityApiService 列出 watch 了仓库的用户 +列出 watch 了仓库的用户 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *GetV5ReposOwnerRepoSubscribersOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []UserBasic +*/ + +type GetV5ReposOwnerRepoSubscribersOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *ActivityApiService) GetV5ReposOwnerRepoSubscribers(ctx context.Context, owner string, repo string, localVarOptionals *GetV5ReposOwnerRepoSubscribersOpts) ([]UserBasic, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []UserBasic + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/subscribers" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []UserBasic + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ActivityApiService 列出授权用户 star 了的仓库 +列出授权用户 star 了的仓库 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *GetV5UserStarredOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Sort" (optional.String) - 根据仓库创建时间(created)或最后推送时间(updated)进行排序,默认:创建时间 + * @param "Direction" (optional.String) - 按递增(asc)或递减(desc)排序,默认:递减 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []Project +*/ + +type GetV5UserStarredOpts struct { + AccessToken optional.String + Sort optional.String + Direction optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *ActivityApiService) GetV5UserStarred(ctx context.Context, localVarOptionals *GetV5UserStarredOpts) ([]Project, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Project + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/user/starred" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Direction.IsSet() { + localVarQueryParams.Add("direction", parameterToString(localVarOptionals.Direction.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Project + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ActivityApiService 检查授权用户是否 star 了一个仓库 +检查授权用户是否 star 了一个仓库 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *GetV5UserStarredOwnerRepoOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type GetV5UserStarredOwnerRepoOpts struct { + AccessToken optional.String +} + +func (a *ActivityApiService) GetV5UserStarredOwnerRepo(ctx context.Context, owner string, repo string, localVarOptionals *GetV5UserStarredOwnerRepoOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/user/starred/{owner}/{repo}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +ActivityApiService 列出授权用户 watch 了的仓库 +列出授权用户 watch 了的仓库 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *GetV5UserSubscriptionsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Sort" (optional.String) - 根据仓库创建时间(created)或最后推送时间(updated)进行排序,默认:创建时间 + * @param "Direction" (optional.String) - 按递增(asc)或递减(desc)排序,默认:递减 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []Project +*/ + +type GetV5UserSubscriptionsOpts struct { + AccessToken optional.String + Sort optional.String + Direction optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *ActivityApiService) GetV5UserSubscriptions(ctx context.Context, localVarOptionals *GetV5UserSubscriptionsOpts) ([]Project, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Project + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/user/subscriptions" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Direction.IsSet() { + localVarQueryParams.Add("direction", parameterToString(localVarOptionals.Direction.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Project + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ActivityApiService 检查授权用户是否 watch 了一个仓库 +检查授权用户是否 watch 了一个仓库 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *GetV5UserSubscriptionsOwnerRepoOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type GetV5UserSubscriptionsOwnerRepoOpts struct { + AccessToken optional.String +} + +func (a *ActivityApiService) GetV5UserSubscriptionsOwnerRepo(ctx context.Context, owner string, repo string, localVarOptionals *GetV5UserSubscriptionsOwnerRepoOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/user/subscriptions/{owner}/{repo}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +ActivityApiService 列出用户的动态 +列出用户的动态 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param username 用户名(username/login) + * @param optional nil or *GetV5UsersUsernameEventsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []Event +*/ + +type GetV5UsersUsernameEventsOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *ActivityApiService) GetV5UsersUsernameEvents(ctx context.Context, username string, localVarOptionals *GetV5UsersUsernameEventsOpts) ([]Event, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Event + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/users/{username}/events" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Event + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ActivityApiService 列出用户所属组织的动态 +列出用户所属组织的动态 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param username 用户名(username/login) + * @param org 组织的路径(path/login) + * @param optional nil or *GetV5UsersUsernameEventsOrgsOrgOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []Event +*/ + +type GetV5UsersUsernameEventsOrgsOrgOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *ActivityApiService) GetV5UsersUsernameEventsOrgsOrg(ctx context.Context, username string, org string, localVarOptionals *GetV5UsersUsernameEventsOrgsOrgOpts) ([]Event, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Event + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/users/{username}/events/orgs/{org}" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + localVarPath = strings.Replace(localVarPath, "{"+"org"+"}", fmt.Sprintf("%v", org), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Event + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ActivityApiService 列出用户的公开动态 +列出用户的公开动态 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param username 用户名(username/login) + * @param optional nil or *GetV5UsersUsernameEventsPublicOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []Event +*/ + +type GetV5UsersUsernameEventsPublicOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *ActivityApiService) GetV5UsersUsernameEventsPublic(ctx context.Context, username string, localVarOptionals *GetV5UsersUsernameEventsPublicOpts) ([]Event, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Event + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/users/{username}/events/public" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Event + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ActivityApiService 列出一个用户收到的动态 +列出一个用户收到的动态 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param username 用户名(username/login) + * @param optional nil or *GetV5UsersUsernameReceivedEventsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []Event +*/ + +type GetV5UsersUsernameReceivedEventsOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *ActivityApiService) GetV5UsersUsernameReceivedEvents(ctx context.Context, username string, localVarOptionals *GetV5UsersUsernameReceivedEventsOpts) ([]Event, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Event + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/users/{username}/received_events" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Event + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ActivityApiService 列出一个用户收到的公开动态 +列出一个用户收到的公开动态 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param username 用户名(username/login) + * @param optional nil or *GetV5UsersUsernameReceivedEventsPublicOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []Event +*/ + +type GetV5UsersUsernameReceivedEventsPublicOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *ActivityApiService) GetV5UsersUsernameReceivedEventsPublic(ctx context.Context, username string, localVarOptionals *GetV5UsersUsernameReceivedEventsPublicOpts) ([]Event, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Event + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/users/{username}/received_events/public" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Event + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ActivityApiService 列出用户 star 了的仓库 +列出用户 star 了的仓库 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param username 用户名(username/login) + * @param optional nil or *GetV5UsersUsernameStarredOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + * @param "Sort" (optional.String) - 根据仓库创建时间(created)或最后推送时间(updated)进行排序,默认:创建时间 + * @param "Direction" (optional.String) - 按递增(asc)或递减(desc)排序,默认:递减 + +@return []Project +*/ + +type GetV5UsersUsernameStarredOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 + Sort optional.String + Direction optional.String +} + +func (a *ActivityApiService) GetV5UsersUsernameStarred(ctx context.Context, username string, localVarOptionals *GetV5UsersUsernameStarredOpts) ([]Project, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Project + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/users/{username}/starred" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Direction.IsSet() { + localVarQueryParams.Add("direction", parameterToString(localVarOptionals.Direction.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Project + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ActivityApiService 列出用户 watch 了的仓库 +列出用户 watch 了的仓库 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param username 用户名(username/login) + * @param optional nil or *GetV5UsersUsernameSubscriptionsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + * @param "Sort" (optional.String) - 根据仓库创建时间(created)或最后推送时间(updated)进行排序,默认:创建时间 + * @param "Direction" (optional.String) - 按递增(asc)或递减(desc)排序,默认:递减 + +@return []Project +*/ + +type GetV5UsersUsernameSubscriptionsOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 + Sort optional.String + Direction optional.String +} + +func (a *ActivityApiService) GetV5UsersUsernameSubscriptions(ctx context.Context, username string, localVarOptionals *GetV5UsersUsernameSubscriptionsOpts) ([]Project, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Project + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/users/{username}/subscriptions" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Direction.IsSet() { + localVarQueryParams.Add("direction", parameterToString(localVarOptionals.Direction.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Project + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ActivityApiService 标记一条私信为已读 +标记一条私信为已读 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id 私信的 ID + * @param optional nil or *PatchV5NotificationsMessagesIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type PatchV5NotificationsMessagesIdOpts struct { + AccessToken optional.String +} + +func (a *ActivityApiService) PatchV5NotificationsMessagesId(ctx context.Context, id string, localVarOptionals *PatchV5NotificationsMessagesIdOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/notifications/messages/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +ActivityApiService 标记一条通知为已读 +标记一条通知为已读 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id 通知的 ID + * @param optional nil or *PatchV5NotificationsThreadsIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type PatchV5NotificationsThreadsIdOpts struct { + AccessToken optional.String +} + +func (a *ActivityApiService) PatchV5NotificationsThreadsId(ctx context.Context, id string, localVarOptionals *PatchV5NotificationsThreadsIdOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/notifications/threads/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +ActivityApiService 发送私信给指定用户 +发送私信给指定用户 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param username 用户名(username/login) + * @param content 私信内容 + * @param optional nil or *PostV5NotificationsMessagesOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return UserMessage +*/ + +type PostV5NotificationsMessagesOpts struct { + AccessToken optional.String +} + +func (a *ActivityApiService) PostV5NotificationsMessages(ctx context.Context, username string, content string, localVarOptionals *PostV5NotificationsMessagesOpts) (UserMessage, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue UserMessage + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/notifications/messages" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("username", parameterToString(username, "")) + localVarFormParams.Add("content", parameterToString(content, "")) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 201 { + var v UserMessage + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +ActivityApiService 标记所有私信为已读 +标记所有私信为已读 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *PutV5NotificationsMessagesOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Ids" (optional.String) - 指定一组私信 ID,以 , 分隔 + + +*/ + +type PutV5NotificationsMessagesOpts struct { + AccessToken optional.String + Ids optional.String +} + +func (a *ActivityApiService) PutV5NotificationsMessages(ctx context.Context, localVarOptionals *PutV5NotificationsMessagesOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/notifications/messages" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Ids.IsSet() { + localVarFormParams.Add("ids", parameterToString(localVarOptionals.Ids.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +ActivityApiService 标记所有通知为已读 +标记所有通知为已读 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *PutV5NotificationsThreadsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Ids" (optional.String) - 指定一组通知 ID,以 , 分隔 + + +*/ + +type PutV5NotificationsThreadsOpts struct { + AccessToken optional.String + Ids optional.String +} + +func (a *ActivityApiService) PutV5NotificationsThreads(ctx context.Context, localVarOptionals *PutV5NotificationsThreadsOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/notifications/threads" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Ids.IsSet() { + localVarFormParams.Add("ids", parameterToString(localVarOptionals.Ids.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +ActivityApiService 标记一个仓库里的通知为已读 +标记一个仓库里的通知为已读 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *PutV5ReposOwnerRepoNotificationsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Ids" (optional.String) - 指定一组通知 ID,以 , 分隔 + + +*/ + +type PutV5ReposOwnerRepoNotificationsOpts struct { + AccessToken optional.String + Ids optional.String +} + +func (a *ActivityApiService) PutV5ReposOwnerRepoNotifications(ctx context.Context, owner string, repo string, localVarOptionals *PutV5ReposOwnerRepoNotificationsOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/notifications" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Ids.IsSet() { + localVarFormParams.Add("ids", parameterToString(localVarOptionals.Ids.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +ActivityApiService star 一个仓库 +star 一个仓库 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *PutV5UserStarredOwnerRepoOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type PutV5UserStarredOwnerRepoOpts struct { + AccessToken optional.String +} + +func (a *ActivityApiService) PutV5UserStarredOwnerRepo(ctx context.Context, owner string, repo string, localVarOptionals *PutV5UserStarredOwnerRepoOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/user/starred/{owner}/{repo}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +ActivityApiService watch 一个仓库 +watch 一个仓库 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param watchType watch策略, watching: 关注所有动态, releases_only: 仅关注版本发行动态, ignoring: 关注但不提醒动态 + * @param optional nil or *PutV5UserSubscriptionsOwnerRepoOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type PutV5UserSubscriptionsOwnerRepoOpts struct { + AccessToken optional.String +} + +func (a *ActivityApiService) PutV5UserSubscriptionsOwnerRepo(ctx context.Context, owner string, repo string, watchType string, localVarOptionals *PutV5UserSubscriptionsOwnerRepoOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/user/subscriptions/{owner}/{repo}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("watch_type", parameterToString(watchType, "")) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} diff --git a/api_enterprises.go b/api_enterprises.go new file mode 100644 index 0000000..2146e33 --- /dev/null +++ b/api_enterprises.go @@ -0,0 +1,1608 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type EnterprisesApiService service + +/* +EnterprisesApiService 移除企业成员 +移除企业成员 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param enterprise 企业的路径(path/login) + * @param username 用户名(username/login) + * @param optional nil or *DeleteV5EnterprisesEnterpriseMembersUsernameOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type DeleteV5EnterprisesEnterpriseMembersUsernameOpts struct { + AccessToken optional.String +} + +func (a *EnterprisesApiService) DeleteV5EnterprisesEnterpriseMembersUsername(ctx context.Context, enterprise string, username string, localVarOptionals *DeleteV5EnterprisesEnterpriseMembersUsernameOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/enterprises/{enterprise}/members/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"enterprise"+"}", fmt.Sprintf("%v", enterprise), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +EnterprisesApiService 删除周报某个评论 +删除周报某个评论 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param enterprise 企业的路径(path/login) + * @param reportId 周报ID + * @param id 评论ID + * @param optional nil or *DeleteV5EnterprisesEnterpriseWeekReportsReportIdCommentsIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type DeleteV5EnterprisesEnterpriseWeekReportsReportIdCommentsIdOpts struct { + AccessToken optional.String +} + +func (a *EnterprisesApiService) DeleteV5EnterprisesEnterpriseWeekReportsReportIdCommentsId(ctx context.Context, enterprise string, reportId int32, id int32, localVarOptionals *DeleteV5EnterprisesEnterpriseWeekReportsReportIdCommentsIdOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/enterprises/{enterprise}/week_reports/{report_id}/comments/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"enterprise"+"}", fmt.Sprintf("%v", enterprise), -1) + localVarPath = strings.Replace(localVarPath, "{"+"report_id"+"}", fmt.Sprintf("%v", reportId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +EnterprisesApiService 获取一个企业 +获取一个企业 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param enterprise 企业的路径(path/login) + * @param optional nil or *GetV5EnterprisesEnterpriseOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return EnterpriseBasic +*/ + +type GetV5EnterprisesEnterpriseOpts struct { + AccessToken optional.String +} + +func (a *EnterprisesApiService) GetV5EnterprisesEnterprise(ctx context.Context, enterprise string, localVarOptionals *GetV5EnterprisesEnterpriseOpts) (EnterpriseBasic, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue EnterpriseBasic + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/enterprises/{enterprise}" + localVarPath = strings.Replace(localVarPath, "{"+"enterprise"+"}", fmt.Sprintf("%v", enterprise), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v EnterpriseBasic + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +EnterprisesApiService 列出企业的所有成员 +列出企业的所有成员 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param enterprise 企业的路径(path/login) + * @param optional nil or *GetV5EnterprisesEnterpriseMembersOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Role" (optional.String) - 根据角色筛选成员 + +@return []EnterpriseMember +*/ + +type GetV5EnterprisesEnterpriseMembersOpts struct { + AccessToken optional.String + Role optional.String +} + +func (a *EnterprisesApiService) GetV5EnterprisesEnterpriseMembers(ctx context.Context, enterprise string, localVarOptionals *GetV5EnterprisesEnterpriseMembersOpts) ([]EnterpriseMember, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []EnterpriseMember + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/enterprises/{enterprise}/members" + localVarPath = strings.Replace(localVarPath, "{"+"enterprise"+"}", fmt.Sprintf("%v", enterprise), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Role.IsSet() { + localVarQueryParams.Add("role", parameterToString(localVarOptionals.Role.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []EnterpriseMember + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +EnterprisesApiService 获取企业的一个成员 +获取企业的一个成员 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param enterprise 企业的路径(path/login) + * @param username 用户名(username/login) + * @param optional nil or *GetV5EnterprisesEnterpriseMembersUsernameOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return EnterpriseMember +*/ + +type GetV5EnterprisesEnterpriseMembersUsernameOpts struct { + AccessToken optional.String +} + +func (a *EnterprisesApiService) GetV5EnterprisesEnterpriseMembersUsername(ctx context.Context, enterprise string, username string, localVarOptionals *GetV5EnterprisesEnterpriseMembersUsernameOpts) (EnterpriseMember, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue EnterpriseMember + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/enterprises/{enterprise}/members/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"enterprise"+"}", fmt.Sprintf("%v", enterprise), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v EnterpriseMember + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +EnterprisesApiService 个人周报列表 +个人周报列表 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param enterprise 企业的路径(path/login) + * @param username 用户名(username/login) + * @param optional nil or *GetV5EnterprisesEnterpriseUsersUsernameWeekReportsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []WeekReport +*/ + +type GetV5EnterprisesEnterpriseUsersUsernameWeekReportsOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *EnterprisesApiService) GetV5EnterprisesEnterpriseUsersUsernameWeekReports(ctx context.Context, enterprise string, username string, localVarOptionals *GetV5EnterprisesEnterpriseUsersUsernameWeekReportsOpts) ([]WeekReport, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []WeekReport + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/enterprises/{enterprise}/users/{username}/week_reports" + localVarPath = strings.Replace(localVarPath, "{"+"enterprise"+"}", fmt.Sprintf("%v", enterprise), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []WeekReport + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +EnterprisesApiService 企业成员周报列表 +企业成员周报列表 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param enterprise 企业的路径(path/login) + * @param optional nil or *GetV5EnterprisesEnterpriseWeekReportsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + * @param "Username" (optional.String) - 用户名(username/login) + * @param "Year" (optional.Int32) - 周报所属年 + * @param "WeekIndex" (optional.Int32) - 周报所属周 + * @param "Date" (optional.String) - 周报日期(格式:2019-03-25) + +@return []WeekReport +*/ + +type GetV5EnterprisesEnterpriseWeekReportsOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 + Username optional.String + Year optional.Int32 + WeekIndex optional.Int32 + Date optional.String +} + +func (a *EnterprisesApiService) GetV5EnterprisesEnterpriseWeekReports(ctx context.Context, enterprise string, localVarOptionals *GetV5EnterprisesEnterpriseWeekReportsOpts) ([]WeekReport, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []WeekReport + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/enterprises/{enterprise}/week_reports" + localVarPath = strings.Replace(localVarPath, "{"+"enterprise"+"}", fmt.Sprintf("%v", enterprise), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Username.IsSet() { + localVarQueryParams.Add("username", parameterToString(localVarOptionals.Username.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Year.IsSet() { + localVarQueryParams.Add("year", parameterToString(localVarOptionals.Year.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.WeekIndex.IsSet() { + localVarQueryParams.Add("week_index", parameterToString(localVarOptionals.WeekIndex.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Date.IsSet() { + localVarQueryParams.Add("date", parameterToString(localVarOptionals.Date.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []WeekReport + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +EnterprisesApiService 周报详情 +周报详情 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param enterprise 企业的路径(path/login) + * @param id 周报ID + * @param optional nil or *GetV5EnterprisesEnterpriseWeekReportsIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return WeekReport +*/ + +type GetV5EnterprisesEnterpriseWeekReportsIdOpts struct { + AccessToken optional.String +} + +func (a *EnterprisesApiService) GetV5EnterprisesEnterpriseWeekReportsId(ctx context.Context, enterprise string, id int32, localVarOptionals *GetV5EnterprisesEnterpriseWeekReportsIdOpts) (WeekReport, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue WeekReport + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/enterprises/{enterprise}/week_reports/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"enterprise"+"}", fmt.Sprintf("%v", enterprise), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v WeekReport + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +EnterprisesApiService 某个周报评论列表 +某个周报评论列表 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param enterprise 企业的路径(path/login) + * @param id 周报ID + * @param optional nil or *GetV5EnterprisesEnterpriseWeekReportsIdCommentsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []Note +*/ + +type GetV5EnterprisesEnterpriseWeekReportsIdCommentsOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *EnterprisesApiService) GetV5EnterprisesEnterpriseWeekReportsIdComments(ctx context.Context, enterprise string, id int32, localVarOptionals *GetV5EnterprisesEnterpriseWeekReportsIdCommentsOpts) ([]Note, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Note + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/enterprises/{enterprise}/week_reports/{id}/comments" + localVarPath = strings.Replace(localVarPath, "{"+"enterprise"+"}", fmt.Sprintf("%v", enterprise), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Note + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +EnterprisesApiService 列出授权用户所属的企业 +列出授权用户所属的企业 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *GetV5UserEnterprisesOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + * @param "Admin" (optional.Bool) - 只列出授权用户管理的企业 + +@return []EnterpriseBasic +*/ + +type GetV5UserEnterprisesOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 + Admin optional.Bool +} + +func (a *EnterprisesApiService) GetV5UserEnterprises(ctx context.Context, localVarOptionals *GetV5UserEnterprisesOpts) ([]EnterpriseBasic, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []EnterpriseBasic + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/user/enterprises" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Admin.IsSet() { + localVarQueryParams.Add("admin", parameterToString(localVarOptionals.Admin.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []EnterpriseBasic + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +EnterprisesApiService 编辑周报 +编辑周报 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param enterprise 企业的路径(path/login) + * @param id 周报ID + * @param content 周报内容 + * @param optional nil or *PatchV5EnterprisesEnterpriseWeekReportIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return WeekReport +*/ + +type PatchV5EnterprisesEnterpriseWeekReportIdOpts struct { + AccessToken optional.String +} + +func (a *EnterprisesApiService) PatchV5EnterprisesEnterpriseWeekReportId(ctx context.Context, enterprise string, id int32, content string, localVarOptionals *PatchV5EnterprisesEnterpriseWeekReportIdOpts) (WeekReport, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue WeekReport + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/enterprises/{enterprise}/week_report/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"enterprise"+"}", fmt.Sprintf("%v", enterprise), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("content", parameterToString(content, "")) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v WeekReport + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +EnterprisesApiService 添加或邀请企业成员 +添加或邀请企业成员 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param enterprise 企业的路径(path/login) + * @param optional nil or *PostV5EnterprisesEnterpriseMembersOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Username" (optional.String) - 需要邀请的码云用户名(username/login),username,email至少填写一个 + * @param "Email" (optional.String) - 要添加邮箱地址,若该邮箱未注册则自动创建帐号。username,email至少填写一个 + * @param "Outsourced" (optional.Bool) - 是否企业外包成员,默认:否 + * @param "Role" (optional.String) - 企业角色,默认普通成员 + * @param "Name" (optional.String) - 企业成员真实姓名(备注) + + +*/ + +type PostV5EnterprisesEnterpriseMembersOpts struct { + AccessToken optional.String + Username optional.String + Email optional.String + Outsourced optional.Bool + Role optional.String + Name optional.String +} + +func (a *EnterprisesApiService) PostV5EnterprisesEnterpriseMembers(ctx context.Context, enterprise string, localVarOptionals *PostV5EnterprisesEnterpriseMembersOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/enterprises/{enterprise}/members" + localVarPath = strings.Replace(localVarPath, "{"+"enterprise"+"}", fmt.Sprintf("%v", enterprise), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Username.IsSet() { + localVarFormParams.Add("username", parameterToString(localVarOptionals.Username.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Email.IsSet() { + localVarFormParams.Add("email", parameterToString(localVarOptionals.Email.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Outsourced.IsSet() { + localVarFormParams.Add("outsourced", parameterToString(localVarOptionals.Outsourced.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Role.IsSet() { + localVarFormParams.Add("role", parameterToString(localVarOptionals.Role.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Name.IsSet() { + localVarFormParams.Add("name", parameterToString(localVarOptionals.Name.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +EnterprisesApiService 新建周报 +新建周报 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param enterprise 企业的路径(path/login) + * @param year 周报所属年 + * @param content 周报内容 + * @param weekIndex 周报所属周 + * @param username 用户名(username/login) + * @param optional nil or *PostV5EnterprisesEnterpriseWeekReportOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Date" (optional.String) - 周报日期(格式:2019-03-25) + +@return WeekReport +*/ + +type PostV5EnterprisesEnterpriseWeekReportOpts struct { + AccessToken optional.String + Date optional.String +} + +func (a *EnterprisesApiService) PostV5EnterprisesEnterpriseWeekReport(ctx context.Context, enterprise string, year int32, content string, weekIndex int32, username string, localVarOptionals *PostV5EnterprisesEnterpriseWeekReportOpts) (WeekReport, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue WeekReport + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/enterprises/{enterprise}/week_report" + localVarPath = strings.Replace(localVarPath, "{"+"enterprise"+"}", fmt.Sprintf("%v", enterprise), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("year", parameterToString(year, "")) + localVarFormParams.Add("content", parameterToString(content, "")) + localVarFormParams.Add("week_index", parameterToString(weekIndex, "")) + localVarFormParams.Add("username", parameterToString(username, "")) + if localVarOptionals != nil && localVarOptionals.Date.IsSet() { + localVarFormParams.Add("date", parameterToString(localVarOptionals.Date.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 201 { + var v WeekReport + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +EnterprisesApiService 评论周报 +评论周报 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param enterprise 企业的路径(path/login) + * @param id 周报ID + * @param body 评论的内容 + * @param optional nil or *PostV5EnterprisesEnterpriseWeekReportsIdCommentOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return Note +*/ + +type PostV5EnterprisesEnterpriseWeekReportsIdCommentOpts struct { + AccessToken optional.String +} + +func (a *EnterprisesApiService) PostV5EnterprisesEnterpriseWeekReportsIdComment(ctx context.Context, enterprise string, id int32, body string, localVarOptionals *PostV5EnterprisesEnterpriseWeekReportsIdCommentOpts) (Note, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Note + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/enterprises/{enterprise}/week_reports/{id}/comment" + localVarPath = strings.Replace(localVarPath, "{"+"enterprise"+"}", fmt.Sprintf("%v", enterprise), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("body", parameterToString(body, "")) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 201 { + var v Note + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +EnterprisesApiService 修改企业成员权限或备注 +修改企业成员权限或备注 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param enterprise 企业的路径(path/login) + * @param username 用户名(username/login) + * @param optional nil or *PutV5EnterprisesEnterpriseMembersUsernameOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Outsourced" (optional.Bool) - 是否企业外包成员,默认:否 + * @param "Role" (optional.String) - 企业角色,默认普通成员 + * @param "Active" (optional.Bool) - 是否可访问企业资源,默认:是。(若选否则禁止该用户访问企业资源) + * @param "Name" (optional.String) - 企业成员真实姓名(备注) + +@return EnterpriseMember +*/ + +type PutV5EnterprisesEnterpriseMembersUsernameOpts struct { + AccessToken optional.String + Outsourced optional.Bool + Role optional.String + Active optional.Bool + Name optional.String +} + +func (a *EnterprisesApiService) PutV5EnterprisesEnterpriseMembersUsername(ctx context.Context, enterprise string, username string, localVarOptionals *PutV5EnterprisesEnterpriseMembersUsernameOpts) (EnterpriseMember, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue EnterpriseMember + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/enterprises/{enterprise}/members/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"enterprise"+"}", fmt.Sprintf("%v", enterprise), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Outsourced.IsSet() { + localVarFormParams.Add("outsourced", parameterToString(localVarOptionals.Outsourced.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Role.IsSet() { + localVarFormParams.Add("role", parameterToString(localVarOptionals.Role.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Active.IsSet() { + localVarFormParams.Add("active", parameterToString(localVarOptionals.Active.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Name.IsSet() { + localVarFormParams.Add("name", parameterToString(localVarOptionals.Name.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v EnterpriseMember + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/api_gists.go b/api_gists.go new file mode 100644 index 0000000..8bcdc24 --- /dev/null +++ b/api_gists.go @@ -0,0 +1,1918 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" + "os" +) + +// Linger please +var ( + _ context.Context +) + +type GistsApiService service + +/* +GistsApiService 删除代码片段的评论 +删除代码片段的评论 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param gistId 代码片段的ID + * @param id 评论的ID + * @param optional nil or *DeleteV5GistsGistIdCommentsIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type DeleteV5GistsGistIdCommentsIdOpts struct { + AccessToken optional.String +} + +func (a *GistsApiService) DeleteV5GistsGistIdCommentsId(ctx context.Context, gistId string, id int32, localVarOptionals *DeleteV5GistsGistIdCommentsIdOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/gists/{gist_id}/comments/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"gist_id"+"}", fmt.Sprintf("%v", gistId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +GistsApiService 删除指定代码片段 +删除指定代码片段 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id 代码片段的ID + * @param optional nil or *DeleteV5GistsIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type DeleteV5GistsIdOpts struct { + AccessToken optional.String +} + +func (a *GistsApiService) DeleteV5GistsId(ctx context.Context, id string, localVarOptionals *DeleteV5GistsIdOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/gists/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +GistsApiService 取消Star代码片段 +取消Star代码片段 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id 代码片段的ID + * @param optional nil or *DeleteV5GistsIdStarOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type DeleteV5GistsIdStarOpts struct { + AccessToken optional.String +} + +func (a *GistsApiService) DeleteV5GistsIdStar(ctx context.Context, id string, localVarOptionals *DeleteV5GistsIdStarOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/gists/{id}/star" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +GistsApiService 获取代码片段 +获取代码片段 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *GetV5GistsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Since" (optional.String) - 起始的更新时间,要求时间格式为 ISO 8601 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []Code +*/ + +type GetV5GistsOpts struct { + AccessToken optional.String + Since optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *GistsApiService) GetV5Gists(ctx context.Context, localVarOptionals *GetV5GistsOpts) ([]Code, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Code + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/gists" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Since.IsSet() { + localVarQueryParams.Add("since", parameterToString(localVarOptionals.Since.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Code + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +GistsApiService 获取代码片段的评论 +获取代码片段的评论 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param gistId 代码片段的ID + * @param optional nil or *GetV5GistsGistIdCommentsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []CodeComment +*/ + +type GetV5GistsGistIdCommentsOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *GistsApiService) GetV5GistsGistIdComments(ctx context.Context, gistId string, localVarOptionals *GetV5GistsGistIdCommentsOpts) ([]CodeComment, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []CodeComment + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/gists/{gist_id}/comments" + localVarPath = strings.Replace(localVarPath, "{"+"gist_id"+"}", fmt.Sprintf("%v", gistId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []CodeComment + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +GistsApiService 获取单条代码片段的评论 +获取单条代码片段的评论 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param gistId 代码片段的ID + * @param id 评论的ID + * @param optional nil or *GetV5GistsGistIdCommentsIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return CodeComment +*/ + +type GetV5GistsGistIdCommentsIdOpts struct { + AccessToken optional.String +} + +func (a *GistsApiService) GetV5GistsGistIdCommentsId(ctx context.Context, gistId string, id int32, localVarOptionals *GetV5GistsGistIdCommentsIdOpts) (CodeComment, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue CodeComment + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/gists/{gist_id}/comments/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"gist_id"+"}", fmt.Sprintf("%v", gistId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v CodeComment + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +GistsApiService 获取单条代码片段 +获取单条代码片段 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id 代码片段的ID + * @param optional nil or *GetV5GistsIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return CodeForksHistory +*/ + +type GetV5GistsIdOpts struct { + AccessToken optional.String +} + +func (a *GistsApiService) GetV5GistsId(ctx context.Context, id string, localVarOptionals *GetV5GistsIdOpts) (CodeForksHistory, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue CodeForksHistory + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/gists/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v CodeForksHistory + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +GistsApiService 获取代码片段的commit +获取代码片段的commit + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id 代码片段的ID + * @param optional nil or *GetV5GistsIdCommitsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return CodeForksHistory +*/ + +type GetV5GistsIdCommitsOpts struct { + AccessToken optional.String +} + +func (a *GistsApiService) GetV5GistsIdCommits(ctx context.Context, id string, localVarOptionals *GetV5GistsIdCommitsOpts) (CodeForksHistory, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue CodeForksHistory + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/gists/{id}/commits" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v CodeForksHistory + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +GistsApiService 获取 Fork 了指定代码片段的列表 +获取 Fork 了指定代码片段的列表 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id 代码片段的ID + * @param optional nil or *GetV5GistsIdForksOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return CodeForks +*/ + +type GetV5GistsIdForksOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *GistsApiService) GetV5GistsIdForks(ctx context.Context, id string, localVarOptionals *GetV5GistsIdForksOpts) (CodeForks, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue CodeForks + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/gists/{id}/forks" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v CodeForks + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +GistsApiService 判断代码片段是否已Star +判断代码片段是否已Star + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id 代码片段的ID + * @param optional nil or *GetV5GistsIdStarOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type GetV5GistsIdStarOpts struct { + AccessToken optional.String +} + +func (a *GistsApiService) GetV5GistsIdStar(ctx context.Context, id string, localVarOptionals *GetV5GistsIdStarOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/gists/{id}/star" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +GistsApiService 获取公开的代码片段 +获取公开的代码片段 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *GetV5GistsPublicOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Since" (optional.String) - 起始的更新时间,要求时间格式为 ISO 8601 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []Code +*/ + +type GetV5GistsPublicOpts struct { + AccessToken optional.String + Since optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *GistsApiService) GetV5GistsPublic(ctx context.Context, localVarOptionals *GetV5GistsPublicOpts) ([]Code, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Code + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/gists/public" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Since.IsSet() { + localVarQueryParams.Add("since", parameterToString(localVarOptionals.Since.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Code + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +GistsApiService 获取用户Star的代码片段 +获取用户Star的代码片段 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *GetV5GistsStarredOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Since" (optional.String) - 起始的更新时间,要求时间格式为 ISO 8601 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []Code +*/ + +type GetV5GistsStarredOpts struct { + AccessToken optional.String + Since optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *GistsApiService) GetV5GistsStarred(ctx context.Context, localVarOptionals *GetV5GistsStarredOpts) ([]Code, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Code + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/gists/starred" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Since.IsSet() { + localVarQueryParams.Add("since", parameterToString(localVarOptionals.Since.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Code + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +GistsApiService 获取指定用户的公开代码片段 +获取指定用户的公开代码片段 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param username 用户名(username/login) + * @param optional nil or *GetV5UsersUsernameGistsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []Code +*/ + +type GetV5UsersUsernameGistsOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *GistsApiService) GetV5UsersUsernameGists(ctx context.Context, username string, localVarOptionals *GetV5UsersUsernameGistsOpts) ([]Code, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Code + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/users/{username}/gists" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Code + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +GistsApiService 修改代码片段的评论 +修改代码片段的评论 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param gistId 代码片段的ID + * @param id 评论的ID + * @param body 评论内容 + * @param optional nil or *PatchV5GistsGistIdCommentsIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return CodeComment +*/ + +type PatchV5GistsGistIdCommentsIdOpts struct { + AccessToken optional.String +} + +func (a *GistsApiService) PatchV5GistsGistIdCommentsId(ctx context.Context, gistId string, id int32, body string, localVarOptionals *PatchV5GistsGistIdCommentsIdOpts) (CodeComment, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue CodeComment + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/gists/{gist_id}/comments/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"gist_id"+"}", fmt.Sprintf("%v", gistId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("body", parameterToString(body, "")) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v CodeComment + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +GistsApiService 修改代码片段 +修改代码片段 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id 代码片段的ID + * @param optional nil or *PatchV5GistsIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Files" (optional.Interface of *os.File) - Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } } + * @param "Description" (optional.String) - 代码片段描述,1~30个字符 + * @param "Public" (optional.Bool) - 公开/私有,默认: 私有 + +@return CodeForksHistory +*/ + +type PatchV5GistsIdOpts struct { + AccessToken optional.String + Files optional.Interface + Description optional.String + Public optional.Bool +} + +func (a *GistsApiService) PatchV5GistsId(ctx context.Context, id string, localVarOptionals *PatchV5GistsIdOpts) (CodeForksHistory, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue CodeForksHistory + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/gists/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + var localVarFile *os.File + if localVarOptionals != nil && localVarOptionals.Files.IsSet() { + localVarFileOk := false + localVarFile, localVarFileOk = localVarOptionals.Files.Value().(*os.File) + if !localVarFileOk { + return localVarReturnValue, nil, reportError("files should be *os.File") + } + } + if localVarFile != nil { + fbs, _ := ioutil.ReadAll(localVarFile) + localVarFileBytes = fbs + localVarFileName = localVarFile.Name() + localVarFile.Close() + } + if localVarOptionals != nil && localVarOptionals.Description.IsSet() { + localVarFormParams.Add("description", parameterToString(localVarOptionals.Description.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Public.IsSet() { + localVarFormParams.Add("public", parameterToString(localVarOptionals.Public.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v CodeForksHistory + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +GistsApiService 创建代码片段 +创建代码片段 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param files Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } } + * @param description 代码片段描述,1~30个字符 + * @param optional nil or *PostV5GistsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Public" (optional.Bool) - 公开/私有,默认: 私有 + +@return []CodeForksHistory +*/ + +type PostV5GistsOpts struct { + AccessToken optional.String + Public optional.Bool +} + +func (a *GistsApiService) PostV5Gists(ctx context.Context, files *os.File, description string, localVarOptionals *PostV5GistsOpts) ([]CodeForksHistory, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []CodeForksHistory + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/gists" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarFile != nil { + fbs, _ := ioutil.ReadAll(localVarFile) + localVarFileBytes = fbs + localVarFileName = localVarFile.Name() + localVarFile.Close() + } + localVarFormParams.Add("description", parameterToString(description, "")) + if localVarOptionals != nil && localVarOptionals.Public.IsSet() { + localVarFormParams.Add("public", parameterToString(localVarOptionals.Public.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 201 { + var v []CodeForksHistory + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +GistsApiService 增加代码片段的评论 +增加代码片段的评论 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param gistId 代码片段的ID + * @param body 评论内容 + * @param optional nil or *PostV5GistsGistIdCommentsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return CodeComment +*/ + +type PostV5GistsGistIdCommentsOpts struct { + AccessToken optional.String +} + +func (a *GistsApiService) PostV5GistsGistIdComments(ctx context.Context, gistId string, body string, localVarOptionals *PostV5GistsGistIdCommentsOpts) (CodeComment, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue CodeComment + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/gists/{gist_id}/comments" + localVarPath = strings.Replace(localVarPath, "{"+"gist_id"+"}", fmt.Sprintf("%v", gistId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("body", parameterToString(body, "")) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 201 { + var v CodeComment + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +GistsApiService Fork代码片段 +Fork代码片段 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id 代码片段的ID + * @param optional nil or *PostV5GistsIdForksOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type PostV5GistsIdForksOpts struct { + AccessToken optional.String +} + +func (a *GistsApiService) PostV5GistsIdForks(ctx context.Context, id string, localVarOptionals *PostV5GistsIdForksOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/gists/{id}/forks" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +GistsApiService Star代码片段 +Star代码片段 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id 代码片段的ID + * @param optional nil or *PutV5GistsIdStarOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type PutV5GistsIdStarOpts struct { + AccessToken optional.String +} + +func (a *GistsApiService) PutV5GistsIdStar(ctx context.Context, id string, localVarOptionals *PutV5GistsIdStarOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/gists/{id}/star" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} diff --git a/api_git_data.go b/api_git_data.go new file mode 100644 index 0000000..ed69781 --- /dev/null +++ b/api_git_data.go @@ -0,0 +1,238 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type GitDataApiService service + +/* +GitDataApiService 获取文件Blob +获取文件Blob + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param sha 文件的 Blob SHA,可通过 [获取仓库具体路径下的内容] API 获取 + * @param optional nil or *GetV5ReposOwnerRepoGitBlobsShaOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return Blob +*/ + +type GetV5ReposOwnerRepoGitBlobsShaOpts struct { + AccessToken optional.String +} + +func (a *GitDataApiService) GetV5ReposOwnerRepoGitBlobsSha(ctx context.Context, owner string, repo string, sha string, localVarOptionals *GetV5ReposOwnerRepoGitBlobsShaOpts) (Blob, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Blob + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/git/blobs/{sha}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"sha"+"}", fmt.Sprintf("%v", sha), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Blob + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +GitDataApiService 获取目录Tree +获取目录Tree + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param sha 可以是分支名(如master)、Commit或者目录Tree的SHA值 + * @param optional nil or *GetV5ReposOwnerRepoGitTreesShaOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Recursive" (optional.Int32) - 赋值为1递归获取目录 + +@return Tree +*/ + +type GetV5ReposOwnerRepoGitTreesShaOpts struct { + AccessToken optional.String + Recursive optional.Int32 +} + +func (a *GitDataApiService) GetV5ReposOwnerRepoGitTreesSha(ctx context.Context, owner string, repo string, sha string, localVarOptionals *GetV5ReposOwnerRepoGitTreesShaOpts) (Tree, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Tree + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/git/trees/{sha}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"sha"+"}", fmt.Sprintf("%v", sha), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Recursive.IsSet() { + localVarQueryParams.Add("recursive", parameterToString(localVarOptionals.Recursive.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Tree + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/api_issues.go b/api_issues.go new file mode 100644 index 0000000..b2fa050 --- /dev/null +++ b/api_issues.go @@ -0,0 +1,2306 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type IssuesApiService service + +/* +IssuesApiService 删除Issue某条评论 +删除Issue某条评论 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param id 评论的ID + * @param optional nil or *DeleteV5ReposOwnerRepoIssuesCommentsIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type DeleteV5ReposOwnerRepoIssuesCommentsIdOpts struct { + AccessToken optional.String +} + +func (a *IssuesApiService) DeleteV5ReposOwnerRepoIssuesCommentsId(ctx context.Context, owner string, repo string, id int32, localVarOptionals *DeleteV5ReposOwnerRepoIssuesCommentsIdOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/issues/comments/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +IssuesApiService 获取某个企业的所有Issues +获取某个企业的所有Issues + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param enterprise 企业的路径(path/login) + * @param optional nil or *GetV5EnterprisesEnterpriseIssuesOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "State" (optional.String) - Issue的状态: open(开启的), progressing(进行中), closed(关闭的), rejected(拒绝的)。 默认: open + * @param "Labels" (optional.String) - 用逗号分开的标签。如: bug,performance + * @param "Sort" (optional.String) - 排序依据: 创建时间(created),更新时间(updated_at)。默认: created_at + * @param "Direction" (optional.String) - 排序方式: 升序(asc),降序(desc)。默认: desc + * @param "Since" (optional.String) - 起始的更新时间,要求时间格式为 ISO 8601 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + * @param "Schedule" (optional.String) - 计划开始日期,格式:20181006T173008+80-20181007T173008+80(区间),或者 -20181007T173008+80(小于20181007T173008+80),或者 20181006T173008+80-(大于20181006T173008+80),要求时间格式为20181006T173008+80 + * @param "Deadline" (optional.String) - 计划截止日期,格式同上 + * @param "CreatedAt" (optional.String) - 任务创建时间,格式同上 + * @param "FinishedAt" (optional.String) - 任务完成时间,即任务最后一次转为已完成状态的时间点。格式同上 + * @param "Milestone" (optional.String) - 根据里程碑标题。none为没里程碑的,*为所有带里程碑的 + * @param "Assignee" (optional.String) - 用户的username。 none为没指派者, *为所有带有指派者的 + * @param "Creator" (optional.String) - 创建Issues的用户username + * @param "Program" (optional.String) - 所属项目名称。none为没所属有项目的,*为所有带所属项目的 + +@return []Issue +*/ + +type GetV5EnterprisesEnterpriseIssuesOpts struct { + AccessToken optional.String + State optional.String + Labels optional.String + Sort optional.String + Direction optional.String + Since optional.String + Page optional.Int32 + PerPage optional.Int32 + Schedule optional.String + Deadline optional.String + CreatedAt optional.String + FinishedAt optional.String + Milestone optional.String + Assignee optional.String + Creator optional.String + Program optional.String +} + +func (a *IssuesApiService) GetV5EnterprisesEnterpriseIssues(ctx context.Context, enterprise string, localVarOptionals *GetV5EnterprisesEnterpriseIssuesOpts) ([]Issue, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Issue + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/enterprises/{enterprise}/issues" + localVarPath = strings.Replace(localVarPath, "{"+"enterprise"+"}", fmt.Sprintf("%v", enterprise), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.State.IsSet() { + localVarQueryParams.Add("state", parameterToString(localVarOptionals.State.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Labels.IsSet() { + localVarQueryParams.Add("labels", parameterToString(localVarOptionals.Labels.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Direction.IsSet() { + localVarQueryParams.Add("direction", parameterToString(localVarOptionals.Direction.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Since.IsSet() { + localVarQueryParams.Add("since", parameterToString(localVarOptionals.Since.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Schedule.IsSet() { + localVarQueryParams.Add("schedule", parameterToString(localVarOptionals.Schedule.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Deadline.IsSet() { + localVarQueryParams.Add("deadline", parameterToString(localVarOptionals.Deadline.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.CreatedAt.IsSet() { + localVarQueryParams.Add("created_at", parameterToString(localVarOptionals.CreatedAt.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.FinishedAt.IsSet() { + localVarQueryParams.Add("finished_at", parameterToString(localVarOptionals.FinishedAt.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Milestone.IsSet() { + localVarQueryParams.Add("milestone", parameterToString(localVarOptionals.Milestone.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Assignee.IsSet() { + localVarQueryParams.Add("assignee", parameterToString(localVarOptionals.Assignee.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Creator.IsSet() { + localVarQueryParams.Add("creator", parameterToString(localVarOptionals.Creator.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Program.IsSet() { + localVarQueryParams.Add("program", parameterToString(localVarOptionals.Program.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Issue + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +IssuesApiService 获取企业的某个Issue +获取企业的某个Issue + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param enterprise 企业的路径(path/login) + * @param number Issue 编号(区分大小写,无需添加 # 号) + * @param optional nil or *GetV5EnterprisesEnterpriseIssuesNumberOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return Issue +*/ + +type GetV5EnterprisesEnterpriseIssuesNumberOpts struct { + AccessToken optional.String +} + +func (a *IssuesApiService) GetV5EnterprisesEnterpriseIssuesNumber(ctx context.Context, enterprise string, number string, localVarOptionals *GetV5EnterprisesEnterpriseIssuesNumberOpts) (Issue, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Issue + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/enterprises/{enterprise}/issues/{number}" + localVarPath = strings.Replace(localVarPath, "{"+"enterprise"+"}", fmt.Sprintf("%v", enterprise), -1) + localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Issue + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +IssuesApiService 获取企业某个Issue所有评论 +获取企业某个Issue所有评论 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param enterprise 企业的路径(path/login) + * @param number Issue 编号(区分大小写,无需添加 # 号) + * @param optional nil or *GetV5EnterprisesEnterpriseIssuesNumberCommentsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []Note +*/ + +type GetV5EnterprisesEnterpriseIssuesNumberCommentsOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *IssuesApiService) GetV5EnterprisesEnterpriseIssuesNumberComments(ctx context.Context, enterprise string, number string, localVarOptionals *GetV5EnterprisesEnterpriseIssuesNumberCommentsOpts) ([]Note, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Note + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/enterprises/{enterprise}/issues/{number}/comments" + localVarPath = strings.Replace(localVarPath, "{"+"enterprise"+"}", fmt.Sprintf("%v", enterprise), -1) + localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Note + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +IssuesApiService 获取企业某个Issue所有标签 +获取企业某个Issue所有标签 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param enterprise 企业的路径(path/login) + * @param number Issue 编号(区分大小写,无需添加 # 号) + * @param optional nil or *GetV5EnterprisesEnterpriseIssuesNumberLabelsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []Label +*/ + +type GetV5EnterprisesEnterpriseIssuesNumberLabelsOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *IssuesApiService) GetV5EnterprisesEnterpriseIssuesNumberLabels(ctx context.Context, enterprise string, number string, localVarOptionals *GetV5EnterprisesEnterpriseIssuesNumberLabelsOpts) ([]Label, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Label + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/enterprises/{enterprise}/issues/{number}/labels" + localVarPath = strings.Replace(localVarPath, "{"+"enterprise"+"}", fmt.Sprintf("%v", enterprise), -1) + localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Label + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +IssuesApiService 获取当前授权用户的所有Issues +获取当前授权用户的所有Issues + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *GetV5IssuesOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Filter" (optional.String) - 筛选参数: 授权用户负责的(assigned),授权用户创建的(created),包含前两者的(all)。默认: assigned + * @param "State" (optional.String) - Issue的状态: open(开启的), progressing(进行中), closed(关闭的), rejected(拒绝的)。 默认: open + * @param "Labels" (optional.String) - 用逗号分开的标签。如: bug,performance + * @param "Sort" (optional.String) - 排序依据: 创建时间(created),更新时间(updated_at)。默认: created_at + * @param "Direction" (optional.String) - 排序方式: 升序(asc),降序(desc)。默认: desc + * @param "Since" (optional.String) - 起始的更新时间,要求时间格式为 ISO 8601 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + * @param "Schedule" (optional.String) - 计划开始日期,格式:20181006T173008+80-20181007T173008+80(区间),或者 -20181007T173008+80(小于20181007T173008+80),或者 20181006T173008+80-(大于20181006T173008+80),要求时间格式为20181006T173008+80 + * @param "Deadline" (optional.String) - 计划截止日期,格式同上 + * @param "CreatedAt" (optional.String) - 任务创建时间,格式同上 + * @param "FinishedAt" (optional.String) - 任务完成时间,即任务最后一次转为已完成状态的时间点。格式同上 + +@return []Issue +*/ + +type GetV5IssuesOpts struct { + AccessToken optional.String + Filter optional.String + State optional.String + Labels optional.String + Sort optional.String + Direction optional.String + Since optional.String + Page optional.Int32 + PerPage optional.Int32 + Schedule optional.String + Deadline optional.String + CreatedAt optional.String + FinishedAt optional.String +} + +func (a *IssuesApiService) GetV5Issues(ctx context.Context, localVarOptionals *GetV5IssuesOpts) ([]Issue, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Issue + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/issues" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.State.IsSet() { + localVarQueryParams.Add("state", parameterToString(localVarOptionals.State.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Labels.IsSet() { + localVarQueryParams.Add("labels", parameterToString(localVarOptionals.Labels.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Direction.IsSet() { + localVarQueryParams.Add("direction", parameterToString(localVarOptionals.Direction.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Since.IsSet() { + localVarQueryParams.Add("since", parameterToString(localVarOptionals.Since.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Schedule.IsSet() { + localVarQueryParams.Add("schedule", parameterToString(localVarOptionals.Schedule.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Deadline.IsSet() { + localVarQueryParams.Add("deadline", parameterToString(localVarOptionals.Deadline.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.CreatedAt.IsSet() { + localVarQueryParams.Add("created_at", parameterToString(localVarOptionals.CreatedAt.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.FinishedAt.IsSet() { + localVarQueryParams.Add("finished_at", parameterToString(localVarOptionals.FinishedAt.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Issue + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +IssuesApiService 获取当前用户某个组织的Issues +获取当前用户某个组织的Issues + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param org 组织的路径(path/login) + * @param optional nil or *GetV5OrgsOrgIssuesOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Filter" (optional.String) - 筛选参数: 授权用户负责的(assigned),授权用户创建的(created),包含前两者的(all)。默认: assigned + * @param "State" (optional.String) - Issue的状态: open(开启的), progressing(进行中), closed(关闭的), rejected(拒绝的)。 默认: open + * @param "Labels" (optional.String) - 用逗号分开的标签。如: bug,performance + * @param "Sort" (optional.String) - 排序依据: 创建时间(created),更新时间(updated_at)。默认: created_at + * @param "Direction" (optional.String) - 排序方式: 升序(asc),降序(desc)。默认: desc + * @param "Since" (optional.String) - 起始的更新时间,要求时间格式为 ISO 8601 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + * @param "Schedule" (optional.String) - 计划开始日期,格式:20181006T173008+80-20181007T173008+80(区间),或者 -20181007T173008+80(小于20181007T173008+80),或者 20181006T173008+80-(大于20181006T173008+80),要求时间格式为20181006T173008+80 + * @param "Deadline" (optional.String) - 计划截止日期,格式同上 + * @param "CreatedAt" (optional.String) - 任务创建时间,格式同上 + * @param "FinishedAt" (optional.String) - 任务完成时间,即任务最后一次转为已完成状态的时间点。格式同上 + +@return []Issue +*/ + +type GetV5OrgsOrgIssuesOpts struct { + AccessToken optional.String + Filter optional.String + State optional.String + Labels optional.String + Sort optional.String + Direction optional.String + Since optional.String + Page optional.Int32 + PerPage optional.Int32 + Schedule optional.String + Deadline optional.String + CreatedAt optional.String + FinishedAt optional.String +} + +func (a *IssuesApiService) GetV5OrgsOrgIssues(ctx context.Context, org string, localVarOptionals *GetV5OrgsOrgIssuesOpts) ([]Issue, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Issue + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/orgs/{org}/issues" + localVarPath = strings.Replace(localVarPath, "{"+"org"+"}", fmt.Sprintf("%v", org), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.State.IsSet() { + localVarQueryParams.Add("state", parameterToString(localVarOptionals.State.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Labels.IsSet() { + localVarQueryParams.Add("labels", parameterToString(localVarOptionals.Labels.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Direction.IsSet() { + localVarQueryParams.Add("direction", parameterToString(localVarOptionals.Direction.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Since.IsSet() { + localVarQueryParams.Add("since", parameterToString(localVarOptionals.Since.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Schedule.IsSet() { + localVarQueryParams.Add("schedule", parameterToString(localVarOptionals.Schedule.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Deadline.IsSet() { + localVarQueryParams.Add("deadline", parameterToString(localVarOptionals.Deadline.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.CreatedAt.IsSet() { + localVarQueryParams.Add("created_at", parameterToString(localVarOptionals.CreatedAt.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.FinishedAt.IsSet() { + localVarQueryParams.Add("finished_at", parameterToString(localVarOptionals.FinishedAt.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Issue + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +IssuesApiService 获取某个Issue下的操作日志 +获取某个Issue下的操作日志 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param number Issue 编号(区分大小写,无需添加 # 号) + * @param optional nil or *GetV5ReposOwnerIssuesNumberOperateLogsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Repo" (optional.String) - 仓库路径(path) + * @param "Sort" (optional.String) - 按递增(asc)或递减(desc)排序,默认:递减 + +@return []OperateLog +*/ + +type GetV5ReposOwnerIssuesNumberOperateLogsOpts struct { + AccessToken optional.String + Repo optional.String + Sort optional.String +} + +func (a *IssuesApiService) GetV5ReposOwnerIssuesNumberOperateLogs(ctx context.Context, owner string, number string, localVarOptionals *GetV5ReposOwnerIssuesNumberOperateLogsOpts) ([]OperateLog, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []OperateLog + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/issues/{number}/operate_logs" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Repo.IsSet() { + localVarQueryParams.Add("repo", parameterToString(localVarOptionals.Repo.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []OperateLog + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +IssuesApiService 仓库的所有Issues +仓库的所有Issues + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *GetV5ReposOwnerRepoIssuesOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "State" (optional.String) - Issue的状态: open(开启的), progressing(进行中), closed(关闭的), rejected(拒绝的)。 默认: open + * @param "Labels" (optional.String) - 用逗号分开的标签。如: bug,performance + * @param "Sort" (optional.String) - 排序依据: 创建时间(created),更新时间(updated_at)。默认: created_at + * @param "Direction" (optional.String) - 排序方式: 升序(asc),降序(desc)。默认: desc + * @param "Since" (optional.String) - 起始的更新时间,要求时间格式为 ISO 8601 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + * @param "Schedule" (optional.String) - 计划开始日期,格式:20181006T173008+80-20181007T173008+80(区间),或者 -20181007T173008+80(小于20181007T173008+80),或者 20181006T173008+80-(大于20181006T173008+80),要求时间格式为20181006T173008+80 + * @param "Deadline" (optional.String) - 计划截止日期,格式同上 + * @param "CreatedAt" (optional.String) - 任务创建时间,格式同上 + * @param "FinishedAt" (optional.String) - 任务完成时间,即任务最后一次转为已完成状态的时间点。格式同上 + * @param "Milestone" (optional.String) - 根据里程碑标题。none为没里程碑的,*为所有带里程碑的 + * @param "Assignee" (optional.String) - 用户的username。 none为没指派者, *为所有带有指派者的 + * @param "Creator" (optional.String) - 创建Issues的用户username + * @param "Program" (optional.String) - 所属项目名称。none为没有所属项目,*为所有带所属项目的 + +@return []Issue +*/ + +type GetV5ReposOwnerRepoIssuesOpts struct { + AccessToken optional.String + State optional.String + Labels optional.String + Sort optional.String + Direction optional.String + Since optional.String + Page optional.Int32 + PerPage optional.Int32 + Schedule optional.String + Deadline optional.String + CreatedAt optional.String + FinishedAt optional.String + Milestone optional.String + Assignee optional.String + Creator optional.String + Program optional.String +} + +func (a *IssuesApiService) GetV5ReposOwnerRepoIssues(ctx context.Context, owner string, repo string, localVarOptionals *GetV5ReposOwnerRepoIssuesOpts) ([]Issue, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Issue + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/issues" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.State.IsSet() { + localVarQueryParams.Add("state", parameterToString(localVarOptionals.State.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Labels.IsSet() { + localVarQueryParams.Add("labels", parameterToString(localVarOptionals.Labels.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Direction.IsSet() { + localVarQueryParams.Add("direction", parameterToString(localVarOptionals.Direction.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Since.IsSet() { + localVarQueryParams.Add("since", parameterToString(localVarOptionals.Since.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Schedule.IsSet() { + localVarQueryParams.Add("schedule", parameterToString(localVarOptionals.Schedule.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Deadline.IsSet() { + localVarQueryParams.Add("deadline", parameterToString(localVarOptionals.Deadline.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.CreatedAt.IsSet() { + localVarQueryParams.Add("created_at", parameterToString(localVarOptionals.CreatedAt.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.FinishedAt.IsSet() { + localVarQueryParams.Add("finished_at", parameterToString(localVarOptionals.FinishedAt.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Milestone.IsSet() { + localVarQueryParams.Add("milestone", parameterToString(localVarOptionals.Milestone.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Assignee.IsSet() { + localVarQueryParams.Add("assignee", parameterToString(localVarOptionals.Assignee.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Creator.IsSet() { + localVarQueryParams.Add("creator", parameterToString(localVarOptionals.Creator.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Program.IsSet() { + localVarQueryParams.Add("program", parameterToString(localVarOptionals.Program.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Issue + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +IssuesApiService 获取仓库所有Issue的评论 +获取仓库所有Issue的评论 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *GetV5ReposOwnerRepoIssuesCommentsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Sort" (optional.String) - Either created or updated. Default: created + * @param "Direction" (optional.String) - Either asc or desc. Ignored without the sort parameter. + * @param "Since" (optional.String) - Only comments updated at or after this time are returned. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return Note +*/ + +type GetV5ReposOwnerRepoIssuesCommentsOpts struct { + AccessToken optional.String + Sort optional.String + Direction optional.String + Since optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *IssuesApiService) GetV5ReposOwnerRepoIssuesComments(ctx context.Context, owner string, repo string, localVarOptionals *GetV5ReposOwnerRepoIssuesCommentsOpts) (Note, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Note + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/issues/comments" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Direction.IsSet() { + localVarQueryParams.Add("direction", parameterToString(localVarOptionals.Direction.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Since.IsSet() { + localVarQueryParams.Add("since", parameterToString(localVarOptionals.Since.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Note + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +IssuesApiService 获取仓库Issue某条评论 +获取仓库Issue某条评论 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param id 评论的ID + * @param optional nil or *GetV5ReposOwnerRepoIssuesCommentsIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return Note +*/ + +type GetV5ReposOwnerRepoIssuesCommentsIdOpts struct { + AccessToken optional.String +} + +func (a *IssuesApiService) GetV5ReposOwnerRepoIssuesCommentsId(ctx context.Context, owner string, repo string, id int32, localVarOptionals *GetV5ReposOwnerRepoIssuesCommentsIdOpts) (Note, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Note + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/issues/comments/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Note + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +IssuesApiService 仓库的某个Issue +仓库的某个Issue + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param number Issue 编号(区分大小写,无需添加 # 号) + * @param optional nil or *GetV5ReposOwnerRepoIssuesNumberOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return Issue +*/ + +type GetV5ReposOwnerRepoIssuesNumberOpts struct { + AccessToken optional.String +} + +func (a *IssuesApiService) GetV5ReposOwnerRepoIssuesNumber(ctx context.Context, owner string, repo string, number string, localVarOptionals *GetV5ReposOwnerRepoIssuesNumberOpts) (Issue, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Issue + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/issues/{number}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Issue + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +IssuesApiService 获取仓库某个Issue所有的评论 +获取仓库某个Issue所有的评论 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param number Issue 编号(区分大小写,无需添加 # 号) + * @param optional nil or *GetV5ReposOwnerRepoIssuesNumberCommentsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Since" (optional.String) - Only comments updated at or after this time are returned. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return Note +*/ + +type GetV5ReposOwnerRepoIssuesNumberCommentsOpts struct { + AccessToken optional.String + Since optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *IssuesApiService) GetV5ReposOwnerRepoIssuesNumberComments(ctx context.Context, owner string, repo string, number string, localVarOptionals *GetV5ReposOwnerRepoIssuesNumberCommentsOpts) (Note, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Note + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/issues/{number}/comments" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Since.IsSet() { + localVarQueryParams.Add("since", parameterToString(localVarOptionals.Since.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Note + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +IssuesApiService 获取授权用户的所有Issues +获取授权用户的所有Issues + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *GetV5UserIssuesOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Filter" (optional.String) - 筛选参数: 授权用户负责的(assigned),授权用户创建的(created),包含前两者的(all)。默认: assigned + * @param "State" (optional.String) - Issue的状态: open(开启的), progressing(进行中), closed(关闭的), rejected(拒绝的)。 默认: open + * @param "Labels" (optional.String) - 用逗号分开的标签。如: bug,performance + * @param "Sort" (optional.String) - 排序依据: 创建时间(created),更新时间(updated_at)。默认: created_at + * @param "Direction" (optional.String) - 排序方式: 升序(asc),降序(desc)。默认: desc + * @param "Since" (optional.String) - 起始的更新时间,要求时间格式为 ISO 8601 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + * @param "Schedule" (optional.String) - 计划开始日期,格式:20181006T173008+80-20181007T173008+80(区间),或者 -20181007T173008+80(小于20181007T173008+80),或者 20181006T173008+80-(大于20181006T173008+80),要求时间格式为20181006T173008+80 + * @param "Deadline" (optional.String) - 计划截止日期,格式同上 + * @param "CreatedAt" (optional.String) - 任务创建时间,格式同上 + * @param "FinishedAt" (optional.String) - 任务完成时间,即任务最后一次转为已完成状态的时间点。格式同上 + +@return []Issue +*/ + +type GetV5UserIssuesOpts struct { + AccessToken optional.String + Filter optional.String + State optional.String + Labels optional.String + Sort optional.String + Direction optional.String + Since optional.String + Page optional.Int32 + PerPage optional.Int32 + Schedule optional.String + Deadline optional.String + CreatedAt optional.String + FinishedAt optional.String +} + +func (a *IssuesApiService) GetV5UserIssues(ctx context.Context, localVarOptionals *GetV5UserIssuesOpts) ([]Issue, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Issue + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/user/issues" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.State.IsSet() { + localVarQueryParams.Add("state", parameterToString(localVarOptionals.State.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Labels.IsSet() { + localVarQueryParams.Add("labels", parameterToString(localVarOptionals.Labels.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Direction.IsSet() { + localVarQueryParams.Add("direction", parameterToString(localVarOptionals.Direction.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Since.IsSet() { + localVarQueryParams.Add("since", parameterToString(localVarOptionals.Since.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Schedule.IsSet() { + localVarQueryParams.Add("schedule", parameterToString(localVarOptionals.Schedule.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Deadline.IsSet() { + localVarQueryParams.Add("deadline", parameterToString(localVarOptionals.Deadline.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.CreatedAt.IsSet() { + localVarQueryParams.Add("created_at", parameterToString(localVarOptionals.CreatedAt.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.FinishedAt.IsSet() { + localVarQueryParams.Add("finished_at", parameterToString(localVarOptionals.FinishedAt.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Issue + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +IssuesApiService 更新Issue +更新Issue + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param number Issue 编号(区分大小写,无需添加 # 号) + * @param optional nil or *PatchV5ReposOwnerIssuesNumberOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Repo" (optional.String) - 仓库路径(path) + * @param "Title" (optional.String) - Issue标题 + * @param "State" (optional.String) - Issue 状态,open(开启的)、progressing(进行中)、closed(关闭的) + * @param "Body" (optional.String) - Issue描述 + * @param "Assignee" (optional.String) - Issue负责人的username + * @param "Milestone" (optional.Int32) - 里程碑序号 + * @param "Labels" (optional.String) - 用逗号分开的标签,名称要求长度在 2-20 之间且非特殊字符。如: bug,performance + * @param "Program" (optional.String) - 项目ID + +@return Issue +*/ + +type PatchV5ReposOwnerIssuesNumberOpts struct { + AccessToken optional.String + Repo optional.String + Title optional.String + State optional.String + Body optional.String + Assignee optional.String + Milestone optional.Int32 + Labels optional.String + Program optional.String +} + +func (a *IssuesApiService) PatchV5ReposOwnerIssuesNumber(ctx context.Context, owner string, number string, localVarOptionals *PatchV5ReposOwnerIssuesNumberOpts) (Issue, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Issue + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/issues/{number}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Repo.IsSet() { + localVarFormParams.Add("repo", parameterToString(localVarOptionals.Repo.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Title.IsSet() { + localVarFormParams.Add("title", parameterToString(localVarOptionals.Title.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.State.IsSet() { + localVarFormParams.Add("state", parameterToString(localVarOptionals.State.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + localVarFormParams.Add("body", parameterToString(localVarOptionals.Body.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Assignee.IsSet() { + localVarFormParams.Add("assignee", parameterToString(localVarOptionals.Assignee.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Milestone.IsSet() { + localVarFormParams.Add("milestone", parameterToString(localVarOptionals.Milestone.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Labels.IsSet() { + localVarFormParams.Add("labels", parameterToString(localVarOptionals.Labels.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Program.IsSet() { + localVarFormParams.Add("program", parameterToString(localVarOptionals.Program.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Issue + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +IssuesApiService 更新Issue某条评论 +更新Issue某条评论 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param id 评论的ID + * @param body The contents of the comment. + * @param optional nil or *PatchV5ReposOwnerRepoIssuesCommentsIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return Note +*/ + +type PatchV5ReposOwnerRepoIssuesCommentsIdOpts struct { + AccessToken optional.String +} + +func (a *IssuesApiService) PatchV5ReposOwnerRepoIssuesCommentsId(ctx context.Context, owner string, repo string, id int32, body string, localVarOptionals *PatchV5ReposOwnerRepoIssuesCommentsIdOpts) (Note, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Note + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/issues/comments/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("body", parameterToString(body, "")) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Note + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +IssuesApiService 创建Issue +创建Issue + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param title Issue标题 + * @param optional nil or *PostV5ReposOwnerIssuesOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Repo" (optional.String) - 仓库路径(path) + * @param "IssueType" (optional.String) - 企业自定义任务类型,非企业默认任务类型为“任务” + * @param "Body" (optional.String) - Issue描述 + * @param "Assignee" (optional.String) - Issue负责人的username + * @param "Milestone" (optional.Int32) - 里程碑序号 + * @param "Labels" (optional.String) - 用逗号分开的标签,名称要求长度在 2-20 之间且非特殊字符。如: bug,performance + * @param "Program" (optional.String) - 项目ID + +@return Issue +*/ + +type PostV5ReposOwnerIssuesOpts struct { + AccessToken optional.String + Repo optional.String + IssueType optional.String + Body optional.String + Assignee optional.String + Milestone optional.Int32 + Labels optional.String + Program optional.String +} + +func (a *IssuesApiService) PostV5ReposOwnerIssues(ctx context.Context, owner string, title string, localVarOptionals *PostV5ReposOwnerIssuesOpts) (Issue, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Issue + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/issues" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Repo.IsSet() { + localVarFormParams.Add("repo", parameterToString(localVarOptionals.Repo.Value(), "")) + } + localVarFormParams.Add("title", parameterToString(title, "")) + if localVarOptionals != nil && localVarOptionals.IssueType.IsSet() { + localVarFormParams.Add("issue_type", parameterToString(localVarOptionals.IssueType.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + localVarFormParams.Add("body", parameterToString(localVarOptionals.Body.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Assignee.IsSet() { + localVarFormParams.Add("assignee", parameterToString(localVarOptionals.Assignee.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Milestone.IsSet() { + localVarFormParams.Add("milestone", parameterToString(localVarOptionals.Milestone.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Labels.IsSet() { + localVarFormParams.Add("labels", parameterToString(localVarOptionals.Labels.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Program.IsSet() { + localVarFormParams.Add("program", parameterToString(localVarOptionals.Program.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 201 { + var v Issue + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +IssuesApiService 创建某个Issue评论 +创建某个Issue评论 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param number Issue 编号(区分大小写,无需添加 # 号) + * @param body The contents of the comment. + * @param optional nil or *PostV5ReposOwnerRepoIssuesNumberCommentsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return Note +*/ + +type PostV5ReposOwnerRepoIssuesNumberCommentsOpts struct { + AccessToken optional.String +} + +func (a *IssuesApiService) PostV5ReposOwnerRepoIssuesNumberComments(ctx context.Context, owner string, repo string, number string, body string, localVarOptionals *PostV5ReposOwnerRepoIssuesNumberCommentsOpts) (Note, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Note + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/issues/{number}/comments" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("body", parameterToString(body, "")) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 201 { + var v Note + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/api_labels.go b/api_labels.go new file mode 100644 index 0000000..44e0558 --- /dev/null +++ b/api_labels.go @@ -0,0 +1,1225 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type LabelsApiService service + +/* +LabelsApiService 删除Issue所有标签 +删除Issue所有标签 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param number Issue 编号(区分大小写,无需添加 # 号) + * @param optional nil or *DeleteV5ReposOwnerRepoIssuesNumberLabelsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type DeleteV5ReposOwnerRepoIssuesNumberLabelsOpts struct { + AccessToken optional.String +} + +func (a *LabelsApiService) DeleteV5ReposOwnerRepoIssuesNumberLabels(ctx context.Context, owner string, repo string, number string, localVarOptionals *DeleteV5ReposOwnerRepoIssuesNumberLabelsOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/issues/{number}/labels" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +LabelsApiService 删除Issue标签 +删除Issue标签 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param number Issue 编号(区分大小写,无需添加 # 号) + * @param name 标签名称 + * @param optional nil or *DeleteV5ReposOwnerRepoIssuesNumberLabelsNameOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type DeleteV5ReposOwnerRepoIssuesNumberLabelsNameOpts struct { + AccessToken optional.String +} + +func (a *LabelsApiService) DeleteV5ReposOwnerRepoIssuesNumberLabelsName(ctx context.Context, owner string, repo string, number string, name string, localVarOptionals *DeleteV5ReposOwnerRepoIssuesNumberLabelsNameOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/issues/{number}/labels/{name}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1) + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +LabelsApiService 删除一个仓库任务标签 +删除一个仓库任务标签 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param name 标签名称 + * @param optional nil or *DeleteV5ReposOwnerRepoLabelsNameOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type DeleteV5ReposOwnerRepoLabelsNameOpts struct { + AccessToken optional.String +} + +func (a *LabelsApiService) DeleteV5ReposOwnerRepoLabelsName(ctx context.Context, owner string, repo string, name string, localVarOptionals *DeleteV5ReposOwnerRepoLabelsNameOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/labels/{name}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +LabelsApiService 获取企业所有标签 +获取企业所有标签 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param enterprise 企业的路径(path/login) + * @param optional nil or *GetV5EnterprisesEnterpriseLabelsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return []Label +*/ + +type GetV5EnterprisesEnterpriseLabelsOpts struct { + AccessToken optional.String +} + +func (a *LabelsApiService) GetV5EnterprisesEnterpriseLabels(ctx context.Context, enterprise string, localVarOptionals *GetV5EnterprisesEnterpriseLabelsOpts) ([]Label, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Label + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/enterprises/{enterprise}/labels" + localVarPath = strings.Replace(localVarPath, "{"+"enterprise"+"}", fmt.Sprintf("%v", enterprise), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Label + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +LabelsApiService 获取企业某个标签 +获取企业某个标签 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param enterprise 企业的路径(path/login) + * @param name 标签名称 + * @param optional nil or *GetV5EnterprisesEnterpriseLabelsNameOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return Label +*/ + +type GetV5EnterprisesEnterpriseLabelsNameOpts struct { + AccessToken optional.String +} + +func (a *LabelsApiService) GetV5EnterprisesEnterpriseLabelsName(ctx context.Context, enterprise string, name string, localVarOptionals *GetV5EnterprisesEnterpriseLabelsNameOpts) (Label, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Label + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/enterprises/{enterprise}/labels/{name}" + localVarPath = strings.Replace(localVarPath, "{"+"enterprise"+"}", fmt.Sprintf("%v", enterprise), -1) + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Label + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +LabelsApiService 获取仓库任务的所有标签 +获取仓库任务的所有标签 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param number Issue 编号(区分大小写,无需添加 # 号) + * @param optional nil or *GetV5ReposOwnerRepoIssuesNumberLabelsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return []Label +*/ + +type GetV5ReposOwnerRepoIssuesNumberLabelsOpts struct { + AccessToken optional.String +} + +func (a *LabelsApiService) GetV5ReposOwnerRepoIssuesNumberLabels(ctx context.Context, owner string, repo string, number string, localVarOptionals *GetV5ReposOwnerRepoIssuesNumberLabelsOpts) ([]Label, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Label + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/issues/{number}/labels" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Label + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +LabelsApiService 获取仓库所有任务标签 +获取仓库所有任务标签 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *GetV5ReposOwnerRepoLabelsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return []Label +*/ + +type GetV5ReposOwnerRepoLabelsOpts struct { + AccessToken optional.String +} + +func (a *LabelsApiService) GetV5ReposOwnerRepoLabels(ctx context.Context, owner string, repo string, localVarOptionals *GetV5ReposOwnerRepoLabelsOpts) ([]Label, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Label + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/labels" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Label + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +LabelsApiService 根据标签名称获取单个标签 +根据标签名称获取单个标签 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param name 标签名称 + * @param optional nil or *GetV5ReposOwnerRepoLabelsNameOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return Label +*/ + +type GetV5ReposOwnerRepoLabelsNameOpts struct { + AccessToken optional.String +} + +func (a *LabelsApiService) GetV5ReposOwnerRepoLabelsName(ctx context.Context, owner string, repo string, name string, localVarOptionals *GetV5ReposOwnerRepoLabelsNameOpts) (Label, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Label + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/labels/{name}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Label + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +LabelsApiService 更新一个仓库任务标签 +更新一个仓库任务标签 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param originalName 标签原有名称 + * @param optional nil or *PatchV5ReposOwnerRepoLabelsOriginalNameOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Name" (optional.String) - 标签新名称 + * @param "Color" (optional.String) - 标签新颜色 + +@return Label +*/ + +type PatchV5ReposOwnerRepoLabelsOriginalNameOpts struct { + AccessToken optional.String + Name optional.String + Color optional.String +} + +func (a *LabelsApiService) PatchV5ReposOwnerRepoLabelsOriginalName(ctx context.Context, owner string, repo string, originalName string, localVarOptionals *PatchV5ReposOwnerRepoLabelsOriginalNameOpts) (Label, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Label + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/labels/{original_name}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"original_name"+"}", fmt.Sprintf("%v", originalName), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Name.IsSet() { + localVarFormParams.Add("name", parameterToString(localVarOptionals.Name.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Color.IsSet() { + localVarFormParams.Add("color", parameterToString(localVarOptionals.Color.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Label + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +LabelsApiService 创建Issue标签 +创建Issue标签 需要在请求的body里填上数组,元素为标签的名字。如: [\"performance\", \"bug\"] + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param number Issue 编号(区分大小写,无需添加 # 号) + * @param optional nil or *PostV5ReposOwnerRepoIssuesNumberLabelsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Body" (optional.Interface of []string) - 标签名数组,如: [\"feat\", \"bug\"] + +@return Label +*/ + +type PostV5ReposOwnerRepoIssuesNumberLabelsOpts struct { + AccessToken optional.String + Body optional.Interface +} + +func (a *LabelsApiService) PostV5ReposOwnerRepoIssuesNumberLabels(ctx context.Context, owner string, repo string, number string, localVarOptionals *PostV5ReposOwnerRepoIssuesNumberLabelsOpts) (Label, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Label + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/issues/{number}/labels" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + localVarFormParams.Add("body", parameterToString(localVarOptionals.Body.Value(), "multi")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 201 { + var v Label + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +LabelsApiService 创建仓库任务标签 +创建仓库任务标签 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param name 标签名称 + * @param color 标签颜色。为6位的数字,如: 000000 + * @param optional nil or *PostV5ReposOwnerRepoLabelsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return Label +*/ + +type PostV5ReposOwnerRepoLabelsOpts struct { + AccessToken optional.String +} + +func (a *LabelsApiService) PostV5ReposOwnerRepoLabels(ctx context.Context, owner string, repo string, name string, color string, localVarOptionals *PostV5ReposOwnerRepoLabelsOpts) (Label, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Label + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/labels" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("name", parameterToString(name, "")) + localVarFormParams.Add("color", parameterToString(color, "")) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 201 { + var v Label + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +LabelsApiService 替换Issue所有标签 +替换Issue所有标签 需要在请求的body里填上数组,元素为标签的名字。如: [\"performance\", \"bug\"] + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param number Issue 编号(区分大小写,无需添加 # 号) + * @param optional nil or *PutV5ReposOwnerRepoIssuesNumberLabelsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Body" (optional.Interface of []string) - 标签名数组,如: [\"feat\", \"bug\"] + +@return Label +*/ + +type PutV5ReposOwnerRepoIssuesNumberLabelsOpts struct { + AccessToken optional.String + Body optional.Interface +} + +func (a *LabelsApiService) PutV5ReposOwnerRepoIssuesNumberLabels(ctx context.Context, owner string, repo string, number string, localVarOptionals *PutV5ReposOwnerRepoIssuesNumberLabelsOpts) (Label, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Label + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/issues/{number}/labels" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + localVarFormParams.Add("body", parameterToString(localVarOptionals.Body.Value(), "multi")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Label + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/api_milestones.go b/api_milestones.go new file mode 100644 index 0000000..fd46d30 --- /dev/null +++ b/api_milestones.go @@ -0,0 +1,573 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type MilestonesApiService service + +/* +MilestonesApiService 删除仓库单个里程碑 +删除仓库单个里程碑 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param number 里程碑序号(id) + * @param optional nil or *DeleteV5ReposOwnerRepoMilestonesNumberOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type DeleteV5ReposOwnerRepoMilestonesNumberOpts struct { + AccessToken optional.String +} + +func (a *MilestonesApiService) DeleteV5ReposOwnerRepoMilestonesNumber(ctx context.Context, owner string, repo string, number int32, localVarOptionals *DeleteV5ReposOwnerRepoMilestonesNumberOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/milestones/{number}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +MilestonesApiService 获取仓库所有里程碑 +获取仓库所有里程碑 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *GetV5ReposOwnerRepoMilestonesOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "State" (optional.String) - 里程碑状态: open, closed, all。默认: open + * @param "Sort" (optional.String) - 排序方式: due_on + * @param "Direction" (optional.String) - 升序(asc)或是降序(desc)。默认: asc + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []Milestone +*/ + +type GetV5ReposOwnerRepoMilestonesOpts struct { + AccessToken optional.String + State optional.String + Sort optional.String + Direction optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *MilestonesApiService) GetV5ReposOwnerRepoMilestones(ctx context.Context, owner string, repo string, localVarOptionals *GetV5ReposOwnerRepoMilestonesOpts) ([]Milestone, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Milestone + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/milestones" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.State.IsSet() { + localVarQueryParams.Add("state", parameterToString(localVarOptionals.State.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Direction.IsSet() { + localVarQueryParams.Add("direction", parameterToString(localVarOptionals.Direction.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Milestone + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +MilestonesApiService 获取仓库单个里程碑 +获取仓库单个里程碑 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param number 里程碑序号(id) + * @param optional nil or *GetV5ReposOwnerRepoMilestonesNumberOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return Milestone +*/ + +type GetV5ReposOwnerRepoMilestonesNumberOpts struct { + AccessToken optional.String +} + +func (a *MilestonesApiService) GetV5ReposOwnerRepoMilestonesNumber(ctx context.Context, owner string, repo string, number int32, localVarOptionals *GetV5ReposOwnerRepoMilestonesNumberOpts) (Milestone, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Milestone + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/milestones/{number}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Milestone + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +MilestonesApiService 更新仓库里程碑 +更新仓库里程碑 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param number 里程碑序号(id) + * @param title 里程碑标题 + * @param dueOn 里程碑的截止日期 + * @param optional nil or *PatchV5ReposOwnerRepoMilestonesNumberOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "State" (optional.String) - 里程碑状态: open, closed, all。默认: open + * @param "Description" (optional.String) - 里程碑具体描述 + +@return Milestone +*/ + +type PatchV5ReposOwnerRepoMilestonesNumberOpts struct { + AccessToken optional.String + State optional.String + Description optional.String +} + +func (a *MilestonesApiService) PatchV5ReposOwnerRepoMilestonesNumber(ctx context.Context, owner string, repo string, number int32, title string, dueOn string, localVarOptionals *PatchV5ReposOwnerRepoMilestonesNumberOpts) (Milestone, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Milestone + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/milestones/{number}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("title", parameterToString(title, "")) + if localVarOptionals != nil && localVarOptionals.State.IsSet() { + localVarFormParams.Add("state", parameterToString(localVarOptionals.State.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Description.IsSet() { + localVarFormParams.Add("description", parameterToString(localVarOptionals.Description.Value(), "")) + } + localVarFormParams.Add("due_on", parameterToString(dueOn, "")) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Milestone + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +MilestonesApiService 创建仓库里程碑 +创建仓库里程碑 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param title 里程碑标题 + * @param dueOn 里程碑的截止日期 + * @param optional nil or *PostV5ReposOwnerRepoMilestonesOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "State" (optional.String) - 里程碑状态: open, closed, all。默认: open + * @param "Description" (optional.String) - 里程碑具体描述 + +@return Milestone +*/ + +type PostV5ReposOwnerRepoMilestonesOpts struct { + AccessToken optional.String + State optional.String + Description optional.String +} + +func (a *MilestonesApiService) PostV5ReposOwnerRepoMilestones(ctx context.Context, owner string, repo string, title string, dueOn string, localVarOptionals *PostV5ReposOwnerRepoMilestonesOpts) (Milestone, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Milestone + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/milestones" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("title", parameterToString(title, "")) + if localVarOptionals != nil && localVarOptionals.State.IsSet() { + localVarFormParams.Add("state", parameterToString(localVarOptionals.State.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Description.IsSet() { + localVarFormParams.Add("description", parameterToString(localVarOptionals.Description.Value(), "")) + } + localVarFormParams.Add("due_on", parameterToString(dueOn, "")) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 201 { + var v Milestone + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/api_miscellaneous.go b/api_miscellaneous.go new file mode 100644 index 0000000..ff10ac3 --- /dev/null +++ b/api_miscellaneous.go @@ -0,0 +1,752 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type MiscellaneousApiService service + +/* +MiscellaneousApiService 列出可使用的 Emoji +列出可使用的 Emoji + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *GetV5EmojisOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type GetV5EmojisOpts struct { + AccessToken optional.String +} + +func (a *MiscellaneousApiService) GetV5Emojis(ctx context.Context, localVarOptionals *GetV5EmojisOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/emojis" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +MiscellaneousApiService 列出可使用的 .gitignore 模板 +列出可使用的 .gitignore 模板 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *GetV5GitignoreTemplatesOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type GetV5GitignoreTemplatesOpts struct { + AccessToken optional.String +} + +func (a *MiscellaneousApiService) GetV5GitignoreTemplates(ctx context.Context, localVarOptionals *GetV5GitignoreTemplatesOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/gitignore/templates" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +MiscellaneousApiService 获取一个 .gitignore 模板 +获取一个 .gitignore 模板 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param name .gitignore 模板名 + * @param optional nil or *GetV5GitignoreTemplatesNameOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type GetV5GitignoreTemplatesNameOpts struct { + AccessToken optional.String +} + +func (a *MiscellaneousApiService) GetV5GitignoreTemplatesName(ctx context.Context, name string, localVarOptionals *GetV5GitignoreTemplatesNameOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/gitignore/templates/{name}" + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +MiscellaneousApiService 获取一个 .gitignore 模板原始文件 +获取一个 .gitignore 模板原始文件 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param name .gitignore 模板名 + * @param optional nil or *GetV5GitignoreTemplatesNameRawOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type GetV5GitignoreTemplatesNameRawOpts struct { + AccessToken optional.String +} + +func (a *MiscellaneousApiService) GetV5GitignoreTemplatesNameRaw(ctx context.Context, name string, localVarOptionals *GetV5GitignoreTemplatesNameRawOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/gitignore/templates/{name}/raw" + localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +MiscellaneousApiService 列出可使用的开源许可协议 +列出可使用的开源许可协议 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *GetV5LicensesOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type GetV5LicensesOpts struct { + AccessToken optional.String +} + +func (a *MiscellaneousApiService) GetV5Licenses(ctx context.Context, localVarOptionals *GetV5LicensesOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/licenses" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +MiscellaneousApiService 获取一个开源许可协议 +获取一个开源许可协议 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param license 协议名称 + * @param optional nil or *GetV5LicensesLicenseOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type GetV5LicensesLicenseOpts struct { + AccessToken optional.String +} + +func (a *MiscellaneousApiService) GetV5LicensesLicense(ctx context.Context, license string, localVarOptionals *GetV5LicensesLicenseOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/licenses/{license}" + localVarPath = strings.Replace(localVarPath, "{"+"license"+"}", fmt.Sprintf("%v", license), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +MiscellaneousApiService 获取一个开源许可协议原始文件 +获取一个开源许可协议原始文件 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param license 协议名称 + * @param optional nil or *GetV5LicensesLicenseRawOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type GetV5LicensesLicenseRawOpts struct { + AccessToken optional.String +} + +func (a *MiscellaneousApiService) GetV5LicensesLicenseRaw(ctx context.Context, license string, localVarOptionals *GetV5LicensesLicenseRawOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/licenses/{license}/raw" + localVarPath = strings.Replace(localVarPath, "{"+"license"+"}", fmt.Sprintf("%v", license), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +MiscellaneousApiService 获取一个仓库使用的开源许可协议 +获取一个仓库使用的开源许可协议 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *GetV5ReposOwnerRepoLicenseOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type GetV5ReposOwnerRepoLicenseOpts struct { + AccessToken optional.String +} + +func (a *MiscellaneousApiService) GetV5ReposOwnerRepoLicense(ctx context.Context, owner string, repo string, localVarOptionals *GetV5ReposOwnerRepoLicenseOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/license" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +MiscellaneousApiService 渲染 Markdown 文本 +渲染 Markdown 文本 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param text Markdown 文本 + * @param optional nil or *PostV5MarkdownOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type PostV5MarkdownOpts struct { + AccessToken optional.String +} + +func (a *MiscellaneousApiService) PostV5Markdown(ctx context.Context, text string, localVarOptionals *PostV5MarkdownOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/markdown" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("text", parameterToString(text, "")) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} diff --git a/api_organizations.go b/api_organizations.go new file mode 100644 index 0000000..a5ee091 --- /dev/null +++ b/api_organizations.go @@ -0,0 +1,1377 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type OrganizationsApiService service + +/* +OrganizationsApiService 移除授权用户所管理组织中的成员 +移除授权用户所管理组织中的成员 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param org 组织的路径(path/login) + * @param username 用户名(username/login) + * @param optional nil or *DeleteV5OrgsOrgMembershipsUsernameOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type DeleteV5OrgsOrgMembershipsUsernameOpts struct { + AccessToken optional.String +} + +func (a *OrganizationsApiService) DeleteV5OrgsOrgMembershipsUsername(ctx context.Context, org string, username string, localVarOptionals *DeleteV5OrgsOrgMembershipsUsernameOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/orgs/{org}/memberships/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"org"+"}", fmt.Sprintf("%v", org), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +OrganizationsApiService 退出一个组织 +退出一个组织 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param org 组织的路径(path/login) + * @param optional nil or *DeleteV5UserMembershipsOrgsOrgOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type DeleteV5UserMembershipsOrgsOrgOpts struct { + AccessToken optional.String +} + +func (a *OrganizationsApiService) DeleteV5UserMembershipsOrgsOrg(ctx context.Context, org string, localVarOptionals *DeleteV5UserMembershipsOrgsOrgOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/user/memberships/orgs/{org}" + localVarPath = strings.Replace(localVarPath, "{"+"org"+"}", fmt.Sprintf("%v", org), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +OrganizationsApiService 获取一个组织 +获取一个组织 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param org 组织的路径(path/login) + * @param optional nil or *GetV5OrgsOrgOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return Group +*/ + +type GetV5OrgsOrgOpts struct { + AccessToken optional.String +} + +func (a *OrganizationsApiService) GetV5OrgsOrg(ctx context.Context, org string, localVarOptionals *GetV5OrgsOrgOpts) (Group, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Group + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/orgs/{org}" + localVarPath = strings.Replace(localVarPath, "{"+"org"+"}", fmt.Sprintf("%v", org), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Group + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +OrganizationsApiService 列出一个组织的所有成员 +列出一个组织的所有成员 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param org 组织的路径(path/login) + * @param optional nil or *GetV5OrgsOrgMembersOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + * @param "Role" (optional.String) - 根据角色筛选成员 + +@return []UserBasic +*/ + +type GetV5OrgsOrgMembersOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 + Role optional.String +} + +func (a *OrganizationsApiService) GetV5OrgsOrgMembers(ctx context.Context, org string, localVarOptionals *GetV5OrgsOrgMembersOpts) ([]UserBasic, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []UserBasic + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/orgs/{org}/members" + localVarPath = strings.Replace(localVarPath, "{"+"org"+"}", fmt.Sprintf("%v", org), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Role.IsSet() { + localVarQueryParams.Add("role", parameterToString(localVarOptionals.Role.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []UserBasic + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +OrganizationsApiService 获取授权用户所属组织的一个成员 +获取授权用户所属组织的一个成员 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param org 组织的路径(path/login) + * @param username 用户名(username/login) + * @param optional nil or *GetV5OrgsOrgMembershipsUsernameOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return GroupMember +*/ + +type GetV5OrgsOrgMembershipsUsernameOpts struct { + AccessToken optional.String +} + +func (a *OrganizationsApiService) GetV5OrgsOrgMembershipsUsername(ctx context.Context, org string, username string, localVarOptionals *GetV5OrgsOrgMembershipsUsernameOpts) (GroupMember, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue GroupMember + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/orgs/{org}/memberships/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"org"+"}", fmt.Sprintf("%v", org), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v GroupMember + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +OrganizationsApiService 列出授权用户在所属组织的成员资料 +列出授权用户在所属组织的成员资料 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *GetV5UserMembershipsOrgsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Active" (optional.Bool) - 根据成员是否已激活进行筛选资料,缺省返回所有资料 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []GroupMember +*/ + +type GetV5UserMembershipsOrgsOpts struct { + AccessToken optional.String + Active optional.Bool + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *OrganizationsApiService) GetV5UserMembershipsOrgs(ctx context.Context, localVarOptionals *GetV5UserMembershipsOrgsOpts) ([]GroupMember, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GroupMember + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/user/memberships/orgs" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Active.IsSet() { + localVarQueryParams.Add("active", parameterToString(localVarOptionals.Active.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []GroupMember + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +OrganizationsApiService 获取授权用户在一个组织的成员资料 +获取授权用户在一个组织的成员资料 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param org 组织的路径(path/login) + * @param optional nil or *GetV5UserMembershipsOrgsOrgOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return GroupMember +*/ + +type GetV5UserMembershipsOrgsOrgOpts struct { + AccessToken optional.String +} + +func (a *OrganizationsApiService) GetV5UserMembershipsOrgsOrg(ctx context.Context, org string, localVarOptionals *GetV5UserMembershipsOrgsOrgOpts) (GroupMember, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue GroupMember + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/user/memberships/orgs/{org}" + localVarPath = strings.Replace(localVarPath, "{"+"org"+"}", fmt.Sprintf("%v", org), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v GroupMember + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +OrganizationsApiService 列出授权用户所属的组织 +列出授权用户所属的组织 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *GetV5UserOrgsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + * @param "Admin" (optional.Bool) - 只列出授权用户管理的组织 + +@return []Group +*/ + +type GetV5UserOrgsOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 + Admin optional.Bool +} + +func (a *OrganizationsApiService) GetV5UserOrgs(ctx context.Context, localVarOptionals *GetV5UserOrgsOpts) ([]Group, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Group + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/user/orgs" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Admin.IsSet() { + localVarQueryParams.Add("admin", parameterToString(localVarOptionals.Admin.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Group + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +OrganizationsApiService 列出用户所属的组织 +列出用户所属的组织 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param username 用户名(username/login) + * @param optional nil or *GetV5UsersUsernameOrgsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []Group +*/ + +type GetV5UsersUsernameOrgsOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *OrganizationsApiService) GetV5UsersUsernameOrgs(ctx context.Context, username string, localVarOptionals *GetV5UsersUsernameOrgsOpts) ([]Group, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Group + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/users/{username}/orgs" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Group + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +OrganizationsApiService 更新授权用户所管理的组织资料 +更新授权用户所管理的组织资料 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param org 组织的路径(path/login) + * @param optional nil or *PatchV5OrgsOrgOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Email" (optional.String) - 组织公开的邮箱地址 + * @param "Location" (optional.String) - 组织所在地 + * @param "Name" (optional.String) - 组织名称 + * @param "Description" (optional.String) - 组织简介 + * @param "HtmlUrl" (optional.String) - 组织站点 + +@return GroupDetail +*/ + +type PatchV5OrgsOrgOpts struct { + AccessToken optional.String + Email optional.String + Location optional.String + Name optional.String + Description optional.String + HtmlUrl optional.String +} + +func (a *OrganizationsApiService) PatchV5OrgsOrg(ctx context.Context, org string, localVarOptionals *PatchV5OrgsOrgOpts) (GroupDetail, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue GroupDetail + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/orgs/{org}" + localVarPath = strings.Replace(localVarPath, "{"+"org"+"}", fmt.Sprintf("%v", org), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Email.IsSet() { + localVarFormParams.Add("email", parameterToString(localVarOptionals.Email.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Location.IsSet() { + localVarFormParams.Add("location", parameterToString(localVarOptionals.Location.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Name.IsSet() { + localVarFormParams.Add("name", parameterToString(localVarOptionals.Name.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Description.IsSet() { + localVarFormParams.Add("description", parameterToString(localVarOptionals.Description.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.HtmlUrl.IsSet() { + localVarFormParams.Add("html_url", parameterToString(localVarOptionals.HtmlUrl.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v GroupDetail + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +OrganizationsApiService 更新授权用户在一个组织的成员资料 +更新授权用户在一个组织的成员资料 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param org 组织的路径(path/login) + * @param optional nil or *PatchV5UserMembershipsOrgsOrgOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Remark" (optional.String) - 在组织中的备注信息 + +@return GroupMember +*/ + +type PatchV5UserMembershipsOrgsOrgOpts struct { + AccessToken optional.String + Remark optional.String +} + +func (a *OrganizationsApiService) PatchV5UserMembershipsOrgsOrg(ctx context.Context, org string, localVarOptionals *PatchV5UserMembershipsOrgsOrgOpts) (GroupMember, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue GroupMember + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/user/memberships/orgs/{org}" + localVarPath = strings.Replace(localVarPath, "{"+"org"+"}", fmt.Sprintf("%v", org), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Remark.IsSet() { + localVarFormParams.Add("remark", parameterToString(localVarOptionals.Remark.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v GroupMember + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +OrganizationsApiService 创建组织 +创建组织 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param name 组织名称 + * @param org 组织的路径(path/login) + * @param optional nil or *PostV5UsersOrganizationOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Description" (optional.String) - 组织描述 + +@return Group +*/ + +type PostV5UsersOrganizationOpts struct { + AccessToken optional.String + Description optional.String +} + +func (a *OrganizationsApiService) PostV5UsersOrganization(ctx context.Context, name string, org string, localVarOptionals *PostV5UsersOrganizationOpts) (Group, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Group + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/users/organization" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("name", parameterToString(name, "")) + localVarFormParams.Add("org", parameterToString(org, "")) + if localVarOptionals != nil && localVarOptionals.Description.IsSet() { + localVarFormParams.Add("description", parameterToString(localVarOptionals.Description.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 201 { + var v Group + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +OrganizationsApiService 增加或更新授权用户所管理组织的成员 +增加或更新授权用户所管理组织的成员 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param org 组织的路径(path/login) + * @param username 用户名(username/login) + * @param optional nil or *PutV5OrgsOrgMembershipsUsernameOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Role" (optional.String) - 设置用户在组织的角色 + +@return GroupMember +*/ + +type PutV5OrgsOrgMembershipsUsernameOpts struct { + AccessToken optional.String + Role optional.String +} + +func (a *OrganizationsApiService) PutV5OrgsOrgMembershipsUsername(ctx context.Context, org string, username string, localVarOptionals *PutV5OrgsOrgMembershipsUsernameOpts) (GroupMember, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue GroupMember + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/orgs/{org}/memberships/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"org"+"}", fmt.Sprintf("%v", org), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Role.IsSet() { + localVarFormParams.Add("role", parameterToString(localVarOptionals.Role.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v GroupMember + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/api_pull_requests.go b/api_pull_requests.go new file mode 100644 index 0000000..3f2e4ec --- /dev/null +++ b/api_pull_requests.go @@ -0,0 +1,2122 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type PullRequestsApiService service + +/* +PullRequestsApiService 删除评论 +删除评论 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param id 评论的ID + * @param optional nil or *DeleteV5ReposOwnerRepoPullsCommentsIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type DeleteV5ReposOwnerRepoPullsCommentsIdOpts struct { + AccessToken optional.String +} + +func (a *PullRequestsApiService) DeleteV5ReposOwnerRepoPullsCommentsId(ctx context.Context, owner string, repo string, id int32, localVarOptionals *DeleteV5ReposOwnerRepoPullsCommentsIdOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/pulls/comments/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +PullRequestsApiService 取消用户审查 Pull Request +取消用户审查 Pull Request + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param number 第几个PR,即本仓库PR的序数 + * @param assignees 用户的个人空间地址, 以 , 分隔 + * @param optional nil or *DeleteV5ReposOwnerRepoPullsNumberAssigneesOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return PullRequest +*/ + +type DeleteV5ReposOwnerRepoPullsNumberAssigneesOpts struct { + AccessToken optional.String +} + +func (a *PullRequestsApiService) DeleteV5ReposOwnerRepoPullsNumberAssignees(ctx context.Context, owner string, repo string, number int32, assignees string, localVarOptionals *DeleteV5ReposOwnerRepoPullsNumberAssigneesOpts) (PullRequest, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue PullRequest + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/pulls/{number}/assignees" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarQueryParams.Add("assignees", parameterToString(assignees, "")) + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v PullRequest + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PullRequestsApiService 取消用户测试 Pull Request +取消用户测试 Pull Request + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param number 第几个PR,即本仓库PR的序数 + * @param testers 用户的个人空间地址, 以 , 分隔 + * @param optional nil or *DeleteV5ReposOwnerRepoPullsNumberTestersOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return PullRequest +*/ + +type DeleteV5ReposOwnerRepoPullsNumberTestersOpts struct { + AccessToken optional.String +} + +func (a *PullRequestsApiService) DeleteV5ReposOwnerRepoPullsNumberTesters(ctx context.Context, owner string, repo string, number int32, testers string, localVarOptionals *DeleteV5ReposOwnerRepoPullsNumberTestersOpts) (PullRequest, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue PullRequest + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/pulls/{number}/testers" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarQueryParams.Add("testers", parameterToString(testers, "")) + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v PullRequest + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PullRequestsApiService 获取Pull Request列表 +获取Pull Request列表 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *GetV5ReposOwnerRepoPullsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "State" (optional.String) - 可选。Pull Request 状态 + * @param "Head" (optional.String) - 可选。Pull Request 提交的源分支。格式:branch 或者:username:branch + * @param "Base" (optional.String) - 可选。Pull Request 提交目标分支的名称。 + * @param "Sort" (optional.String) - 可选。排序字段,默认按创建时间 + * @param "Direction" (optional.String) - 可选。升序/降序 + * @param "MilestoneNumber" (optional.Int32) - 可选。里程碑序号(id) + * @param "Labels" (optional.String) - 用逗号分开的标签。如: bug,performance + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []PullRequest +*/ + +type GetV5ReposOwnerRepoPullsOpts struct { + AccessToken optional.String + State optional.String + Head optional.String + Base optional.String + Sort optional.String + Direction optional.String + MilestoneNumber optional.Int32 + Labels optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *PullRequestsApiService) GetV5ReposOwnerRepoPulls(ctx context.Context, owner string, repo string, localVarOptionals *GetV5ReposOwnerRepoPullsOpts) ([]PullRequest, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []PullRequest + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/pulls" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.State.IsSet() { + localVarQueryParams.Add("state", parameterToString(localVarOptionals.State.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Head.IsSet() { + localVarQueryParams.Add("head", parameterToString(localVarOptionals.Head.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Base.IsSet() { + localVarQueryParams.Add("base", parameterToString(localVarOptionals.Base.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Direction.IsSet() { + localVarQueryParams.Add("direction", parameterToString(localVarOptionals.Direction.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.MilestoneNumber.IsSet() { + localVarQueryParams.Add("milestone_number", parameterToString(localVarOptionals.MilestoneNumber.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Labels.IsSet() { + localVarQueryParams.Add("labels", parameterToString(localVarOptionals.Labels.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []PullRequest + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PullRequestsApiService 获取该仓库下的所有Pull Request评论 +获取该仓库下的所有Pull Request评论 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *GetV5ReposOwnerRepoPullsCommentsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Sort" (optional.String) - 可选。按创建时间/更新时间排序 + * @param "Direction" (optional.String) - 可选。升序/降序 + * @param "Since" (optional.String) - 起始的更新时间,要求时间格式为 ISO 8601 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []PullRequestComments +*/ + +type GetV5ReposOwnerRepoPullsCommentsOpts struct { + AccessToken optional.String + Sort optional.String + Direction optional.String + Since optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *PullRequestsApiService) GetV5ReposOwnerRepoPullsComments(ctx context.Context, owner string, repo string, localVarOptionals *GetV5ReposOwnerRepoPullsCommentsOpts) ([]PullRequestComments, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []PullRequestComments + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/pulls/comments" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Direction.IsSet() { + localVarQueryParams.Add("direction", parameterToString(localVarOptionals.Direction.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Since.IsSet() { + localVarQueryParams.Add("since", parameterToString(localVarOptionals.Since.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []PullRequestComments + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PullRequestsApiService 获取Pull Request的某个评论 +获取Pull Request的某个评论 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param id + * @param optional nil or *GetV5ReposOwnerRepoPullsCommentsIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return PullRequestComments +*/ + +type GetV5ReposOwnerRepoPullsCommentsIdOpts struct { + AccessToken optional.String +} + +func (a *PullRequestsApiService) GetV5ReposOwnerRepoPullsCommentsId(ctx context.Context, owner string, repo string, id int32, localVarOptionals *GetV5ReposOwnerRepoPullsCommentsIdOpts) (PullRequestComments, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue PullRequestComments + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/pulls/comments/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v PullRequestComments + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PullRequestsApiService 获取单个Pull Request +获取单个Pull Request + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param number 第几个PR,即本仓库PR的序数 + * @param optional nil or *GetV5ReposOwnerRepoPullsNumberOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return PullRequest +*/ + +type GetV5ReposOwnerRepoPullsNumberOpts struct { + AccessToken optional.String +} + +func (a *PullRequestsApiService) GetV5ReposOwnerRepoPullsNumber(ctx context.Context, owner string, repo string, number int32, localVarOptionals *GetV5ReposOwnerRepoPullsNumberOpts) (PullRequest, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue PullRequest + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/pulls/{number}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v PullRequest + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PullRequestsApiService 获取某个Pull Request的所有评论 +获取某个Pull Request的所有评论 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param number 第几个PR,即本仓库PR的序数 + * @param optional nil or *GetV5ReposOwnerRepoPullsNumberCommentsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []PullRequestComments +*/ + +type GetV5ReposOwnerRepoPullsNumberCommentsOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *PullRequestsApiService) GetV5ReposOwnerRepoPullsNumberComments(ctx context.Context, owner string, repo string, number int32, localVarOptionals *GetV5ReposOwnerRepoPullsNumberCommentsOpts) ([]PullRequestComments, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []PullRequestComments + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/pulls/{number}/comments" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []PullRequestComments + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PullRequestsApiService 获取某Pull Request的所有Commit信息。最多显示250条Commit +获取某Pull Request的所有Commit信息。最多显示250条Commit + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param number 第几个PR,即本仓库PR的序数 + * @param optional nil or *GetV5ReposOwnerRepoPullsNumberCommitsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return []PullRequestCommits +*/ + +type GetV5ReposOwnerRepoPullsNumberCommitsOpts struct { + AccessToken optional.String +} + +func (a *PullRequestsApiService) GetV5ReposOwnerRepoPullsNumberCommits(ctx context.Context, owner string, repo string, number int32, localVarOptionals *GetV5ReposOwnerRepoPullsNumberCommitsOpts) ([]PullRequestCommits, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []PullRequestCommits + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/pulls/{number}/commits" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []PullRequestCommits + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PullRequestsApiService Pull Request Commit文件列表。最多显示300条diff +Pull Request Commit文件列表。最多显示300条diff + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param number 第几个PR,即本仓库PR的序数 + * @param optional nil or *GetV5ReposOwnerRepoPullsNumberFilesOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return []PullRequestFiles +*/ + +type GetV5ReposOwnerRepoPullsNumberFilesOpts struct { + AccessToken optional.String +} + +func (a *PullRequestsApiService) GetV5ReposOwnerRepoPullsNumberFiles(ctx context.Context, owner string, repo string, number int32, localVarOptionals *GetV5ReposOwnerRepoPullsNumberFilesOpts) ([]PullRequestFiles, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []PullRequestFiles + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/pulls/{number}/files" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []PullRequestFiles + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PullRequestsApiService 判断Pull Request是否已经合并 +判断Pull Request是否已经合并 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param number 第几个PR,即本仓库PR的序数 + * @param optional nil or *GetV5ReposOwnerRepoPullsNumberMergeOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type GetV5ReposOwnerRepoPullsNumberMergeOpts struct { + AccessToken optional.String +} + +func (a *PullRequestsApiService) GetV5ReposOwnerRepoPullsNumberMerge(ctx context.Context, owner string, repo string, number int32, localVarOptionals *GetV5ReposOwnerRepoPullsNumberMergeOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/pulls/{number}/merge" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +PullRequestsApiService 获取某个Pull Request的操作日志 +获取某个Pull Request的操作日志 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param number 第几个PR,即本仓库PR的序数 + * @param optional nil or *GetV5ReposOwnerRepoPullsNumberOperateLogsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Sort" (optional.String) - 按递增(asc)或递减(desc)排序,默认:递减 + +@return OperateLog +*/ + +type GetV5ReposOwnerRepoPullsNumberOperateLogsOpts struct { + AccessToken optional.String + Sort optional.String +} + +func (a *PullRequestsApiService) GetV5ReposOwnerRepoPullsNumberOperateLogs(ctx context.Context, owner string, repo string, number int32, localVarOptionals *GetV5ReposOwnerRepoPullsNumberOperateLogsOpts) (OperateLog, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue OperateLog + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/pulls/{number}/operate_logs" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v OperateLog + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PullRequestsApiService 编辑评论 +编辑评论 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param id 评论的ID + * @param body 必填。评论内容 + * @param optional nil or *PatchV5ReposOwnerRepoPullsCommentsIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return PullRequestComments +*/ + +type PatchV5ReposOwnerRepoPullsCommentsIdOpts struct { + AccessToken optional.String +} + +func (a *PullRequestsApiService) PatchV5ReposOwnerRepoPullsCommentsId(ctx context.Context, owner string, repo string, id int32, body string, localVarOptionals *PatchV5ReposOwnerRepoPullsCommentsIdOpts) (PullRequestComments, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue PullRequestComments + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/pulls/comments/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("body", parameterToString(body, "")) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v PullRequestComments + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PullRequestsApiService 更新Pull Request信息 +更新Pull Request信息 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param number 第几个PR,即本仓库PR的序数 + * @param optional nil or *PatchV5ReposOwnerRepoPullsNumberOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Title" (optional.String) - 可选。Pull Request 标题 + * @param "Body" (optional.String) - 可选。Pull Request 内容 + * @param "State" (optional.String) - 可选。Pull Request 状态 + * @param "MilestoneNumber" (optional.Int32) - 可选。里程碑序号(id) + * @param "Labels" (optional.String) - 用逗号分开的标签,名称要求长度在 2-20 之间且非特殊字符。如: bug,performance + +@return PullRequest +*/ + +type PatchV5ReposOwnerRepoPullsNumberOpts struct { + AccessToken optional.String + Title optional.String + Body optional.String + State optional.String + MilestoneNumber optional.Int32 + Labels optional.String +} + +func (a *PullRequestsApiService) PatchV5ReposOwnerRepoPullsNumber(ctx context.Context, owner string, repo string, number int32, localVarOptionals *PatchV5ReposOwnerRepoPullsNumberOpts) (PullRequest, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue PullRequest + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/pulls/{number}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Title.IsSet() { + localVarFormParams.Add("title", parameterToString(localVarOptionals.Title.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + localVarFormParams.Add("body", parameterToString(localVarOptionals.Body.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.State.IsSet() { + localVarFormParams.Add("state", parameterToString(localVarOptionals.State.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.MilestoneNumber.IsSet() { + localVarFormParams.Add("milestone_number", parameterToString(localVarOptionals.MilestoneNumber.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Labels.IsSet() { + localVarFormParams.Add("labels", parameterToString(localVarOptionals.Labels.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v PullRequest + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PullRequestsApiService 创建Pull Request +创建Pull Request + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param title 必填。Pull Request 标题 + * @param head 必填。Pull Request 提交的源分支。格式:branch 或者:username:branch + * @param base 必填。Pull Request 提交目标分支的名称 + * @param optional nil or *PostV5ReposOwnerRepoPullsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Body" (optional.String) - 可选。Pull Request 内容 + * @param "MilestoneNumber" (optional.Int32) - 可选。里程碑序号(id) + * @param "Labels" (optional.String) - 用逗号分开的标签,名称要求长度在 2-20 之间且非特殊字符。如: bug,performance + * @param "Issue" (optional.String) - 可选。Pull Request的标题和内容可以根据指定的Issue Id自动填充 + * @param "Assignees" (optional.String) - 可选。审查人员username,可多个,半角逗号分隔,如:(username1,username2) + * @param "Testers" (optional.String) - 可选。测试人员username,可多个,半角逗号分隔,如:(username1,username2) + * @param "PruneSourceBranch" (optional.Bool) - 可选。合并PR后是否删除源分支,默认false(不删除) + +@return PullRequest +*/ + +type PostV5ReposOwnerRepoPullsOpts struct { + AccessToken optional.String + Body optional.String + MilestoneNumber optional.Int32 + Labels optional.String + Issue optional.String + Assignees optional.String + Testers optional.String + PruneSourceBranch optional.Bool +} + +func (a *PullRequestsApiService) PostV5ReposOwnerRepoPulls(ctx context.Context, owner string, repo string, title string, head string, base string, localVarOptionals *PostV5ReposOwnerRepoPullsOpts) (PullRequest, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue PullRequest + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/pulls" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("title", parameterToString(title, "")) + localVarFormParams.Add("head", parameterToString(head, "")) + localVarFormParams.Add("base", parameterToString(base, "")) + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + localVarFormParams.Add("body", parameterToString(localVarOptionals.Body.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.MilestoneNumber.IsSet() { + localVarFormParams.Add("milestone_number", parameterToString(localVarOptionals.MilestoneNumber.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Labels.IsSet() { + localVarFormParams.Add("labels", parameterToString(localVarOptionals.Labels.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Issue.IsSet() { + localVarFormParams.Add("issue", parameterToString(localVarOptionals.Issue.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Assignees.IsSet() { + localVarFormParams.Add("assignees", parameterToString(localVarOptionals.Assignees.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Testers.IsSet() { + localVarFormParams.Add("testers", parameterToString(localVarOptionals.Testers.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PruneSourceBranch.IsSet() { + localVarFormParams.Add("prune_source_branch", parameterToString(localVarOptionals.PruneSourceBranch.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 201 { + var v PullRequest + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PullRequestsApiService 指派用户审查 Pull Request +指派用户审查 Pull Request + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param number 第几个PR,即本仓库PR的序数 + * @param assignees 用户的个人空间地址, 以 , 分隔 + * @param optional nil or *PostV5ReposOwnerRepoPullsNumberAssigneesOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return PullRequest +*/ + +type PostV5ReposOwnerRepoPullsNumberAssigneesOpts struct { + AccessToken optional.String +} + +func (a *PullRequestsApiService) PostV5ReposOwnerRepoPullsNumberAssignees(ctx context.Context, owner string, repo string, number int32, assignees string, localVarOptionals *PostV5ReposOwnerRepoPullsNumberAssigneesOpts) (PullRequest, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue PullRequest + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/pulls/{number}/assignees" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("assignees", parameterToString(assignees, "")) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 201 { + var v PullRequest + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PullRequestsApiService 提交Pull Request评论 +提交Pull Request评论 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param number 第几个PR,即本仓库PR的序数 + * @param body 必填。评论内容 + * @param optional nil or *PostV5ReposOwnerRepoPullsNumberCommentsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "CommitId" (optional.String) - 可选。PR代码评论的commit id + * @param "Path" (optional.String) - 可选。PR代码评论的文件名 + * @param "Position" (optional.Int32) - 可选。PR代码评论diff中的行数 + +@return PullRequestComments +*/ + +type PostV5ReposOwnerRepoPullsNumberCommentsOpts struct { + AccessToken optional.String + CommitId optional.String + Path optional.String + Position optional.Int32 +} + +func (a *PullRequestsApiService) PostV5ReposOwnerRepoPullsNumberComments(ctx context.Context, owner string, repo string, number int32, body string, localVarOptionals *PostV5ReposOwnerRepoPullsNumberCommentsOpts) (PullRequestComments, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue PullRequestComments + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/pulls/{number}/comments" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("body", parameterToString(body, "")) + if localVarOptionals != nil && localVarOptionals.CommitId.IsSet() { + localVarFormParams.Add("commit_id", parameterToString(localVarOptionals.CommitId.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Path.IsSet() { + localVarFormParams.Add("path", parameterToString(localVarOptionals.Path.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Position.IsSet() { + localVarFormParams.Add("position", parameterToString(localVarOptionals.Position.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 201 { + var v PullRequestComments + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PullRequestsApiService 指派用户测试 Pull Request +指派用户测试 Pull Request + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param number 第几个PR,即本仓库PR的序数 + * @param testers 用户的个人空间地址, 以 , 分隔 + * @param optional nil or *PostV5ReposOwnerRepoPullsNumberTestersOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return PullRequest +*/ + +type PostV5ReposOwnerRepoPullsNumberTestersOpts struct { + AccessToken optional.String +} + +func (a *PullRequestsApiService) PostV5ReposOwnerRepoPullsNumberTesters(ctx context.Context, owner string, repo string, number int32, testers string, localVarOptionals *PostV5ReposOwnerRepoPullsNumberTestersOpts) (PullRequest, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue PullRequest + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/pulls/{number}/testers" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("testers", parameterToString(testers, "")) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 201 { + var v PullRequest + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +PullRequestsApiService 合并Pull Request +合并Pull Request + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param number 第几个PR,即本仓库PR的序数 + * @param optional nil or *PutV5ReposOwnerRepoPullsNumberMergeOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "MergeMethod" (optional.String) - 可选。合并PR的方法,merge(合并所有提交)和 squash(扁平化分支合并)。默认为merge。 + * @param "PruneSourceBranch" (optional.Bool) - 可选。合并PR后是否删除源分支,默认false(不删除) + * @param "Title" (optional.String) - 可选。合并标题,默认为PR的标题 + * @param "Description" (optional.String) - 可选。合并描述,默认为 \"Merge pull request !{pr_id} from {author}/{source_branch}\",与页面显示的默认一致。 + + +*/ + +type PutV5ReposOwnerRepoPullsNumberMergeOpts struct { + AccessToken optional.String + MergeMethod optional.String + PruneSourceBranch optional.Bool + Title optional.String + Description optional.String +} + +func (a *PullRequestsApiService) PutV5ReposOwnerRepoPullsNumberMerge(ctx context.Context, owner string, repo string, number int32, localVarOptionals *PutV5ReposOwnerRepoPullsNumberMergeOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/pulls/{number}/merge" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.MergeMethod.IsSet() { + localVarFormParams.Add("merge_method", parameterToString(localVarOptionals.MergeMethod.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PruneSourceBranch.IsSet() { + localVarFormParams.Add("prune_source_branch", parameterToString(localVarOptionals.PruneSourceBranch.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Title.IsSet() { + localVarFormParams.Add("title", parameterToString(localVarOptionals.Title.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Description.IsSet() { + localVarFormParams.Add("description", parameterToString(localVarOptionals.Description.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} diff --git a/api_repositories.go b/api_repositories.go new file mode 100644 index 0000000..7d6ba8e --- /dev/null +++ b/api_repositories.go @@ -0,0 +1,5927 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type RepositoriesApiService service + +/* +RepositoriesApiService 删除一个仓库 +删除一个仓库 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *DeleteV5ReposOwnerRepoOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type DeleteV5ReposOwnerRepoOpts struct { + AccessToken optional.String +} + +func (a *RepositoriesApiService) DeleteV5ReposOwnerRepo(ctx context.Context, owner string, repo string, localVarOptionals *DeleteV5ReposOwnerRepoOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +RepositoriesApiService 取消保护分支的设置 +取消保护分支的设置 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param branch 分支名称 + * @param optional nil or *DeleteV5ReposOwnerRepoBranchesBranchProtectionOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type DeleteV5ReposOwnerRepoBranchesBranchProtectionOpts struct { + AccessToken optional.String +} + +func (a *RepositoriesApiService) DeleteV5ReposOwnerRepoBranchesBranchProtection(ctx context.Context, owner string, repo string, branch string, localVarOptionals *DeleteV5ReposOwnerRepoBranchesBranchProtectionOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/branches/{branch}/protection" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"branch"+"}", fmt.Sprintf("%v", branch), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +RepositoriesApiService 移除仓库成员 +移除仓库成员 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param username 用户名(username/login) + * @param optional nil or *DeleteV5ReposOwnerRepoCollaboratorsUsernameOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type DeleteV5ReposOwnerRepoCollaboratorsUsernameOpts struct { + AccessToken optional.String +} + +func (a *RepositoriesApiService) DeleteV5ReposOwnerRepoCollaboratorsUsername(ctx context.Context, owner string, repo string, username string, localVarOptionals *DeleteV5ReposOwnerRepoCollaboratorsUsernameOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/collaborators/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +RepositoriesApiService 删除Commit评论 +删除Commit评论 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param id 评论的ID + * @param optional nil or *DeleteV5ReposOwnerRepoCommentsIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type DeleteV5ReposOwnerRepoCommentsIdOpts struct { + AccessToken optional.String +} + +func (a *RepositoriesApiService) DeleteV5ReposOwnerRepoCommentsId(ctx context.Context, owner string, repo string, id int32, localVarOptionals *DeleteV5ReposOwnerRepoCommentsIdOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/comments/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +RepositoriesApiService 删除文件 +删除文件 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param path 文件的路径 + * @param sha 文件的 Blob SHA,可通过 [获取仓库具体路径下的内容] API 获取 + * @param message 提交信息 + * @param optional nil or *DeleteV5ReposOwnerRepoContentsPathOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Branch" (optional.String) - 分支名称。默认为仓库对默认分支 + * @param "CommitterName" (optional.String) - Committer的名字,默认为当前用户的名字 + * @param "CommitterEmail" (optional.String) - Committer的邮箱,默认为当前用户的邮箱 + * @param "AuthorName" (optional.String) - Author的名字,默认为当前用户的名字 + * @param "AuthorEmail" (optional.String) - Author的邮箱,默认为当前用户的邮箱 + +@return CommitContent +*/ + +type DeleteV5ReposOwnerRepoContentsPathOpts struct { + AccessToken optional.String + Branch optional.String + CommitterName optional.String + CommitterEmail optional.String + AuthorName optional.String + AuthorEmail optional.String +} + +func (a *RepositoriesApiService) DeleteV5ReposOwnerRepoContentsPath(ctx context.Context, owner string, repo string, path string, sha string, message string, localVarOptionals *DeleteV5ReposOwnerRepoContentsPathOpts) (CommitContent, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue CommitContent + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/contents/{path}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"path"+"}", fmt.Sprintf("%v", path), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarQueryParams.Add("sha", parameterToString(sha, "")) + localVarQueryParams.Add("message", parameterToString(message, "")) + if localVarOptionals != nil && localVarOptionals.Branch.IsSet() { + localVarQueryParams.Add("branch", parameterToString(localVarOptionals.Branch.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.CommitterName.IsSet() { + localVarQueryParams.Add("committer[name]", parameterToString(localVarOptionals.CommitterName.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.CommitterEmail.IsSet() { + localVarQueryParams.Add("committer[email]", parameterToString(localVarOptionals.CommitterEmail.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.AuthorName.IsSet() { + localVarQueryParams.Add("author[name]", parameterToString(localVarOptionals.AuthorName.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.AuthorEmail.IsSet() { + localVarQueryParams.Add("author[email]", parameterToString(localVarOptionals.AuthorEmail.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v CommitContent + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 停用仓库公钥 +停用仓库公钥 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param id 公钥 ID + * @param optional nil or *DeleteV5ReposOwnerRepoKeysEnableIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type DeleteV5ReposOwnerRepoKeysEnableIdOpts struct { + AccessToken optional.String +} + +func (a *RepositoriesApiService) DeleteV5ReposOwnerRepoKeysEnableId(ctx context.Context, owner string, repo string, id int32, localVarOptionals *DeleteV5ReposOwnerRepoKeysEnableIdOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/keys/enable/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +RepositoriesApiService 删除一个仓库公钥 +删除一个仓库公钥 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param id 公钥 ID + * @param optional nil or *DeleteV5ReposOwnerRepoKeysIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type DeleteV5ReposOwnerRepoKeysIdOpts struct { + AccessToken optional.String +} + +func (a *RepositoriesApiService) DeleteV5ReposOwnerRepoKeysId(ctx context.Context, owner string, repo string, id int32, localVarOptionals *DeleteV5ReposOwnerRepoKeysIdOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/keys/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +RepositoriesApiService 删除仓库Release +删除仓库Release + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param id + * @param optional nil or *DeleteV5ReposOwnerRepoReleasesIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type DeleteV5ReposOwnerRepoReleasesIdOpts struct { + AccessToken optional.String +} + +func (a *RepositoriesApiService) DeleteV5ReposOwnerRepoReleasesId(ctx context.Context, owner string, repo string, id int32, localVarOptionals *DeleteV5ReposOwnerRepoReleasesIdOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/releases/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +RepositoriesApiService 获取企业的所有仓库 +获取企业的所有仓库 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param enterprise 企业的路径(path/login) + * @param optional nil or *GetV5EnterprisesEnterpriseReposOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Type_" (optional.String) - 筛选仓库的类型,可以是 all, public, internal, private。默认: all + * @param "Direct" (optional.Bool) - 只获取直属仓库,默认: false + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return Project +*/ + +type GetV5EnterprisesEnterpriseReposOpts struct { + AccessToken optional.String + Type_ optional.String + Direct optional.Bool + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *RepositoriesApiService) GetV5EnterprisesEnterpriseRepos(ctx context.Context, enterprise string, localVarOptionals *GetV5EnterprisesEnterpriseReposOpts) (Project, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Project + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/enterprises/{enterprise}/repos" + localVarPath = strings.Replace(localVarPath, "{"+"enterprise"+"}", fmt.Sprintf("%v", enterprise), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Type_.IsSet() { + localVarQueryParams.Add("type", parameterToString(localVarOptionals.Type_.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Direct.IsSet() { + localVarQueryParams.Add("direct", parameterToString(localVarOptionals.Direct.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Project + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 获取一个组织的仓库 +获取一个组织的仓库 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param org 组织的路径(path/login) + * @param optional nil or *GetV5OrgsOrgReposOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Type_" (optional.String) - 筛选仓库的类型,可以是 all, public, private。默认: all + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return Project +*/ + +type GetV5OrgsOrgReposOpts struct { + AccessToken optional.String + Type_ optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *RepositoriesApiService) GetV5OrgsOrgRepos(ctx context.Context, org string, localVarOptionals *GetV5OrgsOrgReposOpts) (Project, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Project + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/orgs/{org}/repos" + localVarPath = strings.Replace(localVarPath, "{"+"org"+"}", fmt.Sprintf("%v", org), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Type_.IsSet() { + localVarQueryParams.Add("type", parameterToString(localVarOptionals.Type_.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Project + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 获取用户的某个仓库 +获取用户的某个仓库 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *GetV5ReposOwnerRepoOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return Project +*/ + +type GetV5ReposOwnerRepoOpts struct { + AccessToken optional.String +} + +func (a *RepositoriesApiService) GetV5ReposOwnerRepo(ctx context.Context, owner string, repo string, localVarOptionals *GetV5ReposOwnerRepoOpts) (Project, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Project + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Project + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 获取所有分支 +获取所有分支 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *GetV5ReposOwnerRepoBranchesOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return []Branch +*/ + +type GetV5ReposOwnerRepoBranchesOpts struct { + AccessToken optional.String +} + +func (a *RepositoriesApiService) GetV5ReposOwnerRepoBranches(ctx context.Context, owner string, repo string, localVarOptionals *GetV5ReposOwnerRepoBranchesOpts) ([]Branch, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Branch + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/branches" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Branch + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 获取单个分支 +获取单个分支 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param branch 分支名称 + * @param optional nil or *GetV5ReposOwnerRepoBranchesBranchOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return CompleteBranch +*/ + +type GetV5ReposOwnerRepoBranchesBranchOpts struct { + AccessToken optional.String +} + +func (a *RepositoriesApiService) GetV5ReposOwnerRepoBranchesBranch(ctx context.Context, owner string, repo string, branch string, localVarOptionals *GetV5ReposOwnerRepoBranchesBranchOpts) (CompleteBranch, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue CompleteBranch + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/branches/{branch}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"branch"+"}", fmt.Sprintf("%v", branch), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v CompleteBranch + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 获取仓库的所有成员 +获取仓库的所有成员 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *GetV5ReposOwnerRepoCollaboratorsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return ProjectMember +*/ + +type GetV5ReposOwnerRepoCollaboratorsOpts struct { + AccessToken optional.String +} + +func (a *RepositoriesApiService) GetV5ReposOwnerRepoCollaborators(ctx context.Context, owner string, repo string, localVarOptionals *GetV5ReposOwnerRepoCollaboratorsOpts) (ProjectMember, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ProjectMember + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/collaborators" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v ProjectMember + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 判断用户是否为仓库成员 +判断用户是否为仓库成员 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param username 用户名(username/login) + * @param optional nil or *GetV5ReposOwnerRepoCollaboratorsUsernameOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type GetV5ReposOwnerRepoCollaboratorsUsernameOpts struct { + AccessToken optional.String +} + +func (a *RepositoriesApiService) GetV5ReposOwnerRepoCollaboratorsUsername(ctx context.Context, owner string, repo string, username string, localVarOptionals *GetV5ReposOwnerRepoCollaboratorsUsernameOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/collaborators/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +RepositoriesApiService 查看仓库成员的权限 +查看仓库成员的权限 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param username 用户名(username/login) + * @param optional nil or *GetV5ReposOwnerRepoCollaboratorsUsernamePermissionOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return ProjectMemberPermission +*/ + +type GetV5ReposOwnerRepoCollaboratorsUsernamePermissionOpts struct { + AccessToken optional.String +} + +func (a *RepositoriesApiService) GetV5ReposOwnerRepoCollaboratorsUsernamePermission(ctx context.Context, owner string, repo string, username string, localVarOptionals *GetV5ReposOwnerRepoCollaboratorsUsernamePermissionOpts) (ProjectMemberPermission, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ProjectMemberPermission + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/collaborators/{username}/permission" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v ProjectMemberPermission + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 获取仓库的Commit评论 +获取仓库的Commit评论 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *GetV5ReposOwnerRepoCommentsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return Note +*/ + +type GetV5ReposOwnerRepoCommentsOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *RepositoriesApiService) GetV5ReposOwnerRepoComments(ctx context.Context, owner string, repo string, localVarOptionals *GetV5ReposOwnerRepoCommentsOpts) (Note, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Note + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/comments" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Note + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 获取仓库的某条Commit评论 +获取仓库的某条Commit评论 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param id 评论的ID + * @param optional nil or *GetV5ReposOwnerRepoCommentsIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return Note +*/ + +type GetV5ReposOwnerRepoCommentsIdOpts struct { + AccessToken optional.String +} + +func (a *RepositoriesApiService) GetV5ReposOwnerRepoCommentsId(ctx context.Context, owner string, repo string, id int32, localVarOptionals *GetV5ReposOwnerRepoCommentsIdOpts) (Note, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Note + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/comments/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Note + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 仓库的所有提交 +仓库的所有提交 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *GetV5ReposOwnerRepoCommitsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Sha" (optional.String) - 提交起始的SHA值或者分支名. 默认: 仓库的默认分支 + * @param "Path" (optional.String) - 包含该文件的提交 + * @param "Author" (optional.String) - 提交作者的邮箱或个人空间地址(username/login) + * @param "Since" (optional.String) - 提交的起始时间,时间格式为 ISO 8601 + * @param "Until" (optional.String) - 提交的最后时间,时间格式为 ISO 8601 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []RepoCommit +*/ + +type GetV5ReposOwnerRepoCommitsOpts struct { + AccessToken optional.String + Sha optional.String + Path optional.String + Author optional.String + Since optional.String + Until optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *RepositoriesApiService) GetV5ReposOwnerRepoCommits(ctx context.Context, owner string, repo string, localVarOptionals *GetV5ReposOwnerRepoCommitsOpts) ([]RepoCommit, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []RepoCommit + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/commits" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sha.IsSet() { + localVarQueryParams.Add("sha", parameterToString(localVarOptionals.Sha.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Path.IsSet() { + localVarQueryParams.Add("path", parameterToString(localVarOptionals.Path.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Author.IsSet() { + localVarQueryParams.Add("author", parameterToString(localVarOptionals.Author.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Since.IsSet() { + localVarQueryParams.Add("since", parameterToString(localVarOptionals.Since.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Until.IsSet() { + localVarQueryParams.Add("until", parameterToString(localVarOptionals.Until.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []RepoCommit + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 获取单个Commit的评论 +获取单个Commit的评论 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param ref Commit的Reference + * @param optional nil or *GetV5ReposOwnerRepoCommitsRefCommentsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return Note +*/ + +type GetV5ReposOwnerRepoCommitsRefCommentsOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *RepositoriesApiService) GetV5ReposOwnerRepoCommitsRefComments(ctx context.Context, owner string, repo string, ref string, localVarOptionals *GetV5ReposOwnerRepoCommitsRefCommentsOpts) (Note, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Note + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/commits/{ref}/comments" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"ref"+"}", fmt.Sprintf("%v", ref), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Note + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 仓库的某个提交 +仓库的某个提交 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param sha 提交的SHA值或者分支名 + * @param optional nil or *GetV5ReposOwnerRepoCommitsShaOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return RepoCommit +*/ + +type GetV5ReposOwnerRepoCommitsShaOpts struct { + AccessToken optional.String +} + +func (a *RepositoriesApiService) GetV5ReposOwnerRepoCommitsSha(ctx context.Context, owner string, repo string, sha string, localVarOptionals *GetV5ReposOwnerRepoCommitsShaOpts) (RepoCommit, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue RepoCommit + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/commits/{sha}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"sha"+"}", fmt.Sprintf("%v", sha), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v RepoCommit + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 两个Commits之间对比的版本差异 +两个Commits之间对比的版本差异 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param base Commit提交的SHA值或者分支名作为对比起点 + * @param head Commit提交的SHA值或者分支名作为对比终点 + * @param optional nil or *GetV5ReposOwnerRepoCompareBaseHeadOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return Compare +*/ + +type GetV5ReposOwnerRepoCompareBaseHeadOpts struct { + AccessToken optional.String +} + +func (a *RepositoriesApiService) GetV5ReposOwnerRepoCompareBaseHead(ctx context.Context, owner string, repo string, base string, head string, localVarOptionals *GetV5ReposOwnerRepoCompareBaseHeadOpts) (Compare, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Compare + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/compare/{base}...{head}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"base"+"}", fmt.Sprintf("%v", base), -1) + localVarPath = strings.Replace(localVarPath, "{"+"head"+"}", fmt.Sprintf("%v", head), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Compare + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 获取仓库具体路径下的内容 +获取仓库具体路径下的内容 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param path 文件的路径 + * @param optional nil or *GetV5ReposOwnerRepoContentsPathOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Ref" (optional.String) - 分支、tag或commit。默认: 仓库的默认分支(通常是master) + +@return []Content +*/ + +type GetV5ReposOwnerRepoContentsPathOpts struct { + AccessToken optional.String + Ref optional.String +} + +func (a *RepositoriesApiService) GetV5ReposOwnerRepoContentsPath(ctx context.Context, owner string, repo string, path string, localVarOptionals *GetV5ReposOwnerRepoContentsPathOpts) ([]Content, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Content + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/contents(/{path})" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"path"+"}", fmt.Sprintf("%v", path), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Ref.IsSet() { + localVarQueryParams.Add("ref", parameterToString(localVarOptionals.Ref.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Content + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 获取仓库贡献者 +获取仓库贡献者 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *GetV5ReposOwnerRepoContributorsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return Contributor +*/ + +type GetV5ReposOwnerRepoContributorsOpts struct { + AccessToken optional.String +} + +func (a *RepositoriesApiService) GetV5ReposOwnerRepoContributors(ctx context.Context, owner string, repo string, localVarOptionals *GetV5ReposOwnerRepoContributorsOpts) (Contributor, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Contributor + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/contributors" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Contributor + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 查看仓库的Forks +查看仓库的Forks + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *GetV5ReposOwnerRepoForksOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Sort" (optional.String) - 排序方式: fork的时间(newest, oldest),star的人数(stargazers) + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return Project +*/ + +type GetV5ReposOwnerRepoForksOpts struct { + AccessToken optional.String + Sort optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *RepositoriesApiService) GetV5ReposOwnerRepoForks(ctx context.Context, owner string, repo string, localVarOptionals *GetV5ReposOwnerRepoForksOpts) (Project, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Project + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/forks" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Project + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 获取仓库已部署的公钥 +获取仓库已部署的公钥 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *GetV5ReposOwnerRepoKeysOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []SshKey +*/ + +type GetV5ReposOwnerRepoKeysOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *RepositoriesApiService) GetV5ReposOwnerRepoKeys(ctx context.Context, owner string, repo string, localVarOptionals *GetV5ReposOwnerRepoKeysOpts) ([]SshKey, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SshKey + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/keys" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []SshKey + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 获取仓库可部署的公钥 +获取仓库可部署的公钥 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *GetV5ReposOwnerRepoKeysAvailableOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []SshKeyBasic +*/ + +type GetV5ReposOwnerRepoKeysAvailableOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *RepositoriesApiService) GetV5ReposOwnerRepoKeysAvailable(ctx context.Context, owner string, repo string, localVarOptionals *GetV5ReposOwnerRepoKeysAvailableOpts) ([]SshKeyBasic, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SshKeyBasic + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/keys/available" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []SshKeyBasic + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 获取仓库的单个公钥 +获取仓库的单个公钥 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param id 公钥 ID + * @param optional nil or *GetV5ReposOwnerRepoKeysIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return SshKey +*/ + +type GetV5ReposOwnerRepoKeysIdOpts struct { + AccessToken optional.String +} + +func (a *RepositoriesApiService) GetV5ReposOwnerRepoKeysId(ctx context.Context, owner string, repo string, id int32, localVarOptionals *GetV5ReposOwnerRepoKeysIdOpts) (SshKey, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue SshKey + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/keys/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v SshKey + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 获取Pages信息 +获取Pages信息 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *GetV5ReposOwnerRepoPagesOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type GetV5ReposOwnerRepoPagesOpts struct { + AccessToken optional.String +} + +func (a *RepositoriesApiService) GetV5ReposOwnerRepoPages(ctx context.Context, owner string, repo string, localVarOptionals *GetV5ReposOwnerRepoPagesOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/pages" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +RepositoriesApiService 获取仓库README +获取仓库README + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *GetV5ReposOwnerRepoReadmeOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Ref" (optional.String) - 分支、tag或commit。默认: 仓库的默认分支(通常是master) + +@return Content +*/ + +type GetV5ReposOwnerRepoReadmeOpts struct { + AccessToken optional.String + Ref optional.String +} + +func (a *RepositoriesApiService) GetV5ReposOwnerRepoReadme(ctx context.Context, owner string, repo string, localVarOptionals *GetV5ReposOwnerRepoReadmeOpts) (Content, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Content + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/readme" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Ref.IsSet() { + localVarQueryParams.Add("ref", parameterToString(localVarOptionals.Ref.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Content + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 获取仓库的所有Releases +获取仓库的所有Releases + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *GetV5ReposOwnerRepoReleasesOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []Release +*/ + +type GetV5ReposOwnerRepoReleasesOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *RepositoriesApiService) GetV5ReposOwnerRepoReleases(ctx context.Context, owner string, repo string, localVarOptionals *GetV5ReposOwnerRepoReleasesOpts) ([]Release, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Release + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/releases" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Release + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 获取仓库的单个Releases +获取仓库的单个Releases + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param id 发行版本的ID + * @param optional nil or *GetV5ReposOwnerRepoReleasesIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return Release +*/ + +type GetV5ReposOwnerRepoReleasesIdOpts struct { + AccessToken optional.String +} + +func (a *RepositoriesApiService) GetV5ReposOwnerRepoReleasesId(ctx context.Context, owner string, repo string, id int32, localVarOptionals *GetV5ReposOwnerRepoReleasesIdOpts) (Release, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Release + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/releases/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Release + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 获取仓库的最后更新的Release +获取仓库的最后更新的Release + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *GetV5ReposOwnerRepoReleasesLatestOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return Release +*/ + +type GetV5ReposOwnerRepoReleasesLatestOpts struct { + AccessToken optional.String +} + +func (a *RepositoriesApiService) GetV5ReposOwnerRepoReleasesLatest(ctx context.Context, owner string, repo string, localVarOptionals *GetV5ReposOwnerRepoReleasesLatestOpts) (Release, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Release + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/releases/latest" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Release + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 根据Tag名称获取仓库的Release +根据Tag名称获取仓库的Release + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param tag Tag 名称 + * @param optional nil or *GetV5ReposOwnerRepoReleasesTagsTagOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return Release +*/ + +type GetV5ReposOwnerRepoReleasesTagsTagOpts struct { + AccessToken optional.String +} + +func (a *RepositoriesApiService) GetV5ReposOwnerRepoReleasesTagsTag(ctx context.Context, owner string, repo string, tag string, localVarOptionals *GetV5ReposOwnerRepoReleasesTagsTagOpts) (Release, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Release + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/releases/tags/{tag}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"tag"+"}", fmt.Sprintf("%v", tag), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Release + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 列出仓库所有的tags +列出仓库所有的tags + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *GetV5ReposOwnerRepoTagsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return Tag +*/ + +type GetV5ReposOwnerRepoTagsOpts struct { + AccessToken optional.String +} + +func (a *RepositoriesApiService) GetV5ReposOwnerRepoTags(ctx context.Context, owner string, repo string, localVarOptionals *GetV5ReposOwnerRepoTagsOpts) (Tag, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Tag + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/tags" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Tag + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 列出授权用户的所有仓库 +列出授权用户的所有仓库 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *GetV5UserReposOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Visibility" (optional.String) - 公开(public)、私有(private)或者所有(all),默认: 所有(all) + * @param "Affiliation" (optional.String) - owner(授权用户拥有的仓库)、collaborator(授权用户为仓库成员)、organization_member(授权用户为仓库所在组织并有访问仓库权限)、enterprise_member(授权用户所在企业并有访问仓库权限)、admin(所有有权限的,包括所管理的组织中所有仓库、所管理的企业的所有仓库)。 可以用逗号分隔符组合。如: owner, organization_member 或 owner, collaborator, organization_member + * @param "Type_" (optional.String) - 筛选用户仓库: 其创建(owner)、个人(personal)、其为成员(member)、公开(public)、私有(private),不能与 visibility 或 affiliation 参数一并使用,否则会报 422 错误 + * @param "Sort" (optional.String) - 排序方式: 创建时间(created),更新时间(updated),最后推送时间(pushed),仓库所属与名称(full_name)。默认: full_name + * @param "Direction" (optional.String) - 如果sort参数为full_name,用升序(asc)。否则降序(desc) + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return Project +*/ + +type GetV5UserReposOpts struct { + AccessToken optional.String + Visibility optional.String + Affiliation optional.String + Type_ optional.String + Sort optional.String + Direction optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *RepositoriesApiService) GetV5UserRepos(ctx context.Context, localVarOptionals *GetV5UserReposOpts) (Project, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Project + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/user/repos" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Visibility.IsSet() { + localVarQueryParams.Add("visibility", parameterToString(localVarOptionals.Visibility.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Affiliation.IsSet() { + localVarQueryParams.Add("affiliation", parameterToString(localVarOptionals.Affiliation.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Type_.IsSet() { + localVarQueryParams.Add("type", parameterToString(localVarOptionals.Type_.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Direction.IsSet() { + localVarQueryParams.Add("direction", parameterToString(localVarOptionals.Direction.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Project + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 获取某个用户的公开仓库 +获取某个用户的公开仓库 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param username 用户名(username/login) + * @param optional nil or *GetV5UsersUsernameReposOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Type_" (optional.String) - 用户创建的仓库(owner),用户个人仓库(personal),用户为仓库成员(member),所有(all)。默认: 所有(all) + * @param "Sort" (optional.String) - 排序方式: 创建时间(created),更新时间(updated),最后推送时间(pushed),仓库所属与名称(full_name)。默认: full_name + * @param "Direction" (optional.String) - 如果sort参数为full_name,用升序(asc)。否则降序(desc) + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return Project +*/ + +type GetV5UsersUsernameReposOpts struct { + AccessToken optional.String + Type_ optional.String + Sort optional.String + Direction optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *RepositoriesApiService) GetV5UsersUsernameRepos(ctx context.Context, username string, localVarOptionals *GetV5UsersUsernameReposOpts) (Project, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Project + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/users/{username}/repos" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Type_.IsSet() { + localVarQueryParams.Add("type", parameterToString(localVarOptionals.Type_.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Direction.IsSet() { + localVarQueryParams.Add("direction", parameterToString(localVarOptionals.Direction.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Project + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 更新仓库设置 +更新仓库设置 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param name 仓库名称 + * @param optional nil or *PatchV5ReposOwnerRepoOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Description" (optional.String) - 仓库描述 + * @param "Homepage" (optional.String) - 主页(eg: https://gitee.com) + * @param "HasIssues" (optional.Bool) - 允许提Issue与否。默认: 允许(true) + * @param "HasWiki" (optional.Bool) - 提供Wiki与否。默认: 提供(true) + * @param "Private" (optional.Bool) - 仓库公开或私有。 + * @param "DefaultBranch" (optional.String) - 更新默认分支 + +@return Project +*/ + +type PatchV5ReposOwnerRepoOpts struct { + AccessToken optional.String + Description optional.String + Homepage optional.String + HasIssues optional.Bool + HasWiki optional.Bool + Private optional.Bool + DefaultBranch optional.String +} + +func (a *RepositoriesApiService) PatchV5ReposOwnerRepo(ctx context.Context, owner string, repo string, name string, localVarOptionals *PatchV5ReposOwnerRepoOpts) (Project, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Project + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("name", parameterToString(name, "")) + if localVarOptionals != nil && localVarOptionals.Description.IsSet() { + localVarFormParams.Add("description", parameterToString(localVarOptionals.Description.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Homepage.IsSet() { + localVarFormParams.Add("homepage", parameterToString(localVarOptionals.Homepage.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.HasIssues.IsSet() { + localVarFormParams.Add("has_issues", parameterToString(localVarOptionals.HasIssues.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.HasWiki.IsSet() { + localVarFormParams.Add("has_wiki", parameterToString(localVarOptionals.HasWiki.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Private.IsSet() { + localVarFormParams.Add("private", parameterToString(localVarOptionals.Private.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.DefaultBranch.IsSet() { + localVarFormParams.Add("default_branch", parameterToString(localVarOptionals.DefaultBranch.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Project + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 更新Commit评论 +更新Commit评论 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param id 评论的ID + * @param body 评论的内容 + * @param optional nil or *PatchV5ReposOwnerRepoCommentsIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return Note +*/ + +type PatchV5ReposOwnerRepoCommentsIdOpts struct { + AccessToken optional.String +} + +func (a *RepositoriesApiService) PatchV5ReposOwnerRepoCommentsId(ctx context.Context, owner string, repo string, id int32, body string, localVarOptionals *PatchV5ReposOwnerRepoCommentsIdOpts) (Note, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Note + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/comments/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("body", parameterToString(body, "")) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Note + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 更新仓库Release +更新仓库Release + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param tagName Tag 名称, 提倡以v字母为前缀做为Release名称,例如v1.0或者v2.3.4 + * @param name Release 名称 + * @param body Release 描述 + * @param id + * @param optional nil or *PatchV5ReposOwnerRepoReleasesIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Prerelease" (optional.Bool) - 是否为预览版本。默认: false(非预览版本) + +@return Release +*/ + +type PatchV5ReposOwnerRepoReleasesIdOpts struct { + AccessToken optional.String + Prerelease optional.Bool +} + +func (a *RepositoriesApiService) PatchV5ReposOwnerRepoReleasesId(ctx context.Context, owner string, repo string, tagName string, name string, body string, id int32, localVarOptionals *PatchV5ReposOwnerRepoReleasesIdOpts) (Release, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Release + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/releases/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("tag_name", parameterToString(tagName, "")) + localVarFormParams.Add("name", parameterToString(name, "")) + localVarFormParams.Add("body", parameterToString(body, "")) + if localVarOptionals != nil && localVarOptionals.Prerelease.IsSet() { + localVarFormParams.Add("prerelease", parameterToString(localVarOptionals.Prerelease.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Release + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 创建企业仓库 +创建企业仓库 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param name 仓库名称 + * @param enterprise 企业的路径(path/login) + * @param optional nil or *PostV5EnterprisesEnterpriseReposOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Description" (optional.String) - 仓库描述 + * @param "Homepage" (optional.String) - 主页(eg: https://gitee.com) + * @param "HasIssues" (optional.Bool) - 允许提Issue与否。默认: 允许(true) + * @param "HasWiki" (optional.Bool) - 提供Wiki与否。默认: 提供(true) + * @param "AutoInit" (optional.Bool) - 值为true时则会用README初始化仓库。默认: 不初始化(false) + * @param "GitignoreTemplate" (optional.String) - Git Ingore模版 + * @param "LicenseTemplate" (optional.String) - License模版 + * @param "Private" (optional.Int32) - 仓库开源类型。0(私有), 1(外部开源), 2(内部开源)。默认: 0 + * @param "Outsourced" (optional.Bool) - 值为true值为外包仓库, false值为内部仓库。默认: 内部仓库(false) + * @param "ProjectCreator" (optional.String) - 负责人的username + * @param "Members" (optional.String) - 用逗号分开的仓库成员。如: member1,member2 + +@return Project +*/ + +type PostV5EnterprisesEnterpriseReposOpts struct { + AccessToken optional.String + Description optional.String + Homepage optional.String + HasIssues optional.Bool + HasWiki optional.Bool + AutoInit optional.Bool + GitignoreTemplate optional.String + LicenseTemplate optional.String + Private optional.Int32 + Outsourced optional.Bool + ProjectCreator optional.String + Members optional.String +} + +func (a *RepositoriesApiService) PostV5EnterprisesEnterpriseRepos(ctx context.Context, name string, enterprise string, localVarOptionals *PostV5EnterprisesEnterpriseReposOpts) (Project, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Project + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/enterprises/{enterprise}/repos" + localVarPath = strings.Replace(localVarPath, "{"+"enterprise"+"}", fmt.Sprintf("%v", enterprise), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("name", parameterToString(name, "")) + if localVarOptionals != nil && localVarOptionals.Description.IsSet() { + localVarFormParams.Add("description", parameterToString(localVarOptionals.Description.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Homepage.IsSet() { + localVarFormParams.Add("homepage", parameterToString(localVarOptionals.Homepage.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.HasIssues.IsSet() { + localVarFormParams.Add("has_issues", parameterToString(localVarOptionals.HasIssues.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.HasWiki.IsSet() { + localVarFormParams.Add("has_wiki", parameterToString(localVarOptionals.HasWiki.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.AutoInit.IsSet() { + localVarFormParams.Add("auto_init", parameterToString(localVarOptionals.AutoInit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.GitignoreTemplate.IsSet() { + localVarFormParams.Add("gitignore_template", parameterToString(localVarOptionals.GitignoreTemplate.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.LicenseTemplate.IsSet() { + localVarFormParams.Add("license_template", parameterToString(localVarOptionals.LicenseTemplate.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Private.IsSet() { + localVarFormParams.Add("private", parameterToString(localVarOptionals.Private.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Outsourced.IsSet() { + localVarFormParams.Add("outsourced", parameterToString(localVarOptionals.Outsourced.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.ProjectCreator.IsSet() { + localVarFormParams.Add("project_creator", parameterToString(localVarOptionals.ProjectCreator.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Members.IsSet() { + localVarFormParams.Add("members", parameterToString(localVarOptionals.Members.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 201 { + var v Project + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 创建组织仓库 +创建组织仓库 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param name 仓库名称 + * @param org 组织的路径(path/login) + * @param optional nil or *PostV5OrgsOrgReposOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Description" (optional.String) - 仓库描述 + * @param "Homepage" (optional.String) - 主页(eg: https://gitee.com) + * @param "HasIssues" (optional.Bool) - 允许提Issue与否。默认: 允许(true) + * @param "HasWiki" (optional.Bool) - 提供Wiki与否。默认: 提供(true) + * @param "Public" (optional.Int32) - 仓库开源类型。0(私有), 1(外部开源), 2(内部开源),注:与private互斥,以public为主。 + * @param "Private" (optional.Bool) - 仓库公开或私有。默认: 公开(false),注:与public互斥,以public为主。 + * @param "AutoInit" (optional.Bool) - 值为true时则会用README初始化仓库。默认: 不初始化(false) + * @param "GitignoreTemplate" (optional.String) - Git Ingore模版 + * @param "LicenseTemplate" (optional.String) - License模版 + +@return Project +*/ + +type PostV5OrgsOrgReposOpts struct { + AccessToken optional.String + Description optional.String + Homepage optional.String + HasIssues optional.Bool + HasWiki optional.Bool + Public optional.Int32 + Private optional.Bool + AutoInit optional.Bool + GitignoreTemplate optional.String + LicenseTemplate optional.String +} + +func (a *RepositoriesApiService) PostV5OrgsOrgRepos(ctx context.Context, name string, org string, localVarOptionals *PostV5OrgsOrgReposOpts) (Project, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Project + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/orgs/{org}/repos" + localVarPath = strings.Replace(localVarPath, "{"+"org"+"}", fmt.Sprintf("%v", org), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("name", parameterToString(name, "")) + if localVarOptionals != nil && localVarOptionals.Description.IsSet() { + localVarFormParams.Add("description", parameterToString(localVarOptionals.Description.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Homepage.IsSet() { + localVarFormParams.Add("homepage", parameterToString(localVarOptionals.Homepage.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.HasIssues.IsSet() { + localVarFormParams.Add("has_issues", parameterToString(localVarOptionals.HasIssues.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.HasWiki.IsSet() { + localVarFormParams.Add("has_wiki", parameterToString(localVarOptionals.HasWiki.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Public.IsSet() { + localVarFormParams.Add("public", parameterToString(localVarOptionals.Public.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Private.IsSet() { + localVarFormParams.Add("private", parameterToString(localVarOptionals.Private.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.AutoInit.IsSet() { + localVarFormParams.Add("auto_init", parameterToString(localVarOptionals.AutoInit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.GitignoreTemplate.IsSet() { + localVarFormParams.Add("gitignore_template", parameterToString(localVarOptionals.GitignoreTemplate.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.LicenseTemplate.IsSet() { + localVarFormParams.Add("license_template", parameterToString(localVarOptionals.LicenseTemplate.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 201 { + var v Project + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 创建分支 +创建分支 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param refs 起点名称, 默认:master + * @param branchName 新创建的分支名称 + * @param optional nil or *PostV5ReposOwnerRepoBranchesOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return CompleteBranch +*/ + +type PostV5ReposOwnerRepoBranchesOpts struct { + AccessToken optional.String +} + +func (a *RepositoriesApiService) PostV5ReposOwnerRepoBranches(ctx context.Context, owner string, repo string, refs string, branchName string, localVarOptionals *PostV5ReposOwnerRepoBranchesOpts) (CompleteBranch, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue CompleteBranch + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/branches" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("refs", parameterToString(refs, "")) + localVarFormParams.Add("branch_name", parameterToString(branchName, "")) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 201 { + var v CompleteBranch + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 创建Commit评论 +创建Commit评论 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param sha 评论的sha值 + * @param body 评论的内容 + * @param optional nil or *PostV5ReposOwnerRepoCommitsShaCommentsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Path" (optional.String) - 文件的相对路径 + * @param "Position" (optional.Int32) - Diff的相对行数 + +@return Note +*/ + +type PostV5ReposOwnerRepoCommitsShaCommentsOpts struct { + AccessToken optional.String + Path optional.String + Position optional.Int32 +} + +func (a *RepositoriesApiService) PostV5ReposOwnerRepoCommitsShaComments(ctx context.Context, owner string, repo string, sha string, body string, localVarOptionals *PostV5ReposOwnerRepoCommitsShaCommentsOpts) (Note, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Note + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/commits/{sha}/comments" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"sha"+"}", fmt.Sprintf("%v", sha), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("body", parameterToString(body, "")) + if localVarOptionals != nil && localVarOptionals.Path.IsSet() { + localVarFormParams.Add("path", parameterToString(localVarOptionals.Path.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Position.IsSet() { + localVarFormParams.Add("position", parameterToString(localVarOptionals.Position.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 201 { + var v Note + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 新建文件 +新建文件 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param path 文件的路径 + * @param content 文件内容, 要用 base64 编码 + * @param message 提交信息 + * @param optional nil or *PostV5ReposOwnerRepoContentsPathOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Branch" (optional.String) - 分支名称。默认为仓库对默认分支 + * @param "CommitterName" (optional.String) - Committer的名字,默认为当前用户的名字 + * @param "CommitterEmail" (optional.String) - Committer的邮箱,默认为当前用户的邮箱 + * @param "AuthorName" (optional.String) - Author的名字,默认为当前用户的名字 + * @param "AuthorEmail" (optional.String) - Author的邮箱,默认为当前用户的邮箱 + +@return CommitContent +*/ + +type PostV5ReposOwnerRepoContentsPathOpts struct { + AccessToken optional.String + Branch optional.String + CommitterName optional.String + CommitterEmail optional.String + AuthorName optional.String + AuthorEmail optional.String +} + +func (a *RepositoriesApiService) PostV5ReposOwnerRepoContentsPath(ctx context.Context, owner string, repo string, path string, content string, message string, localVarOptionals *PostV5ReposOwnerRepoContentsPathOpts) (CommitContent, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue CommitContent + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/contents/{path}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"path"+"}", fmt.Sprintf("%v", path), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("content", parameterToString(content, "")) + localVarFormParams.Add("message", parameterToString(message, "")) + if localVarOptionals != nil && localVarOptionals.Branch.IsSet() { + localVarFormParams.Add("branch", parameterToString(localVarOptionals.Branch.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.CommitterName.IsSet() { + localVarFormParams.Add("committer[name]", parameterToString(localVarOptionals.CommitterName.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.CommitterEmail.IsSet() { + localVarFormParams.Add("committer[email]", parameterToString(localVarOptionals.CommitterEmail.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.AuthorName.IsSet() { + localVarFormParams.Add("author[name]", parameterToString(localVarOptionals.AuthorName.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.AuthorEmail.IsSet() { + localVarFormParams.Add("author[email]", parameterToString(localVarOptionals.AuthorEmail.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 201 { + var v CommitContent + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService Fork一个仓库 +Fork一个仓库 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *PostV5ReposOwnerRepoForksOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Organization" (optional.String) - 组织空间地址,不填写默认Fork到用户个人空间地址 + +@return Project +*/ + +type PostV5ReposOwnerRepoForksOpts struct { + AccessToken optional.String + Organization optional.String +} + +func (a *RepositoriesApiService) PostV5ReposOwnerRepoForks(ctx context.Context, owner string, repo string, localVarOptionals *PostV5ReposOwnerRepoForksOpts) (Project, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Project + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/forks" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Organization.IsSet() { + localVarFormParams.Add("organization", parameterToString(localVarOptionals.Organization.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 201 { + var v Project + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 为仓库添加公钥 +为仓库添加公钥 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param key 公钥内容 + * @param title 公钥名称 + * @param optional nil or *PostV5ReposOwnerRepoKeysOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return SshKey +*/ + +type PostV5ReposOwnerRepoKeysOpts struct { + AccessToken optional.String +} + +func (a *RepositoriesApiService) PostV5ReposOwnerRepoKeys(ctx context.Context, owner string, repo string, key string, title string, localVarOptionals *PostV5ReposOwnerRepoKeysOpts) (SshKey, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue SshKey + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/keys" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("key", parameterToString(key, "")) + localVarFormParams.Add("title", parameterToString(title, "")) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 201 { + var v SshKey + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 请求建立Pages +请求建立Pages + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *PostV5ReposOwnerRepoPagesBuildsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type PostV5ReposOwnerRepoPagesBuildsOpts struct { + AccessToken optional.String +} + +func (a *RepositoriesApiService) PostV5ReposOwnerRepoPagesBuilds(ctx context.Context, owner string, repo string, localVarOptionals *PostV5ReposOwnerRepoPagesBuildsOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/pages/builds" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +RepositoriesApiService 创建仓库Release +创建仓库Release + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param tagName Tag 名称, 提倡以v字母为前缀做为Release名称,例如v1.0或者v2.3.4 + * @param name Release 名称 + * @param body Release 描述 + * @param targetCommitish 分支名称或者commit SHA, 默认是当前默认分支 + * @param optional nil or *PostV5ReposOwnerRepoReleasesOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Prerelease" (optional.Bool) - 是否为预览版本。默认: false(非预览版本) + +@return Release +*/ + +type PostV5ReposOwnerRepoReleasesOpts struct { + AccessToken optional.String + Prerelease optional.Bool +} + +func (a *RepositoriesApiService) PostV5ReposOwnerRepoReleases(ctx context.Context, owner string, repo string, tagName string, name string, body string, targetCommitish string, localVarOptionals *PostV5ReposOwnerRepoReleasesOpts) (Release, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Release + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/releases" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("tag_name", parameterToString(tagName, "")) + localVarFormParams.Add("name", parameterToString(name, "")) + localVarFormParams.Add("body", parameterToString(body, "")) + if localVarOptionals != nil && localVarOptionals.Prerelease.IsSet() { + localVarFormParams.Add("prerelease", parameterToString(localVarOptionals.Prerelease.Value(), "")) + } + localVarFormParams.Add("target_commitish", parameterToString(targetCommitish, "")) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 201 { + var v Release + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 创建一个仓库 +创建一个仓库 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param name 仓库名称 + * @param optional nil or *PostV5UserReposOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Description" (optional.String) - 仓库描述 + * @param "Homepage" (optional.String) - 主页(eg: https://gitee.com) + * @param "HasIssues" (optional.Bool) - 允许提Issue与否。默认: 允许(true) + * @param "HasWiki" (optional.Bool) - 提供Wiki与否。默认: 提供(true) + * @param "AutoInit" (optional.Bool) - 值为true时则会用README初始化仓库。默认: 不初始化(false) + * @param "GitignoreTemplate" (optional.String) - Git Ingore模版 + * @param "LicenseTemplate" (optional.String) - License模版 + * @param "Private" (optional.Bool) - 仓库公开或私有。默认: 公开(false) + +@return Project +*/ + +type PostV5UserReposOpts struct { + AccessToken optional.String + Description optional.String + Homepage optional.String + HasIssues optional.Bool + HasWiki optional.Bool + AutoInit optional.Bool + GitignoreTemplate optional.String + LicenseTemplate optional.String + Private optional.Bool +} + +func (a *RepositoriesApiService) PostV5UserRepos(ctx context.Context, name string, localVarOptionals *PostV5UserReposOpts) (Project, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Project + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/user/repos" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("name", parameterToString(name, "")) + if localVarOptionals != nil && localVarOptionals.Description.IsSet() { + localVarFormParams.Add("description", parameterToString(localVarOptionals.Description.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Homepage.IsSet() { + localVarFormParams.Add("homepage", parameterToString(localVarOptionals.Homepage.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.HasIssues.IsSet() { + localVarFormParams.Add("has_issues", parameterToString(localVarOptionals.HasIssues.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.HasWiki.IsSet() { + localVarFormParams.Add("has_wiki", parameterToString(localVarOptionals.HasWiki.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.AutoInit.IsSet() { + localVarFormParams.Add("auto_init", parameterToString(localVarOptionals.AutoInit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.GitignoreTemplate.IsSet() { + localVarFormParams.Add("gitignore_template", parameterToString(localVarOptionals.GitignoreTemplate.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.LicenseTemplate.IsSet() { + localVarFormParams.Add("license_template", parameterToString(localVarOptionals.LicenseTemplate.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Private.IsSet() { + localVarFormParams.Add("private", parameterToString(localVarOptionals.Private.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 201 { + var v Project + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 设置分支保护 +设置分支保护 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param branch 分支名称 + * @param optional nil or *PutV5ReposOwnerRepoBranchesBranchProtectionOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return CompleteBranch +*/ + +type PutV5ReposOwnerRepoBranchesBranchProtectionOpts struct { + AccessToken optional.String +} + +func (a *RepositoriesApiService) PutV5ReposOwnerRepoBranchesBranchProtection(ctx context.Context, owner string, repo string, branch string, localVarOptionals *PutV5ReposOwnerRepoBranchesBranchProtectionOpts) (CompleteBranch, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue CompleteBranch + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/branches/{branch}/protection" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"branch"+"}", fmt.Sprintf("%v", branch), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v CompleteBranch + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 清空一个仓库 +清空一个仓库 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *PutV5ReposOwnerRepoClearOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type PutV5ReposOwnerRepoClearOpts struct { + AccessToken optional.String +} + +func (a *RepositoriesApiService) PutV5ReposOwnerRepoClear(ctx context.Context, owner string, repo string, localVarOptionals *PutV5ReposOwnerRepoClearOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/clear" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +RepositoriesApiService 添加仓库成员 +添加仓库成员 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param username 用户名(username/login) + * @param permission 成员权限: 拉代码(pull),推代码(push),管理员(admin)。默认: push + * @param optional nil or *PutV5ReposOwnerRepoCollaboratorsUsernameOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return ProjectMember +*/ + +type PutV5ReposOwnerRepoCollaboratorsUsernameOpts struct { + AccessToken optional.String +} + +func (a *RepositoriesApiService) PutV5ReposOwnerRepoCollaboratorsUsername(ctx context.Context, owner string, repo string, username string, permission string, localVarOptionals *PutV5ReposOwnerRepoCollaboratorsUsernameOpts) (ProjectMember, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ProjectMember + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/collaborators/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("permission", parameterToString(permission, "")) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v ProjectMember + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 更新文件 +更新文件 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param path 文件的路径 + * @param content 文件内容, 要用 base64 编码 + * @param sha 文件的 Blob SHA,可通过 [获取仓库具体路径下的内容] API 获取 + * @param message 提交信息 + * @param optional nil or *PutV5ReposOwnerRepoContentsPathOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Branch" (optional.String) - 分支名称。默认为仓库对默认分支 + * @param "CommitterName" (optional.String) - Committer的名字,默认为当前用户的名字 + * @param "CommitterEmail" (optional.String) - Committer的邮箱,默认为当前用户的邮箱 + * @param "AuthorName" (optional.String) - Author的名字,默认为当前用户的名字 + * @param "AuthorEmail" (optional.String) - Author的邮箱,默认为当前用户的邮箱 + +@return CommitContent +*/ + +type PutV5ReposOwnerRepoContentsPathOpts struct { + AccessToken optional.String + Branch optional.String + CommitterName optional.String + CommitterEmail optional.String + AuthorName optional.String + AuthorEmail optional.String +} + +func (a *RepositoriesApiService) PutV5ReposOwnerRepoContentsPath(ctx context.Context, owner string, repo string, path string, content string, sha string, message string, localVarOptionals *PutV5ReposOwnerRepoContentsPathOpts) (CommitContent, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue CommitContent + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/contents/{path}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"path"+"}", fmt.Sprintf("%v", path), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("content", parameterToString(content, "")) + localVarFormParams.Add("sha", parameterToString(sha, "")) + localVarFormParams.Add("message", parameterToString(message, "")) + if localVarOptionals != nil && localVarOptionals.Branch.IsSet() { + localVarFormParams.Add("branch", parameterToString(localVarOptionals.Branch.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.CommitterName.IsSet() { + localVarFormParams.Add("committer[name]", parameterToString(localVarOptionals.CommitterName.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.CommitterEmail.IsSet() { + localVarFormParams.Add("committer[email]", parameterToString(localVarOptionals.CommitterEmail.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.AuthorName.IsSet() { + localVarFormParams.Add("author[name]", parameterToString(localVarOptionals.AuthorName.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.AuthorEmail.IsSet() { + localVarFormParams.Add("author[email]", parameterToString(localVarOptionals.AuthorEmail.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v CommitContent + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +RepositoriesApiService 启用仓库公钥 +启用仓库公钥 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param id 公钥 ID + * @param optional nil or *PutV5ReposOwnerRepoKeysEnableIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type PutV5ReposOwnerRepoKeysEnableIdOpts struct { + AccessToken optional.String +} + +func (a *RepositoriesApiService) PutV5ReposOwnerRepoKeysEnableId(ctx context.Context, owner string, repo string, id int32, localVarOptionals *PutV5ReposOwnerRepoKeysEnableIdOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/keys/enable/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} diff --git a/api_search.go b/api_search.go new file mode 100644 index 0000000..ac22df6 --- /dev/null +++ b/api_search.go @@ -0,0 +1,557 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type SearchApiService service + +/* +SearchApiService 搜索代码片段 +搜索代码片段 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param q 搜索关键字 + * @param optional nil or *GetV5SearchGistsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + * @param "Language" (optional.String) - 筛选指定语言的代码片段 + * @param "Owner" (optional.String) - 筛选所属用户 (username/login) 的代码片段 + * @param "Sort" (optional.String) - 排序字段,created_at(创建时间)、updated_at(更新时间)、notes_count(评论数)、stars_count(收藏数)、forks_count(Fork 数),默认为最佳匹配 + * @param "Order" (optional.String) - 排序顺序: desc(default)、asc + +@return []Code +*/ + +type GetV5SearchGistsOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 + Language optional.String + Owner optional.String + Sort optional.String + Order optional.String +} + +func (a *SearchApiService) GetV5SearchGists(ctx context.Context, q string, localVarOptionals *GetV5SearchGistsOpts) ([]Code, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Code + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/search/gists" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarQueryParams.Add("q", parameterToString(q, "")) + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Language.IsSet() { + localVarQueryParams.Add("language", parameterToString(localVarOptionals.Language.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Owner.IsSet() { + localVarQueryParams.Add("owner", parameterToString(localVarOptionals.Owner.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Order.IsSet() { + localVarQueryParams.Add("order", parameterToString(localVarOptionals.Order.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Code + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +SearchApiService 搜索 Issues +搜索 Issues + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param q 搜索关键字 + * @param optional nil or *GetV5SearchIssuesOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + * @param "Repo" (optional.String) - 筛选指定仓库 (path, e.g. oschina/git-osc) 的 issues + * @param "Language" (optional.String) - 筛选指定语言的 issues + * @param "Label" (optional.String) - 筛选指定标签的 issues + * @param "State" (optional.String) - 筛选指定状态的 issues, open(开启)、closed(完成)、rejected(拒绝) + * @param "Author" (optional.String) - 筛选指定创建者 (username/login) 的 issues + * @param "Assignee" (optional.String) - 筛选指定负责人 (username/login) 的 issues + * @param "Sort" (optional.String) - 排序字段,created_at(创建时间)、last_push_at(更新时间)、notes_count(评论数),默认为最佳匹配 + * @param "Order" (optional.String) - 排序顺序: desc(default)、asc + +@return []Issue +*/ + +type GetV5SearchIssuesOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 + Repo optional.String + Language optional.String + Label optional.String + State optional.String + Author optional.String + Assignee optional.String + Sort optional.String + Order optional.String +} + +func (a *SearchApiService) GetV5SearchIssues(ctx context.Context, q string, localVarOptionals *GetV5SearchIssuesOpts) ([]Issue, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Issue + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/search/issues" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarQueryParams.Add("q", parameterToString(q, "")) + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Repo.IsSet() { + localVarQueryParams.Add("repo", parameterToString(localVarOptionals.Repo.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Language.IsSet() { + localVarQueryParams.Add("language", parameterToString(localVarOptionals.Language.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Label.IsSet() { + localVarQueryParams.Add("label", parameterToString(localVarOptionals.Label.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.State.IsSet() { + localVarQueryParams.Add("state", parameterToString(localVarOptionals.State.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Author.IsSet() { + localVarQueryParams.Add("author", parameterToString(localVarOptionals.Author.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Assignee.IsSet() { + localVarQueryParams.Add("assignee", parameterToString(localVarOptionals.Assignee.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Order.IsSet() { + localVarQueryParams.Add("order", parameterToString(localVarOptionals.Order.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Issue + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +SearchApiService 搜索仓库 +搜索仓库 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param q 搜索关键字 + * @param optional nil or *GetV5SearchRepositoriesOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + * @param "Owner" (optional.String) - 筛选指定空间地址(企业、组织或个人的地址 path) 的仓库 + * @param "Fork" (optional.Bool) - 是否搜索含 fork 的仓库,默认:否 + * @param "Language" (optional.String) - 筛选指定语言的仓库 + * @param "Sort" (optional.String) - 排序字段,created_at(创建时间)、last_push_at(更新时间)、stars_count(收藏数)、forks_count(Fork 数)、watches_count(关注数),默认为最佳匹配 + * @param "Order" (optional.String) - 排序顺序: desc(default)、asc + +@return []Project +*/ + +type GetV5SearchRepositoriesOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 + Owner optional.String + Fork optional.Bool + Language optional.String + Sort optional.String + Order optional.String +} + +func (a *SearchApiService) GetV5SearchRepositories(ctx context.Context, q string, localVarOptionals *GetV5SearchRepositoriesOpts) ([]Project, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Project + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/search/repositories" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarQueryParams.Add("q", parameterToString(q, "")) + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Owner.IsSet() { + localVarQueryParams.Add("owner", parameterToString(localVarOptionals.Owner.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Fork.IsSet() { + localVarQueryParams.Add("fork", parameterToString(localVarOptionals.Fork.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Language.IsSet() { + localVarQueryParams.Add("language", parameterToString(localVarOptionals.Language.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Order.IsSet() { + localVarQueryParams.Add("order", parameterToString(localVarOptionals.Order.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Project + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +SearchApiService 搜索用户 +搜索用户 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param q 搜索关键字 + * @param optional nil or *GetV5SearchUsersOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + * @param "Sort" (optional.String) - 排序字段,joined_at(注册时间),默认为最佳匹配 + * @param "Order" (optional.String) - 排序顺序: desc(default)、asc + +@return []User +*/ + +type GetV5SearchUsersOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 + Sort optional.String + Order optional.String +} + +func (a *SearchApiService) GetV5SearchUsers(ctx context.Context, q string, localVarOptionals *GetV5SearchUsersOpts) ([]User, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []User + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/search/users" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarQueryParams.Add("q", parameterToString(q, "")) + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Order.IsSet() { + localVarQueryParams.Add("order", parameterToString(localVarOptionals.Order.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []User + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/api_users.go b/api_users.go new file mode 100644 index 0000000..61c267f --- /dev/null +++ b/api_users.go @@ -0,0 +1,1796 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type UsersApiService service + +/* +UsersApiService 取消关注一个用户 +取消关注一个用户 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param username 用户名(username/login) + * @param optional nil or *DeleteV5UserFollowingUsernameOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type DeleteV5UserFollowingUsernameOpts struct { + AccessToken optional.String +} + +func (a *UsersApiService) DeleteV5UserFollowingUsername(ctx context.Context, username string, localVarOptionals *DeleteV5UserFollowingUsernameOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/user/following/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +UsersApiService 删除一个公钥 +删除一个公钥 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id 公钥 ID + * @param optional nil or *DeleteV5UserKeysIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type DeleteV5UserKeysIdOpts struct { + AccessToken optional.String +} + +func (a *UsersApiService) DeleteV5UserKeysId(ctx context.Context, id int32, localVarOptionals *DeleteV5UserKeysIdOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/user/keys/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +UsersApiService 获取授权用户的资料 +获取授权用户的资料 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *GetV5UserOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return User +*/ + +type GetV5UserOpts struct { + AccessToken optional.String +} + +func (a *UsersApiService) GetV5User(ctx context.Context, localVarOptionals *GetV5UserOpts) (User, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue User + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/user" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v User + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +UsersApiService 列出授权用户的关注者 +列出授权用户的关注者 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *GetV5UserFollowersOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []UserBasic +*/ + +type GetV5UserFollowersOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *UsersApiService) GetV5UserFollowers(ctx context.Context, localVarOptionals *GetV5UserFollowersOpts) ([]UserBasic, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []UserBasic + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/user/followers" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []UserBasic + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +UsersApiService 列出授权用户正关注的用户 +列出授权用户正关注的用户 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *GetV5UserFollowingOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []UserBasic +*/ + +type GetV5UserFollowingOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *UsersApiService) GetV5UserFollowing(ctx context.Context, localVarOptionals *GetV5UserFollowingOpts) ([]UserBasic, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []UserBasic + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/user/following" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []UserBasic + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +UsersApiService 检查授权用户是否关注了一个用户 +检查授权用户是否关注了一个用户 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param username 用户名(username/login) + * @param optional nil or *GetV5UserFollowingUsernameOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type GetV5UserFollowingUsernameOpts struct { + AccessToken optional.String +} + +func (a *UsersApiService) GetV5UserFollowingUsername(ctx context.Context, username string, localVarOptionals *GetV5UserFollowingUsernameOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/user/following/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +UsersApiService 列出授权用户的所有公钥 +列出授权用户的所有公钥 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *GetV5UserKeysOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []SshKey +*/ + +type GetV5UserKeysOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *UsersApiService) GetV5UserKeys(ctx context.Context, localVarOptionals *GetV5UserKeysOpts) ([]SshKey, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SshKey + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/user/keys" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []SshKey + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +UsersApiService 获取一个公钥 +获取一个公钥 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id 公钥 ID + * @param optional nil or *GetV5UserKeysIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return SshKey +*/ + +type GetV5UserKeysIdOpts struct { + AccessToken optional.String +} + +func (a *UsersApiService) GetV5UserKeysId(ctx context.Context, id int32, localVarOptionals *GetV5UserKeysIdOpts) (SshKey, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue SshKey + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/user/keys/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v SshKey + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +UsersApiService 获取授权用户的一个 Namespace +获取授权用户的一个 Namespace + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param path Namespace path + * @param optional nil or *GetV5UserNamespaceOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return []Namespace +*/ + +type GetV5UserNamespaceOpts struct { + AccessToken optional.String +} + +func (a *UsersApiService) GetV5UserNamespace(ctx context.Context, path string, localVarOptionals *GetV5UserNamespaceOpts) ([]Namespace, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Namespace + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/user/namespace" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarQueryParams.Add("path", parameterToString(path, "")) + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Namespace + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +UsersApiService 列出授权用户所有的 Namespace +列出授权用户所有的 Namespace + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *GetV5UserNamespacesOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Mode" (optional.String) - 参与方式: project(所有参与仓库的namepsce)、intrant(所加入的namespace)、all(包含前两者),默认(intrant) + +@return []Namespace +*/ + +type GetV5UserNamespacesOpts struct { + AccessToken optional.String + Mode optional.String +} + +func (a *UsersApiService) GetV5UserNamespaces(ctx context.Context, localVarOptionals *GetV5UserNamespacesOpts) ([]Namespace, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Namespace + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/user/namespaces" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Mode.IsSet() { + localVarQueryParams.Add("mode", parameterToString(localVarOptionals.Mode.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Namespace + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +UsersApiService 获取一个用户 +获取一个用户 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param username 用户名(username/login) + * @param optional nil or *GetV5UsersUsernameOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return User +*/ + +type GetV5UsersUsernameOpts struct { + AccessToken optional.String +} + +func (a *UsersApiService) GetV5UsersUsername(ctx context.Context, username string, localVarOptionals *GetV5UsersUsernameOpts) (User, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue User + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/users/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v User + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +UsersApiService 列出指定用户的关注者 +列出指定用户的关注者 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param username 用户名(username/login) + * @param optional nil or *GetV5UsersUsernameFollowersOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []UserBasic +*/ + +type GetV5UsersUsernameFollowersOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *UsersApiService) GetV5UsersUsernameFollowers(ctx context.Context, username string, localVarOptionals *GetV5UsersUsernameFollowersOpts) ([]UserBasic, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []UserBasic + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/users/{username}/followers" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []UserBasic + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +UsersApiService 列出指定用户正在关注的用户 +列出指定用户正在关注的用户 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param username 用户名(username/login) + * @param optional nil or *GetV5UsersUsernameFollowingOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []UserBasic +*/ + +type GetV5UsersUsernameFollowingOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *UsersApiService) GetV5UsersUsernameFollowing(ctx context.Context, username string, localVarOptionals *GetV5UsersUsernameFollowingOpts) ([]UserBasic, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []UserBasic + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/users/{username}/following" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []UserBasic + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +UsersApiService 检查指定用户是否关注目标用户 +检查指定用户是否关注目标用户 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param username 用户名(username/login) + * @param targetUser 目标用户的用户名(username/login) + * @param optional nil or *GetV5UsersUsernameFollowingTargetUserOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type GetV5UsersUsernameFollowingTargetUserOpts struct { + AccessToken optional.String +} + +func (a *UsersApiService) GetV5UsersUsernameFollowingTargetUser(ctx context.Context, username string, targetUser string, localVarOptionals *GetV5UsersUsernameFollowingTargetUserOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/users/{username}/following/{target_user}" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + localVarPath = strings.Replace(localVarPath, "{"+"target_user"+"}", fmt.Sprintf("%v", targetUser), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +UsersApiService 列出指定用户的所有公钥 +列出指定用户的所有公钥 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param username 用户名(username/login) + * @param optional nil or *GetV5UsersUsernameKeysOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []SshKeyBasic +*/ + +type GetV5UsersUsernameKeysOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *UsersApiService) GetV5UsersUsernameKeys(ctx context.Context, username string, localVarOptionals *GetV5UsersUsernameKeysOpts) ([]SshKeyBasic, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SshKeyBasic + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/users/{username}/keys" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []SshKeyBasic + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +UsersApiService 更新授权用户的资料 +更新授权用户的资料 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *PatchV5UserOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Name" (optional.String) - 昵称 + * @param "Blog" (optional.String) - 微博链接 + * @param "Weibo" (optional.String) - 博客站点 + * @param "Bio" (optional.String) - 自我介绍 + +@return User +*/ + +type PatchV5UserOpts struct { + AccessToken optional.String + Name optional.String + Blog optional.String + Weibo optional.String + Bio optional.String +} + +func (a *UsersApiService) PatchV5User(ctx context.Context, localVarOptionals *PatchV5UserOpts) (User, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue User + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/user" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Name.IsSet() { + localVarFormParams.Add("name", parameterToString(localVarOptionals.Name.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Blog.IsSet() { + localVarFormParams.Add("blog", parameterToString(localVarOptionals.Blog.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Weibo.IsSet() { + localVarFormParams.Add("weibo", parameterToString(localVarOptionals.Weibo.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Bio.IsSet() { + localVarFormParams.Add("bio", parameterToString(localVarOptionals.Bio.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v User + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +UsersApiService 添加一个公钥 +添加一个公钥 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param key 公钥内容 + * @param title 公钥名称 + * @param optional nil or *PostV5UserKeysOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return SshKey +*/ + +type PostV5UserKeysOpts struct { + AccessToken optional.String +} + +func (a *UsersApiService) PostV5UserKeys(ctx context.Context, key string, title string, localVarOptionals *PostV5UserKeysOpts) (SshKey, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue SshKey + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/user/keys" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("key", parameterToString(key, "")) + localVarFormParams.Add("title", parameterToString(title, "")) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 201 { + var v SshKey + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +UsersApiService 关注一个用户 +关注一个用户 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param username 用户名(username/login) + * @param optional nil or *PutV5UserFollowingUsernameOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type PutV5UserFollowingUsernameOpts struct { + AccessToken optional.String +} + +func (a *UsersApiService) PutV5UserFollowingUsername(ctx context.Context, username string, localVarOptionals *PutV5UserFollowingUsernameOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/user/following/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", fmt.Sprintf("%v", username), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} diff --git a/api_webhooks.go b/api_webhooks.go new file mode 100644 index 0000000..47beb0c --- /dev/null +++ b/api_webhooks.go @@ -0,0 +1,679 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type WebhooksApiService service + +/* +WebhooksApiService 删除一个仓库WebHook +删除一个仓库WebHook + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param id Webhook的ID + * @param optional nil or *DeleteV5ReposOwnerRepoHooksIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type DeleteV5ReposOwnerRepoHooksIdOpts struct { + AccessToken optional.String +} + +func (a *WebhooksApiService) DeleteV5ReposOwnerRepoHooksId(ctx context.Context, owner string, repo string, id int32, localVarOptionals *DeleteV5ReposOwnerRepoHooksIdOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/hooks/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + +/* +WebhooksApiService 列出仓库的WebHooks +列出仓库的WebHooks + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param optional nil or *GetV5ReposOwnerRepoHooksOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Page" (optional.Int32) - 当前的页码 + * @param "PerPage" (optional.Int32) - 每页的数量,最大为 100 + +@return []Hook +*/ + +type GetV5ReposOwnerRepoHooksOpts struct { + AccessToken optional.String + Page optional.Int32 + PerPage optional.Int32 +} + +func (a *WebhooksApiService) GetV5ReposOwnerRepoHooks(ctx context.Context, owner string, repo string, localVarOptionals *GetV5ReposOwnerRepoHooksOpts) ([]Hook, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Hook + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/hooks" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() { + localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v []Hook + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +WebhooksApiService 获取仓库单个WebHook +获取仓库单个WebHook + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param id Webhook的ID + * @param optional nil or *GetV5ReposOwnerRepoHooksIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + +@return Hook +*/ + +type GetV5ReposOwnerRepoHooksIdOpts struct { + AccessToken optional.String +} + +func (a *WebhooksApiService) GetV5ReposOwnerRepoHooksId(ctx context.Context, owner string, repo string, id int32, localVarOptionals *GetV5ReposOwnerRepoHooksIdOpts) (Hook, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Hook + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/hooks/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Hook + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +WebhooksApiService 更新一个仓库WebHook +更新一个仓库WebHook + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param id Webhook的ID + * @param url 远程HTTP URL + * @param optional nil or *PatchV5ReposOwnerRepoHooksIdOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Password" (optional.String) - 请求URL时会带上该密码,防止URL被恶意请求 + * @param "PushEvents" (optional.Bool) - Push代码到仓库 + * @param "TagPushEvents" (optional.Bool) - 提交Tag到仓库 + * @param "IssuesEvents" (optional.Bool) - 创建/关闭Issue + * @param "NoteEvents" (optional.Bool) - 评论了Issue/代码等等 + * @param "MergeRequestsEvents" (optional.Bool) - 合并请求和合并后 + +@return Hook +*/ + +type PatchV5ReposOwnerRepoHooksIdOpts struct { + AccessToken optional.String + Password optional.String + PushEvents optional.Bool + TagPushEvents optional.Bool + IssuesEvents optional.Bool + NoteEvents optional.Bool + MergeRequestsEvents optional.Bool +} + +func (a *WebhooksApiService) PatchV5ReposOwnerRepoHooksId(ctx context.Context, owner string, repo string, id int32, url string, localVarOptionals *PatchV5ReposOwnerRepoHooksIdOpts) (Hook, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Hook + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/hooks/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("url", parameterToString(url, "")) + if localVarOptionals != nil && localVarOptionals.Password.IsSet() { + localVarFormParams.Add("password", parameterToString(localVarOptionals.Password.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PushEvents.IsSet() { + localVarFormParams.Add("push_events", parameterToString(localVarOptionals.PushEvents.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.TagPushEvents.IsSet() { + localVarFormParams.Add("tag_push_events", parameterToString(localVarOptionals.TagPushEvents.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.IssuesEvents.IsSet() { + localVarFormParams.Add("issues_events", parameterToString(localVarOptionals.IssuesEvents.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.NoteEvents.IsSet() { + localVarFormParams.Add("note_events", parameterToString(localVarOptionals.NoteEvents.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.MergeRequestsEvents.IsSet() { + localVarFormParams.Add("merge_requests_events", parameterToString(localVarOptionals.MergeRequestsEvents.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 200 { + var v Hook + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +WebhooksApiService 创建一个仓库WebHook +创建一个仓库WebHook + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param url 远程HTTP URL + * @param optional nil or *PostV5ReposOwnerRepoHooksOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + * @param "Password" (optional.String) - 请求URL时会带上该密码,防止URL被恶意请求 + * @param "PushEvents" (optional.Bool) - Push代码到仓库 + * @param "TagPushEvents" (optional.Bool) - 提交Tag到仓库 + * @param "IssuesEvents" (optional.Bool) - 创建/关闭Issue + * @param "NoteEvents" (optional.Bool) - 评论了Issue/代码等等 + * @param "MergeRequestsEvents" (optional.Bool) - 合并请求和合并后 + +@return Hook +*/ + +type PostV5ReposOwnerRepoHooksOpts struct { + AccessToken optional.String + Password optional.String + PushEvents optional.Bool + TagPushEvents optional.Bool + IssuesEvents optional.Bool + NoteEvents optional.Bool + MergeRequestsEvents optional.Bool +} + +func (a *WebhooksApiService) PostV5ReposOwnerRepoHooks(ctx context.Context, owner string, repo string, url string, localVarOptionals *PostV5ReposOwnerRepoHooksOpts) (Hook, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Hook + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/hooks" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + localVarFormParams.Add("url", parameterToString(url, "")) + if localVarOptionals != nil && localVarOptionals.Password.IsSet() { + localVarFormParams.Add("password", parameterToString(localVarOptionals.Password.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PushEvents.IsSet() { + localVarFormParams.Add("push_events", parameterToString(localVarOptionals.PushEvents.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.TagPushEvents.IsSet() { + localVarFormParams.Add("tag_push_events", parameterToString(localVarOptionals.TagPushEvents.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.IssuesEvents.IsSet() { + localVarFormParams.Add("issues_events", parameterToString(localVarOptionals.IssuesEvents.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.NoteEvents.IsSet() { + localVarFormParams.Add("note_events", parameterToString(localVarOptionals.NoteEvents.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.MergeRequestsEvents.IsSet() { + localVarFormParams.Add("merge_requests_events", parameterToString(localVarOptionals.MergeRequestsEvents.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + if localVarHttpResponse.StatusCode == 201 { + var v Hook + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} + +/* +WebhooksApiService 测试WebHook是否发送成功 +测试WebHook是否发送成功 + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param owner 仓库所属空间地址(企业、组织或个人的地址path) + * @param repo 仓库路径(path) + * @param id Webhook的ID + * @param optional nil or *PostV5ReposOwnerRepoHooksIdTestsOpts - Optional Parameters: + * @param "AccessToken" (optional.String) - 用户授权码 + + +*/ + +type PostV5ReposOwnerRepoHooksIdTestsOpts struct { + AccessToken optional.String +} + +func (a *WebhooksApiService) PostV5ReposOwnerRepoHooksIdTests(ctx context.Context, owner string, repo string, id int32, localVarOptionals *PostV5ReposOwnerRepoHooksIdTestsOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/hooks/{id}/tests" + localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { + localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} diff --git a/client.go b/client.go new file mode 100644 index 0000000..4232f05 --- /dev/null +++ b/client.go @@ -0,0 +1,503 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "mime/multipart" + "net/http" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "golang.org/x/oauth2" +) + +var ( + jsonCheck = regexp.MustCompile("(?i:[application|text]/json)") + xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)") +) + +// APIClient manages communication with the 码云 Open API API v5.3.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + ActivityApi *ActivityApiService + + EnterprisesApi *EnterprisesApiService + + GistsApi *GistsApiService + + GitDataApi *GitDataApiService + + IssuesApi *IssuesApiService + + LabelsApi *LabelsApiService + + MilestonesApi *MilestonesApiService + + MiscellaneousApi *MiscellaneousApiService + + OrganizationsApi *OrganizationsApiService + + PullRequestsApi *PullRequestsApiService + + RepositoriesApi *RepositoriesApiService + + SearchApi *SearchApiService + + UsersApi *UsersApiService + + WebhooksApi *WebhooksApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.ActivityApi = (*ActivityApiService)(&c.common) + c.EnterprisesApi = (*EnterprisesApiService)(&c.common) + c.GistsApi = (*GistsApiService)(&c.common) + c.GitDataApi = (*GitDataApiService)(&c.common) + c.IssuesApi = (*IssuesApiService)(&c.common) + c.LabelsApi = (*LabelsApiService)(&c.common) + c.MilestonesApi = (*MilestonesApiService)(&c.common) + c.MiscellaneousApi = (*MiscellaneousApiService)(&c.common) + c.OrganizationsApi = (*OrganizationsApiService)(&c.common) + c.PullRequestsApi = (*PullRequestsApiService)(&c.common) + c.RepositoriesApi = (*RepositoriesApiService)(&c.common) + c.SearchApi = (*SearchApiService)(&c.common) + c.UsersApi = (*UsersApiService)(&c.common) + c.WebhooksApi = (*WebhooksApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insenstive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.ToLower(a) == strings.ToLower(needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +// parameterToString convert interface{} parameters to string, using a delimiter if format is provided. +func parameterToString(obj interface{}, collectionFormat string) string { + var delimiter string + + switch collectionFormat { + case "pipes": + delimiter = "|" + case "ssv": + delimiter = " " + case "tsv": + delimiter = "\t" + case "csv": + delimiter = "," + } + + if reflect.TypeOf(obj).Kind() == reflect.Slice { + return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]") + } + + return fmt.Sprintf("%v", obj) +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + return c.cfg.HTTPClient.Do(request) +} + +// Change base path to allow switching to mocks +func (c *APIClient) ChangeBasePath(path string) { + c.cfg.BasePath = path +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + fileName string, + fileBytes []byte) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + if len(fileBytes) > 0 && fileName != "" { + w.Boundary() + //_, fileNm := filepath.Split(fileName) + part, err := w.CreateFormFile("file", filepath.Base(fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(fileBytes) + if err != nil { + return nil, err + } + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + } + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = query.Encode() + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers.Set(h, v) + } + localVarRequest.Header = headers + } + + // Override request host, if applicable + if c.cfg.Host != "" { + localVarRequest.Host = c.cfg.Host + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + // OAuth2 authentication + if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok { + // We were able to grab an oauth2 token from the context + var latestToken *oauth2.Token + if latestToken, err = tok.Token(); err != nil { + return nil, err + } + + latestToken.SetAuthHeader(localVarRequest) + } + + // Basic HTTP Authentication + if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok { + localVarRequest.SetBasicAuth(auth.UserName, auth.Password) + } + + // AccessToken Authentication + if auth, ok := ctx.Value(ContextAccessToken).(string); ok { + localVarRequest.Header.Add("Authorization", "Bearer "+auth) + } + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if strings.Contains(contentType, "application/xml") { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } else if strings.Contains(contentType, "application/json") { + if err = json.Unmarshal(b, v); err != nil { + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(path) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("Invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } + expires = now.Add(lifetime) + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericSwaggerError Provides access to the body, error and model on returned errors. +type GenericSwaggerError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericSwaggerError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericSwaggerError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericSwaggerError) Model() interface{} { + return e.model +} \ No newline at end of file diff --git a/configuration.go b/configuration.go new file mode 100644 index 0000000..687eccc --- /dev/null +++ b/configuration.go @@ -0,0 +1,72 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +import ( + "net/http" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextOAuth2 takes a oauth2.TokenSource as authentication for the request. + ContextOAuth2 = contextKey("token") + + // ContextBasicAuth takes BasicAuth as authentication for the request. + ContextBasicAuth = contextKey("basic") + + // ContextAccessToken takes a string oauth2 access token as authentication for the request. + ContextAccessToken = contextKey("accesstoken") + + // ContextAPIKey takes an APIKey as authentication for the request + ContextAPIKey = contextKey("apikey") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +type Configuration struct { + BasePath string `json:"basePath,omitempty"` + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + HTTPClient *http.Client +} + +func NewConfiguration() *Configuration { + cfg := &Configuration{ + BasePath: "https://gitee.com/api", + DefaultHeader: make(map[string]string), + UserAgent: "Swagger-Codegen/1.0.0/go", + } + return cfg +} + +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} diff --git a/docs/ActivityApi.md b/docs/ActivityApi.md new file mode 100644 index 0000000..d71368a --- /dev/null +++ b/docs/ActivityApi.md @@ -0,0 +1,1340 @@ +# \ActivityApi + +All URIs are relative to *https://gitee.com/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteV5UserStarredOwnerRepo**](ActivityApi.md#DeleteV5UserStarredOwnerRepo) | **Delete** /v5/user/starred/{owner}/{repo} | 取消 star 一个仓库 +[**DeleteV5UserSubscriptionsOwnerRepo**](ActivityApi.md#DeleteV5UserSubscriptionsOwnerRepo) | **Delete** /v5/user/subscriptions/{owner}/{repo} | 取消 watch 一个仓库 +[**GetV5Events**](ActivityApi.md#GetV5Events) | **Get** /v5/events | 获取站内所有公开动态 +[**GetV5NetworksOwnerRepoEvents**](ActivityApi.md#GetV5NetworksOwnerRepoEvents) | **Get** /v5/networks/{owner}/{repo}/events | 列出仓库的所有公开动态 +[**GetV5NotificationsCount**](ActivityApi.md#GetV5NotificationsCount) | **Get** /v5/notifications/count | 获取授权用户的通知数 +[**GetV5NotificationsMessages**](ActivityApi.md#GetV5NotificationsMessages) | **Get** /v5/notifications/messages | 列出授权用户的所有私信 +[**GetV5NotificationsMessagesId**](ActivityApi.md#GetV5NotificationsMessagesId) | **Get** /v5/notifications/messages/{id} | 获取一条私信 +[**GetV5NotificationsThreads**](ActivityApi.md#GetV5NotificationsThreads) | **Get** /v5/notifications/threads | 列出授权用户的所有通知 +[**GetV5NotificationsThreadsId**](ActivityApi.md#GetV5NotificationsThreadsId) | **Get** /v5/notifications/threads/{id} | 获取一条通知 +[**GetV5OrgsOrgEvents**](ActivityApi.md#GetV5OrgsOrgEvents) | **Get** /v5/orgs/{org}/events | 列出组织的公开动态 +[**GetV5ReposOwnerRepoEvents**](ActivityApi.md#GetV5ReposOwnerRepoEvents) | **Get** /v5/repos/{owner}/{repo}/events | 列出仓库的所有动态 +[**GetV5ReposOwnerRepoNotifications**](ActivityApi.md#GetV5ReposOwnerRepoNotifications) | **Get** /v5/repos/{owner}/{repo}/notifications | 列出一个仓库里的通知 +[**GetV5ReposOwnerRepoStargazers**](ActivityApi.md#GetV5ReposOwnerRepoStargazers) | **Get** /v5/repos/{owner}/{repo}/stargazers | 列出 star 了仓库的用户 +[**GetV5ReposOwnerRepoSubscribers**](ActivityApi.md#GetV5ReposOwnerRepoSubscribers) | **Get** /v5/repos/{owner}/{repo}/subscribers | 列出 watch 了仓库的用户 +[**GetV5UserStarred**](ActivityApi.md#GetV5UserStarred) | **Get** /v5/user/starred | 列出授权用户 star 了的仓库 +[**GetV5UserStarredOwnerRepo**](ActivityApi.md#GetV5UserStarredOwnerRepo) | **Get** /v5/user/starred/{owner}/{repo} | 检查授权用户是否 star 了一个仓库 +[**GetV5UserSubscriptions**](ActivityApi.md#GetV5UserSubscriptions) | **Get** /v5/user/subscriptions | 列出授权用户 watch 了的仓库 +[**GetV5UserSubscriptionsOwnerRepo**](ActivityApi.md#GetV5UserSubscriptionsOwnerRepo) | **Get** /v5/user/subscriptions/{owner}/{repo} | 检查授权用户是否 watch 了一个仓库 +[**GetV5UsersUsernameEvents**](ActivityApi.md#GetV5UsersUsernameEvents) | **Get** /v5/users/{username}/events | 列出用户的动态 +[**GetV5UsersUsernameEventsOrgsOrg**](ActivityApi.md#GetV5UsersUsernameEventsOrgsOrg) | **Get** /v5/users/{username}/events/orgs/{org} | 列出用户所属组织的动态 +[**GetV5UsersUsernameEventsPublic**](ActivityApi.md#GetV5UsersUsernameEventsPublic) | **Get** /v5/users/{username}/events/public | 列出用户的公开动态 +[**GetV5UsersUsernameReceivedEvents**](ActivityApi.md#GetV5UsersUsernameReceivedEvents) | **Get** /v5/users/{username}/received_events | 列出一个用户收到的动态 +[**GetV5UsersUsernameReceivedEventsPublic**](ActivityApi.md#GetV5UsersUsernameReceivedEventsPublic) | **Get** /v5/users/{username}/received_events/public | 列出一个用户收到的公开动态 +[**GetV5UsersUsernameStarred**](ActivityApi.md#GetV5UsersUsernameStarred) | **Get** /v5/users/{username}/starred | 列出用户 star 了的仓库 +[**GetV5UsersUsernameSubscriptions**](ActivityApi.md#GetV5UsersUsernameSubscriptions) | **Get** /v5/users/{username}/subscriptions | 列出用户 watch 了的仓库 +[**PatchV5NotificationsMessagesId**](ActivityApi.md#PatchV5NotificationsMessagesId) | **Patch** /v5/notifications/messages/{id} | 标记一条私信为已读 +[**PatchV5NotificationsThreadsId**](ActivityApi.md#PatchV5NotificationsThreadsId) | **Patch** /v5/notifications/threads/{id} | 标记一条通知为已读 +[**PostV5NotificationsMessages**](ActivityApi.md#PostV5NotificationsMessages) | **Post** /v5/notifications/messages | 发送私信给指定用户 +[**PutV5NotificationsMessages**](ActivityApi.md#PutV5NotificationsMessages) | **Put** /v5/notifications/messages | 标记所有私信为已读 +[**PutV5NotificationsThreads**](ActivityApi.md#PutV5NotificationsThreads) | **Put** /v5/notifications/threads | 标记所有通知为已读 +[**PutV5ReposOwnerRepoNotifications**](ActivityApi.md#PutV5ReposOwnerRepoNotifications) | **Put** /v5/repos/{owner}/{repo}/notifications | 标记一个仓库里的通知为已读 +[**PutV5UserStarredOwnerRepo**](ActivityApi.md#PutV5UserStarredOwnerRepo) | **Put** /v5/user/starred/{owner}/{repo} | star 一个仓库 +[**PutV5UserSubscriptionsOwnerRepo**](ActivityApi.md#PutV5UserSubscriptionsOwnerRepo) | **Put** /v5/user/subscriptions/{owner}/{repo} | watch 一个仓库 + + +# **DeleteV5UserStarredOwnerRepo** +> DeleteV5UserStarredOwnerRepo(ctx, owner, repo, optional) +取消 star 一个仓库 + +取消 star 一个仓库 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***DeleteV5UserStarredOwnerRepoOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DeleteV5UserStarredOwnerRepoOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **DeleteV5UserSubscriptionsOwnerRepo** +> DeleteV5UserSubscriptionsOwnerRepo(ctx, owner, repo, optional) +取消 watch 一个仓库 + +取消 watch 一个仓库 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***DeleteV5UserSubscriptionsOwnerRepoOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DeleteV5UserSubscriptionsOwnerRepoOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5Events** +> []Event GetV5Events(ctx, optional) +获取站内所有公开动态 + +获取站内所有公开动态 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***GetV5EventsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5EventsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]Event**](Event.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5NetworksOwnerRepoEvents** +> []Event GetV5NetworksOwnerRepoEvents(ctx, owner, repo, optional) +列出仓库的所有公开动态 + +列出仓库的所有公开动态 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***GetV5NetworksOwnerRepoEventsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5NetworksOwnerRepoEventsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]Event**](Event.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5NotificationsCount** +> UserNotificationCount GetV5NotificationsCount(ctx, optional) +获取授权用户的通知数 + +获取授权用户的通知数 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***GetV5NotificationsCountOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5NotificationsCountOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accessToken** | **optional.String**| 用户授权码 | + **unread** | **optional.Bool**| 是否只获取未读消息,默认:否 | + +### Return type + +[**UserNotificationCount**](UserNotificationCount.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5NotificationsMessages** +> []UserMessageList GetV5NotificationsMessages(ctx, optional) +列出授权用户的所有私信 + +列出授权用户的所有私信 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***GetV5NotificationsMessagesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5NotificationsMessagesOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accessToken** | **optional.String**| 用户授权码 | + **unread** | **optional.Bool**| 是否只显示未读私信,默认:否 | + **since** | **optional.String**| 只获取在给定时间后更新的私信,要求时间格式为 ISO 8601 | + **before** | **optional.String**| 只获取在给定时间前更新的私信,要求时间格式为 ISO 8601 | + **ids** | **optional.String**| 指定一组私信 ID,以 , 分隔 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]UserMessageList**](UserMessageList.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5NotificationsMessagesId** +> UserMessage GetV5NotificationsMessagesId(ctx, id, optional) +获取一条私信 + +获取一条私信 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| 私信的 ID | + **optional** | ***GetV5NotificationsMessagesIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5NotificationsMessagesIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**UserMessage**](UserMessage.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5NotificationsThreads** +> []UserNotificationList GetV5NotificationsThreads(ctx, optional) +列出授权用户的所有通知 + +列出授权用户的所有通知 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***GetV5NotificationsThreadsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5NotificationsThreadsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accessToken** | **optional.String**| 用户授权码 | + **unread** | **optional.Bool**| 是否只获取未读消息,默认:否 | + **participating** | **optional.Bool**| 是否只获取自己直接参与的消息,默认:否 | + **type_** | **optional.String**| 筛选指定类型的通知,all:所有,event:事件通知,referer:@ 通知 | [default to all] + **since** | **optional.String**| 只获取在给定时间后更新的消息,要求时间格式为 ISO 8601 | + **before** | **optional.String**| 只获取在给定时间前更新的消息,要求时间格式为 ISO 8601 | + **ids** | **optional.String**| 指定一组通知 ID,以 , 分隔 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]UserNotificationList**](UserNotificationList.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5NotificationsThreadsId** +> UserNotification GetV5NotificationsThreadsId(ctx, id, optional) +获取一条通知 + +获取一条通知 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| 通知的 ID | + **optional** | ***GetV5NotificationsThreadsIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5NotificationsThreadsIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**UserNotification**](UserNotification.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5OrgsOrgEvents** +> []Event GetV5OrgsOrgEvents(ctx, org, optional) +列出组织的公开动态 + +列出组织的公开动态 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **org** | **string**| 组织的路径(path/login) | + **optional** | ***GetV5OrgsOrgEventsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5OrgsOrgEventsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]Event**](Event.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoEvents** +> []Event GetV5ReposOwnerRepoEvents(ctx, owner, repo, optional) +列出仓库的所有动态 + +列出仓库的所有动态 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***GetV5ReposOwnerRepoEventsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoEventsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]Event**](Event.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoNotifications** +> []UserNotificationList GetV5ReposOwnerRepoNotifications(ctx, owner, repo, optional) +列出一个仓库里的通知 + +列出一个仓库里的通知 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***GetV5ReposOwnerRepoNotificationsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoNotificationsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **unread** | **optional.Bool**| 是否只获取未读消息,默认:否 | + **participating** | **optional.Bool**| 是否只获取自己直接参与的消息,默认:否 | + **type_** | **optional.String**| 筛选指定类型的通知,all:所有,event:事件通知,referer:@ 通知 | [default to all] + **since** | **optional.String**| 只获取在给定时间后更新的消息,要求时间格式为 ISO 8601 | + **before** | **optional.String**| 只获取在给定时间前更新的消息,要求时间格式为 ISO 8601 | + **ids** | **optional.String**| 指定一组通知 ID,以 , 分隔 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]UserNotificationList**](UserNotificationList.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoStargazers** +> []UserBasic GetV5ReposOwnerRepoStargazers(ctx, owner, repo, optional) +列出 star 了仓库的用户 + +列出 star 了仓库的用户 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***GetV5ReposOwnerRepoStargazersOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoStargazersOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]UserBasic**](UserBasic.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoSubscribers** +> []UserBasic GetV5ReposOwnerRepoSubscribers(ctx, owner, repo, optional) +列出 watch 了仓库的用户 + +列出 watch 了仓库的用户 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***GetV5ReposOwnerRepoSubscribersOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoSubscribersOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]UserBasic**](UserBasic.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5UserStarred** +> []Project GetV5UserStarred(ctx, optional) +列出授权用户 star 了的仓库 + +列出授权用户 star 了的仓库 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***GetV5UserStarredOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5UserStarredOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accessToken** | **optional.String**| 用户授权码 | + **sort** | **optional.String**| 根据仓库创建时间(created)或最后推送时间(updated)进行排序,默认:创建时间 | [default to created] + **direction** | **optional.String**| 按递增(asc)或递减(desc)排序,默认:递减 | [default to desc] + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]Project**](Project.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5UserStarredOwnerRepo** +> GetV5UserStarredOwnerRepo(ctx, owner, repo, optional) +检查授权用户是否 star 了一个仓库 + +检查授权用户是否 star 了一个仓库 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***GetV5UserStarredOwnerRepoOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5UserStarredOwnerRepoOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5UserSubscriptions** +> []Project GetV5UserSubscriptions(ctx, optional) +列出授权用户 watch 了的仓库 + +列出授权用户 watch 了的仓库 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***GetV5UserSubscriptionsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5UserSubscriptionsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accessToken** | **optional.String**| 用户授权码 | + **sort** | **optional.String**| 根据仓库创建时间(created)或最后推送时间(updated)进行排序,默认:创建时间 | [default to created] + **direction** | **optional.String**| 按递增(asc)或递减(desc)排序,默认:递减 | [default to desc] + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]Project**](Project.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5UserSubscriptionsOwnerRepo** +> GetV5UserSubscriptionsOwnerRepo(ctx, owner, repo, optional) +检查授权用户是否 watch 了一个仓库 + +检查授权用户是否 watch 了一个仓库 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***GetV5UserSubscriptionsOwnerRepoOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5UserSubscriptionsOwnerRepoOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5UsersUsernameEvents** +> []Event GetV5UsersUsernameEvents(ctx, username, optional) +列出用户的动态 + +列出用户的动态 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **username** | **string**| 用户名(username/login) | + **optional** | ***GetV5UsersUsernameEventsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5UsersUsernameEventsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]Event**](Event.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5UsersUsernameEventsOrgsOrg** +> []Event GetV5UsersUsernameEventsOrgsOrg(ctx, username, org, optional) +列出用户所属组织的动态 + +列出用户所属组织的动态 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **username** | **string**| 用户名(username/login) | + **org** | **string**| 组织的路径(path/login) | + **optional** | ***GetV5UsersUsernameEventsOrgsOrgOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5UsersUsernameEventsOrgsOrgOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]Event**](Event.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5UsersUsernameEventsPublic** +> []Event GetV5UsersUsernameEventsPublic(ctx, username, optional) +列出用户的公开动态 + +列出用户的公开动态 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **username** | **string**| 用户名(username/login) | + **optional** | ***GetV5UsersUsernameEventsPublicOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5UsersUsernameEventsPublicOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]Event**](Event.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5UsersUsernameReceivedEvents** +> []Event GetV5UsersUsernameReceivedEvents(ctx, username, optional) +列出一个用户收到的动态 + +列出一个用户收到的动态 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **username** | **string**| 用户名(username/login) | + **optional** | ***GetV5UsersUsernameReceivedEventsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5UsersUsernameReceivedEventsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]Event**](Event.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5UsersUsernameReceivedEventsPublic** +> []Event GetV5UsersUsernameReceivedEventsPublic(ctx, username, optional) +列出一个用户收到的公开动态 + +列出一个用户收到的公开动态 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **username** | **string**| 用户名(username/login) | + **optional** | ***GetV5UsersUsernameReceivedEventsPublicOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5UsersUsernameReceivedEventsPublicOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]Event**](Event.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5UsersUsernameStarred** +> []Project GetV5UsersUsernameStarred(ctx, username, optional) +列出用户 star 了的仓库 + +列出用户 star 了的仓库 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **username** | **string**| 用户名(username/login) | + **optional** | ***GetV5UsersUsernameStarredOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5UsersUsernameStarredOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + **sort** | **optional.String**| 根据仓库创建时间(created)或最后推送时间(updated)进行排序,默认:创建时间 | [default to created] + **direction** | **optional.String**| 按递增(asc)或递减(desc)排序,默认:递减 | [default to desc] + +### Return type + +[**[]Project**](Project.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5UsersUsernameSubscriptions** +> []Project GetV5UsersUsernameSubscriptions(ctx, username, optional) +列出用户 watch 了的仓库 + +列出用户 watch 了的仓库 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **username** | **string**| 用户名(username/login) | + **optional** | ***GetV5UsersUsernameSubscriptionsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5UsersUsernameSubscriptionsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + **sort** | **optional.String**| 根据仓库创建时间(created)或最后推送时间(updated)进行排序,默认:创建时间 | [default to created] + **direction** | **optional.String**| 按递增(asc)或递减(desc)排序,默认:递减 | [default to desc] + +### Return type + +[**[]Project**](Project.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PatchV5NotificationsMessagesId** +> PatchV5NotificationsMessagesId(ctx, id, optional) +标记一条私信为已读 + +标记一条私信为已读 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| 私信的 ID | + **optional** | ***PatchV5NotificationsMessagesIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PatchV5NotificationsMessagesIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PatchV5NotificationsThreadsId** +> PatchV5NotificationsThreadsId(ctx, id, optional) +标记一条通知为已读 + +标记一条通知为已读 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| 通知的 ID | + **optional** | ***PatchV5NotificationsThreadsIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PatchV5NotificationsThreadsIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PostV5NotificationsMessages** +> UserMessage PostV5NotificationsMessages(ctx, username, content, optional) +发送私信给指定用户 + +发送私信给指定用户 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **username** | **string**| 用户名(username/login) | + **content** | **string**| 私信内容 | + **optional** | ***PostV5NotificationsMessagesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PostV5NotificationsMessagesOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**UserMessage**](UserMessage.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PutV5NotificationsMessages** +> PutV5NotificationsMessages(ctx, optional) +标记所有私信为已读 + +标记所有私信为已读 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***PutV5NotificationsMessagesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PutV5NotificationsMessagesOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accessToken** | **optional.String**| 用户授权码 | + **ids** | **optional.String**| 指定一组私信 ID,以 , 分隔 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PutV5NotificationsThreads** +> PutV5NotificationsThreads(ctx, optional) +标记所有通知为已读 + +标记所有通知为已读 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***PutV5NotificationsThreadsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PutV5NotificationsThreadsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accessToken** | **optional.String**| 用户授权码 | + **ids** | **optional.String**| 指定一组通知 ID,以 , 分隔 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PutV5ReposOwnerRepoNotifications** +> PutV5ReposOwnerRepoNotifications(ctx, owner, repo, optional) +标记一个仓库里的通知为已读 + +标记一个仓库里的通知为已读 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***PutV5ReposOwnerRepoNotificationsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PutV5ReposOwnerRepoNotificationsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **ids** | **optional.String**| 指定一组通知 ID,以 , 分隔 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PutV5UserStarredOwnerRepo** +> PutV5UserStarredOwnerRepo(ctx, owner, repo, optional) +star 一个仓库 + +star 一个仓库 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***PutV5UserStarredOwnerRepoOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PutV5UserStarredOwnerRepoOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PutV5UserSubscriptionsOwnerRepo** +> PutV5UserSubscriptionsOwnerRepo(ctx, owner, repo, watchType, optional) +watch 一个仓库 + +watch 一个仓库 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **watchType** | **string**| watch策略, watching: 关注所有动态, releases_only: 仅关注版本发行动态, ignoring: 关注但不提醒动态 | [default to watching] + **optional** | ***PutV5UserSubscriptionsOwnerRepoOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PutV5UserSubscriptionsOwnerRepoOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/Blob.md b/docs/Blob.md new file mode 100644 index 0000000..5ccf4ca --- /dev/null +++ b/docs/Blob.md @@ -0,0 +1,14 @@ +# Blob + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Sha** | **string** | | [optional] [default to null] +**Size** | **string** | | [optional] [default to null] +**Url** | **string** | | [optional] [default to null] +**Content** | **string** | | [optional] [default to null] +**Encoding** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Branch.md b/docs/Branch.md new file mode 100644 index 0000000..7b5414c --- /dev/null +++ b/docs/Branch.md @@ -0,0 +1,13 @@ +# Branch + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] [default to null] +**Commit** | **string** | | [optional] [default to null] +**Protected** | **string** | | [optional] [default to null] +**ProtectionUrl** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Code.md b/docs/Code.md new file mode 100644 index 0000000..fe68e8a --- /dev/null +++ b/docs/Code.md @@ -0,0 +1,26 @@ +# Code + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Url** | **string** | | [optional] [default to null] +**ForksUrl** | **string** | | [optional] [default to null] +**CommitsUrl** | **string** | | [optional] [default to null] +**Id** | **string** | | [optional] [default to null] +**Description** | **string** | | [optional] [default to null] +**Public** | **string** | | [optional] [default to null] +**Owner** | **string** | | [optional] [default to null] +**User** | **string** | | [optional] [default to null] +**Files** | **string** | | [optional] [default to null] +**Truncated** | **string** | | [optional] [default to null] +**HtmlUrl** | **string** | | [optional] [default to null] +**Comments** | **string** | | [optional] [default to null] +**CommentsUrl** | **string** | | [optional] [default to null] +**GitPullUrl** | **string** | | [optional] [default to null] +**GitPushUrl** | **string** | | [optional] [default to null] +**CreatedAt** | **string** | | [optional] [default to null] +**UpdatedAt** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CodeComment.md b/docs/CodeComment.md new file mode 100644 index 0000000..b14f11d --- /dev/null +++ b/docs/CodeComment.md @@ -0,0 +1,13 @@ +# CodeComment + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [optional] [default to null] +**Body** | **string** | | [optional] [default to null] +**CreatedAt** | **string** | | [optional] [default to null] +**UpdatedAt** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CodeForks.md b/docs/CodeForks.md new file mode 100644 index 0000000..7a827d9 --- /dev/null +++ b/docs/CodeForks.md @@ -0,0 +1,14 @@ +# CodeForks + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**User** | **string** | | [optional] [default to null] +**Url** | **string** | | [optional] [default to null] +**Id** | **string** | | [optional] [default to null] +**CreatedAt** | **string** | | [optional] [default to null] +**UpdatedAt** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CodeForksHistory.md b/docs/CodeForksHistory.md new file mode 100644 index 0000000..9a6996c --- /dev/null +++ b/docs/CodeForksHistory.md @@ -0,0 +1,28 @@ +# CodeForksHistory + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Url** | **string** | | [optional] [default to null] +**ForksUrl** | **string** | | [optional] [default to null] +**CommitsUrl** | **string** | | [optional] [default to null] +**Id** | **string** | | [optional] [default to null] +**Description** | **string** | | [optional] [default to null] +**Public** | **string** | | [optional] [default to null] +**Owner** | **string** | | [optional] [default to null] +**User** | **string** | | [optional] [default to null] +**Files** | **string** | | [optional] [default to null] +**Truncated** | **string** | | [optional] [default to null] +**HtmlUrl** | **string** | | [optional] [default to null] +**Comments** | **string** | | [optional] [default to null] +**CommentsUrl** | **string** | | [optional] [default to null] +**GitPullUrl** | **string** | | [optional] [default to null] +**GitPushUrl** | **string** | | [optional] [default to null] +**CreatedAt** | **string** | | [optional] [default to null] +**UpdatedAt** | **string** | | [optional] [default to null] +**Forks** | **string** | | [optional] [default to null] +**History** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Commit.md b/docs/Commit.md new file mode 100644 index 0000000..62f24a6 --- /dev/null +++ b/docs/Commit.md @@ -0,0 +1,15 @@ +# Commit + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Sha** | **string** | | [optional] [default to null] +**Author** | **string** | | [optional] [default to null] +**Committer** | **string** | | [optional] [default to null] +**Message** | **string** | | [optional] [default to null] +**Tree** | **string** | | [optional] [default to null] +**Parents** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CommitContent.md b/docs/CommitContent.md new file mode 100644 index 0000000..38c4cd7 --- /dev/null +++ b/docs/CommitContent.md @@ -0,0 +1,11 @@ +# CommitContent + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Content** | [***ContentBasic**](ContentBasic.md) | | [optional] [default to null] +**Commit** | [***Commit**](Commit.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Compare.md b/docs/Compare.md new file mode 100644 index 0000000..5cbdaf8 --- /dev/null +++ b/docs/Compare.md @@ -0,0 +1,13 @@ +# Compare + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BaseCommit** | **string** | | [optional] [default to null] +**MergeBaseCommit** | **string** | | [optional] [default to null] +**Commits** | **string** | | [optional] [default to null] +**Files** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CompleteBranch.md b/docs/CompleteBranch.md new file mode 100644 index 0000000..9d8e17c --- /dev/null +++ b/docs/CompleteBranch.md @@ -0,0 +1,14 @@ +# CompleteBranch + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] [default to null] +**Commit** | **string** | | [optional] [default to null] +**Links** | **string** | | [optional] [default to null] +**Protected** | **string** | | [optional] [default to null] +**ProtectionUrl** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Content.md b/docs/Content.md new file mode 100644 index 0000000..7929573 --- /dev/null +++ b/docs/Content.md @@ -0,0 +1,20 @@ +# Content + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type_** | **string** | | [optional] [default to null] +**Encoding** | **string** | | [optional] [default to null] +**Size** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**Path** | **string** | | [optional] [default to null] +**Content** | **string** | | [optional] [default to null] +**Sha** | **string** | | [optional] [default to null] +**Url** | **string** | | [optional] [default to null] +**HtmlUrl** | **string** | | [optional] [default to null] +**DownloadUrl** | **string** | | [optional] [default to null] +**Links** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ContentBasic.md b/docs/ContentBasic.md new file mode 100644 index 0000000..b35d9a1 --- /dev/null +++ b/docs/ContentBasic.md @@ -0,0 +1,18 @@ +# ContentBasic + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] [default to null] +**Path** | **string** | | [optional] [default to null] +**Size** | **string** | | [optional] [default to null] +**Sha** | **string** | | [optional] [default to null] +**Type_** | **string** | | [optional] [default to null] +**Url** | **string** | | [optional] [default to null] +**HtmlUrl** | **string** | | [optional] [default to null] +**DownloadUrl** | **string** | | [optional] [default to null] +**Links** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Contributor.md b/docs/Contributor.md new file mode 100644 index 0000000..3d52ee6 --- /dev/null +++ b/docs/Contributor.md @@ -0,0 +1,12 @@ +# Contributor + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Email** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**Contributions** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EnterpriseBasic.md b/docs/EnterpriseBasic.md new file mode 100644 index 0000000..69422ca --- /dev/null +++ b/docs/EnterpriseBasic.md @@ -0,0 +1,14 @@ +# EnterpriseBasic + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | | [optional] [default to null] +**Path** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**Url** | **string** | | [optional] [default to null] +**AvatarUrl** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EnterpriseMember.md b/docs/EnterpriseMember.md new file mode 100644 index 0000000..1db48b7 --- /dev/null +++ b/docs/EnterpriseMember.md @@ -0,0 +1,16 @@ +# EnterpriseMember + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Url** | **string** | | [optional] [default to null] +**Active** | **string** | | [optional] [default to null] +**Remark** | **string** | | [optional] [default to null] +**Role** | **string** | | [optional] [default to null] +**Outsourced** | **string** | | [optional] [default to null] +**Enterprise** | [***EnterpriseBasic**](EnterpriseBasic.md) | | [optional] [default to null] +**User** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EnterprisesApi.md b/docs/EnterprisesApi.md new file mode 100644 index 0000000..6d83793 --- /dev/null +++ b/docs/EnterprisesApi.md @@ -0,0 +1,632 @@ +# \EnterprisesApi + +All URIs are relative to *https://gitee.com/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteV5EnterprisesEnterpriseMembersUsername**](EnterprisesApi.md#DeleteV5EnterprisesEnterpriseMembersUsername) | **Delete** /v5/enterprises/{enterprise}/members/{username} | 移除企业成员 +[**DeleteV5EnterprisesEnterpriseWeekReportsReportIdCommentsId**](EnterprisesApi.md#DeleteV5EnterprisesEnterpriseWeekReportsReportIdCommentsId) | **Delete** /v5/enterprises/{enterprise}/week_reports/{report_id}/comments/{id} | 删除周报某个评论 +[**GetV5EnterprisesEnterprise**](EnterprisesApi.md#GetV5EnterprisesEnterprise) | **Get** /v5/enterprises/{enterprise} | 获取一个企业 +[**GetV5EnterprisesEnterpriseMembers**](EnterprisesApi.md#GetV5EnterprisesEnterpriseMembers) | **Get** /v5/enterprises/{enterprise}/members | 列出企业的所有成员 +[**GetV5EnterprisesEnterpriseMembersUsername**](EnterprisesApi.md#GetV5EnterprisesEnterpriseMembersUsername) | **Get** /v5/enterprises/{enterprise}/members/{username} | 获取企业的一个成员 +[**GetV5EnterprisesEnterpriseUsersUsernameWeekReports**](EnterprisesApi.md#GetV5EnterprisesEnterpriseUsersUsernameWeekReports) | **Get** /v5/enterprises/{enterprise}/users/{username}/week_reports | 个人周报列表 +[**GetV5EnterprisesEnterpriseWeekReports**](EnterprisesApi.md#GetV5EnterprisesEnterpriseWeekReports) | **Get** /v5/enterprises/{enterprise}/week_reports | 企业成员周报列表 +[**GetV5EnterprisesEnterpriseWeekReportsId**](EnterprisesApi.md#GetV5EnterprisesEnterpriseWeekReportsId) | **Get** /v5/enterprises/{enterprise}/week_reports/{id} | 周报详情 +[**GetV5EnterprisesEnterpriseWeekReportsIdComments**](EnterprisesApi.md#GetV5EnterprisesEnterpriseWeekReportsIdComments) | **Get** /v5/enterprises/{enterprise}/week_reports/{id}/comments | 某个周报评论列表 +[**GetV5UserEnterprises**](EnterprisesApi.md#GetV5UserEnterprises) | **Get** /v5/user/enterprises | 列出授权用户所属的企业 +[**PatchV5EnterprisesEnterpriseWeekReportId**](EnterprisesApi.md#PatchV5EnterprisesEnterpriseWeekReportId) | **Patch** /v5/enterprises/{enterprise}/week_report/{id} | 编辑周报 +[**PostV5EnterprisesEnterpriseMembers**](EnterprisesApi.md#PostV5EnterprisesEnterpriseMembers) | **Post** /v5/enterprises/{enterprise}/members | 添加或邀请企业成员 +[**PostV5EnterprisesEnterpriseWeekReport**](EnterprisesApi.md#PostV5EnterprisesEnterpriseWeekReport) | **Post** /v5/enterprises/{enterprise}/week_report | 新建周报 +[**PostV5EnterprisesEnterpriseWeekReportsIdComment**](EnterprisesApi.md#PostV5EnterprisesEnterpriseWeekReportsIdComment) | **Post** /v5/enterprises/{enterprise}/week_reports/{id}/comment | 评论周报 +[**PutV5EnterprisesEnterpriseMembersUsername**](EnterprisesApi.md#PutV5EnterprisesEnterpriseMembersUsername) | **Put** /v5/enterprises/{enterprise}/members/{username} | 修改企业成员权限或备注 + + +# **DeleteV5EnterprisesEnterpriseMembersUsername** +> DeleteV5EnterprisesEnterpriseMembersUsername(ctx, enterprise, username, optional) +移除企业成员 + +移除企业成员 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **enterprise** | **string**| 企业的路径(path/login) | + **username** | **string**| 用户名(username/login) | + **optional** | ***DeleteV5EnterprisesEnterpriseMembersUsernameOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DeleteV5EnterprisesEnterpriseMembersUsernameOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **DeleteV5EnterprisesEnterpriseWeekReportsReportIdCommentsId** +> DeleteV5EnterprisesEnterpriseWeekReportsReportIdCommentsId(ctx, enterprise, reportId, id, optional) +删除周报某个评论 + +删除周报某个评论 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **enterprise** | **string**| 企业的路径(path/login) | + **reportId** | **int32**| 周报ID | + **id** | **int32**| 评论ID | + **optional** | ***DeleteV5EnterprisesEnterpriseWeekReportsReportIdCommentsIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DeleteV5EnterprisesEnterpriseWeekReportsReportIdCommentsIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5EnterprisesEnterprise** +> EnterpriseBasic GetV5EnterprisesEnterprise(ctx, enterprise, optional) +获取一个企业 + +获取一个企业 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **enterprise** | **string**| 企业的路径(path/login) | + **optional** | ***GetV5EnterprisesEnterpriseOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5EnterprisesEnterpriseOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**EnterpriseBasic**](EnterpriseBasic.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5EnterprisesEnterpriseMembers** +> []EnterpriseMember GetV5EnterprisesEnterpriseMembers(ctx, enterprise, optional) +列出企业的所有成员 + +列出企业的所有成员 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **enterprise** | **string**| 企业的路径(path/login) | + **optional** | ***GetV5EnterprisesEnterpriseMembersOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5EnterprisesEnterpriseMembersOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + **role** | **optional.String**| 根据角色筛选成员 | [default to all] + +### Return type + +[**[]EnterpriseMember**](EnterpriseMember.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5EnterprisesEnterpriseMembersUsername** +> EnterpriseMember GetV5EnterprisesEnterpriseMembersUsername(ctx, enterprise, username, optional) +获取企业的一个成员 + +获取企业的一个成员 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **enterprise** | **string**| 企业的路径(path/login) | + **username** | **string**| 用户名(username/login) | + **optional** | ***GetV5EnterprisesEnterpriseMembersUsernameOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5EnterprisesEnterpriseMembersUsernameOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**EnterpriseMember**](EnterpriseMember.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5EnterprisesEnterpriseUsersUsernameWeekReports** +> []WeekReport GetV5EnterprisesEnterpriseUsersUsernameWeekReports(ctx, enterprise, username, optional) +个人周报列表 + +个人周报列表 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **enterprise** | **string**| 企业的路径(path/login) | + **username** | **string**| 用户名(username/login) | + **optional** | ***GetV5EnterprisesEnterpriseUsersUsernameWeekReportsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5EnterprisesEnterpriseUsersUsernameWeekReportsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]WeekReport**](WeekReport.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5EnterprisesEnterpriseWeekReports** +> []WeekReport GetV5EnterprisesEnterpriseWeekReports(ctx, enterprise, optional) +企业成员周报列表 + +企业成员周报列表 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **enterprise** | **string**| 企业的路径(path/login) | + **optional** | ***GetV5EnterprisesEnterpriseWeekReportsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5EnterprisesEnterpriseWeekReportsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + **username** | **optional.String**| 用户名(username/login) | + **year** | **optional.Int32**| 周报所属年 | + **weekIndex** | **optional.Int32**| 周报所属周 | + **date** | **optional.String**| 周报日期(格式:2019-03-25) | + +### Return type + +[**[]WeekReport**](WeekReport.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5EnterprisesEnterpriseWeekReportsId** +> WeekReport GetV5EnterprisesEnterpriseWeekReportsId(ctx, enterprise, id, optional) +周报详情 + +周报详情 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **enterprise** | **string**| 企业的路径(path/login) | + **id** | **int32**| 周报ID | + **optional** | ***GetV5EnterprisesEnterpriseWeekReportsIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5EnterprisesEnterpriseWeekReportsIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**WeekReport**](WeekReport.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5EnterprisesEnterpriseWeekReportsIdComments** +> []Note GetV5EnterprisesEnterpriseWeekReportsIdComments(ctx, enterprise, id, optional) +某个周报评论列表 + +某个周报评论列表 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **enterprise** | **string**| 企业的路径(path/login) | + **id** | **int32**| 周报ID | + **optional** | ***GetV5EnterprisesEnterpriseWeekReportsIdCommentsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5EnterprisesEnterpriseWeekReportsIdCommentsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]Note**](Note.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5UserEnterprises** +> []EnterpriseBasic GetV5UserEnterprises(ctx, optional) +列出授权用户所属的企业 + +列出授权用户所属的企业 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***GetV5UserEnterprisesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5UserEnterprisesOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + **admin** | **optional.Bool**| 只列出授权用户管理的企业 | [default to true] + +### Return type + +[**[]EnterpriseBasic**](EnterpriseBasic.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PatchV5EnterprisesEnterpriseWeekReportId** +> WeekReport PatchV5EnterprisesEnterpriseWeekReportId(ctx, enterprise, id, content, optional) +编辑周报 + +编辑周报 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **enterprise** | **string**| 企业的路径(path/login) | + **id** | **int32**| 周报ID | + **content** | **string**| 周报内容 | + **optional** | ***PatchV5EnterprisesEnterpriseWeekReportIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PatchV5EnterprisesEnterpriseWeekReportIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**WeekReport**](WeekReport.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PostV5EnterprisesEnterpriseMembers** +> PostV5EnterprisesEnterpriseMembers(ctx, enterprise, optional) +添加或邀请企业成员 + +添加或邀请企业成员 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **enterprise** | **string**| 企业的路径(path/login) | + **optional** | ***PostV5EnterprisesEnterpriseMembersOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PostV5EnterprisesEnterpriseMembersOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + **username** | **optional.String**| 需要邀请的码云用户名(username/login),username,email至少填写一个 | + **email** | **optional.String**| 要添加邮箱地址,若该邮箱未注册则自动创建帐号。username,email至少填写一个 | + **outsourced** | **optional.Bool**| 是否企业外包成员,默认:否 | + **role** | **optional.String**| 企业角色,默认普通成员 | [default to member] + **name** | **optional.String**| 企业成员真实姓名(备注) | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PostV5EnterprisesEnterpriseWeekReport** +> WeekReport PostV5EnterprisesEnterpriseWeekReport(ctx, enterprise, year, content, weekIndex, username, optional) +新建周报 + +新建周报 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **enterprise** | **string**| 企业的路径(path/login) | + **year** | **int32**| 周报所属年 | + **content** | **string**| 周报内容 | + **weekIndex** | **int32**| 周报所属周 | + **username** | **string**| 用户名(username/login) | + **optional** | ***PostV5EnterprisesEnterpriseWeekReportOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PostV5EnterprisesEnterpriseWeekReportOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + + + **accessToken** | **optional.String**| 用户授权码 | + **date** | **optional.String**| 周报日期(格式:2019-03-25) | + +### Return type + +[**WeekReport**](WeekReport.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PostV5EnterprisesEnterpriseWeekReportsIdComment** +> Note PostV5EnterprisesEnterpriseWeekReportsIdComment(ctx, enterprise, id, body, optional) +评论周报 + +评论周报 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **enterprise** | **string**| 企业的路径(path/login) | + **id** | **int32**| 周报ID | + **body** | **string**| 评论的内容 | + **optional** | ***PostV5EnterprisesEnterpriseWeekReportsIdCommentOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PostV5EnterprisesEnterpriseWeekReportsIdCommentOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**Note**](Note.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PutV5EnterprisesEnterpriseMembersUsername** +> EnterpriseMember PutV5EnterprisesEnterpriseMembersUsername(ctx, enterprise, username, optional) +修改企业成员权限或备注 + +修改企业成员权限或备注 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **enterprise** | **string**| 企业的路径(path/login) | + **username** | **string**| 用户名(username/login) | + **optional** | ***PutV5EnterprisesEnterpriseMembersUsernameOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PutV5EnterprisesEnterpriseMembersUsernameOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **outsourced** | **optional.Bool**| 是否企业外包成员,默认:否 | + **role** | **optional.String**| 企业角色,默认普通成员 | [default to member] + **active** | **optional.Bool**| 是否可访问企业资源,默认:是。(若选否则禁止该用户访问企业资源) | [default to true] + **name** | **optional.String**| 企业成员真实姓名(备注) | + +### Return type + +[**EnterpriseMember**](EnterpriseMember.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/Event.md b/docs/Event.md new file mode 100644 index 0000000..3977d5f --- /dev/null +++ b/docs/Event.md @@ -0,0 +1,17 @@ +# Event + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | | [optional] [default to null] +**Type_** | **string** | | [optional] [default to null] +**Actor** | **string** | | [optional] [default to null] +**Repo** | **string** | | [optional] [default to null] +**Org** | **string** | | [optional] [default to null] +**Public** | **string** | | [optional] [default to null] +**CreatedAt** | **string** | | [optional] [default to null] +**Payload** | [***interface{}**](interface{}.md) | 不同类型动态的内容 | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GistsApi.md b/docs/GistsApi.md new file mode 100644 index 0000000..592d3ee --- /dev/null +++ b/docs/GistsApi.md @@ -0,0 +1,755 @@ +# \GistsApi + +All URIs are relative to *https://gitee.com/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteV5GistsGistIdCommentsId**](GistsApi.md#DeleteV5GistsGistIdCommentsId) | **Delete** /v5/gists/{gist_id}/comments/{id} | 删除代码片段的评论 +[**DeleteV5GistsId**](GistsApi.md#DeleteV5GistsId) | **Delete** /v5/gists/{id} | 删除指定代码片段 +[**DeleteV5GistsIdStar**](GistsApi.md#DeleteV5GistsIdStar) | **Delete** /v5/gists/{id}/star | 取消Star代码片段 +[**GetV5Gists**](GistsApi.md#GetV5Gists) | **Get** /v5/gists | 获取代码片段 +[**GetV5GistsGistIdComments**](GistsApi.md#GetV5GistsGistIdComments) | **Get** /v5/gists/{gist_id}/comments | 获取代码片段的评论 +[**GetV5GistsGistIdCommentsId**](GistsApi.md#GetV5GistsGistIdCommentsId) | **Get** /v5/gists/{gist_id}/comments/{id} | 获取单条代码片段的评论 +[**GetV5GistsId**](GistsApi.md#GetV5GistsId) | **Get** /v5/gists/{id} | 获取单条代码片段 +[**GetV5GistsIdCommits**](GistsApi.md#GetV5GistsIdCommits) | **Get** /v5/gists/{id}/commits | 获取代码片段的commit +[**GetV5GistsIdForks**](GistsApi.md#GetV5GistsIdForks) | **Get** /v5/gists/{id}/forks | 获取 Fork 了指定代码片段的列表 +[**GetV5GistsIdStar**](GistsApi.md#GetV5GistsIdStar) | **Get** /v5/gists/{id}/star | 判断代码片段是否已Star +[**GetV5GistsPublic**](GistsApi.md#GetV5GistsPublic) | **Get** /v5/gists/public | 获取公开的代码片段 +[**GetV5GistsStarred**](GistsApi.md#GetV5GistsStarred) | **Get** /v5/gists/starred | 获取用户Star的代码片段 +[**GetV5UsersUsernameGists**](GistsApi.md#GetV5UsersUsernameGists) | **Get** /v5/users/{username}/gists | 获取指定用户的公开代码片段 +[**PatchV5GistsGistIdCommentsId**](GistsApi.md#PatchV5GistsGistIdCommentsId) | **Patch** /v5/gists/{gist_id}/comments/{id} | 修改代码片段的评论 +[**PatchV5GistsId**](GistsApi.md#PatchV5GistsId) | **Patch** /v5/gists/{id} | 修改代码片段 +[**PostV5Gists**](GistsApi.md#PostV5Gists) | **Post** /v5/gists | 创建代码片段 +[**PostV5GistsGistIdComments**](GistsApi.md#PostV5GistsGistIdComments) | **Post** /v5/gists/{gist_id}/comments | 增加代码片段的评论 +[**PostV5GistsIdForks**](GistsApi.md#PostV5GistsIdForks) | **Post** /v5/gists/{id}/forks | Fork代码片段 +[**PutV5GistsIdStar**](GistsApi.md#PutV5GistsIdStar) | **Put** /v5/gists/{id}/star | Star代码片段 + + +# **DeleteV5GistsGistIdCommentsId** +> DeleteV5GistsGistIdCommentsId(ctx, gistId, id, optional) +删除代码片段的评论 + +删除代码片段的评论 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **gistId** | **string**| 代码片段的ID | + **id** | **int32**| 评论的ID | + **optional** | ***DeleteV5GistsGistIdCommentsIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DeleteV5GistsGistIdCommentsIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **DeleteV5GistsId** +> DeleteV5GistsId(ctx, id, optional) +删除指定代码片段 + +删除指定代码片段 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| 代码片段的ID | + **optional** | ***DeleteV5GistsIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DeleteV5GistsIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **DeleteV5GistsIdStar** +> DeleteV5GistsIdStar(ctx, id, optional) +取消Star代码片段 + +取消Star代码片段 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| 代码片段的ID | + **optional** | ***DeleteV5GistsIdStarOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DeleteV5GistsIdStarOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5Gists** +> []Code GetV5Gists(ctx, optional) +获取代码片段 + +获取代码片段 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***GetV5GistsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5GistsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accessToken** | **optional.String**| 用户授权码 | + **since** | **optional.String**| 起始的更新时间,要求时间格式为 ISO 8601 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]Code**](Code.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5GistsGistIdComments** +> []CodeComment GetV5GistsGistIdComments(ctx, gistId, optional) +获取代码片段的评论 + +获取代码片段的评论 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **gistId** | **string**| 代码片段的ID | + **optional** | ***GetV5GistsGistIdCommentsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5GistsGistIdCommentsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]CodeComment**](CodeComment.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5GistsGistIdCommentsId** +> CodeComment GetV5GistsGistIdCommentsId(ctx, gistId, id, optional) +获取单条代码片段的评论 + +获取单条代码片段的评论 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **gistId** | **string**| 代码片段的ID | + **id** | **int32**| 评论的ID | + **optional** | ***GetV5GistsGistIdCommentsIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5GistsGistIdCommentsIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**CodeComment**](CodeComment.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5GistsId** +> CodeForksHistory GetV5GistsId(ctx, id, optional) +获取单条代码片段 + +获取单条代码片段 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| 代码片段的ID | + **optional** | ***GetV5GistsIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5GistsIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**CodeForksHistory**](CodeForksHistory.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5GistsIdCommits** +> CodeForksHistory GetV5GistsIdCommits(ctx, id, optional) +获取代码片段的commit + +获取代码片段的commit + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| 代码片段的ID | + **optional** | ***GetV5GistsIdCommitsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5GistsIdCommitsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**CodeForksHistory**](CodeForksHistory.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5GistsIdForks** +> CodeForks GetV5GistsIdForks(ctx, id, optional) +获取 Fork 了指定代码片段的列表 + +获取 Fork 了指定代码片段的列表 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| 代码片段的ID | + **optional** | ***GetV5GistsIdForksOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5GistsIdForksOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**CodeForks**](CodeForks.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5GistsIdStar** +> GetV5GistsIdStar(ctx, id, optional) +判断代码片段是否已Star + +判断代码片段是否已Star + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| 代码片段的ID | + **optional** | ***GetV5GistsIdStarOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5GistsIdStarOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5GistsPublic** +> []Code GetV5GistsPublic(ctx, optional) +获取公开的代码片段 + +获取公开的代码片段 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***GetV5GistsPublicOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5GistsPublicOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accessToken** | **optional.String**| 用户授权码 | + **since** | **optional.String**| 起始的更新时间,要求时间格式为 ISO 8601 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]Code**](Code.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5GistsStarred** +> []Code GetV5GistsStarred(ctx, optional) +获取用户Star的代码片段 + +获取用户Star的代码片段 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***GetV5GistsStarredOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5GistsStarredOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accessToken** | **optional.String**| 用户授权码 | + **since** | **optional.String**| 起始的更新时间,要求时间格式为 ISO 8601 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]Code**](Code.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5UsersUsernameGists** +> []Code GetV5UsersUsernameGists(ctx, username, optional) +获取指定用户的公开代码片段 + +获取指定用户的公开代码片段 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **username** | **string**| 用户名(username/login) | + **optional** | ***GetV5UsersUsernameGistsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5UsersUsernameGistsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]Code**](Code.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PatchV5GistsGistIdCommentsId** +> CodeComment PatchV5GistsGistIdCommentsId(ctx, gistId, id, body, optional) +修改代码片段的评论 + +修改代码片段的评论 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **gistId** | **string**| 代码片段的ID | + **id** | **int32**| 评论的ID | + **body** | **string**| 评论内容 | + **optional** | ***PatchV5GistsGistIdCommentsIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PatchV5GistsGistIdCommentsIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**CodeComment**](CodeComment.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PatchV5GistsId** +> CodeForksHistory PatchV5GistsId(ctx, id, optional) +修改代码片段 + +修改代码片段 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| 代码片段的ID | + **optional** | ***PatchV5GistsIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PatchV5GistsIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + **files** | **optional.Interface of *os.File**| Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } } | + **description** | **optional.String**| 代码片段描述,1~30个字符 | + **public** | **optional.Bool**| 公开/私有,默认: 私有 | + +### Return type + +[**CodeForksHistory**](CodeForksHistory.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PostV5Gists** +> []CodeForksHistory PostV5Gists(ctx, files, description, optional) +创建代码片段 + +创建代码片段 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **files** | ***os.File**| Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } } | + **description** | **string**| 代码片段描述,1~30个字符 | + **optional** | ***PostV5GistsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PostV5GistsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **public** | **optional.Bool**| 公开/私有,默认: 私有 | + +### Return type + +[**[]CodeForksHistory**](CodeForksHistory.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PostV5GistsGistIdComments** +> CodeComment PostV5GistsGistIdComments(ctx, gistId, body, optional) +增加代码片段的评论 + +增加代码片段的评论 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **gistId** | **string**| 代码片段的ID | + **body** | **string**| 评论内容 | + **optional** | ***PostV5GistsGistIdCommentsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PostV5GistsGistIdCommentsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**CodeComment**](CodeComment.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PostV5GistsIdForks** +> PostV5GistsIdForks(ctx, id, optional) +Fork代码片段 + +Fork代码片段 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| 代码片段的ID | + **optional** | ***PostV5GistsIdForksOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PostV5GistsIdForksOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PutV5GistsIdStar** +> PutV5GistsIdStar(ctx, id, optional) +Star代码片段 + +Star代码片段 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| 代码片段的ID | + **optional** | ***PutV5GistsIdStarOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PutV5GistsIdStarOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/GitDataApi.md b/docs/GitDataApi.md new file mode 100644 index 0000000..605d929 --- /dev/null +++ b/docs/GitDataApi.md @@ -0,0 +1,93 @@ +# \GitDataApi + +All URIs are relative to *https://gitee.com/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetV5ReposOwnerRepoGitBlobsSha**](GitDataApi.md#GetV5ReposOwnerRepoGitBlobsSha) | **Get** /v5/repos/{owner}/{repo}/git/blobs/{sha} | 获取文件Blob +[**GetV5ReposOwnerRepoGitTreesSha**](GitDataApi.md#GetV5ReposOwnerRepoGitTreesSha) | **Get** /v5/repos/{owner}/{repo}/git/trees/{sha} | 获取目录Tree + + +# **GetV5ReposOwnerRepoGitBlobsSha** +> Blob GetV5ReposOwnerRepoGitBlobsSha(ctx, owner, repo, sha, optional) +获取文件Blob + +获取文件Blob + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **sha** | **string**| 文件的 Blob SHA,可通过 [获取仓库具体路径下的内容] API 获取 | + **optional** | ***GetV5ReposOwnerRepoGitBlobsShaOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoGitBlobsShaOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**Blob**](Blob.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoGitTreesSha** +> Tree GetV5ReposOwnerRepoGitTreesSha(ctx, owner, repo, sha, optional) +获取目录Tree + +获取目录Tree + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **sha** | **string**| 可以是分支名(如master)、Commit或者目录Tree的SHA值 | + **optional** | ***GetV5ReposOwnerRepoGitTreesShaOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoGitTreesShaOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + **recursive** | **optional.Int32**| 赋值为1递归获取目录 | + +### Return type + +[**Tree**](Tree.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/Group.md b/docs/Group.md new file mode 100644 index 0000000..f98d9f2 --- /dev/null +++ b/docs/Group.md @@ -0,0 +1,17 @@ +# Group + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | | [optional] [default to null] +**Login** | **string** | | [optional] [default to null] +**Url** | **string** | | [optional] [default to null] +**AvatarUrl** | **string** | | [optional] [default to null] +**ReposUrl** | **string** | | [optional] [default to null] +**EventsUrl** | **string** | | [optional] [default to null] +**MembersUrl** | **string** | | [optional] [default to null] +**Description** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GroupDetail.md b/docs/GroupDetail.md new file mode 100644 index 0000000..72bbabd --- /dev/null +++ b/docs/GroupDetail.md @@ -0,0 +1,29 @@ +# GroupDetail + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | | [optional] [default to null] +**Login** | **string** | | [optional] [default to null] +**Url** | **string** | | [optional] [default to null] +**AvatarUrl** | **string** | | [optional] [default to null] +**ReposUrl** | **string** | | [optional] [default to null] +**EventsUrl** | **string** | | [optional] [default to null] +**MembersUrl** | **string** | | [optional] [default to null] +**Description** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**CreatedAt** | **string** | | [optional] [default to null] +**Type_** | **string** | | [optional] [default to null] +**Location** | **string** | | [optional] [default to null] +**Email** | **string** | | [optional] [default to null] +**HtmlUrl** | **string** | | [optional] [default to null] +**Public** | **string** | | [optional] [default to null] +**Enterprise** | **string** | | [optional] [default to null] +**Members** | **string** | | [optional] [default to null] +**PublicRepos** | **string** | | [optional] [default to null] +**PrivateRepos** | **string** | | [optional] [default to null] +**Owner** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GroupMember.md b/docs/GroupMember.md new file mode 100644 index 0000000..0dd7ff4 --- /dev/null +++ b/docs/GroupMember.md @@ -0,0 +1,16 @@ +# GroupMember + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Url** | **string** | | [optional] [default to null] +**Active** | **string** | | [optional] [default to null] +**Remark** | **string** | | [optional] [default to null] +**Role** | **string** | | [optional] [default to null] +**OrganizationUrl** | **string** | | [optional] [default to null] +**Organization** | [***Group**](Group.md) | | [optional] [default to null] +**User** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Hook.md b/docs/Hook.md new file mode 100644 index 0000000..e942102 --- /dev/null +++ b/docs/Hook.md @@ -0,0 +1,21 @@ +# Hook + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [optional] [default to null] +**Url** | **string** | | [optional] [default to null] +**CreatedAt** | **string** | | [optional] [default to null] +**Password** | **string** | | [optional] [default to null] +**ProjectId** | **string** | | [optional] [default to null] +**Result** | **string** | | [optional] [default to null] +**ResultCode** | **string** | | [optional] [default to null] +**PushEvents** | **string** | | [optional] [default to null] +**TagPushEvents** | **string** | | [optional] [default to null] +**IssuesEvents** | **string** | | [optional] [default to null] +**NoteEvents** | **string** | | [optional] [default to null] +**MergeRequestsEvents** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Issue.md b/docs/Issue.md new file mode 100644 index 0000000..ef2330e --- /dev/null +++ b/docs/Issue.md @@ -0,0 +1,36 @@ +# Issue + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | | [optional] [default to null] +**Url** | **string** | | [optional] [default to null] +**RepositoryUrl** | **string** | | [optional] [default to null] +**LabelsUrl** | **string** | | [optional] [default to null] +**CommentsUrl** | **string** | | [optional] [default to null] +**HtmlUrl** | **string** | | [optional] [default to null] +**ParentUrl** | **string** | | [optional] [default to null] +**Number** | **string** | | [optional] [default to null] +**State** | **string** | | [optional] [default to null] +**Title** | **string** | | [optional] [default to null] +**Body** | **string** | | [optional] [default to null] +**BodyHtml** | **string** | | [optional] [default to null] +**User** | **string** | | [optional] [default to null] +**Labels** | [***Label**](Label.md) | | [optional] [default to null] +**Assignee** | [***UserBasic**](UserBasic.md) | | [optional] [default to null] +**Collaborators** | [***UserBasic**](UserBasic.md) | | [optional] [default to null] +**Repository** | **string** | | [optional] [default to null] +**Milestone** | [***Milestone**](Milestone.md) | | [optional] [default to null] +**CreatedAt** | [**time.Time**](time.Time.md) | | [optional] [default to null] +**UpdatedAt** | [**time.Time**](time.Time.md) | | [optional] [default to null] +**PlanStartedAt** | [**time.Time**](time.Time.md) | | [optional] [default to null] +**Deadline** | [**time.Time**](time.Time.md) | | [optional] [default to null] +**FinishedAt** | [**time.Time**](time.Time.md) | | [optional] [default to null] +**ScheduledTime** | **string** | | [optional] [default to null] +**Comments** | **int32** | | [optional] [default to null] +**IssueType** | **string** | | [optional] [default to null] +**Program** | [***ProgramBasic**](ProgramBasic.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/IssuesApi.md b/docs/IssuesApi.md new file mode 100644 index 0000000..18be361 --- /dev/null +++ b/docs/IssuesApi.md @@ -0,0 +1,827 @@ +# \IssuesApi + +All URIs are relative to *https://gitee.com/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteV5ReposOwnerRepoIssuesCommentsId**](IssuesApi.md#DeleteV5ReposOwnerRepoIssuesCommentsId) | **Delete** /v5/repos/{owner}/{repo}/issues/comments/{id} | 删除Issue某条评论 +[**GetV5EnterprisesEnterpriseIssues**](IssuesApi.md#GetV5EnterprisesEnterpriseIssues) | **Get** /v5/enterprises/{enterprise}/issues | 获取某个企业的所有Issues +[**GetV5EnterprisesEnterpriseIssuesNumber**](IssuesApi.md#GetV5EnterprisesEnterpriseIssuesNumber) | **Get** /v5/enterprises/{enterprise}/issues/{number} | 获取企业的某个Issue +[**GetV5EnterprisesEnterpriseIssuesNumberComments**](IssuesApi.md#GetV5EnterprisesEnterpriseIssuesNumberComments) | **Get** /v5/enterprises/{enterprise}/issues/{number}/comments | 获取企业某个Issue所有评论 +[**GetV5EnterprisesEnterpriseIssuesNumberLabels**](IssuesApi.md#GetV5EnterprisesEnterpriseIssuesNumberLabels) | **Get** /v5/enterprises/{enterprise}/issues/{number}/labels | 获取企业某个Issue所有标签 +[**GetV5Issues**](IssuesApi.md#GetV5Issues) | **Get** /v5/issues | 获取当前授权用户的所有Issues +[**GetV5OrgsOrgIssues**](IssuesApi.md#GetV5OrgsOrgIssues) | **Get** /v5/orgs/{org}/issues | 获取当前用户某个组织的Issues +[**GetV5ReposOwnerIssuesNumberOperateLogs**](IssuesApi.md#GetV5ReposOwnerIssuesNumberOperateLogs) | **Get** /v5/repos/{owner}/issues/{number}/operate_logs | 获取某个Issue下的操作日志 +[**GetV5ReposOwnerRepoIssues**](IssuesApi.md#GetV5ReposOwnerRepoIssues) | **Get** /v5/repos/{owner}/{repo}/issues | 仓库的所有Issues +[**GetV5ReposOwnerRepoIssuesComments**](IssuesApi.md#GetV5ReposOwnerRepoIssuesComments) | **Get** /v5/repos/{owner}/{repo}/issues/comments | 获取仓库所有Issue的评论 +[**GetV5ReposOwnerRepoIssuesCommentsId**](IssuesApi.md#GetV5ReposOwnerRepoIssuesCommentsId) | **Get** /v5/repos/{owner}/{repo}/issues/comments/{id} | 获取仓库Issue某条评论 +[**GetV5ReposOwnerRepoIssuesNumber**](IssuesApi.md#GetV5ReposOwnerRepoIssuesNumber) | **Get** /v5/repos/{owner}/{repo}/issues/{number} | 仓库的某个Issue +[**GetV5ReposOwnerRepoIssuesNumberComments**](IssuesApi.md#GetV5ReposOwnerRepoIssuesNumberComments) | **Get** /v5/repos/{owner}/{repo}/issues/{number}/comments | 获取仓库某个Issue所有的评论 +[**GetV5UserIssues**](IssuesApi.md#GetV5UserIssues) | **Get** /v5/user/issues | 获取授权用户的所有Issues +[**PatchV5ReposOwnerIssuesNumber**](IssuesApi.md#PatchV5ReposOwnerIssuesNumber) | **Patch** /v5/repos/{owner}/issues/{number} | 更新Issue +[**PatchV5ReposOwnerRepoIssuesCommentsId**](IssuesApi.md#PatchV5ReposOwnerRepoIssuesCommentsId) | **Patch** /v5/repos/{owner}/{repo}/issues/comments/{id} | 更新Issue某条评论 +[**PostV5ReposOwnerIssues**](IssuesApi.md#PostV5ReposOwnerIssues) | **Post** /v5/repos/{owner}/issues | 创建Issue +[**PostV5ReposOwnerRepoIssuesNumberComments**](IssuesApi.md#PostV5ReposOwnerRepoIssuesNumberComments) | **Post** /v5/repos/{owner}/{repo}/issues/{number}/comments | 创建某个Issue评论 + + +# **DeleteV5ReposOwnerRepoIssuesCommentsId** +> DeleteV5ReposOwnerRepoIssuesCommentsId(ctx, owner, repo, id, optional) +删除Issue某条评论 + +删除Issue某条评论 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **id** | **int32**| 评论的ID | + **optional** | ***DeleteV5ReposOwnerRepoIssuesCommentsIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DeleteV5ReposOwnerRepoIssuesCommentsIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5EnterprisesEnterpriseIssues** +> []Issue GetV5EnterprisesEnterpriseIssues(ctx, enterprise, optional) +获取某个企业的所有Issues + +获取某个企业的所有Issues + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **enterprise** | **string**| 企业的路径(path/login) | + **optional** | ***GetV5EnterprisesEnterpriseIssuesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5EnterprisesEnterpriseIssuesOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + **state** | **optional.String**| Issue的状态: open(开启的), progressing(进行中), closed(关闭的), rejected(拒绝的)。 默认: open | [default to open] + **labels** | **optional.String**| 用逗号分开的标签。如: bug,performance | + **sort** | **optional.String**| 排序依据: 创建时间(created),更新时间(updated_at)。默认: created_at | [default to created] + **direction** | **optional.String**| 排序方式: 升序(asc),降序(desc)。默认: desc | [default to desc] + **since** | **optional.String**| 起始的更新时间,要求时间格式为 ISO 8601 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + **schedule** | **optional.String**| 计划开始日期,格式:20181006T173008+80-20181007T173008+80(区间),或者 -20181007T173008+80(小于20181007T173008+80),或者 20181006T173008+80-(大于20181006T173008+80),要求时间格式为20181006T173008+80 | + **deadline** | **optional.String**| 计划截止日期,格式同上 | + **createdAt** | **optional.String**| 任务创建时间,格式同上 | + **finishedAt** | **optional.String**| 任务完成时间,即任务最后一次转为已完成状态的时间点。格式同上 | + **milestone** | **optional.String**| 根据里程碑标题。none为没里程碑的,*为所有带里程碑的 | + **assignee** | **optional.String**| 用户的username。 none为没指派者, *为所有带有指派者的 | + **creator** | **optional.String**| 创建Issues的用户username | + **program** | **optional.String**| 所属项目名称。none为没所属有项目的,*为所有带所属项目的 | + +### Return type + +[**[]Issue**](Issue.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5EnterprisesEnterpriseIssuesNumber** +> Issue GetV5EnterprisesEnterpriseIssuesNumber(ctx, enterprise, number, optional) +获取企业的某个Issue + +获取企业的某个Issue + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **enterprise** | **string**| 企业的路径(path/login) | + **number** | **string**| Issue 编号(区分大小写,无需添加 # 号) | + **optional** | ***GetV5EnterprisesEnterpriseIssuesNumberOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5EnterprisesEnterpriseIssuesNumberOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**Issue**](Issue.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5EnterprisesEnterpriseIssuesNumberComments** +> []Note GetV5EnterprisesEnterpriseIssuesNumberComments(ctx, enterprise, number, optional) +获取企业某个Issue所有评论 + +获取企业某个Issue所有评论 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **enterprise** | **string**| 企业的路径(path/login) | + **number** | **string**| Issue 编号(区分大小写,无需添加 # 号) | + **optional** | ***GetV5EnterprisesEnterpriseIssuesNumberCommentsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5EnterprisesEnterpriseIssuesNumberCommentsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]Note**](Note.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5EnterprisesEnterpriseIssuesNumberLabels** +> []Label GetV5EnterprisesEnterpriseIssuesNumberLabels(ctx, enterprise, number, optional) +获取企业某个Issue所有标签 + +获取企业某个Issue所有标签 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **enterprise** | **string**| 企业的路径(path/login) | + **number** | **string**| Issue 编号(区分大小写,无需添加 # 号) | + **optional** | ***GetV5EnterprisesEnterpriseIssuesNumberLabelsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5EnterprisesEnterpriseIssuesNumberLabelsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]Label**](Label.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5Issues** +> []Issue GetV5Issues(ctx, optional) +获取当前授权用户的所有Issues + +获取当前授权用户的所有Issues + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***GetV5IssuesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5IssuesOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accessToken** | **optional.String**| 用户授权码 | + **filter** | **optional.String**| 筛选参数: 授权用户负责的(assigned),授权用户创建的(created),包含前两者的(all)。默认: assigned | [default to assigned] + **state** | **optional.String**| Issue的状态: open(开启的), progressing(进行中), closed(关闭的), rejected(拒绝的)。 默认: open | [default to open] + **labels** | **optional.String**| 用逗号分开的标签。如: bug,performance | + **sort** | **optional.String**| 排序依据: 创建时间(created),更新时间(updated_at)。默认: created_at | [default to created] + **direction** | **optional.String**| 排序方式: 升序(asc),降序(desc)。默认: desc | [default to desc] + **since** | **optional.String**| 起始的更新时间,要求时间格式为 ISO 8601 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + **schedule** | **optional.String**| 计划开始日期,格式:20181006T173008+80-20181007T173008+80(区间),或者 -20181007T173008+80(小于20181007T173008+80),或者 20181006T173008+80-(大于20181006T173008+80),要求时间格式为20181006T173008+80 | + **deadline** | **optional.String**| 计划截止日期,格式同上 | + **createdAt** | **optional.String**| 任务创建时间,格式同上 | + **finishedAt** | **optional.String**| 任务完成时间,即任务最后一次转为已完成状态的时间点。格式同上 | + +### Return type + +[**[]Issue**](Issue.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5OrgsOrgIssues** +> []Issue GetV5OrgsOrgIssues(ctx, org, optional) +获取当前用户某个组织的Issues + +获取当前用户某个组织的Issues + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **org** | **string**| 组织的路径(path/login) | + **optional** | ***GetV5OrgsOrgIssuesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5OrgsOrgIssuesOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + **filter** | **optional.String**| 筛选参数: 授权用户负责的(assigned),授权用户创建的(created),包含前两者的(all)。默认: assigned | [default to assigned] + **state** | **optional.String**| Issue的状态: open(开启的), progressing(进行中), closed(关闭的), rejected(拒绝的)。 默认: open | [default to open] + **labels** | **optional.String**| 用逗号分开的标签。如: bug,performance | + **sort** | **optional.String**| 排序依据: 创建时间(created),更新时间(updated_at)。默认: created_at | [default to created] + **direction** | **optional.String**| 排序方式: 升序(asc),降序(desc)。默认: desc | [default to desc] + **since** | **optional.String**| 起始的更新时间,要求时间格式为 ISO 8601 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + **schedule** | **optional.String**| 计划开始日期,格式:20181006T173008+80-20181007T173008+80(区间),或者 -20181007T173008+80(小于20181007T173008+80),或者 20181006T173008+80-(大于20181006T173008+80),要求时间格式为20181006T173008+80 | + **deadline** | **optional.String**| 计划截止日期,格式同上 | + **createdAt** | **optional.String**| 任务创建时间,格式同上 | + **finishedAt** | **optional.String**| 任务完成时间,即任务最后一次转为已完成状态的时间点。格式同上 | + +### Return type + +[**[]Issue**](Issue.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerIssuesNumberOperateLogs** +> []OperateLog GetV5ReposOwnerIssuesNumberOperateLogs(ctx, owner, number, optional) +获取某个Issue下的操作日志 + +获取某个Issue下的操作日志 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **number** | **string**| Issue 编号(区分大小写,无需添加 # 号) | + **optional** | ***GetV5ReposOwnerIssuesNumberOperateLogsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerIssuesNumberOperateLogsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **repo** | **optional.String**| 仓库路径(path) | + **sort** | **optional.String**| 按递增(asc)或递减(desc)排序,默认:递减 | [default to desc] + +### Return type + +[**[]OperateLog**](OperateLog.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoIssues** +> []Issue GetV5ReposOwnerRepoIssues(ctx, owner, repo, optional) +仓库的所有Issues + +仓库的所有Issues + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***GetV5ReposOwnerRepoIssuesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoIssuesOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **state** | **optional.String**| Issue的状态: open(开启的), progressing(进行中), closed(关闭的), rejected(拒绝的)。 默认: open | [default to open] + **labels** | **optional.String**| 用逗号分开的标签。如: bug,performance | + **sort** | **optional.String**| 排序依据: 创建时间(created),更新时间(updated_at)。默认: created_at | [default to created] + **direction** | **optional.String**| 排序方式: 升序(asc),降序(desc)。默认: desc | [default to desc] + **since** | **optional.String**| 起始的更新时间,要求时间格式为 ISO 8601 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + **schedule** | **optional.String**| 计划开始日期,格式:20181006T173008+80-20181007T173008+80(区间),或者 -20181007T173008+80(小于20181007T173008+80),或者 20181006T173008+80-(大于20181006T173008+80),要求时间格式为20181006T173008+80 | + **deadline** | **optional.String**| 计划截止日期,格式同上 | + **createdAt** | **optional.String**| 任务创建时间,格式同上 | + **finishedAt** | **optional.String**| 任务完成时间,即任务最后一次转为已完成状态的时间点。格式同上 | + **milestone** | **optional.String**| 根据里程碑标题。none为没里程碑的,*为所有带里程碑的 | + **assignee** | **optional.String**| 用户的username。 none为没指派者, *为所有带有指派者的 | + **creator** | **optional.String**| 创建Issues的用户username | + **program** | **optional.String**| 所属项目名称。none为没有所属项目,*为所有带所属项目的 | + +### Return type + +[**[]Issue**](Issue.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoIssuesComments** +> Note GetV5ReposOwnerRepoIssuesComments(ctx, owner, repo, optional) +获取仓库所有Issue的评论 + +获取仓库所有Issue的评论 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***GetV5ReposOwnerRepoIssuesCommentsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoIssuesCommentsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **sort** | **optional.String**| Either created or updated. Default: created | [default to created] + **direction** | **optional.String**| Either asc or desc. Ignored without the sort parameter. | [default to asc] + **since** | **optional.String**| Only comments updated at or after this time are returned. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**Note**](Note.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoIssuesCommentsId** +> Note GetV5ReposOwnerRepoIssuesCommentsId(ctx, owner, repo, id, optional) +获取仓库Issue某条评论 + +获取仓库Issue某条评论 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **id** | **int32**| 评论的ID | + **optional** | ***GetV5ReposOwnerRepoIssuesCommentsIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoIssuesCommentsIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**Note**](Note.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoIssuesNumber** +> Issue GetV5ReposOwnerRepoIssuesNumber(ctx, owner, repo, number, optional) +仓库的某个Issue + +仓库的某个Issue + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **number** | **string**| Issue 编号(区分大小写,无需添加 # 号) | + **optional** | ***GetV5ReposOwnerRepoIssuesNumberOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoIssuesNumberOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**Issue**](Issue.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoIssuesNumberComments** +> Note GetV5ReposOwnerRepoIssuesNumberComments(ctx, owner, repo, number, optional) +获取仓库某个Issue所有的评论 + +获取仓库某个Issue所有的评论 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **number** | **string**| Issue 编号(区分大小写,无需添加 # 号) | + **optional** | ***GetV5ReposOwnerRepoIssuesNumberCommentsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoIssuesNumberCommentsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + **since** | **optional.String**| Only comments updated at or after this time are returned. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**Note**](Note.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5UserIssues** +> []Issue GetV5UserIssues(ctx, optional) +获取授权用户的所有Issues + +获取授权用户的所有Issues + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***GetV5UserIssuesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5UserIssuesOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accessToken** | **optional.String**| 用户授权码 | + **filter** | **optional.String**| 筛选参数: 授权用户负责的(assigned),授权用户创建的(created),包含前两者的(all)。默认: assigned | [default to assigned] + **state** | **optional.String**| Issue的状态: open(开启的), progressing(进行中), closed(关闭的), rejected(拒绝的)。 默认: open | [default to open] + **labels** | **optional.String**| 用逗号分开的标签。如: bug,performance | + **sort** | **optional.String**| 排序依据: 创建时间(created),更新时间(updated_at)。默认: created_at | [default to created] + **direction** | **optional.String**| 排序方式: 升序(asc),降序(desc)。默认: desc | [default to desc] + **since** | **optional.String**| 起始的更新时间,要求时间格式为 ISO 8601 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + **schedule** | **optional.String**| 计划开始日期,格式:20181006T173008+80-20181007T173008+80(区间),或者 -20181007T173008+80(小于20181007T173008+80),或者 20181006T173008+80-(大于20181006T173008+80),要求时间格式为20181006T173008+80 | + **deadline** | **optional.String**| 计划截止日期,格式同上 | + **createdAt** | **optional.String**| 任务创建时间,格式同上 | + **finishedAt** | **optional.String**| 任务完成时间,即任务最后一次转为已完成状态的时间点。格式同上 | + +### Return type + +[**[]Issue**](Issue.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PatchV5ReposOwnerIssuesNumber** +> Issue PatchV5ReposOwnerIssuesNumber(ctx, owner, number, optional) +更新Issue + +更新Issue + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **number** | **string**| Issue 编号(区分大小写,无需添加 # 号) | + **optional** | ***PatchV5ReposOwnerIssuesNumberOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PatchV5ReposOwnerIssuesNumberOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **repo** | **optional.String**| 仓库路径(path) | + **title** | **optional.String**| Issue标题 | + **state** | **optional.String**| Issue 状态,open(开启的)、progressing(进行中)、closed(关闭的) | + **body** | **optional.String**| Issue描述 | + **assignee** | **optional.String**| Issue负责人的username | + **milestone** | **optional.Int32**| 里程碑序号 | + **labels** | **optional.String**| 用逗号分开的标签,名称要求长度在 2-20 之间且非特殊字符。如: bug,performance | + **program** | **optional.String**| 项目ID | + +### Return type + +[**Issue**](Issue.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PatchV5ReposOwnerRepoIssuesCommentsId** +> Note PatchV5ReposOwnerRepoIssuesCommentsId(ctx, owner, repo, id, body, optional) +更新Issue某条评论 + +更新Issue某条评论 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **id** | **int32**| 评论的ID | + **body** | **string**| The contents of the comment. | + **optional** | ***PatchV5ReposOwnerRepoIssuesCommentsIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PatchV5ReposOwnerRepoIssuesCommentsIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**Note**](Note.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PostV5ReposOwnerIssues** +> Issue PostV5ReposOwnerIssues(ctx, owner, title, optional) +创建Issue + +创建Issue + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **title** | **string**| Issue标题 | + **optional** | ***PostV5ReposOwnerIssuesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PostV5ReposOwnerIssuesOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **repo** | **optional.String**| 仓库路径(path) | + **issueType** | **optional.String**| 企业自定义任务类型,非企业默认任务类型为“任务” | + **body** | **optional.String**| Issue描述 | + **assignee** | **optional.String**| Issue负责人的username | + **milestone** | **optional.Int32**| 里程碑序号 | + **labels** | **optional.String**| 用逗号分开的标签,名称要求长度在 2-20 之间且非特殊字符。如: bug,performance | + **program** | **optional.String**| 项目ID | + +### Return type + +[**Issue**](Issue.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PostV5ReposOwnerRepoIssuesNumberComments** +> Note PostV5ReposOwnerRepoIssuesNumberComments(ctx, owner, repo, number, body, optional) +创建某个Issue评论 + +创建某个Issue评论 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **number** | **string**| Issue 编号(区分大小写,无需添加 # 号) | + **body** | **string**| The contents of the comment. | + **optional** | ***PostV5ReposOwnerRepoIssuesNumberCommentsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PostV5ReposOwnerRepoIssuesNumberCommentsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**Note**](Note.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/Label.md b/docs/Label.md new file mode 100644 index 0000000..225554d --- /dev/null +++ b/docs/Label.md @@ -0,0 +1,14 @@ +# Label + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**Color** | **string** | | [optional] [default to null] +**RepositoryId** | **int32** | | [optional] [default to null] +**Url** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/LabelsApi.md b/docs/LabelsApi.md new file mode 100644 index 0000000..f777e0d --- /dev/null +++ b/docs/LabelsApi.md @@ -0,0 +1,512 @@ +# \LabelsApi + +All URIs are relative to *https://gitee.com/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteV5ReposOwnerRepoIssuesNumberLabels**](LabelsApi.md#DeleteV5ReposOwnerRepoIssuesNumberLabels) | **Delete** /v5/repos/{owner}/{repo}/issues/{number}/labels | 删除Issue所有标签 +[**DeleteV5ReposOwnerRepoIssuesNumberLabelsName**](LabelsApi.md#DeleteV5ReposOwnerRepoIssuesNumberLabelsName) | **Delete** /v5/repos/{owner}/{repo}/issues/{number}/labels/{name} | 删除Issue标签 +[**DeleteV5ReposOwnerRepoLabelsName**](LabelsApi.md#DeleteV5ReposOwnerRepoLabelsName) | **Delete** /v5/repos/{owner}/{repo}/labels/{name} | 删除一个仓库任务标签 +[**GetV5EnterprisesEnterpriseLabels**](LabelsApi.md#GetV5EnterprisesEnterpriseLabels) | **Get** /v5/enterprises/{enterprise}/labels | 获取企业所有标签 +[**GetV5EnterprisesEnterpriseLabelsName**](LabelsApi.md#GetV5EnterprisesEnterpriseLabelsName) | **Get** /v5/enterprises/{enterprise}/labels/{name} | 获取企业某个标签 +[**GetV5ReposOwnerRepoIssuesNumberLabels**](LabelsApi.md#GetV5ReposOwnerRepoIssuesNumberLabels) | **Get** /v5/repos/{owner}/{repo}/issues/{number}/labels | 获取仓库任务的所有标签 +[**GetV5ReposOwnerRepoLabels**](LabelsApi.md#GetV5ReposOwnerRepoLabels) | **Get** /v5/repos/{owner}/{repo}/labels | 获取仓库所有任务标签 +[**GetV5ReposOwnerRepoLabelsName**](LabelsApi.md#GetV5ReposOwnerRepoLabelsName) | **Get** /v5/repos/{owner}/{repo}/labels/{name} | 根据标签名称获取单个标签 +[**PatchV5ReposOwnerRepoLabelsOriginalName**](LabelsApi.md#PatchV5ReposOwnerRepoLabelsOriginalName) | **Patch** /v5/repos/{owner}/{repo}/labels/{original_name} | 更新一个仓库任务标签 +[**PostV5ReposOwnerRepoIssuesNumberLabels**](LabelsApi.md#PostV5ReposOwnerRepoIssuesNumberLabels) | **Post** /v5/repos/{owner}/{repo}/issues/{number}/labels | 创建Issue标签 +[**PostV5ReposOwnerRepoLabels**](LabelsApi.md#PostV5ReposOwnerRepoLabels) | **Post** /v5/repos/{owner}/{repo}/labels | 创建仓库任务标签 +[**PutV5ReposOwnerRepoIssuesNumberLabels**](LabelsApi.md#PutV5ReposOwnerRepoIssuesNumberLabels) | **Put** /v5/repos/{owner}/{repo}/issues/{number}/labels | 替换Issue所有标签 + + +# **DeleteV5ReposOwnerRepoIssuesNumberLabels** +> DeleteV5ReposOwnerRepoIssuesNumberLabels(ctx, owner, repo, number, optional) +删除Issue所有标签 + +删除Issue所有标签 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **number** | **string**| Issue 编号(区分大小写,无需添加 # 号) | + **optional** | ***DeleteV5ReposOwnerRepoIssuesNumberLabelsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DeleteV5ReposOwnerRepoIssuesNumberLabelsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **DeleteV5ReposOwnerRepoIssuesNumberLabelsName** +> DeleteV5ReposOwnerRepoIssuesNumberLabelsName(ctx, owner, repo, number, name, optional) +删除Issue标签 + +删除Issue标签 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **number** | **string**| Issue 编号(区分大小写,无需添加 # 号) | + **name** | **string**| 标签名称 | + **optional** | ***DeleteV5ReposOwnerRepoIssuesNumberLabelsNameOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DeleteV5ReposOwnerRepoIssuesNumberLabelsNameOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **DeleteV5ReposOwnerRepoLabelsName** +> DeleteV5ReposOwnerRepoLabelsName(ctx, owner, repo, name, optional) +删除一个仓库任务标签 + +删除一个仓库任务标签 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **name** | **string**| 标签名称 | + **optional** | ***DeleteV5ReposOwnerRepoLabelsNameOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DeleteV5ReposOwnerRepoLabelsNameOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5EnterprisesEnterpriseLabels** +> []Label GetV5EnterprisesEnterpriseLabels(ctx, enterprise, optional) +获取企业所有标签 + +获取企业所有标签 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **enterprise** | **string**| 企业的路径(path/login) | + **optional** | ***GetV5EnterprisesEnterpriseLabelsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5EnterprisesEnterpriseLabelsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**[]Label**](Label.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5EnterprisesEnterpriseLabelsName** +> Label GetV5EnterprisesEnterpriseLabelsName(ctx, enterprise, name, optional) +获取企业某个标签 + +获取企业某个标签 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **enterprise** | **string**| 企业的路径(path/login) | + **name** | **string**| 标签名称 | + **optional** | ***GetV5EnterprisesEnterpriseLabelsNameOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5EnterprisesEnterpriseLabelsNameOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**Label**](Label.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoIssuesNumberLabels** +> []Label GetV5ReposOwnerRepoIssuesNumberLabels(ctx, owner, repo, number, optional) +获取仓库任务的所有标签 + +获取仓库任务的所有标签 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **number** | **string**| Issue 编号(区分大小写,无需添加 # 号) | + **optional** | ***GetV5ReposOwnerRepoIssuesNumberLabelsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoIssuesNumberLabelsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**[]Label**](Label.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoLabels** +> []Label GetV5ReposOwnerRepoLabels(ctx, owner, repo, optional) +获取仓库所有任务标签 + +获取仓库所有任务标签 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***GetV5ReposOwnerRepoLabelsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoLabelsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**[]Label**](Label.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoLabelsName** +> Label GetV5ReposOwnerRepoLabelsName(ctx, owner, repo, name, optional) +根据标签名称获取单个标签 + +根据标签名称获取单个标签 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **name** | **string**| 标签名称 | + **optional** | ***GetV5ReposOwnerRepoLabelsNameOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoLabelsNameOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**Label**](Label.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PatchV5ReposOwnerRepoLabelsOriginalName** +> Label PatchV5ReposOwnerRepoLabelsOriginalName(ctx, owner, repo, originalName, optional) +更新一个仓库任务标签 + +更新一个仓库任务标签 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **originalName** | **string**| 标签原有名称 | + **optional** | ***PatchV5ReposOwnerRepoLabelsOriginalNameOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PatchV5ReposOwnerRepoLabelsOriginalNameOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + **name** | **optional.String**| 标签新名称 | + **color** | **optional.String**| 标签新颜色 | + +### Return type + +[**Label**](Label.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PostV5ReposOwnerRepoIssuesNumberLabels** +> Label PostV5ReposOwnerRepoIssuesNumberLabels(ctx, owner, repo, number, optional) +创建Issue标签 + +创建Issue标签 需要在请求的body里填上数组,元素为标签的名字。如: [\"performance\", \"bug\"] + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **number** | **string**| Issue 编号(区分大小写,无需添加 # 号) | + **optional** | ***PostV5ReposOwnerRepoIssuesNumberLabelsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PostV5ReposOwnerRepoIssuesNumberLabelsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + **body** | [**optional.Interface of []string**](string.md)| 标签名数组,如: [\"feat\", \"bug\"] | + +### Return type + +[**Label**](Label.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PostV5ReposOwnerRepoLabels** +> Label PostV5ReposOwnerRepoLabels(ctx, owner, repo, name, color, optional) +创建仓库任务标签 + +创建仓库任务标签 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **name** | **string**| 标签名称 | + **color** | **string**| 标签颜色。为6位的数字,如: 000000 | + **optional** | ***PostV5ReposOwnerRepoLabelsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PostV5ReposOwnerRepoLabelsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**Label**](Label.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PutV5ReposOwnerRepoIssuesNumberLabels** +> Label PutV5ReposOwnerRepoIssuesNumberLabels(ctx, owner, repo, number, optional) +替换Issue所有标签 + +替换Issue所有标签 需要在请求的body里填上数组,元素为标签的名字。如: [\"performance\", \"bug\"] + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **number** | **string**| Issue 编号(区分大小写,无需添加 # 号) | + **optional** | ***PutV5ReposOwnerRepoIssuesNumberLabelsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PutV5ReposOwnerRepoIssuesNumberLabelsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + **body** | [**optional.Interface of []string**](string.md)| 标签名数组,如: [\"feat\", \"bug\"] | + +### Return type + +[**Label**](Label.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/Milestone.md b/docs/Milestone.md new file mode 100644 index 0000000..0cd4056 --- /dev/null +++ b/docs/Milestone.md @@ -0,0 +1,21 @@ +# Milestone + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Url** | **string** | | [optional] [default to null] +**HtmlUrl** | **string** | | [optional] [default to null] +**Number** | **int32** | | [optional] [default to null] +**RepositoryId** | **int32** | | [optional] [default to null] +**State** | **string** | | [optional] [default to null] +**Title** | **string** | | [optional] [default to null] +**Description** | **string** | | [optional] [default to null] +**UpdatedAt** | [**time.Time**](time.Time.md) | | [optional] [default to null] +**CreatedAt** | [**time.Time**](time.Time.md) | | [optional] [default to null] +**OpenIssues** | **int32** | | [optional] [default to null] +**ClosedIssues** | **int32** | | [optional] [default to null] +**DueOn** | [**time.Time**](time.Time.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MilestonesApi.md b/docs/MilestonesApi.md new file mode 100644 index 0000000..fa2c5b7 --- /dev/null +++ b/docs/MilestonesApi.md @@ -0,0 +1,231 @@ +# \MilestonesApi + +All URIs are relative to *https://gitee.com/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteV5ReposOwnerRepoMilestonesNumber**](MilestonesApi.md#DeleteV5ReposOwnerRepoMilestonesNumber) | **Delete** /v5/repos/{owner}/{repo}/milestones/{number} | 删除仓库单个里程碑 +[**GetV5ReposOwnerRepoMilestones**](MilestonesApi.md#GetV5ReposOwnerRepoMilestones) | **Get** /v5/repos/{owner}/{repo}/milestones | 获取仓库所有里程碑 +[**GetV5ReposOwnerRepoMilestonesNumber**](MilestonesApi.md#GetV5ReposOwnerRepoMilestonesNumber) | **Get** /v5/repos/{owner}/{repo}/milestones/{number} | 获取仓库单个里程碑 +[**PatchV5ReposOwnerRepoMilestonesNumber**](MilestonesApi.md#PatchV5ReposOwnerRepoMilestonesNumber) | **Patch** /v5/repos/{owner}/{repo}/milestones/{number} | 更新仓库里程碑 +[**PostV5ReposOwnerRepoMilestones**](MilestonesApi.md#PostV5ReposOwnerRepoMilestones) | **Post** /v5/repos/{owner}/{repo}/milestones | 创建仓库里程碑 + + +# **DeleteV5ReposOwnerRepoMilestonesNumber** +> DeleteV5ReposOwnerRepoMilestonesNumber(ctx, owner, repo, number, optional) +删除仓库单个里程碑 + +删除仓库单个里程碑 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **number** | **int32**| 里程碑序号(id) | + **optional** | ***DeleteV5ReposOwnerRepoMilestonesNumberOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DeleteV5ReposOwnerRepoMilestonesNumberOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoMilestones** +> []Milestone GetV5ReposOwnerRepoMilestones(ctx, owner, repo, optional) +获取仓库所有里程碑 + +获取仓库所有里程碑 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***GetV5ReposOwnerRepoMilestonesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoMilestonesOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **state** | **optional.String**| 里程碑状态: open, closed, all。默认: open | [default to open] + **sort** | **optional.String**| 排序方式: due_on | [default to due_on] + **direction** | **optional.String**| 升序(asc)或是降序(desc)。默认: asc | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]Milestone**](Milestone.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoMilestonesNumber** +> Milestone GetV5ReposOwnerRepoMilestonesNumber(ctx, owner, repo, number, optional) +获取仓库单个里程碑 + +获取仓库单个里程碑 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **number** | **int32**| 里程碑序号(id) | + **optional** | ***GetV5ReposOwnerRepoMilestonesNumberOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoMilestonesNumberOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**Milestone**](Milestone.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PatchV5ReposOwnerRepoMilestonesNumber** +> Milestone PatchV5ReposOwnerRepoMilestonesNumber(ctx, owner, repo, number, title, dueOn, optional) +更新仓库里程碑 + +更新仓库里程碑 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **number** | **int32**| 里程碑序号(id) | + **title** | **string**| 里程碑标题 | + **dueOn** | **string**| 里程碑的截止日期 | + **optional** | ***PatchV5ReposOwnerRepoMilestonesNumberOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PatchV5ReposOwnerRepoMilestonesNumberOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + + + **accessToken** | **optional.String**| 用户授权码 | + **state** | **optional.String**| 里程碑状态: open, closed, all。默认: open | [default to open] + **description** | **optional.String**| 里程碑具体描述 | + +### Return type + +[**Milestone**](Milestone.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PostV5ReposOwnerRepoMilestones** +> Milestone PostV5ReposOwnerRepoMilestones(ctx, owner, repo, title, dueOn, optional) +创建仓库里程碑 + +创建仓库里程碑 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **title** | **string**| 里程碑标题 | + **dueOn** | **string**| 里程碑的截止日期 | + **optional** | ***PostV5ReposOwnerRepoMilestonesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PostV5ReposOwnerRepoMilestonesOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + + **accessToken** | **optional.String**| 用户授权码 | + **state** | **optional.String**| 里程碑状态: open, closed, all。默认: open | [default to open] + **description** | **optional.String**| 里程碑具体描述 | + +### Return type + +[**Milestone**](Milestone.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/MiscellaneousApi.md b/docs/MiscellaneousApi.md new file mode 100644 index 0000000..9a7cb2b --- /dev/null +++ b/docs/MiscellaneousApi.md @@ -0,0 +1,346 @@ +# \MiscellaneousApi + +All URIs are relative to *https://gitee.com/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetV5Emojis**](MiscellaneousApi.md#GetV5Emojis) | **Get** /v5/emojis | 列出可使用的 Emoji +[**GetV5GitignoreTemplates**](MiscellaneousApi.md#GetV5GitignoreTemplates) | **Get** /v5/gitignore/templates | 列出可使用的 .gitignore 模板 +[**GetV5GitignoreTemplatesName**](MiscellaneousApi.md#GetV5GitignoreTemplatesName) | **Get** /v5/gitignore/templates/{name} | 获取一个 .gitignore 模板 +[**GetV5GitignoreTemplatesNameRaw**](MiscellaneousApi.md#GetV5GitignoreTemplatesNameRaw) | **Get** /v5/gitignore/templates/{name}/raw | 获取一个 .gitignore 模板原始文件 +[**GetV5Licenses**](MiscellaneousApi.md#GetV5Licenses) | **Get** /v5/licenses | 列出可使用的开源许可协议 +[**GetV5LicensesLicense**](MiscellaneousApi.md#GetV5LicensesLicense) | **Get** /v5/licenses/{license} | 获取一个开源许可协议 +[**GetV5LicensesLicenseRaw**](MiscellaneousApi.md#GetV5LicensesLicenseRaw) | **Get** /v5/licenses/{license}/raw | 获取一个开源许可协议原始文件 +[**GetV5ReposOwnerRepoLicense**](MiscellaneousApi.md#GetV5ReposOwnerRepoLicense) | **Get** /v5/repos/{owner}/{repo}/license | 获取一个仓库使用的开源许可协议 +[**PostV5Markdown**](MiscellaneousApi.md#PostV5Markdown) | **Post** /v5/markdown | 渲染 Markdown 文本 + + +# **GetV5Emojis** +> GetV5Emojis(ctx, optional) +列出可使用的 Emoji + +列出可使用的 Emoji + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***GetV5EmojisOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5EmojisOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5GitignoreTemplates** +> GetV5GitignoreTemplates(ctx, optional) +列出可使用的 .gitignore 模板 + +列出可使用的 .gitignore 模板 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***GetV5GitignoreTemplatesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5GitignoreTemplatesOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5GitignoreTemplatesName** +> GetV5GitignoreTemplatesName(ctx, name, optional) +获取一个 .gitignore 模板 + +获取一个 .gitignore 模板 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **name** | **string**| .gitignore 模板名 | + **optional** | ***GetV5GitignoreTemplatesNameOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5GitignoreTemplatesNameOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5GitignoreTemplatesNameRaw** +> GetV5GitignoreTemplatesNameRaw(ctx, name, optional) +获取一个 .gitignore 模板原始文件 + +获取一个 .gitignore 模板原始文件 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **name** | **string**| .gitignore 模板名 | + **optional** | ***GetV5GitignoreTemplatesNameRawOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5GitignoreTemplatesNameRawOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5Licenses** +> GetV5Licenses(ctx, optional) +列出可使用的开源许可协议 + +列出可使用的开源许可协议 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***GetV5LicensesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5LicensesOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5LicensesLicense** +> GetV5LicensesLicense(ctx, license, optional) +获取一个开源许可协议 + +获取一个开源许可协议 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **license** | **string**| 协议名称 | + **optional** | ***GetV5LicensesLicenseOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5LicensesLicenseOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5LicensesLicenseRaw** +> GetV5LicensesLicenseRaw(ctx, license, optional) +获取一个开源许可协议原始文件 + +获取一个开源许可协议原始文件 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **license** | **string**| 协议名称 | + **optional** | ***GetV5LicensesLicenseRawOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5LicensesLicenseRawOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoLicense** +> GetV5ReposOwnerRepoLicense(ctx, owner, repo, optional) +获取一个仓库使用的开源许可协议 + +获取一个仓库使用的开源许可协议 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***GetV5ReposOwnerRepoLicenseOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoLicenseOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PostV5Markdown** +> PostV5Markdown(ctx, text, optional) +渲染 Markdown 文本 + +渲染 Markdown 文本 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **text** | **string**| Markdown 文本 | + **optional** | ***PostV5MarkdownOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PostV5MarkdownOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/Namespace.md b/docs/Namespace.md new file mode 100644 index 0000000..331dde6 --- /dev/null +++ b/docs/Namespace.md @@ -0,0 +1,15 @@ +# Namespace + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | | [optional] [default to null] +**Type_** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**Path** | **string** | | [optional] [default to null] +**HtmlUrl** | **string** | | [optional] [default to null] +**Parent** | [***NamespaceMini**](NamespaceMini.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/NamespaceMini.md b/docs/NamespaceMini.md new file mode 100644 index 0000000..9cbc859 --- /dev/null +++ b/docs/NamespaceMini.md @@ -0,0 +1,14 @@ +# NamespaceMini + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | | [optional] [default to null] +**Type_** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**Path** | **string** | | [optional] [default to null] +**HtmlUrl** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Note.md b/docs/Note.md new file mode 100644 index 0000000..58b3699 --- /dev/null +++ b/docs/Note.md @@ -0,0 +1,16 @@ +# Note + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [optional] [default to null] +**Body** | **string** | | [optional] [default to null] +**BodyHtml** | **string** | | [optional] [default to null] +**User** | **string** | | [optional] [default to null] +**Source** | **string** | | [optional] [default to null] +**CreatedAt** | **string** | | [optional] [default to null] +**Target** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OperateLog.md b/docs/OperateLog.md new file mode 100644 index 0000000..757bf3e --- /dev/null +++ b/docs/OperateLog.md @@ -0,0 +1,14 @@ +# OperateLog + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [optional] [default to null] +**Icon** | **string** | | [optional] [default to null] +**User** | **string** | | [optional] [default to null] +**Content** | **string** | | [optional] [default to null] +**CreatedAt** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrganizationsApi.md b/docs/OrganizationsApi.md new file mode 100644 index 0000000..63c20bd --- /dev/null +++ b/docs/OrganizationsApi.md @@ -0,0 +1,525 @@ +# \OrganizationsApi + +All URIs are relative to *https://gitee.com/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteV5OrgsOrgMembershipsUsername**](OrganizationsApi.md#DeleteV5OrgsOrgMembershipsUsername) | **Delete** /v5/orgs/{org}/memberships/{username} | 移除授权用户所管理组织中的成员 +[**DeleteV5UserMembershipsOrgsOrg**](OrganizationsApi.md#DeleteV5UserMembershipsOrgsOrg) | **Delete** /v5/user/memberships/orgs/{org} | 退出一个组织 +[**GetV5OrgsOrg**](OrganizationsApi.md#GetV5OrgsOrg) | **Get** /v5/orgs/{org} | 获取一个组织 +[**GetV5OrgsOrgMembers**](OrganizationsApi.md#GetV5OrgsOrgMembers) | **Get** /v5/orgs/{org}/members | 列出一个组织的所有成员 +[**GetV5OrgsOrgMembershipsUsername**](OrganizationsApi.md#GetV5OrgsOrgMembershipsUsername) | **Get** /v5/orgs/{org}/memberships/{username} | 获取授权用户所属组织的一个成员 +[**GetV5UserMembershipsOrgs**](OrganizationsApi.md#GetV5UserMembershipsOrgs) | **Get** /v5/user/memberships/orgs | 列出授权用户在所属组织的成员资料 +[**GetV5UserMembershipsOrgsOrg**](OrganizationsApi.md#GetV5UserMembershipsOrgsOrg) | **Get** /v5/user/memberships/orgs/{org} | 获取授权用户在一个组织的成员资料 +[**GetV5UserOrgs**](OrganizationsApi.md#GetV5UserOrgs) | **Get** /v5/user/orgs | 列出授权用户所属的组织 +[**GetV5UsersUsernameOrgs**](OrganizationsApi.md#GetV5UsersUsernameOrgs) | **Get** /v5/users/{username}/orgs | 列出用户所属的组织 +[**PatchV5OrgsOrg**](OrganizationsApi.md#PatchV5OrgsOrg) | **Patch** /v5/orgs/{org} | 更新授权用户所管理的组织资料 +[**PatchV5UserMembershipsOrgsOrg**](OrganizationsApi.md#PatchV5UserMembershipsOrgsOrg) | **Patch** /v5/user/memberships/orgs/{org} | 更新授权用户在一个组织的成员资料 +[**PostV5UsersOrganization**](OrganizationsApi.md#PostV5UsersOrganization) | **Post** /v5/users/organization | 创建组织 +[**PutV5OrgsOrgMembershipsUsername**](OrganizationsApi.md#PutV5OrgsOrgMembershipsUsername) | **Put** /v5/orgs/{org}/memberships/{username} | 增加或更新授权用户所管理组织的成员 + + +# **DeleteV5OrgsOrgMembershipsUsername** +> DeleteV5OrgsOrgMembershipsUsername(ctx, org, username, optional) +移除授权用户所管理组织中的成员 + +移除授权用户所管理组织中的成员 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **org** | **string**| 组织的路径(path/login) | + **username** | **string**| 用户名(username/login) | + **optional** | ***DeleteV5OrgsOrgMembershipsUsernameOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DeleteV5OrgsOrgMembershipsUsernameOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **DeleteV5UserMembershipsOrgsOrg** +> DeleteV5UserMembershipsOrgsOrg(ctx, org, optional) +退出一个组织 + +退出一个组织 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **org** | **string**| 组织的路径(path/login) | + **optional** | ***DeleteV5UserMembershipsOrgsOrgOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DeleteV5UserMembershipsOrgsOrgOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5OrgsOrg** +> Group GetV5OrgsOrg(ctx, org, optional) +获取一个组织 + +获取一个组织 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **org** | **string**| 组织的路径(path/login) | + **optional** | ***GetV5OrgsOrgOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5OrgsOrgOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**Group**](Group.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5OrgsOrgMembers** +> []UserBasic GetV5OrgsOrgMembers(ctx, org, optional) +列出一个组织的所有成员 + +列出一个组织的所有成员 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **org** | **string**| 组织的路径(path/login) | + **optional** | ***GetV5OrgsOrgMembersOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5OrgsOrgMembersOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + **role** | **optional.String**| 根据角色筛选成员 | [default to all] + +### Return type + +[**[]UserBasic**](UserBasic.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5OrgsOrgMembershipsUsername** +> GroupMember GetV5OrgsOrgMembershipsUsername(ctx, org, username, optional) +获取授权用户所属组织的一个成员 + +获取授权用户所属组织的一个成员 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **org** | **string**| 组织的路径(path/login) | + **username** | **string**| 用户名(username/login) | + **optional** | ***GetV5OrgsOrgMembershipsUsernameOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5OrgsOrgMembershipsUsernameOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**GroupMember**](GroupMember.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5UserMembershipsOrgs** +> []GroupMember GetV5UserMembershipsOrgs(ctx, optional) +列出授权用户在所属组织的成员资料 + +列出授权用户在所属组织的成员资料 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***GetV5UserMembershipsOrgsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5UserMembershipsOrgsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accessToken** | **optional.String**| 用户授权码 | + **active** | **optional.Bool**| 根据成员是否已激活进行筛选资料,缺省返回所有资料 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]GroupMember**](GroupMember.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5UserMembershipsOrgsOrg** +> GroupMember GetV5UserMembershipsOrgsOrg(ctx, org, optional) +获取授权用户在一个组织的成员资料 + +获取授权用户在一个组织的成员资料 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **org** | **string**| 组织的路径(path/login) | + **optional** | ***GetV5UserMembershipsOrgsOrgOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5UserMembershipsOrgsOrgOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**GroupMember**](GroupMember.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5UserOrgs** +> []Group GetV5UserOrgs(ctx, optional) +列出授权用户所属的组织 + +列出授权用户所属的组织 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***GetV5UserOrgsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5UserOrgsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + **admin** | **optional.Bool**| 只列出授权用户管理的组织 | + +### Return type + +[**[]Group**](Group.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5UsersUsernameOrgs** +> []Group GetV5UsersUsernameOrgs(ctx, username, optional) +列出用户所属的组织 + +列出用户所属的组织 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **username** | **string**| 用户名(username/login) | + **optional** | ***GetV5UsersUsernameOrgsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5UsersUsernameOrgsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]Group**](Group.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PatchV5OrgsOrg** +> GroupDetail PatchV5OrgsOrg(ctx, org, optional) +更新授权用户所管理的组织资料 + +更新授权用户所管理的组织资料 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **org** | **string**| 组织的路径(path/login) | + **optional** | ***PatchV5OrgsOrgOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PatchV5OrgsOrgOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + **email** | **optional.String**| 组织公开的邮箱地址 | + **location** | **optional.String**| 组织所在地 | + **name** | **optional.String**| 组织名称 | + **description** | **optional.String**| 组织简介 | + **htmlUrl** | **optional.String**| 组织站点 | + +### Return type + +[**GroupDetail**](GroupDetail.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PatchV5UserMembershipsOrgsOrg** +> GroupMember PatchV5UserMembershipsOrgsOrg(ctx, org, optional) +更新授权用户在一个组织的成员资料 + +更新授权用户在一个组织的成员资料 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **org** | **string**| 组织的路径(path/login) | + **optional** | ***PatchV5UserMembershipsOrgsOrgOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PatchV5UserMembershipsOrgsOrgOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + **remark** | **optional.String**| 在组织中的备注信息 | + +### Return type + +[**GroupMember**](GroupMember.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PostV5UsersOrganization** +> Group PostV5UsersOrganization(ctx, name, org, optional) +创建组织 + +创建组织 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **name** | **string**| 组织名称 | + **org** | **string**| 组织的路径(path/login) | + **optional** | ***PostV5UsersOrganizationOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PostV5UsersOrganizationOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **description** | **optional.String**| 组织描述 | + +### Return type + +[**Group**](Group.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PutV5OrgsOrgMembershipsUsername** +> GroupMember PutV5OrgsOrgMembershipsUsername(ctx, org, username, optional) +增加或更新授权用户所管理组织的成员 + +增加或更新授权用户所管理组织的成员 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **org** | **string**| 组织的路径(path/login) | + **username** | **string**| 用户名(username/login) | + **optional** | ***PutV5OrgsOrgMembershipsUsernameOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PutV5OrgsOrgMembershipsUsernameOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **role** | **optional.String**| 设置用户在组织的角色 | [default to member] + +### Return type + +[**GroupMember**](GroupMember.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/ProgramBasic.md b/docs/ProgramBasic.md new file mode 100644 index 0000000..6fa8a35 --- /dev/null +++ b/docs/ProgramBasic.md @@ -0,0 +1,14 @@ +# ProgramBasic + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**Description** | **string** | | [optional] [default to null] +**Assignee** | **string** | | [optional] [default to null] +**Author** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Project.md b/docs/Project.md new file mode 100644 index 0000000..05749fa --- /dev/null +++ b/docs/Project.md @@ -0,0 +1,67 @@ +# Project + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | | [optional] [default to null] +**FullName** | **string** | | [optional] [default to null] +**HumanName** | **string** | | [optional] [default to null] +**Url** | **string** | | [optional] [default to null] +**Namespace** | [***interface{}**](interface{}.md) | | [optional] [default to null] +**Path** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**Owner** | **string** | | [optional] [default to null] +**Description** | **string** | | [optional] [default to null] +**Private** | **string** | | [optional] [default to null] +**Public** | **string** | | [optional] [default to null] +**Internal** | **string** | | [optional] [default to null] +**Fork** | **string** | | [optional] [default to null] +**HtmlUrl** | **string** | | [optional] [default to null] +**SshUrl** | **string** | | [optional] [default to null] +**ForksUrl** | **string** | | [optional] [default to null] +**KeysUrl** | **string** | | [optional] [default to null] +**CollaboratorsUrl** | **string** | | [optional] [default to null] +**HooksUrl** | **string** | | [optional] [default to null] +**BranchesUrl** | **string** | | [optional] [default to null] +**TagsUrl** | **string** | | [optional] [default to null] +**BlobsUrl** | **string** | | [optional] [default to null] +**StargazersUrl** | **string** | | [optional] [default to null] +**ContributorsUrl** | **string** | | [optional] [default to null] +**CommitsUrl** | **string** | | [optional] [default to null] +**CommentsUrl** | **string** | | [optional] [default to null] +**IssueCommentUrl** | **string** | | [optional] [default to null] +**IssuesUrl** | **string** | | [optional] [default to null] +**PullsUrl** | **string** | | [optional] [default to null] +**MilestonesUrl** | **string** | | [optional] [default to null] +**NotificationsUrl** | **string** | | [optional] [default to null] +**LabelsUrl** | **string** | | [optional] [default to null] +**ReleasesUrl** | **string** | | [optional] [default to null] +**Recommend** | **string** | | [optional] [default to null] +**Homepage** | **string** | | [optional] [default to null] +**Language** | **string** | | [optional] [default to null] +**ForksCount** | **string** | | [optional] [default to null] +**StargazersCount** | **string** | | [optional] [default to null] +**WatchersCount** | **string** | | [optional] [default to null] +**DefaultBranch** | **string** | | [optional] [default to null] +**OpenIssuesCount** | **int32** | | [optional] [default to null] +**HasIssues** | **string** | | [optional] [default to null] +**HasWiki** | **string** | | [optional] [default to null] +**PullRequestsEnabled** | **string** | | [optional] [default to null] +**HasPage** | **string** | | [optional] [default to null] +**License** | **string** | | [optional] [default to null] +**Outsourced** | **string** | | [optional] [default to null] +**ProjectCreator** | **string** | | [optional] [default to null] +**Members** | **string** | | [optional] [default to null] +**PushedAt** | **string** | | [optional] [default to null] +**CreatedAt** | **string** | | [optional] [default to null] +**UpdatedAt** | **string** | | [optional] [default to null] +**Parent** | [***Project**](Project.md) | | [optional] [default to null] +**Paas** | **string** | | [optional] [default to null] +**Stared** | **string** | | [optional] [default to null] +**Watched** | **string** | | [optional] [default to null] +**Permission** | **string** | | [optional] [default to null] +**Relation** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ProjectBasic.md b/docs/ProjectBasic.md new file mode 100644 index 0000000..37a0bcf --- /dev/null +++ b/docs/ProjectBasic.md @@ -0,0 +1,24 @@ +# ProjectBasic + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | | [optional] [default to null] +**FullName** | **string** | | [optional] [default to null] +**HumanName** | **string** | | [optional] [default to null] +**Url** | **string** | | [optional] [default to null] +**Namespace** | [***interface{}**](interface{}.md) | | [optional] [default to null] +**Path** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**Owner** | **string** | | [optional] [default to null] +**Description** | **string** | | [optional] [default to null] +**Private** | **string** | | [optional] [default to null] +**Public** | **string** | | [optional] [default to null] +**Internal** | **string** | | [optional] [default to null] +**Fork** | **string** | | [optional] [default to null] +**HtmlUrl** | **string** | | [optional] [default to null] +**SshUrl** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ProjectMember.md b/docs/ProjectMember.md new file mode 100644 index 0000000..8b343c3 --- /dev/null +++ b/docs/ProjectMember.md @@ -0,0 +1,27 @@ +# ProjectMember + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | | [optional] [default to null] +**Login** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**AvatarUrl** | **string** | | [optional] [default to null] +**Url** | **string** | | [optional] [default to null] +**HtmlUrl** | **string** | | [optional] [default to null] +**FollowersUrl** | **string** | | [optional] [default to null] +**FollowingUrl** | **string** | | [optional] [default to null] +**GistsUrl** | **string** | | [optional] [default to null] +**StarredUrl** | **string** | | [optional] [default to null] +**SubscriptionsUrl** | **string** | | [optional] [default to null] +**OrganizationsUrl** | **string** | | [optional] [default to null] +**ReposUrl** | **string** | | [optional] [default to null] +**EventsUrl** | **string** | | [optional] [default to null] +**ReceivedEventsUrl** | **string** | | [optional] [default to null] +**Type_** | **string** | | [optional] [default to null] +**SiteAdmin** | **string** | | [optional] [default to null] +**Permissions** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ProjectMemberPermission.md b/docs/ProjectMemberPermission.md new file mode 100644 index 0000000..160b8a9 --- /dev/null +++ b/docs/ProjectMemberPermission.md @@ -0,0 +1,27 @@ +# ProjectMemberPermission + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | | [optional] [default to null] +**Login** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**AvatarUrl** | **string** | | [optional] [default to null] +**Url** | **string** | | [optional] [default to null] +**HtmlUrl** | **string** | | [optional] [default to null] +**FollowersUrl** | **string** | | [optional] [default to null] +**FollowingUrl** | **string** | | [optional] [default to null] +**GistsUrl** | **string** | | [optional] [default to null] +**StarredUrl** | **string** | | [optional] [default to null] +**SubscriptionsUrl** | **string** | | [optional] [default to null] +**OrganizationsUrl** | **string** | | [optional] [default to null] +**ReposUrl** | **string** | | [optional] [default to null] +**EventsUrl** | **string** | | [optional] [default to null] +**ReceivedEventsUrl** | **string** | | [optional] [default to null] +**Type_** | **string** | | [optional] [default to null] +**SiteAdmin** | **string** | | [optional] [default to null] +**Permission** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PullRequest.md b/docs/PullRequest.md new file mode 100644 index 0000000..296a4fd --- /dev/null +++ b/docs/PullRequest.md @@ -0,0 +1,39 @@ +# PullRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [optional] [default to null] +**Url** | **string** | | [optional] [default to null] +**HtmlUrl** | **string** | | [optional] [default to null] +**DiffUrl** | **string** | | [optional] [default to null] +**PatchUrl** | **string** | | [optional] [default to null] +**IssueUrl** | **string** | | [optional] [default to null] +**CommitsUrl** | **string** | | [optional] [default to null] +**ReviewCommentsUrl** | **string** | | [optional] [default to null] +**ReviewCommentUrl** | **string** | | [optional] [default to null] +**CommentsUrl** | **string** | | [optional] [default to null] +**StatusesUrl** | **string** | | [optional] [default to null] +**Number** | **string** | | [optional] [default to null] +**State** | **string** | | [optional] [default to null] +**Title** | **string** | | [optional] [default to null] +**Body** | **string** | | [optional] [default to null] +**BodyHtml** | **string** | | [optional] [default to null] +**Assignees** | **[]string** | | [optional] [default to null] +**Testers** | **[]string** | | [optional] [default to null] +**Milestone** | [***Milestone**](Milestone.md) | | [optional] [default to null] +**Labels** | [***Label**](Label.md) | | [optional] [default to null] +**Locked** | **string** | | [optional] [default to null] +**CreatedAt** | **string** | | [optional] [default to null] +**UpdatedAt** | **string** | | [optional] [default to null] +**ClosedAt** | **string** | | [optional] [default to null] +**MergedAt** | **string** | | [optional] [default to null] +**Mergeable** | **string** | | [optional] [default to null] +**Head** | **string** | | [optional] [default to null] +**Base** | **string** | | [optional] [default to null] +**Links** | **string** | | [optional] [default to null] +**User** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PullRequestComments.md b/docs/PullRequestComments.md new file mode 100644 index 0000000..2aeb13c --- /dev/null +++ b/docs/PullRequestComments.md @@ -0,0 +1,23 @@ +# PullRequestComments + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Url** | **string** | | [optional] [default to null] +**Id** | **string** | | [optional] [default to null] +**Path** | **string** | | [optional] [default to null] +**Position** | **string** | | [optional] [default to null] +**OriginalPosition** | **string** | | [optional] [default to null] +**CommitId** | **string** | | [optional] [default to null] +**OriginalCommitId** | **string** | | [optional] [default to null] +**User** | **string** | | [optional] [default to null] +**Body** | **string** | | [optional] [default to null] +**CreatedAt** | **string** | | [optional] [default to null] +**UpdatedAt** | **string** | | [optional] [default to null] +**HtmlUrl** | **string** | | [optional] [default to null] +**PullRequestUrl** | **string** | | [optional] [default to null] +**Links** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PullRequestCommits.md b/docs/PullRequestCommits.md new file mode 100644 index 0000000..7730f77 --- /dev/null +++ b/docs/PullRequestCommits.md @@ -0,0 +1,17 @@ +# PullRequestCommits + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Url** | **string** | | [optional] [default to null] +**Sha** | **string** | | [optional] [default to null] +**HtmlUrl** | **string** | | [optional] [default to null] +**CommentsUrl** | **string** | | [optional] [default to null] +**Commit** | **string** | | [optional] [default to null] +**Author** | **string** | | [optional] [default to null] +**Committer** | **string** | | [optional] [default to null] +**Parents** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PullRequestFiles.md b/docs/PullRequestFiles.md new file mode 100644 index 0000000..45628c6 --- /dev/null +++ b/docs/PullRequestFiles.md @@ -0,0 +1,17 @@ +# PullRequestFiles + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Sha** | **string** | | [optional] [default to null] +**Filename** | **string** | | [optional] [default to null] +**Status** | **string** | | [optional] [default to null] +**Additions** | **string** | | [optional] [default to null] +**Deletions** | **string** | | [optional] [default to null] +**BlobUrl** | **string** | | [optional] [default to null] +**RawUrl** | **string** | | [optional] [default to null] +**Patch** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PullRequestsApi.md b/docs/PullRequestsApi.md new file mode 100644 index 0000000..4477607 --- /dev/null +++ b/docs/PullRequestsApi.md @@ -0,0 +1,854 @@ +# \PullRequestsApi + +All URIs are relative to *https://gitee.com/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteV5ReposOwnerRepoPullsCommentsId**](PullRequestsApi.md#DeleteV5ReposOwnerRepoPullsCommentsId) | **Delete** /v5/repos/{owner}/{repo}/pulls/comments/{id} | 删除评论 +[**DeleteV5ReposOwnerRepoPullsNumberAssignees**](PullRequestsApi.md#DeleteV5ReposOwnerRepoPullsNumberAssignees) | **Delete** /v5/repos/{owner}/{repo}/pulls/{number}/assignees | 取消用户审查 Pull Request +[**DeleteV5ReposOwnerRepoPullsNumberTesters**](PullRequestsApi.md#DeleteV5ReposOwnerRepoPullsNumberTesters) | **Delete** /v5/repos/{owner}/{repo}/pulls/{number}/testers | 取消用户测试 Pull Request +[**GetV5ReposOwnerRepoPulls**](PullRequestsApi.md#GetV5ReposOwnerRepoPulls) | **Get** /v5/repos/{owner}/{repo}/pulls | 获取Pull Request列表 +[**GetV5ReposOwnerRepoPullsComments**](PullRequestsApi.md#GetV5ReposOwnerRepoPullsComments) | **Get** /v5/repos/{owner}/{repo}/pulls/comments | 获取该仓库下的所有Pull Request评论 +[**GetV5ReposOwnerRepoPullsCommentsId**](PullRequestsApi.md#GetV5ReposOwnerRepoPullsCommentsId) | **Get** /v5/repos/{owner}/{repo}/pulls/comments/{id} | 获取Pull Request的某个评论 +[**GetV5ReposOwnerRepoPullsNumber**](PullRequestsApi.md#GetV5ReposOwnerRepoPullsNumber) | **Get** /v5/repos/{owner}/{repo}/pulls/{number} | 获取单个Pull Request +[**GetV5ReposOwnerRepoPullsNumberComments**](PullRequestsApi.md#GetV5ReposOwnerRepoPullsNumberComments) | **Get** /v5/repos/{owner}/{repo}/pulls/{number}/comments | 获取某个Pull Request的所有评论 +[**GetV5ReposOwnerRepoPullsNumberCommits**](PullRequestsApi.md#GetV5ReposOwnerRepoPullsNumberCommits) | **Get** /v5/repos/{owner}/{repo}/pulls/{number}/commits | 获取某Pull Request的所有Commit信息。最多显示250条Commit +[**GetV5ReposOwnerRepoPullsNumberFiles**](PullRequestsApi.md#GetV5ReposOwnerRepoPullsNumberFiles) | **Get** /v5/repos/{owner}/{repo}/pulls/{number}/files | Pull Request Commit文件列表。最多显示300条diff +[**GetV5ReposOwnerRepoPullsNumberMerge**](PullRequestsApi.md#GetV5ReposOwnerRepoPullsNumberMerge) | **Get** /v5/repos/{owner}/{repo}/pulls/{number}/merge | 判断Pull Request是否已经合并 +[**GetV5ReposOwnerRepoPullsNumberOperateLogs**](PullRequestsApi.md#GetV5ReposOwnerRepoPullsNumberOperateLogs) | **Get** /v5/repos/{owner}/{repo}/pulls/{number}/operate_logs | 获取某个Pull Request的操作日志 +[**PatchV5ReposOwnerRepoPullsCommentsId**](PullRequestsApi.md#PatchV5ReposOwnerRepoPullsCommentsId) | **Patch** /v5/repos/{owner}/{repo}/pulls/comments/{id} | 编辑评论 +[**PatchV5ReposOwnerRepoPullsNumber**](PullRequestsApi.md#PatchV5ReposOwnerRepoPullsNumber) | **Patch** /v5/repos/{owner}/{repo}/pulls/{number} | 更新Pull Request信息 +[**PostV5ReposOwnerRepoPulls**](PullRequestsApi.md#PostV5ReposOwnerRepoPulls) | **Post** /v5/repos/{owner}/{repo}/pulls | 创建Pull Request +[**PostV5ReposOwnerRepoPullsNumberAssignees**](PullRequestsApi.md#PostV5ReposOwnerRepoPullsNumberAssignees) | **Post** /v5/repos/{owner}/{repo}/pulls/{number}/assignees | 指派用户审查 Pull Request +[**PostV5ReposOwnerRepoPullsNumberComments**](PullRequestsApi.md#PostV5ReposOwnerRepoPullsNumberComments) | **Post** /v5/repos/{owner}/{repo}/pulls/{number}/comments | 提交Pull Request评论 +[**PostV5ReposOwnerRepoPullsNumberTesters**](PullRequestsApi.md#PostV5ReposOwnerRepoPullsNumberTesters) | **Post** /v5/repos/{owner}/{repo}/pulls/{number}/testers | 指派用户测试 Pull Request +[**PutV5ReposOwnerRepoPullsNumberMerge**](PullRequestsApi.md#PutV5ReposOwnerRepoPullsNumberMerge) | **Put** /v5/repos/{owner}/{repo}/pulls/{number}/merge | 合并Pull Request + + +# **DeleteV5ReposOwnerRepoPullsCommentsId** +> DeleteV5ReposOwnerRepoPullsCommentsId(ctx, owner, repo, id, optional) +删除评论 + +删除评论 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **id** | **int32**| 评论的ID | + **optional** | ***DeleteV5ReposOwnerRepoPullsCommentsIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DeleteV5ReposOwnerRepoPullsCommentsIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **DeleteV5ReposOwnerRepoPullsNumberAssignees** +> PullRequest DeleteV5ReposOwnerRepoPullsNumberAssignees(ctx, owner, repo, number, assignees, optional) +取消用户审查 Pull Request + +取消用户审查 Pull Request + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **number** | **int32**| 第几个PR,即本仓库PR的序数 | + **assignees** | **string**| 用户的个人空间地址, 以 , 分隔 | + **optional** | ***DeleteV5ReposOwnerRepoPullsNumberAssigneesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DeleteV5ReposOwnerRepoPullsNumberAssigneesOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**PullRequest**](PullRequest.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **DeleteV5ReposOwnerRepoPullsNumberTesters** +> PullRequest DeleteV5ReposOwnerRepoPullsNumberTesters(ctx, owner, repo, number, testers, optional) +取消用户测试 Pull Request + +取消用户测试 Pull Request + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **number** | **int32**| 第几个PR,即本仓库PR的序数 | + **testers** | **string**| 用户的个人空间地址, 以 , 分隔 | + **optional** | ***DeleteV5ReposOwnerRepoPullsNumberTestersOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DeleteV5ReposOwnerRepoPullsNumberTestersOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**PullRequest**](PullRequest.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoPulls** +> []PullRequest GetV5ReposOwnerRepoPulls(ctx, owner, repo, optional) +获取Pull Request列表 + +获取Pull Request列表 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***GetV5ReposOwnerRepoPullsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoPullsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **state** | **optional.String**| 可选。Pull Request 状态 | [default to open] + **head** | **optional.String**| 可选。Pull Request 提交的源分支。格式:branch 或者:username:branch | + **base** | **optional.String**| 可选。Pull Request 提交目标分支的名称。 | + **sort** | **optional.String**| 可选。排序字段,默认按创建时间 | [default to created] + **direction** | **optional.String**| 可选。升序/降序 | [default to desc] + **milestoneNumber** | **optional.Int32**| 可选。里程碑序号(id) | + **labels** | **optional.String**| 用逗号分开的标签。如: bug,performance | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]PullRequest**](PullRequest.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoPullsComments** +> []PullRequestComments GetV5ReposOwnerRepoPullsComments(ctx, owner, repo, optional) +获取该仓库下的所有Pull Request评论 + +获取该仓库下的所有Pull Request评论 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***GetV5ReposOwnerRepoPullsCommentsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoPullsCommentsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **sort** | **optional.String**| 可选。按创建时间/更新时间排序 | [default to created] + **direction** | **optional.String**| 可选。升序/降序 | [default to desc] + **since** | **optional.String**| 起始的更新时间,要求时间格式为 ISO 8601 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]PullRequestComments**](PullRequestComments.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoPullsCommentsId** +> PullRequestComments GetV5ReposOwnerRepoPullsCommentsId(ctx, owner, repo, id, optional) +获取Pull Request的某个评论 + +获取Pull Request的某个评论 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **id** | **int32**| | + **optional** | ***GetV5ReposOwnerRepoPullsCommentsIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoPullsCommentsIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**PullRequestComments**](PullRequestComments.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoPullsNumber** +> PullRequest GetV5ReposOwnerRepoPullsNumber(ctx, owner, repo, number, optional) +获取单个Pull Request + +获取单个Pull Request + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **number** | **int32**| 第几个PR,即本仓库PR的序数 | + **optional** | ***GetV5ReposOwnerRepoPullsNumberOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoPullsNumberOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**PullRequest**](PullRequest.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoPullsNumberComments** +> []PullRequestComments GetV5ReposOwnerRepoPullsNumberComments(ctx, owner, repo, number, optional) +获取某个Pull Request的所有评论 + +获取某个Pull Request的所有评论 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **number** | **int32**| 第几个PR,即本仓库PR的序数 | + **optional** | ***GetV5ReposOwnerRepoPullsNumberCommentsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoPullsNumberCommentsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]PullRequestComments**](PullRequestComments.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoPullsNumberCommits** +> []PullRequestCommits GetV5ReposOwnerRepoPullsNumberCommits(ctx, owner, repo, number, optional) +获取某Pull Request的所有Commit信息。最多显示250条Commit + +获取某Pull Request的所有Commit信息。最多显示250条Commit + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **number** | **int32**| 第几个PR,即本仓库PR的序数 | + **optional** | ***GetV5ReposOwnerRepoPullsNumberCommitsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoPullsNumberCommitsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**[]PullRequestCommits**](PullRequestCommits.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoPullsNumberFiles** +> []PullRequestFiles GetV5ReposOwnerRepoPullsNumberFiles(ctx, owner, repo, number, optional) +Pull Request Commit文件列表。最多显示300条diff + +Pull Request Commit文件列表。最多显示300条diff + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **number** | **int32**| 第几个PR,即本仓库PR的序数 | + **optional** | ***GetV5ReposOwnerRepoPullsNumberFilesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoPullsNumberFilesOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**[]PullRequestFiles**](PullRequestFiles.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoPullsNumberMerge** +> GetV5ReposOwnerRepoPullsNumberMerge(ctx, owner, repo, number, optional) +判断Pull Request是否已经合并 + +判断Pull Request是否已经合并 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **number** | **int32**| 第几个PR,即本仓库PR的序数 | + **optional** | ***GetV5ReposOwnerRepoPullsNumberMergeOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoPullsNumberMergeOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoPullsNumberOperateLogs** +> OperateLog GetV5ReposOwnerRepoPullsNumberOperateLogs(ctx, owner, repo, number, optional) +获取某个Pull Request的操作日志 + +获取某个Pull Request的操作日志 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **number** | **int32**| 第几个PR,即本仓库PR的序数 | + **optional** | ***GetV5ReposOwnerRepoPullsNumberOperateLogsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoPullsNumberOperateLogsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + **sort** | **optional.String**| 按递增(asc)或递减(desc)排序,默认:递减 | [default to desc] + +### Return type + +[**OperateLog**](OperateLog.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PatchV5ReposOwnerRepoPullsCommentsId** +> PullRequestComments PatchV5ReposOwnerRepoPullsCommentsId(ctx, owner, repo, id, body, optional) +编辑评论 + +编辑评论 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **id** | **int32**| 评论的ID | + **body** | **string**| 必填。评论内容 | + **optional** | ***PatchV5ReposOwnerRepoPullsCommentsIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PatchV5ReposOwnerRepoPullsCommentsIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**PullRequestComments**](PullRequestComments.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PatchV5ReposOwnerRepoPullsNumber** +> PullRequest PatchV5ReposOwnerRepoPullsNumber(ctx, owner, repo, number, optional) +更新Pull Request信息 + +更新Pull Request信息 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **number** | **int32**| 第几个PR,即本仓库PR的序数 | + **optional** | ***PatchV5ReposOwnerRepoPullsNumberOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PatchV5ReposOwnerRepoPullsNumberOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + **title** | **optional.String**| 可选。Pull Request 标题 | + **body** | **optional.String**| 可选。Pull Request 内容 | + **state** | **optional.String**| 可选。Pull Request 状态 | + **milestoneNumber** | **optional.Int32**| 可选。里程碑序号(id) | + **labels** | **optional.String**| 用逗号分开的标签,名称要求长度在 2-20 之间且非特殊字符。如: bug,performance | + +### Return type + +[**PullRequest**](PullRequest.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PostV5ReposOwnerRepoPulls** +> PullRequest PostV5ReposOwnerRepoPulls(ctx, owner, repo, title, head, base, optional) +创建Pull Request + +创建Pull Request + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **title** | **string**| 必填。Pull Request 标题 | + **head** | **string**| 必填。Pull Request 提交的源分支。格式:branch 或者:username:branch | + **base** | **string**| 必填。Pull Request 提交目标分支的名称 | + **optional** | ***PostV5ReposOwnerRepoPullsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PostV5ReposOwnerRepoPullsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + + + **accessToken** | **optional.String**| 用户授权码 | + **body** | **optional.String**| 可选。Pull Request 内容 | + **milestoneNumber** | **optional.Int32**| 可选。里程碑序号(id) | + **labels** | **optional.String**| 用逗号分开的标签,名称要求长度在 2-20 之间且非特殊字符。如: bug,performance | + **issue** | **optional.String**| 可选。Pull Request的标题和内容可以根据指定的Issue Id自动填充 | + **assignees** | **optional.String**| 可选。审查人员username,可多个,半角逗号分隔,如:(username1,username2) | + **testers** | **optional.String**| 可选。测试人员username,可多个,半角逗号分隔,如:(username1,username2) | + **pruneSourceBranch** | **optional.Bool**| 可选。合并PR后是否删除源分支,默认false(不删除) | + +### Return type + +[**PullRequest**](PullRequest.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PostV5ReposOwnerRepoPullsNumberAssignees** +> PullRequest PostV5ReposOwnerRepoPullsNumberAssignees(ctx, owner, repo, number, assignees, optional) +指派用户审查 Pull Request + +指派用户审查 Pull Request + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **number** | **int32**| 第几个PR,即本仓库PR的序数 | + **assignees** | **string**| 用户的个人空间地址, 以 , 分隔 | + **optional** | ***PostV5ReposOwnerRepoPullsNumberAssigneesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PostV5ReposOwnerRepoPullsNumberAssigneesOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**PullRequest**](PullRequest.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PostV5ReposOwnerRepoPullsNumberComments** +> PullRequestComments PostV5ReposOwnerRepoPullsNumberComments(ctx, owner, repo, number, body, optional) +提交Pull Request评论 + +提交Pull Request评论 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **number** | **int32**| 第几个PR,即本仓库PR的序数 | + **body** | **string**| 必填。评论内容 | + **optional** | ***PostV5ReposOwnerRepoPullsNumberCommentsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PostV5ReposOwnerRepoPullsNumberCommentsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + + **accessToken** | **optional.String**| 用户授权码 | + **commitId** | **optional.String**| 可选。PR代码评论的commit id | + **path** | **optional.String**| 可选。PR代码评论的文件名 | + **position** | **optional.Int32**| 可选。PR代码评论diff中的行数 | + +### Return type + +[**PullRequestComments**](PullRequestComments.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PostV5ReposOwnerRepoPullsNumberTesters** +> PullRequest PostV5ReposOwnerRepoPullsNumberTesters(ctx, owner, repo, number, testers, optional) +指派用户测试 Pull Request + +指派用户测试 Pull Request + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **number** | **int32**| 第几个PR,即本仓库PR的序数 | + **testers** | **string**| 用户的个人空间地址, 以 , 分隔 | + **optional** | ***PostV5ReposOwnerRepoPullsNumberTestersOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PostV5ReposOwnerRepoPullsNumberTestersOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**PullRequest**](PullRequest.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PutV5ReposOwnerRepoPullsNumberMerge** +> PutV5ReposOwnerRepoPullsNumberMerge(ctx, owner, repo, number, optional) +合并Pull Request + +合并Pull Request + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **number** | **int32**| 第几个PR,即本仓库PR的序数 | + **optional** | ***PutV5ReposOwnerRepoPullsNumberMergeOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PutV5ReposOwnerRepoPullsNumberMergeOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + **mergeMethod** | **optional.String**| 可选。合并PR的方法,merge(合并所有提交)和 squash(扁平化分支合并)。默认为merge。 | [default to merge] + **pruneSourceBranch** | **optional.Bool**| 可选。合并PR后是否删除源分支,默认false(不删除) | + **title** | **optional.String**| 可选。合并标题,默认为PR的标题 | + **description** | **optional.String**| 可选。合并描述,默认为 \"Merge pull request !{pr_id} from {author}/{source_branch}\",与页面显示的默认一致。 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/Release.md b/docs/Release.md new file mode 100644 index 0000000..67a149d --- /dev/null +++ b/docs/Release.md @@ -0,0 +1,18 @@ +# Release + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | | [optional] [default to null] +**TagName** | **string** | | [optional] [default to null] +**TargetCommitish** | **string** | | [optional] [default to null] +**Prerelease** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**Body** | **string** | | [optional] [default to null] +**Author** | **string** | | [optional] [default to null] +**CreatedAt** | [**time.Time**](time.Time.md) | | [optional] [default to null] +**Assets** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RepoCommit.md b/docs/RepoCommit.md new file mode 100644 index 0000000..7bb78c9 --- /dev/null +++ b/docs/RepoCommit.md @@ -0,0 +1,18 @@ +# RepoCommit + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Url** | **string** | | [optional] [default to null] +**Sha** | **string** | | [optional] [default to null] +**HtmlUrl** | **string** | | [optional] [default to null] +**CommentsUrl** | **string** | | [optional] [default to null] +**Commit** | **string** | | [optional] [default to null] +**Author** | **string** | | [optional] [default to null] +**Committer** | **string** | | [optional] [default to null] +**Parents** | **string** | | [optional] [default to null] +**Stats** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RepositoriesApi.md b/docs/RepositoriesApi.md new file mode 100644 index 0000000..1dfc918 --- /dev/null +++ b/docs/RepositoriesApi.md @@ -0,0 +1,2389 @@ +# \RepositoriesApi + +All URIs are relative to *https://gitee.com/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteV5ReposOwnerRepo**](RepositoriesApi.md#DeleteV5ReposOwnerRepo) | **Delete** /v5/repos/{owner}/{repo} | 删除一个仓库 +[**DeleteV5ReposOwnerRepoBranchesBranchProtection**](RepositoriesApi.md#DeleteV5ReposOwnerRepoBranchesBranchProtection) | **Delete** /v5/repos/{owner}/{repo}/branches/{branch}/protection | 取消保护分支的设置 +[**DeleteV5ReposOwnerRepoCollaboratorsUsername**](RepositoriesApi.md#DeleteV5ReposOwnerRepoCollaboratorsUsername) | **Delete** /v5/repos/{owner}/{repo}/collaborators/{username} | 移除仓库成员 +[**DeleteV5ReposOwnerRepoCommentsId**](RepositoriesApi.md#DeleteV5ReposOwnerRepoCommentsId) | **Delete** /v5/repos/{owner}/{repo}/comments/{id} | 删除Commit评论 +[**DeleteV5ReposOwnerRepoContentsPath**](RepositoriesApi.md#DeleteV5ReposOwnerRepoContentsPath) | **Delete** /v5/repos/{owner}/{repo}/contents/{path} | 删除文件 +[**DeleteV5ReposOwnerRepoKeysEnableId**](RepositoriesApi.md#DeleteV5ReposOwnerRepoKeysEnableId) | **Delete** /v5/repos/{owner}/{repo}/keys/enable/{id} | 停用仓库公钥 +[**DeleteV5ReposOwnerRepoKeysId**](RepositoriesApi.md#DeleteV5ReposOwnerRepoKeysId) | **Delete** /v5/repos/{owner}/{repo}/keys/{id} | 删除一个仓库公钥 +[**DeleteV5ReposOwnerRepoReleasesId**](RepositoriesApi.md#DeleteV5ReposOwnerRepoReleasesId) | **Delete** /v5/repos/{owner}/{repo}/releases/{id} | 删除仓库Release +[**GetV5EnterprisesEnterpriseRepos**](RepositoriesApi.md#GetV5EnterprisesEnterpriseRepos) | **Get** /v5/enterprises/{enterprise}/repos | 获取企业的所有仓库 +[**GetV5OrgsOrgRepos**](RepositoriesApi.md#GetV5OrgsOrgRepos) | **Get** /v5/orgs/{org}/repos | 获取一个组织的仓库 +[**GetV5ReposOwnerRepo**](RepositoriesApi.md#GetV5ReposOwnerRepo) | **Get** /v5/repos/{owner}/{repo} | 获取用户的某个仓库 +[**GetV5ReposOwnerRepoBranches**](RepositoriesApi.md#GetV5ReposOwnerRepoBranches) | **Get** /v5/repos/{owner}/{repo}/branches | 获取所有分支 +[**GetV5ReposOwnerRepoBranchesBranch**](RepositoriesApi.md#GetV5ReposOwnerRepoBranchesBranch) | **Get** /v5/repos/{owner}/{repo}/branches/{branch} | 获取单个分支 +[**GetV5ReposOwnerRepoCollaborators**](RepositoriesApi.md#GetV5ReposOwnerRepoCollaborators) | **Get** /v5/repos/{owner}/{repo}/collaborators | 获取仓库的所有成员 +[**GetV5ReposOwnerRepoCollaboratorsUsername**](RepositoriesApi.md#GetV5ReposOwnerRepoCollaboratorsUsername) | **Get** /v5/repos/{owner}/{repo}/collaborators/{username} | 判断用户是否为仓库成员 +[**GetV5ReposOwnerRepoCollaboratorsUsernamePermission**](RepositoriesApi.md#GetV5ReposOwnerRepoCollaboratorsUsernamePermission) | **Get** /v5/repos/{owner}/{repo}/collaborators/{username}/permission | 查看仓库成员的权限 +[**GetV5ReposOwnerRepoComments**](RepositoriesApi.md#GetV5ReposOwnerRepoComments) | **Get** /v5/repos/{owner}/{repo}/comments | 获取仓库的Commit评论 +[**GetV5ReposOwnerRepoCommentsId**](RepositoriesApi.md#GetV5ReposOwnerRepoCommentsId) | **Get** /v5/repos/{owner}/{repo}/comments/{id} | 获取仓库的某条Commit评论 +[**GetV5ReposOwnerRepoCommits**](RepositoriesApi.md#GetV5ReposOwnerRepoCommits) | **Get** /v5/repos/{owner}/{repo}/commits | 仓库的所有提交 +[**GetV5ReposOwnerRepoCommitsRefComments**](RepositoriesApi.md#GetV5ReposOwnerRepoCommitsRefComments) | **Get** /v5/repos/{owner}/{repo}/commits/{ref}/comments | 获取单个Commit的评论 +[**GetV5ReposOwnerRepoCommitsSha**](RepositoriesApi.md#GetV5ReposOwnerRepoCommitsSha) | **Get** /v5/repos/{owner}/{repo}/commits/{sha} | 仓库的某个提交 +[**GetV5ReposOwnerRepoCompareBaseHead**](RepositoriesApi.md#GetV5ReposOwnerRepoCompareBaseHead) | **Get** /v5/repos/{owner}/{repo}/compare/{base}...{head} | 两个Commits之间对比的版本差异 +[**GetV5ReposOwnerRepoContentsPath**](RepositoriesApi.md#GetV5ReposOwnerRepoContentsPath) | **Get** /v5/repos/{owner}/{repo}/contents(/{path}) | 获取仓库具体路径下的内容 +[**GetV5ReposOwnerRepoContributors**](RepositoriesApi.md#GetV5ReposOwnerRepoContributors) | **Get** /v5/repos/{owner}/{repo}/contributors | 获取仓库贡献者 +[**GetV5ReposOwnerRepoForks**](RepositoriesApi.md#GetV5ReposOwnerRepoForks) | **Get** /v5/repos/{owner}/{repo}/forks | 查看仓库的Forks +[**GetV5ReposOwnerRepoKeys**](RepositoriesApi.md#GetV5ReposOwnerRepoKeys) | **Get** /v5/repos/{owner}/{repo}/keys | 获取仓库已部署的公钥 +[**GetV5ReposOwnerRepoKeysAvailable**](RepositoriesApi.md#GetV5ReposOwnerRepoKeysAvailable) | **Get** /v5/repos/{owner}/{repo}/keys/available | 获取仓库可部署的公钥 +[**GetV5ReposOwnerRepoKeysId**](RepositoriesApi.md#GetV5ReposOwnerRepoKeysId) | **Get** /v5/repos/{owner}/{repo}/keys/{id} | 获取仓库的单个公钥 +[**GetV5ReposOwnerRepoPages**](RepositoriesApi.md#GetV5ReposOwnerRepoPages) | **Get** /v5/repos/{owner}/{repo}/pages | 获取Pages信息 +[**GetV5ReposOwnerRepoReadme**](RepositoriesApi.md#GetV5ReposOwnerRepoReadme) | **Get** /v5/repos/{owner}/{repo}/readme | 获取仓库README +[**GetV5ReposOwnerRepoReleases**](RepositoriesApi.md#GetV5ReposOwnerRepoReleases) | **Get** /v5/repos/{owner}/{repo}/releases | 获取仓库的所有Releases +[**GetV5ReposOwnerRepoReleasesId**](RepositoriesApi.md#GetV5ReposOwnerRepoReleasesId) | **Get** /v5/repos/{owner}/{repo}/releases/{id} | 获取仓库的单个Releases +[**GetV5ReposOwnerRepoReleasesLatest**](RepositoriesApi.md#GetV5ReposOwnerRepoReleasesLatest) | **Get** /v5/repos/{owner}/{repo}/releases/latest | 获取仓库的最后更新的Release +[**GetV5ReposOwnerRepoReleasesTagsTag**](RepositoriesApi.md#GetV5ReposOwnerRepoReleasesTagsTag) | **Get** /v5/repos/{owner}/{repo}/releases/tags/{tag} | 根据Tag名称获取仓库的Release +[**GetV5ReposOwnerRepoTags**](RepositoriesApi.md#GetV5ReposOwnerRepoTags) | **Get** /v5/repos/{owner}/{repo}/tags | 列出仓库所有的tags +[**GetV5UserRepos**](RepositoriesApi.md#GetV5UserRepos) | **Get** /v5/user/repos | 列出授权用户的所有仓库 +[**GetV5UsersUsernameRepos**](RepositoriesApi.md#GetV5UsersUsernameRepos) | **Get** /v5/users/{username}/repos | 获取某个用户的公开仓库 +[**PatchV5ReposOwnerRepo**](RepositoriesApi.md#PatchV5ReposOwnerRepo) | **Patch** /v5/repos/{owner}/{repo} | 更新仓库设置 +[**PatchV5ReposOwnerRepoCommentsId**](RepositoriesApi.md#PatchV5ReposOwnerRepoCommentsId) | **Patch** /v5/repos/{owner}/{repo}/comments/{id} | 更新Commit评论 +[**PatchV5ReposOwnerRepoReleasesId**](RepositoriesApi.md#PatchV5ReposOwnerRepoReleasesId) | **Patch** /v5/repos/{owner}/{repo}/releases/{id} | 更新仓库Release +[**PostV5EnterprisesEnterpriseRepos**](RepositoriesApi.md#PostV5EnterprisesEnterpriseRepos) | **Post** /v5/enterprises/{enterprise}/repos | 创建企业仓库 +[**PostV5OrgsOrgRepos**](RepositoriesApi.md#PostV5OrgsOrgRepos) | **Post** /v5/orgs/{org}/repos | 创建组织仓库 +[**PostV5ReposOwnerRepoBranches**](RepositoriesApi.md#PostV5ReposOwnerRepoBranches) | **Post** /v5/repos/{owner}/{repo}/branches | 创建分支 +[**PostV5ReposOwnerRepoCommitsShaComments**](RepositoriesApi.md#PostV5ReposOwnerRepoCommitsShaComments) | **Post** /v5/repos/{owner}/{repo}/commits/{sha}/comments | 创建Commit评论 +[**PostV5ReposOwnerRepoContentsPath**](RepositoriesApi.md#PostV5ReposOwnerRepoContentsPath) | **Post** /v5/repos/{owner}/{repo}/contents/{path} | 新建文件 +[**PostV5ReposOwnerRepoForks**](RepositoriesApi.md#PostV5ReposOwnerRepoForks) | **Post** /v5/repos/{owner}/{repo}/forks | Fork一个仓库 +[**PostV5ReposOwnerRepoKeys**](RepositoriesApi.md#PostV5ReposOwnerRepoKeys) | **Post** /v5/repos/{owner}/{repo}/keys | 为仓库添加公钥 +[**PostV5ReposOwnerRepoPagesBuilds**](RepositoriesApi.md#PostV5ReposOwnerRepoPagesBuilds) | **Post** /v5/repos/{owner}/{repo}/pages/builds | 请求建立Pages +[**PostV5ReposOwnerRepoReleases**](RepositoriesApi.md#PostV5ReposOwnerRepoReleases) | **Post** /v5/repos/{owner}/{repo}/releases | 创建仓库Release +[**PostV5UserRepos**](RepositoriesApi.md#PostV5UserRepos) | **Post** /v5/user/repos | 创建一个仓库 +[**PutV5ReposOwnerRepoBranchesBranchProtection**](RepositoriesApi.md#PutV5ReposOwnerRepoBranchesBranchProtection) | **Put** /v5/repos/{owner}/{repo}/branches/{branch}/protection | 设置分支保护 +[**PutV5ReposOwnerRepoClear**](RepositoriesApi.md#PutV5ReposOwnerRepoClear) | **Put** /v5/repos/{owner}/{repo}/clear | 清空一个仓库 +[**PutV5ReposOwnerRepoCollaboratorsUsername**](RepositoriesApi.md#PutV5ReposOwnerRepoCollaboratorsUsername) | **Put** /v5/repos/{owner}/{repo}/collaborators/{username} | 添加仓库成员 +[**PutV5ReposOwnerRepoContentsPath**](RepositoriesApi.md#PutV5ReposOwnerRepoContentsPath) | **Put** /v5/repos/{owner}/{repo}/contents/{path} | 更新文件 +[**PutV5ReposOwnerRepoKeysEnableId**](RepositoriesApi.md#PutV5ReposOwnerRepoKeysEnableId) | **Put** /v5/repos/{owner}/{repo}/keys/enable/{id} | 启用仓库公钥 + + +# **DeleteV5ReposOwnerRepo** +> DeleteV5ReposOwnerRepo(ctx, owner, repo, optional) +删除一个仓库 + +删除一个仓库 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***DeleteV5ReposOwnerRepoOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DeleteV5ReposOwnerRepoOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **DeleteV5ReposOwnerRepoBranchesBranchProtection** +> DeleteV5ReposOwnerRepoBranchesBranchProtection(ctx, owner, repo, branch, optional) +取消保护分支的设置 + +取消保护分支的设置 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **branch** | **string**| 分支名称 | + **optional** | ***DeleteV5ReposOwnerRepoBranchesBranchProtectionOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DeleteV5ReposOwnerRepoBranchesBranchProtectionOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **DeleteV5ReposOwnerRepoCollaboratorsUsername** +> DeleteV5ReposOwnerRepoCollaboratorsUsername(ctx, owner, repo, username, optional) +移除仓库成员 + +移除仓库成员 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **username** | **string**| 用户名(username/login) | + **optional** | ***DeleteV5ReposOwnerRepoCollaboratorsUsernameOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DeleteV5ReposOwnerRepoCollaboratorsUsernameOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **DeleteV5ReposOwnerRepoCommentsId** +> DeleteV5ReposOwnerRepoCommentsId(ctx, owner, repo, id, optional) +删除Commit评论 + +删除Commit评论 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **id** | **int32**| 评论的ID | + **optional** | ***DeleteV5ReposOwnerRepoCommentsIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DeleteV5ReposOwnerRepoCommentsIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **DeleteV5ReposOwnerRepoContentsPath** +> CommitContent DeleteV5ReposOwnerRepoContentsPath(ctx, owner, repo, path, sha, message, optional) +删除文件 + +删除文件 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **path** | **string**| 文件的路径 | + **sha** | **string**| 文件的 Blob SHA,可通过 [获取仓库具体路径下的内容] API 获取 | + **message** | **string**| 提交信息 | + **optional** | ***DeleteV5ReposOwnerRepoContentsPathOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DeleteV5ReposOwnerRepoContentsPathOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + + + **accessToken** | **optional.String**| 用户授权码 | + **branch** | **optional.String**| 分支名称。默认为仓库对默认分支 | + **committerName** | **optional.String**| Committer的名字,默认为当前用户的名字 | + **committerEmail** | **optional.String**| Committer的邮箱,默认为当前用户的邮箱 | + **authorName** | **optional.String**| Author的名字,默认为当前用户的名字 | + **authorEmail** | **optional.String**| Author的邮箱,默认为当前用户的邮箱 | + +### Return type + +[**CommitContent**](CommitContent.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **DeleteV5ReposOwnerRepoKeysEnableId** +> DeleteV5ReposOwnerRepoKeysEnableId(ctx, owner, repo, id, optional) +停用仓库公钥 + +停用仓库公钥 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **id** | **int32**| 公钥 ID | + **optional** | ***DeleteV5ReposOwnerRepoKeysEnableIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DeleteV5ReposOwnerRepoKeysEnableIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **DeleteV5ReposOwnerRepoKeysId** +> DeleteV5ReposOwnerRepoKeysId(ctx, owner, repo, id, optional) +删除一个仓库公钥 + +删除一个仓库公钥 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **id** | **int32**| 公钥 ID | + **optional** | ***DeleteV5ReposOwnerRepoKeysIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DeleteV5ReposOwnerRepoKeysIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **DeleteV5ReposOwnerRepoReleasesId** +> DeleteV5ReposOwnerRepoReleasesId(ctx, owner, repo, id, optional) +删除仓库Release + +删除仓库Release + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **id** | **int32**| | + **optional** | ***DeleteV5ReposOwnerRepoReleasesIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DeleteV5ReposOwnerRepoReleasesIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5EnterprisesEnterpriseRepos** +> Project GetV5EnterprisesEnterpriseRepos(ctx, enterprise, optional) +获取企业的所有仓库 + +获取企业的所有仓库 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **enterprise** | **string**| 企业的路径(path/login) | + **optional** | ***GetV5EnterprisesEnterpriseReposOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5EnterprisesEnterpriseReposOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + **type_** | **optional.String**| 筛选仓库的类型,可以是 all, public, internal, private。默认: all | [default to all] + **direct** | **optional.Bool**| 只获取直属仓库,默认: false | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**Project**](Project.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5OrgsOrgRepos** +> Project GetV5OrgsOrgRepos(ctx, org, optional) +获取一个组织的仓库 + +获取一个组织的仓库 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **org** | **string**| 组织的路径(path/login) | + **optional** | ***GetV5OrgsOrgReposOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5OrgsOrgReposOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + **type_** | **optional.String**| 筛选仓库的类型,可以是 all, public, private。默认: all | [default to all] + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**Project**](Project.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepo** +> Project GetV5ReposOwnerRepo(ctx, owner, repo, optional) +获取用户的某个仓库 + +获取用户的某个仓库 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***GetV5ReposOwnerRepoOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**Project**](Project.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoBranches** +> []Branch GetV5ReposOwnerRepoBranches(ctx, owner, repo, optional) +获取所有分支 + +获取所有分支 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***GetV5ReposOwnerRepoBranchesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoBranchesOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**[]Branch**](Branch.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoBranchesBranch** +> CompleteBranch GetV5ReposOwnerRepoBranchesBranch(ctx, owner, repo, branch, optional) +获取单个分支 + +获取单个分支 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **branch** | **string**| 分支名称 | + **optional** | ***GetV5ReposOwnerRepoBranchesBranchOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoBranchesBranchOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**CompleteBranch**](CompleteBranch.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoCollaborators** +> ProjectMember GetV5ReposOwnerRepoCollaborators(ctx, owner, repo, optional) +获取仓库的所有成员 + +获取仓库的所有成员 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***GetV5ReposOwnerRepoCollaboratorsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoCollaboratorsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**ProjectMember**](ProjectMember.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoCollaboratorsUsername** +> GetV5ReposOwnerRepoCollaboratorsUsername(ctx, owner, repo, username, optional) +判断用户是否为仓库成员 + +判断用户是否为仓库成员 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **username** | **string**| 用户名(username/login) | + **optional** | ***GetV5ReposOwnerRepoCollaboratorsUsernameOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoCollaboratorsUsernameOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoCollaboratorsUsernamePermission** +> ProjectMemberPermission GetV5ReposOwnerRepoCollaboratorsUsernamePermission(ctx, owner, repo, username, optional) +查看仓库成员的权限 + +查看仓库成员的权限 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **username** | **string**| 用户名(username/login) | + **optional** | ***GetV5ReposOwnerRepoCollaboratorsUsernamePermissionOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoCollaboratorsUsernamePermissionOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**ProjectMemberPermission**](ProjectMemberPermission.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoComments** +> Note GetV5ReposOwnerRepoComments(ctx, owner, repo, optional) +获取仓库的Commit评论 + +获取仓库的Commit评论 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***GetV5ReposOwnerRepoCommentsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoCommentsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**Note**](Note.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoCommentsId** +> Note GetV5ReposOwnerRepoCommentsId(ctx, owner, repo, id, optional) +获取仓库的某条Commit评论 + +获取仓库的某条Commit评论 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **id** | **int32**| 评论的ID | + **optional** | ***GetV5ReposOwnerRepoCommentsIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoCommentsIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**Note**](Note.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoCommits** +> []RepoCommit GetV5ReposOwnerRepoCommits(ctx, owner, repo, optional) +仓库的所有提交 + +仓库的所有提交 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***GetV5ReposOwnerRepoCommitsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoCommitsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **sha** | **optional.String**| 提交起始的SHA值或者分支名. 默认: 仓库的默认分支 | + **path** | **optional.String**| 包含该文件的提交 | + **author** | **optional.String**| 提交作者的邮箱或个人空间地址(username/login) | + **since** | **optional.String**| 提交的起始时间,时间格式为 ISO 8601 | + **until** | **optional.String**| 提交的最后时间,时间格式为 ISO 8601 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]RepoCommit**](RepoCommit.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoCommitsRefComments** +> Note GetV5ReposOwnerRepoCommitsRefComments(ctx, owner, repo, ref, optional) +获取单个Commit的评论 + +获取单个Commit的评论 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **ref** | **string**| Commit的Reference | + **optional** | ***GetV5ReposOwnerRepoCommitsRefCommentsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoCommitsRefCommentsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**Note**](Note.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoCommitsSha** +> RepoCommit GetV5ReposOwnerRepoCommitsSha(ctx, owner, repo, sha, optional) +仓库的某个提交 + +仓库的某个提交 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **sha** | **string**| 提交的SHA值或者分支名 | + **optional** | ***GetV5ReposOwnerRepoCommitsShaOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoCommitsShaOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**RepoCommit**](RepoCommit.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoCompareBaseHead** +> Compare GetV5ReposOwnerRepoCompareBaseHead(ctx, owner, repo, base, head, optional) +两个Commits之间对比的版本差异 + +两个Commits之间对比的版本差异 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **base** | **string**| Commit提交的SHA值或者分支名作为对比起点 | + **head** | **string**| Commit提交的SHA值或者分支名作为对比终点 | + **optional** | ***GetV5ReposOwnerRepoCompareBaseHeadOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoCompareBaseHeadOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**Compare**](Compare.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoContentsPath** +> []Content GetV5ReposOwnerRepoContentsPath(ctx, owner, repo, path, optional) +获取仓库具体路径下的内容 + +获取仓库具体路径下的内容 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **path** | **string**| 文件的路径 | + **optional** | ***GetV5ReposOwnerRepoContentsPathOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoContentsPathOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + **ref** | **optional.String**| 分支、tag或commit。默认: 仓库的默认分支(通常是master) | + +### Return type + +[**[]Content**](Content.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoContributors** +> Contributor GetV5ReposOwnerRepoContributors(ctx, owner, repo, optional) +获取仓库贡献者 + +获取仓库贡献者 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***GetV5ReposOwnerRepoContributorsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoContributorsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**Contributor**](Contributor.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoForks** +> Project GetV5ReposOwnerRepoForks(ctx, owner, repo, optional) +查看仓库的Forks + +查看仓库的Forks + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***GetV5ReposOwnerRepoForksOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoForksOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **sort** | **optional.String**| 排序方式: fork的时间(newest, oldest),star的人数(stargazers) | [default to newest] + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**Project**](Project.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoKeys** +> []SshKey GetV5ReposOwnerRepoKeys(ctx, owner, repo, optional) +获取仓库已部署的公钥 + +获取仓库已部署的公钥 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***GetV5ReposOwnerRepoKeysOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoKeysOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]SshKey**](SSHKey.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoKeysAvailable** +> []SshKeyBasic GetV5ReposOwnerRepoKeysAvailable(ctx, owner, repo, optional) +获取仓库可部署的公钥 + +获取仓库可部署的公钥 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***GetV5ReposOwnerRepoKeysAvailableOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoKeysAvailableOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]SshKeyBasic**](SSHKeyBasic.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoKeysId** +> SshKey GetV5ReposOwnerRepoKeysId(ctx, owner, repo, id, optional) +获取仓库的单个公钥 + +获取仓库的单个公钥 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **id** | **int32**| 公钥 ID | + **optional** | ***GetV5ReposOwnerRepoKeysIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoKeysIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**SshKey**](SSHKey.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoPages** +> GetV5ReposOwnerRepoPages(ctx, owner, repo, optional) +获取Pages信息 + +获取Pages信息 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***GetV5ReposOwnerRepoPagesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoPagesOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoReadme** +> Content GetV5ReposOwnerRepoReadme(ctx, owner, repo, optional) +获取仓库README + +获取仓库README + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***GetV5ReposOwnerRepoReadmeOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoReadmeOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **ref** | **optional.String**| 分支、tag或commit。默认: 仓库的默认分支(通常是master) | + +### Return type + +[**Content**](Content.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoReleases** +> []Release GetV5ReposOwnerRepoReleases(ctx, owner, repo, optional) +获取仓库的所有Releases + +获取仓库的所有Releases + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***GetV5ReposOwnerRepoReleasesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoReleasesOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]Release**](Release.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoReleasesId** +> Release GetV5ReposOwnerRepoReleasesId(ctx, owner, repo, id, optional) +获取仓库的单个Releases + +获取仓库的单个Releases + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **id** | **int32**| 发行版本的ID | + **optional** | ***GetV5ReposOwnerRepoReleasesIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoReleasesIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**Release**](Release.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoReleasesLatest** +> Release GetV5ReposOwnerRepoReleasesLatest(ctx, owner, repo, optional) +获取仓库的最后更新的Release + +获取仓库的最后更新的Release + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***GetV5ReposOwnerRepoReleasesLatestOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoReleasesLatestOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**Release**](Release.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoReleasesTagsTag** +> Release GetV5ReposOwnerRepoReleasesTagsTag(ctx, owner, repo, tag, optional) +根据Tag名称获取仓库的Release + +根据Tag名称获取仓库的Release + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **tag** | **string**| Tag 名称 | + **optional** | ***GetV5ReposOwnerRepoReleasesTagsTagOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoReleasesTagsTagOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**Release**](Release.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoTags** +> Tag GetV5ReposOwnerRepoTags(ctx, owner, repo, optional) +列出仓库所有的tags + +列出仓库所有的tags + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***GetV5ReposOwnerRepoTagsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoTagsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**Tag**](Tag.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5UserRepos** +> Project GetV5UserRepos(ctx, optional) +列出授权用户的所有仓库 + +列出授权用户的所有仓库 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***GetV5UserReposOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5UserReposOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accessToken** | **optional.String**| 用户授权码 | + **visibility** | **optional.String**| 公开(public)、私有(private)或者所有(all),默认: 所有(all) | + **affiliation** | **optional.String**| owner(授权用户拥有的仓库)、collaborator(授权用户为仓库成员)、organization_member(授权用户为仓库所在组织并有访问仓库权限)、enterprise_member(授权用户所在企业并有访问仓库权限)、admin(所有有权限的,包括所管理的组织中所有仓库、所管理的企业的所有仓库)。 可以用逗号分隔符组合。如: owner, organization_member 或 owner, collaborator, organization_member | + **type_** | **optional.String**| 筛选用户仓库: 其创建(owner)、个人(personal)、其为成员(member)、公开(public)、私有(private),不能与 visibility 或 affiliation 参数一并使用,否则会报 422 错误 | + **sort** | **optional.String**| 排序方式: 创建时间(created),更新时间(updated),最后推送时间(pushed),仓库所属与名称(full_name)。默认: full_name | [default to full_name] + **direction** | **optional.String**| 如果sort参数为full_name,用升序(asc)。否则降序(desc) | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**Project**](Project.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5UsersUsernameRepos** +> Project GetV5UsersUsernameRepos(ctx, username, optional) +获取某个用户的公开仓库 + +获取某个用户的公开仓库 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **username** | **string**| 用户名(username/login) | + **optional** | ***GetV5UsersUsernameReposOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5UsersUsernameReposOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + **type_** | **optional.String**| 用户创建的仓库(owner),用户个人仓库(personal),用户为仓库成员(member),所有(all)。默认: 所有(all) | [default to all] + **sort** | **optional.String**| 排序方式: 创建时间(created),更新时间(updated),最后推送时间(pushed),仓库所属与名称(full_name)。默认: full_name | [default to full_name] + **direction** | **optional.String**| 如果sort参数为full_name,用升序(asc)。否则降序(desc) | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**Project**](Project.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PatchV5ReposOwnerRepo** +> Project PatchV5ReposOwnerRepo(ctx, owner, repo, name, optional) +更新仓库设置 + +更新仓库设置 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **name** | **string**| 仓库名称 | + **optional** | ***PatchV5ReposOwnerRepoOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PatchV5ReposOwnerRepoOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + **description** | **optional.String**| 仓库描述 | + **homepage** | **optional.String**| 主页(eg: https://gitee.com) | + **hasIssues** | **optional.Bool**| 允许提Issue与否。默认: 允许(true) | [default to true] + **hasWiki** | **optional.Bool**| 提供Wiki与否。默认: 提供(true) | [default to true] + **private** | **optional.Bool**| 仓库公开或私有。 | + **defaultBranch** | **optional.String**| 更新默认分支 | + +### Return type + +[**Project**](Project.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PatchV5ReposOwnerRepoCommentsId** +> Note PatchV5ReposOwnerRepoCommentsId(ctx, owner, repo, id, body, optional) +更新Commit评论 + +更新Commit评论 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **id** | **int32**| 评论的ID | + **body** | **string**| 评论的内容 | + **optional** | ***PatchV5ReposOwnerRepoCommentsIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PatchV5ReposOwnerRepoCommentsIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**Note**](Note.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PatchV5ReposOwnerRepoReleasesId** +> Release PatchV5ReposOwnerRepoReleasesId(ctx, owner, repo, tagName, name, body, id, optional) +更新仓库Release + +更新仓库Release + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **tagName** | **string**| Tag 名称, 提倡以v字母为前缀做为Release名称,例如v1.0或者v2.3.4 | + **name** | **string**| Release 名称 | + **body** | **string**| Release 描述 | + **id** | **int32**| | + **optional** | ***PatchV5ReposOwnerRepoReleasesIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PatchV5ReposOwnerRepoReleasesIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + + + + **accessToken** | **optional.String**| 用户授权码 | + **prerelease** | **optional.Bool**| 是否为预览版本。默认: false(非预览版本) | + +### Return type + +[**Release**](Release.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PostV5EnterprisesEnterpriseRepos** +> Project PostV5EnterprisesEnterpriseRepos(ctx, name, enterprise, optional) +创建企业仓库 + +创建企业仓库 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **name** | **string**| 仓库名称 | + **enterprise** | **string**| 企业的路径(path/login) | + **optional** | ***PostV5EnterprisesEnterpriseReposOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PostV5EnterprisesEnterpriseReposOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **description** | **optional.String**| 仓库描述 | + **homepage** | **optional.String**| 主页(eg: https://gitee.com) | + **hasIssues** | **optional.Bool**| 允许提Issue与否。默认: 允许(true) | [default to true] + **hasWiki** | **optional.Bool**| 提供Wiki与否。默认: 提供(true) | [default to true] + **autoInit** | **optional.Bool**| 值为true时则会用README初始化仓库。默认: 不初始化(false) | + **gitignoreTemplate** | **optional.String**| Git Ingore模版 | + **licenseTemplate** | **optional.String**| License模版 | + **private** | **optional.Int32**| 仓库开源类型。0(私有), 1(外部开源), 2(内部开源)。默认: 0 | [default to 0] + **outsourced** | **optional.Bool**| 值为true值为外包仓库, false值为内部仓库。默认: 内部仓库(false) | + **projectCreator** | **optional.String**| 负责人的username | + **members** | **optional.String**| 用逗号分开的仓库成员。如: member1,member2 | + +### Return type + +[**Project**](Project.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PostV5OrgsOrgRepos** +> Project PostV5OrgsOrgRepos(ctx, name, org, optional) +创建组织仓库 + +创建组织仓库 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **name** | **string**| 仓库名称 | + **org** | **string**| 组织的路径(path/login) | + **optional** | ***PostV5OrgsOrgReposOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PostV5OrgsOrgReposOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **description** | **optional.String**| 仓库描述 | + **homepage** | **optional.String**| 主页(eg: https://gitee.com) | + **hasIssues** | **optional.Bool**| 允许提Issue与否。默认: 允许(true) | [default to true] + **hasWiki** | **optional.Bool**| 提供Wiki与否。默认: 提供(true) | [default to true] + **public** | **optional.Int32**| 仓库开源类型。0(私有), 1(外部开源), 2(内部开源),注:与private互斥,以public为主。 | + **private** | **optional.Bool**| 仓库公开或私有。默认: 公开(false),注:与public互斥,以public为主。 | + **autoInit** | **optional.Bool**| 值为true时则会用README初始化仓库。默认: 不初始化(false) | + **gitignoreTemplate** | **optional.String**| Git Ingore模版 | + **licenseTemplate** | **optional.String**| License模版 | + +### Return type + +[**Project**](Project.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PostV5ReposOwnerRepoBranches** +> CompleteBranch PostV5ReposOwnerRepoBranches(ctx, owner, repo, refs, branchName, optional) +创建分支 + +创建分支 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **refs** | **string**| 起点名称, 默认:master | [default to master] + **branchName** | **string**| 新创建的分支名称 | + **optional** | ***PostV5ReposOwnerRepoBranchesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PostV5ReposOwnerRepoBranchesOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**CompleteBranch**](CompleteBranch.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PostV5ReposOwnerRepoCommitsShaComments** +> Note PostV5ReposOwnerRepoCommitsShaComments(ctx, owner, repo, sha, body, optional) +创建Commit评论 + +创建Commit评论 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **sha** | **string**| 评论的sha值 | + **body** | **string**| 评论的内容 | + **optional** | ***PostV5ReposOwnerRepoCommitsShaCommentsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PostV5ReposOwnerRepoCommitsShaCommentsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + + **accessToken** | **optional.String**| 用户授权码 | + **path** | **optional.String**| 文件的相对路径 | + **position** | **optional.Int32**| Diff的相对行数 | + +### Return type + +[**Note**](Note.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PostV5ReposOwnerRepoContentsPath** +> CommitContent PostV5ReposOwnerRepoContentsPath(ctx, owner, repo, path, content, message, optional) +新建文件 + +新建文件 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **path** | **string**| 文件的路径 | + **content** | **string**| 文件内容, 要用 base64 编码 | + **message** | **string**| 提交信息 | + **optional** | ***PostV5ReposOwnerRepoContentsPathOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PostV5ReposOwnerRepoContentsPathOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + + + **accessToken** | **optional.String**| 用户授权码 | + **branch** | **optional.String**| 分支名称。默认为仓库对默认分支 | + **committerName** | **optional.String**| Committer的名字,默认为当前用户的名字 | + **committerEmail** | **optional.String**| Committer的邮箱,默认为当前用户的邮箱 | + **authorName** | **optional.String**| Author的名字,默认为当前用户的名字 | + **authorEmail** | **optional.String**| Author的邮箱,默认为当前用户的邮箱 | + +### Return type + +[**CommitContent**](CommitContent.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PostV5ReposOwnerRepoForks** +> Project PostV5ReposOwnerRepoForks(ctx, owner, repo, optional) +Fork一个仓库 + +Fork一个仓库 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***PostV5ReposOwnerRepoForksOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PostV5ReposOwnerRepoForksOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **organization** | **optional.String**| 组织空间地址,不填写默认Fork到用户个人空间地址 | + +### Return type + +[**Project**](Project.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PostV5ReposOwnerRepoKeys** +> SshKey PostV5ReposOwnerRepoKeys(ctx, owner, repo, key, title, optional) +为仓库添加公钥 + +为仓库添加公钥 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **key** | **string**| 公钥内容 | + **title** | **string**| 公钥名称 | + **optional** | ***PostV5ReposOwnerRepoKeysOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PostV5ReposOwnerRepoKeysOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**SshKey**](SSHKey.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PostV5ReposOwnerRepoPagesBuilds** +> PostV5ReposOwnerRepoPagesBuilds(ctx, owner, repo, optional) +请求建立Pages + +请求建立Pages + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***PostV5ReposOwnerRepoPagesBuildsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PostV5ReposOwnerRepoPagesBuildsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PostV5ReposOwnerRepoReleases** +> Release PostV5ReposOwnerRepoReleases(ctx, owner, repo, tagName, name, body, targetCommitish, optional) +创建仓库Release + +创建仓库Release + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **tagName** | **string**| Tag 名称, 提倡以v字母为前缀做为Release名称,例如v1.0或者v2.3.4 | + **name** | **string**| Release 名称 | + **body** | **string**| Release 描述 | + **targetCommitish** | **string**| 分支名称或者commit SHA, 默认是当前默认分支 | + **optional** | ***PostV5ReposOwnerRepoReleasesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PostV5ReposOwnerRepoReleasesOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + + + + **accessToken** | **optional.String**| 用户授权码 | + **prerelease** | **optional.Bool**| 是否为预览版本。默认: false(非预览版本) | + +### Return type + +[**Release**](Release.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PostV5UserRepos** +> Project PostV5UserRepos(ctx, name, optional) +创建一个仓库 + +创建一个仓库 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **name** | **string**| 仓库名称 | + **optional** | ***PostV5UserReposOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PostV5UserReposOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + **description** | **optional.String**| 仓库描述 | + **homepage** | **optional.String**| 主页(eg: https://gitee.com) | + **hasIssues** | **optional.Bool**| 允许提Issue与否。默认: 允许(true) | [default to true] + **hasWiki** | **optional.Bool**| 提供Wiki与否。默认: 提供(true) | [default to true] + **autoInit** | **optional.Bool**| 值为true时则会用README初始化仓库。默认: 不初始化(false) | + **gitignoreTemplate** | **optional.String**| Git Ingore模版 | + **licenseTemplate** | **optional.String**| License模版 | + **private** | **optional.Bool**| 仓库公开或私有。默认: 公开(false) | + +### Return type + +[**Project**](Project.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PutV5ReposOwnerRepoBranchesBranchProtection** +> CompleteBranch PutV5ReposOwnerRepoBranchesBranchProtection(ctx, owner, repo, branch, optional) +设置分支保护 + +设置分支保护 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **branch** | **string**| 分支名称 | + **optional** | ***PutV5ReposOwnerRepoBranchesBranchProtectionOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PutV5ReposOwnerRepoBranchesBranchProtectionOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**CompleteBranch**](CompleteBranch.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PutV5ReposOwnerRepoClear** +> PutV5ReposOwnerRepoClear(ctx, owner, repo, optional) +清空一个仓库 + +清空一个仓库 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***PutV5ReposOwnerRepoClearOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PutV5ReposOwnerRepoClearOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PutV5ReposOwnerRepoCollaboratorsUsername** +> ProjectMember PutV5ReposOwnerRepoCollaboratorsUsername(ctx, owner, repo, username, permission, optional) +添加仓库成员 + +添加仓库成员 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **username** | **string**| 用户名(username/login) | + **permission** | **string**| 成员权限: 拉代码(pull),推代码(push),管理员(admin)。默认: push | [default to push] + **optional** | ***PutV5ReposOwnerRepoCollaboratorsUsernameOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PutV5ReposOwnerRepoCollaboratorsUsernameOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**ProjectMember**](ProjectMember.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PutV5ReposOwnerRepoContentsPath** +> CommitContent PutV5ReposOwnerRepoContentsPath(ctx, owner, repo, path, content, sha, message, optional) +更新文件 + +更新文件 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **path** | **string**| 文件的路径 | + **content** | **string**| 文件内容, 要用 base64 编码 | + **sha** | **string**| 文件的 Blob SHA,可通过 [获取仓库具体路径下的内容] API 获取 | + **message** | **string**| 提交信息 | + **optional** | ***PutV5ReposOwnerRepoContentsPathOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PutV5ReposOwnerRepoContentsPathOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + + + + **accessToken** | **optional.String**| 用户授权码 | + **branch** | **optional.String**| 分支名称。默认为仓库对默认分支 | + **committerName** | **optional.String**| Committer的名字,默认为当前用户的名字 | + **committerEmail** | **optional.String**| Committer的邮箱,默认为当前用户的邮箱 | + **authorName** | **optional.String**| Author的名字,默认为当前用户的名字 | + **authorEmail** | **optional.String**| Author的邮箱,默认为当前用户的邮箱 | + +### Return type + +[**CommitContent**](CommitContent.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PutV5ReposOwnerRepoKeysEnableId** +> PutV5ReposOwnerRepoKeysEnableId(ctx, owner, repo, id, optional) +启用仓库公钥 + +启用仓库公钥 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **id** | **int32**| 公钥 ID | + **optional** | ***PutV5ReposOwnerRepoKeysEnableIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PutV5ReposOwnerRepoKeysEnableIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/SearchApi.md b/docs/SearchApi.md new file mode 100644 index 0000000..83d9f62 --- /dev/null +++ b/docs/SearchApi.md @@ -0,0 +1,187 @@ +# \SearchApi + +All URIs are relative to *https://gitee.com/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetV5SearchGists**](SearchApi.md#GetV5SearchGists) | **Get** /v5/search/gists | 搜索代码片段 +[**GetV5SearchIssues**](SearchApi.md#GetV5SearchIssues) | **Get** /v5/search/issues | 搜索 Issues +[**GetV5SearchRepositories**](SearchApi.md#GetV5SearchRepositories) | **Get** /v5/search/repositories | 搜索仓库 +[**GetV5SearchUsers**](SearchApi.md#GetV5SearchUsers) | **Get** /v5/search/users | 搜索用户 + + +# **GetV5SearchGists** +> []Code GetV5SearchGists(ctx, q, optional) +搜索代码片段 + +搜索代码片段 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **q** | **string**| 搜索关键字 | + **optional** | ***GetV5SearchGistsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5SearchGistsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + **language** | **optional.String**| 筛选指定语言的代码片段 | + **owner** | **optional.String**| 筛选所属用户 (username/login) 的代码片段 | + **sort** | **optional.String**| 排序字段,created_at(创建时间)、updated_at(更新时间)、notes_count(评论数)、stars_count(收藏数)、forks_count(Fork 数),默认为最佳匹配 | + **order** | **optional.String**| 排序顺序: desc(default)、asc | [default to desc] + +### Return type + +[**[]Code**](Code.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5SearchIssues** +> []Issue GetV5SearchIssues(ctx, q, optional) +搜索 Issues + +搜索 Issues + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **q** | **string**| 搜索关键字 | + **optional** | ***GetV5SearchIssuesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5SearchIssuesOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + **repo** | **optional.String**| 筛选指定仓库 (path, e.g. oschina/git-osc) 的 issues | + **language** | **optional.String**| 筛选指定语言的 issues | + **label** | **optional.String**| 筛选指定标签的 issues | + **state** | **optional.String**| 筛选指定状态的 issues, open(开启)、closed(完成)、rejected(拒绝) | + **author** | **optional.String**| 筛选指定创建者 (username/login) 的 issues | + **assignee** | **optional.String**| 筛选指定负责人 (username/login) 的 issues | + **sort** | **optional.String**| 排序字段,created_at(创建时间)、last_push_at(更新时间)、notes_count(评论数),默认为最佳匹配 | + **order** | **optional.String**| 排序顺序: desc(default)、asc | [default to desc] + +### Return type + +[**[]Issue**](Issue.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5SearchRepositories** +> []Project GetV5SearchRepositories(ctx, q, optional) +搜索仓库 + +搜索仓库 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **q** | **string**| 搜索关键字 | + **optional** | ***GetV5SearchRepositoriesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5SearchRepositoriesOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + **owner** | **optional.String**| 筛选指定空间地址(企业、组织或个人的地址 path) 的仓库 | + **fork** | **optional.Bool**| 是否搜索含 fork 的仓库,默认:否 | + **language** | **optional.String**| 筛选指定语言的仓库 | + **sort** | **optional.String**| 排序字段,created_at(创建时间)、last_push_at(更新时间)、stars_count(收藏数)、forks_count(Fork 数)、watches_count(关注数),默认为最佳匹配 | + **order** | **optional.String**| 排序顺序: desc(default)、asc | [default to desc] + +### Return type + +[**[]Project**](Project.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5SearchUsers** +> []User GetV5SearchUsers(ctx, q, optional) +搜索用户 + +搜索用户 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **q** | **string**| 搜索关键字 | + **optional** | ***GetV5SearchUsersOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5SearchUsersOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + **sort** | **optional.String**| 排序字段,joined_at(注册时间),默认为最佳匹配 | + **order** | **optional.String**| 排序顺序: desc(default)、asc | [default to desc] + +### Return type + +[**[]User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/SshKey.md b/docs/SshKey.md new file mode 100644 index 0000000..2a43b16 --- /dev/null +++ b/docs/SshKey.md @@ -0,0 +1,14 @@ +# SshKey + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [optional] [default to null] +**Key** | **string** | | [optional] [default to null] +**Url** | **string** | | [optional] [default to null] +**Title** | **string** | | [optional] [default to null] +**CreatedAt** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SshKeyBasic.md b/docs/SshKeyBasic.md new file mode 100644 index 0000000..57c59f2 --- /dev/null +++ b/docs/SshKeyBasic.md @@ -0,0 +1,11 @@ +# SshKeyBasic + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [optional] [default to null] +**Key** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Tag.md b/docs/Tag.md new file mode 100644 index 0000000..b339760 --- /dev/null +++ b/docs/Tag.md @@ -0,0 +1,11 @@ +# Tag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] [default to null] +**Commit** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Tree.md b/docs/Tree.md new file mode 100644 index 0000000..e64d306 --- /dev/null +++ b/docs/Tree.md @@ -0,0 +1,13 @@ +# Tree + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Sha** | **string** | | [optional] [default to null] +**Url** | **string** | | [optional] [default to null] +**Tree** | **string** | | [optional] [default to null] +**Truncated** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/User.md b/docs/User.md new file mode 100644 index 0000000..acbaba1 --- /dev/null +++ b/docs/User.md @@ -0,0 +1,37 @@ +# User + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | | [optional] [default to null] +**Login** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**AvatarUrl** | **string** | | [optional] [default to null] +**Url** | **string** | | [optional] [default to null] +**HtmlUrl** | **string** | | [optional] [default to null] +**FollowersUrl** | **string** | | [optional] [default to null] +**FollowingUrl** | **string** | | [optional] [default to null] +**GistsUrl** | **string** | | [optional] [default to null] +**StarredUrl** | **string** | | [optional] [default to null] +**SubscriptionsUrl** | **string** | | [optional] [default to null] +**OrganizationsUrl** | **string** | | [optional] [default to null] +**ReposUrl** | **string** | | [optional] [default to null] +**EventsUrl** | **string** | | [optional] [default to null] +**ReceivedEventsUrl** | **string** | | [optional] [default to null] +**Type_** | **string** | | [optional] [default to null] +**SiteAdmin** | **string** | | [optional] [default to null] +**Blog** | **string** | | [optional] [default to null] +**Weibo** | **string** | | [optional] [default to null] +**Bio** | **string** | | [optional] [default to null] +**PublicRepos** | **string** | | [optional] [default to null] +**PublicGists** | **string** | | [optional] [default to null] +**Followers** | **string** | | [optional] [default to null] +**Following** | **string** | | [optional] [default to null] +**Stared** | **string** | | [optional] [default to null] +**Watched** | **string** | | [optional] [default to null] +**CreatedAt** | **string** | | [optional] [default to null] +**UpdatedAt** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UserBasic.md b/docs/UserBasic.md new file mode 100644 index 0000000..5cd4ba3 --- /dev/null +++ b/docs/UserBasic.md @@ -0,0 +1,26 @@ +# UserBasic + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | | [optional] [default to null] +**Login** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**AvatarUrl** | **string** | | [optional] [default to null] +**Url** | **string** | | [optional] [default to null] +**HtmlUrl** | **string** | | [optional] [default to null] +**FollowersUrl** | **string** | | [optional] [default to null] +**FollowingUrl** | **string** | | [optional] [default to null] +**GistsUrl** | **string** | | [optional] [default to null] +**StarredUrl** | **string** | | [optional] [default to null] +**SubscriptionsUrl** | **string** | | [optional] [default to null] +**OrganizationsUrl** | **string** | | [optional] [default to null] +**ReposUrl** | **string** | | [optional] [default to null] +**EventsUrl** | **string** | | [optional] [default to null] +**ReceivedEventsUrl** | **string** | | [optional] [default to null] +**Type_** | **string** | | [optional] [default to null] +**SiteAdmin** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UserMessage.md b/docs/UserMessage.md new file mode 100644 index 0000000..485e0d9 --- /dev/null +++ b/docs/UserMessage.md @@ -0,0 +1,16 @@ +# UserMessage + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | | [optional] [default to null] +**Sender** | [***UserBasic**](UserBasic.md) | 发送者 | [optional] [default to null] +**Unread** | **string** | | [optional] [default to null] +**Content** | **string** | | [optional] [default to null] +**UpdatedAt** | **string** | | [optional] [default to null] +**Url** | **string** | | [optional] [default to null] +**HtmlUrl** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UserMessageList.md b/docs/UserMessageList.md new file mode 100644 index 0000000..fbd997e --- /dev/null +++ b/docs/UserMessageList.md @@ -0,0 +1,11 @@ +# UserMessageList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TotalCount** | **int32** | | [optional] [default to null] +**List** | [**[]UserMessage**](UserMessage.md) | 私信列表 | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UserMini.md b/docs/UserMini.md new file mode 100644 index 0000000..2765578 --- /dev/null +++ b/docs/UserMini.md @@ -0,0 +1,15 @@ +# UserMini + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | | [optional] [default to null] +**Login** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**AvatarUrl** | **string** | | [optional] [default to null] +**Url** | **string** | | [optional] [default to null] +**HtmlUrl** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UserNotification.md b/docs/UserNotification.md new file mode 100644 index 0000000..ed92446 --- /dev/null +++ b/docs/UserNotification.md @@ -0,0 +1,21 @@ +# UserNotification + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | | [optional] [default to null] +**Content** | **string** | | [optional] [default to null] +**Type_** | **string** | | [optional] [default to null] +**Unread** | **string** | | [optional] [default to null] +**Mute** | **string** | | [optional] [default to null] +**UpdatedAt** | **string** | | [optional] [default to null] +**Url** | **string** | | [optional] [default to null] +**HtmlUrl** | **string** | | [optional] [default to null] +**Actor** | [***UserBasic**](UserBasic.md) | 通知发送者 | [optional] [default to null] +**Repository** | [***ProjectBasic**](ProjectBasic.md) | | [optional] [default to null] +**Subject** | [***UserNotificationSubject**](UserNotificationSubject.md) | 通知直接关联对象 | [optional] [default to null] +**Namespaces** | [**[]UserNotificationNamespace**](UserNotificationNamespace.md) | 通知次级关联对象 | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UserNotificationCount.md b/docs/UserNotificationCount.md new file mode 100644 index 0000000..5236af3 --- /dev/null +++ b/docs/UserNotificationCount.md @@ -0,0 +1,12 @@ +# UserNotificationCount + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TotalCount** | **int32** | 通知总数 | [optional] [default to null] +**NotificationCount** | **int32** | 通知数量 | [optional] [default to null] +**MessageCount** | **int32** | 私信数量 | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UserNotificationList.md b/docs/UserNotificationList.md new file mode 100644 index 0000000..2234aff --- /dev/null +++ b/docs/UserNotificationList.md @@ -0,0 +1,11 @@ +# UserNotificationList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TotalCount** | **int32** | | [optional] [default to null] +**List** | [**[]UserNotification**](UserNotification.md) | 通知列表 | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UserNotificationNamespace.md b/docs/UserNotificationNamespace.md new file mode 100644 index 0000000..5635767 --- /dev/null +++ b/docs/UserNotificationNamespace.md @@ -0,0 +1,12 @@ +# UserNotificationNamespace + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] [default to null] +**HtmlUrl** | **string** | | [optional] [default to null] +**Type_** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UserNotificationSubject.md b/docs/UserNotificationSubject.md new file mode 100644 index 0000000..adac767 --- /dev/null +++ b/docs/UserNotificationSubject.md @@ -0,0 +1,13 @@ +# UserNotificationSubject + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Title** | **string** | | [optional] [default to null] +**Url** | **string** | | [optional] [default to null] +**LatestCommentUrl** | **string** | | [optional] [default to null] +**Type_** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UsersApi.md b/docs/UsersApi.md new file mode 100644 index 0000000..f419d68 --- /dev/null +++ b/docs/UsersApi.md @@ -0,0 +1,701 @@ +# \UsersApi + +All URIs are relative to *https://gitee.com/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteV5UserFollowingUsername**](UsersApi.md#DeleteV5UserFollowingUsername) | **Delete** /v5/user/following/{username} | 取消关注一个用户 +[**DeleteV5UserKeysId**](UsersApi.md#DeleteV5UserKeysId) | **Delete** /v5/user/keys/{id} | 删除一个公钥 +[**GetV5User**](UsersApi.md#GetV5User) | **Get** /v5/user | 获取授权用户的资料 +[**GetV5UserFollowers**](UsersApi.md#GetV5UserFollowers) | **Get** /v5/user/followers | 列出授权用户的关注者 +[**GetV5UserFollowing**](UsersApi.md#GetV5UserFollowing) | **Get** /v5/user/following | 列出授权用户正关注的用户 +[**GetV5UserFollowingUsername**](UsersApi.md#GetV5UserFollowingUsername) | **Get** /v5/user/following/{username} | 检查授权用户是否关注了一个用户 +[**GetV5UserKeys**](UsersApi.md#GetV5UserKeys) | **Get** /v5/user/keys | 列出授权用户的所有公钥 +[**GetV5UserKeysId**](UsersApi.md#GetV5UserKeysId) | **Get** /v5/user/keys/{id} | 获取一个公钥 +[**GetV5UserNamespace**](UsersApi.md#GetV5UserNamespace) | **Get** /v5/user/namespace | 获取授权用户的一个 Namespace +[**GetV5UserNamespaces**](UsersApi.md#GetV5UserNamespaces) | **Get** /v5/user/namespaces | 列出授权用户所有的 Namespace +[**GetV5UsersUsername**](UsersApi.md#GetV5UsersUsername) | **Get** /v5/users/{username} | 获取一个用户 +[**GetV5UsersUsernameFollowers**](UsersApi.md#GetV5UsersUsernameFollowers) | **Get** /v5/users/{username}/followers | 列出指定用户的关注者 +[**GetV5UsersUsernameFollowing**](UsersApi.md#GetV5UsersUsernameFollowing) | **Get** /v5/users/{username}/following | 列出指定用户正在关注的用户 +[**GetV5UsersUsernameFollowingTargetUser**](UsersApi.md#GetV5UsersUsernameFollowingTargetUser) | **Get** /v5/users/{username}/following/{target_user} | 检查指定用户是否关注目标用户 +[**GetV5UsersUsernameKeys**](UsersApi.md#GetV5UsersUsernameKeys) | **Get** /v5/users/{username}/keys | 列出指定用户的所有公钥 +[**PatchV5User**](UsersApi.md#PatchV5User) | **Patch** /v5/user | 更新授权用户的资料 +[**PostV5UserKeys**](UsersApi.md#PostV5UserKeys) | **Post** /v5/user/keys | 添加一个公钥 +[**PutV5UserFollowingUsername**](UsersApi.md#PutV5UserFollowingUsername) | **Put** /v5/user/following/{username} | 关注一个用户 + + +# **DeleteV5UserFollowingUsername** +> DeleteV5UserFollowingUsername(ctx, username, optional) +取消关注一个用户 + +取消关注一个用户 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **username** | **string**| 用户名(username/login) | + **optional** | ***DeleteV5UserFollowingUsernameOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DeleteV5UserFollowingUsernameOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **DeleteV5UserKeysId** +> DeleteV5UserKeysId(ctx, id, optional) +删除一个公钥 + +删除一个公钥 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **int32**| 公钥 ID | + **optional** | ***DeleteV5UserKeysIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DeleteV5UserKeysIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5User** +> User GetV5User(ctx, optional) +获取授权用户的资料 + +获取授权用户的资料 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***GetV5UserOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5UserOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5UserFollowers** +> []UserBasic GetV5UserFollowers(ctx, optional) +列出授权用户的关注者 + +列出授权用户的关注者 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***GetV5UserFollowersOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5UserFollowersOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]UserBasic**](UserBasic.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5UserFollowing** +> []UserBasic GetV5UserFollowing(ctx, optional) +列出授权用户正关注的用户 + +列出授权用户正关注的用户 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***GetV5UserFollowingOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5UserFollowingOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]UserBasic**](UserBasic.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5UserFollowingUsername** +> GetV5UserFollowingUsername(ctx, username, optional) +检查授权用户是否关注了一个用户 + +检查授权用户是否关注了一个用户 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **username** | **string**| 用户名(username/login) | + **optional** | ***GetV5UserFollowingUsernameOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5UserFollowingUsernameOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5UserKeys** +> []SshKey GetV5UserKeys(ctx, optional) +列出授权用户的所有公钥 + +列出授权用户的所有公钥 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***GetV5UserKeysOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5UserKeysOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]SshKey**](SSHKey.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5UserKeysId** +> SshKey GetV5UserKeysId(ctx, id, optional) +获取一个公钥 + +获取一个公钥 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **int32**| 公钥 ID | + **optional** | ***GetV5UserKeysIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5UserKeysIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**SshKey**](SSHKey.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5UserNamespace** +> []Namespace GetV5UserNamespace(ctx, path, optional) +获取授权用户的一个 Namespace + +获取授权用户的一个 Namespace + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **path** | **string**| Namespace path | + **optional** | ***GetV5UserNamespaceOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5UserNamespaceOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**[]Namespace**](Namespace.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5UserNamespaces** +> []Namespace GetV5UserNamespaces(ctx, optional) +列出授权用户所有的 Namespace + +列出授权用户所有的 Namespace + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***GetV5UserNamespacesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5UserNamespacesOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accessToken** | **optional.String**| 用户授权码 | + **mode** | **optional.String**| 参与方式: project(所有参与仓库的namepsce)、intrant(所加入的namespace)、all(包含前两者),默认(intrant) | + +### Return type + +[**[]Namespace**](Namespace.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5UsersUsername** +> User GetV5UsersUsername(ctx, username, optional) +获取一个用户 + +获取一个用户 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **username** | **string**| 用户名(username/login) | + **optional** | ***GetV5UsersUsernameOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5UsersUsernameOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5UsersUsernameFollowers** +> []UserBasic GetV5UsersUsernameFollowers(ctx, username, optional) +列出指定用户的关注者 + +列出指定用户的关注者 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **username** | **string**| 用户名(username/login) | + **optional** | ***GetV5UsersUsernameFollowersOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5UsersUsernameFollowersOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]UserBasic**](UserBasic.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5UsersUsernameFollowing** +> []UserBasic GetV5UsersUsernameFollowing(ctx, username, optional) +列出指定用户正在关注的用户 + +列出指定用户正在关注的用户 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **username** | **string**| 用户名(username/login) | + **optional** | ***GetV5UsersUsernameFollowingOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5UsersUsernameFollowingOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]UserBasic**](UserBasic.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5UsersUsernameFollowingTargetUser** +> GetV5UsersUsernameFollowingTargetUser(ctx, username, targetUser, optional) +检查指定用户是否关注目标用户 + +检查指定用户是否关注目标用户 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **username** | **string**| 用户名(username/login) | + **targetUser** | **string**| 目标用户的用户名(username/login) | + **optional** | ***GetV5UsersUsernameFollowingTargetUserOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5UsersUsernameFollowingTargetUserOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5UsersUsernameKeys** +> []SshKeyBasic GetV5UsersUsernameKeys(ctx, username, optional) +列出指定用户的所有公钥 + +列出指定用户的所有公钥 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **username** | **string**| 用户名(username/login) | + **optional** | ***GetV5UsersUsernameKeysOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5UsersUsernameKeysOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]SshKeyBasic**](SSHKeyBasic.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PatchV5User** +> User PatchV5User(ctx, optional) +更新授权用户的资料 + +更新授权用户的资料 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***PatchV5UserOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PatchV5UserOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accessToken** | **optional.String**| 用户授权码 | + **name** | **optional.String**| 昵称 | + **blog** | **optional.String**| 微博链接 | + **weibo** | **optional.String**| 博客站点 | + **bio** | **optional.String**| 自我介绍 | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PostV5UserKeys** +> SshKey PostV5UserKeys(ctx, key, title, optional) +添加一个公钥 + +添加一个公钥 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **key** | **string**| 公钥内容 | + **title** | **string**| 公钥名称 | + **optional** | ***PostV5UserKeysOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PostV5UserKeysOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**SshKey**](SSHKey.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PutV5UserFollowingUsername** +> PutV5UserFollowingUsername(ctx, username, optional) +关注一个用户 + +关注一个用户 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **username** | **string**| 用户名(username/login) | + **optional** | ***PutV5UserFollowingUsernameOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PutV5UserFollowingUsernameOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/WebhooksApi.md b/docs/WebhooksApi.md new file mode 100644 index 0000000..e3456b4 --- /dev/null +++ b/docs/WebhooksApi.md @@ -0,0 +1,274 @@ +# \WebhooksApi + +All URIs are relative to *https://gitee.com/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteV5ReposOwnerRepoHooksId**](WebhooksApi.md#DeleteV5ReposOwnerRepoHooksId) | **Delete** /v5/repos/{owner}/{repo}/hooks/{id} | 删除一个仓库WebHook +[**GetV5ReposOwnerRepoHooks**](WebhooksApi.md#GetV5ReposOwnerRepoHooks) | **Get** /v5/repos/{owner}/{repo}/hooks | 列出仓库的WebHooks +[**GetV5ReposOwnerRepoHooksId**](WebhooksApi.md#GetV5ReposOwnerRepoHooksId) | **Get** /v5/repos/{owner}/{repo}/hooks/{id} | 获取仓库单个WebHook +[**PatchV5ReposOwnerRepoHooksId**](WebhooksApi.md#PatchV5ReposOwnerRepoHooksId) | **Patch** /v5/repos/{owner}/{repo}/hooks/{id} | 更新一个仓库WebHook +[**PostV5ReposOwnerRepoHooks**](WebhooksApi.md#PostV5ReposOwnerRepoHooks) | **Post** /v5/repos/{owner}/{repo}/hooks | 创建一个仓库WebHook +[**PostV5ReposOwnerRepoHooksIdTests**](WebhooksApi.md#PostV5ReposOwnerRepoHooksIdTests) | **Post** /v5/repos/{owner}/{repo}/hooks/{id}/tests | 测试WebHook是否发送成功 + + +# **DeleteV5ReposOwnerRepoHooksId** +> DeleteV5ReposOwnerRepoHooksId(ctx, owner, repo, id, optional) +删除一个仓库WebHook + +删除一个仓库WebHook + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **id** | **int32**| Webhook的ID | + **optional** | ***DeleteV5ReposOwnerRepoHooksIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DeleteV5ReposOwnerRepoHooksIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoHooks** +> []Hook GetV5ReposOwnerRepoHooks(ctx, owner, repo, optional) +列出仓库的WebHooks + +列出仓库的WebHooks + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **optional** | ***GetV5ReposOwnerRepoHooksOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoHooksOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **accessToken** | **optional.String**| 用户授权码 | + **page** | **optional.Int32**| 当前的页码 | [default to 1] + **perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20] + +### Return type + +[**[]Hook**](Hook.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetV5ReposOwnerRepoHooksId** +> Hook GetV5ReposOwnerRepoHooksId(ctx, owner, repo, id, optional) +获取仓库单个WebHook + +获取仓库单个WebHook + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **id** | **int32**| Webhook的ID | + **optional** | ***GetV5ReposOwnerRepoHooksIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoHooksIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + +[**Hook**](Hook.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PatchV5ReposOwnerRepoHooksId** +> Hook PatchV5ReposOwnerRepoHooksId(ctx, owner, repo, id, url, optional) +更新一个仓库WebHook + +更新一个仓库WebHook + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **id** | **int32**| Webhook的ID | + **url** | **string**| 远程HTTP URL | + **optional** | ***PatchV5ReposOwnerRepoHooksIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PatchV5ReposOwnerRepoHooksIdOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + + **accessToken** | **optional.String**| 用户授权码 | + **password** | **optional.String**| 请求URL时会带上该密码,防止URL被恶意请求 | + **pushEvents** | **optional.Bool**| Push代码到仓库 | [default to true] + **tagPushEvents** | **optional.Bool**| 提交Tag到仓库 | + **issuesEvents** | **optional.Bool**| 创建/关闭Issue | + **noteEvents** | **optional.Bool**| 评论了Issue/代码等等 | + **mergeRequestsEvents** | **optional.Bool**| 合并请求和合并后 | + +### Return type + +[**Hook**](Hook.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PostV5ReposOwnerRepoHooks** +> Hook PostV5ReposOwnerRepoHooks(ctx, owner, repo, url, optional) +创建一个仓库WebHook + +创建一个仓库WebHook + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **url** | **string**| 远程HTTP URL | + **optional** | ***PostV5ReposOwnerRepoHooksOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PostV5ReposOwnerRepoHooksOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + **password** | **optional.String**| 请求URL时会带上该密码,防止URL被恶意请求 | + **pushEvents** | **optional.Bool**| Push代码到仓库 | [default to true] + **tagPushEvents** | **optional.Bool**| 提交Tag到仓库 | + **issuesEvents** | **optional.Bool**| 创建/关闭Issue | + **noteEvents** | **optional.Bool**| 评论了Issue/代码等等 | + **mergeRequestsEvents** | **optional.Bool**| 合并请求和合并后 | + +### Return type + +[**Hook**](Hook.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PostV5ReposOwnerRepoHooksIdTests** +> PostV5ReposOwnerRepoHooksIdTests(ctx, owner, repo, id, optional) +测试WebHook是否发送成功 + +测试WebHook是否发送成功 + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | + **repo** | **string**| 仓库路径(path) | + **id** | **int32**| Webhook的ID | + **optional** | ***PostV5ReposOwnerRepoHooksIdTestsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PostV5ReposOwnerRepoHooksIdTestsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **accessToken** | **optional.String**| 用户授权码 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/WeekReport.md b/docs/WeekReport.md new file mode 100644 index 0000000..b87e519 --- /dev/null +++ b/docs/WeekReport.md @@ -0,0 +1,20 @@ +# WeekReport + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | | [optional] [default to null] +**Content** | **string** | | [optional] [default to null] +**ContentHtml** | **string** | | [optional] [default to null] +**Year** | **string** | | [optional] [default to null] +**Month** | **string** | | [optional] [default to null] +**WeekIndex** | **string** | | [optional] [default to null] +**WeekBegin** | **string** | | [optional] [default to null] +**WeekEnd** | **string** | | [optional] [default to null] +**CreatedAt** | **string** | | [optional] [default to null] +**UpdatedAt** | **string** | | [optional] [default to null] +**User** | [***UserMini**](UserMini.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/git_push.sh b/git_push.sh new file mode 100644 index 0000000..ae01b18 --- /dev/null +++ b/git_push.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/model_blob.go b/model_blob.go new file mode 100644 index 0000000..d3f4583 --- /dev/null +++ b/model_blob.go @@ -0,0 +1,19 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 获取文件Blob +type Blob struct { + Sha string `json:"sha,omitempty"` + Size string `json:"size,omitempty"` + Url string `json:"url,omitempty"` + Content string `json:"content,omitempty"` + Encoding string `json:"encoding,omitempty"` +} diff --git a/model_branch.go b/model_branch.go new file mode 100644 index 0000000..8e170d5 --- /dev/null +++ b/model_branch.go @@ -0,0 +1,18 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 获取所有分支 +type Branch struct { + Name string `json:"name,omitempty"` + Commit string `json:"commit,omitempty"` + Protected string `json:"protected,omitempty"` + ProtectionUrl string `json:"protection_url,omitempty"` +} diff --git a/model_code.go b/model_code.go new file mode 100644 index 0000000..85883aa --- /dev/null +++ b/model_code.go @@ -0,0 +1,31 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 搜索代码片段 +type Code struct { + Url string `json:"url,omitempty"` + ForksUrl string `json:"forks_url,omitempty"` + CommitsUrl string `json:"commits_url,omitempty"` + Id string `json:"id,omitempty"` + Description string `json:"description,omitempty"` + Public string `json:"public,omitempty"` + Owner string `json:"owner,omitempty"` + User string `json:"user,omitempty"` + Files string `json:"files,omitempty"` + Truncated string `json:"truncated,omitempty"` + HtmlUrl string `json:"html_url,omitempty"` + Comments string `json:"comments,omitempty"` + CommentsUrl string `json:"comments_url,omitempty"` + GitPullUrl string `json:"git_pull_url,omitempty"` + GitPushUrl string `json:"git_push_url,omitempty"` + CreatedAt string `json:"created_at,omitempty"` + UpdatedAt string `json:"updated_at,omitempty"` +} diff --git a/model_code_comment.go b/model_code_comment.go new file mode 100644 index 0000000..0ff7347 --- /dev/null +++ b/model_code_comment.go @@ -0,0 +1,18 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 修改代码片段的评论 +type CodeComment struct { + Id string `json:"id,omitempty"` + Body string `json:"body,omitempty"` + CreatedAt string `json:"created_at,omitempty"` + UpdatedAt string `json:"updated_at,omitempty"` +} diff --git a/model_code_forks.go b/model_code_forks.go new file mode 100644 index 0000000..a39cf2b --- /dev/null +++ b/model_code_forks.go @@ -0,0 +1,19 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 获取 Fork 了指定代码片段的列表 +type CodeForks struct { + User string `json:"user,omitempty"` + Url string `json:"url,omitempty"` + Id string `json:"id,omitempty"` + CreatedAt string `json:"created_at,omitempty"` + UpdatedAt string `json:"updated_at,omitempty"` +} diff --git a/model_code_forks_history.go b/model_code_forks_history.go new file mode 100644 index 0000000..a01c4dc --- /dev/null +++ b/model_code_forks_history.go @@ -0,0 +1,33 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 获取代码片段的commit +type CodeForksHistory struct { + Url string `json:"url,omitempty"` + ForksUrl string `json:"forks_url,omitempty"` + CommitsUrl string `json:"commits_url,omitempty"` + Id string `json:"id,omitempty"` + Description string `json:"description,omitempty"` + Public string `json:"public,omitempty"` + Owner string `json:"owner,omitempty"` + User string `json:"user,omitempty"` + Files string `json:"files,omitempty"` + Truncated string `json:"truncated,omitempty"` + HtmlUrl string `json:"html_url,omitempty"` + Comments string `json:"comments,omitempty"` + CommentsUrl string `json:"comments_url,omitempty"` + GitPullUrl string `json:"git_pull_url,omitempty"` + GitPushUrl string `json:"git_push_url,omitempty"` + CreatedAt string `json:"created_at,omitempty"` + UpdatedAt string `json:"updated_at,omitempty"` + Forks string `json:"forks,omitempty"` + History string `json:"history,omitempty"` +} diff --git a/model_commit.go b/model_commit.go new file mode 100644 index 0000000..58ee3d5 --- /dev/null +++ b/model_commit.go @@ -0,0 +1,19 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +type Commit struct { + Sha string `json:"sha,omitempty"` + Author string `json:"author,omitempty"` + Committer string `json:"committer,omitempty"` + Message string `json:"message,omitempty"` + Tree string `json:"tree,omitempty"` + Parents string `json:"parents,omitempty"` +} diff --git a/model_commit_content.go b/model_commit_content.go new file mode 100644 index 0000000..a4231b1 --- /dev/null +++ b/model_commit_content.go @@ -0,0 +1,16 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 删除文件 +type CommitContent struct { + Content *ContentBasic `json:"content,omitempty"` + Commit *Commit `json:"commit,omitempty"` +} diff --git a/model_compare.go b/model_compare.go new file mode 100644 index 0000000..dd72c25 --- /dev/null +++ b/model_compare.go @@ -0,0 +1,18 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 两个Commits之间对比的版本差异 +type Compare struct { + BaseCommit string `json:"base_commit,omitempty"` + MergeBaseCommit string `json:"merge_base_commit,omitempty"` + Commits string `json:"commits,omitempty"` + Files string `json:"files,omitempty"` +} diff --git a/model_complete_branch.go b/model_complete_branch.go new file mode 100644 index 0000000..e6764bb --- /dev/null +++ b/model_complete_branch.go @@ -0,0 +1,19 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 创建分支 +type CompleteBranch struct { + Name string `json:"name,omitempty"` + Commit string `json:"commit,omitempty"` + Links string `json:"_links,omitempty"` + Protected string `json:"protected,omitempty"` + ProtectionUrl string `json:"protection_url,omitempty"` +} diff --git a/model_content.go b/model_content.go new file mode 100644 index 0000000..a6fc23f --- /dev/null +++ b/model_content.go @@ -0,0 +1,25 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 获取仓库具体路径下的内容 +type Content struct { + Type_ string `json:"type,omitempty"` + Encoding string `json:"encoding,omitempty"` + Size string `json:"size,omitempty"` + Name string `json:"name,omitempty"` + Path string `json:"path,omitempty"` + Content string `json:"content,omitempty"` + Sha string `json:"sha,omitempty"` + Url string `json:"url,omitempty"` + HtmlUrl string `json:"html_url,omitempty"` + DownloadUrl string `json:"download_url,omitempty"` + Links string `json:"_links,omitempty"` +} diff --git a/model_content_basic.go b/model_content_basic.go new file mode 100644 index 0000000..f95c5f7 --- /dev/null +++ b/model_content_basic.go @@ -0,0 +1,22 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +type ContentBasic struct { + Name string `json:"name,omitempty"` + Path string `json:"path,omitempty"` + Size string `json:"size,omitempty"` + Sha string `json:"sha,omitempty"` + Type_ string `json:"type,omitempty"` + Url string `json:"url,omitempty"` + HtmlUrl string `json:"html_url,omitempty"` + DownloadUrl string `json:"download_url,omitempty"` + Links string `json:"_links,omitempty"` +} diff --git a/model_contributor.go b/model_contributor.go new file mode 100644 index 0000000..474973a --- /dev/null +++ b/model_contributor.go @@ -0,0 +1,17 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 获取仓库贡献者 +type Contributor struct { + Email string `json:"email,omitempty"` + Name string `json:"name,omitempty"` + Contributions string `json:"contributions,omitempty"` +} diff --git a/model_enterprise_basic.go b/model_enterprise_basic.go new file mode 100644 index 0000000..85f20d8 --- /dev/null +++ b/model_enterprise_basic.go @@ -0,0 +1,19 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 获取一个企业 +type EnterpriseBasic struct { + Id int32 `json:"id,omitempty"` + Path string `json:"path,omitempty"` + Name string `json:"name,omitempty"` + Url string `json:"url,omitempty"` + AvatarUrl string `json:"avatar_url,omitempty"` +} diff --git a/model_enterprise_member.go b/model_enterprise_member.go new file mode 100644 index 0000000..af8652c --- /dev/null +++ b/model_enterprise_member.go @@ -0,0 +1,21 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 修改企业成员权限或备注 +type EnterpriseMember struct { + Url string `json:"url,omitempty"` + Active string `json:"active,omitempty"` + Remark string `json:"remark,omitempty"` + Role string `json:"role,omitempty"` + Outsourced string `json:"outsourced,omitempty"` + Enterprise *EnterpriseBasic `json:"enterprise,omitempty"` + User string `json:"user,omitempty"` +} diff --git a/model_event.go b/model_event.go new file mode 100644 index 0000000..6bb8052 --- /dev/null +++ b/model_event.go @@ -0,0 +1,23 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 列出仓库的所有公开动态 +type Event struct { + Id int32 `json:"id,omitempty"` + Type_ string `json:"type,omitempty"` + Actor string `json:"actor,omitempty"` + Repo string `json:"repo,omitempty"` + Org string `json:"org,omitempty"` + Public string `json:"public,omitempty"` + CreatedAt string `json:"created_at,omitempty"` + // 不同类型动态的内容 + Payload *interface{} `json:"payload,omitempty"` +} diff --git a/model_group.go b/model_group.go new file mode 100644 index 0000000..44b542b --- /dev/null +++ b/model_group.go @@ -0,0 +1,22 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 获取一个组织 +type Group struct { + Id int32 `json:"id,omitempty"` + Login string `json:"login,omitempty"` + Url string `json:"url,omitempty"` + AvatarUrl string `json:"avatar_url,omitempty"` + ReposUrl string `json:"repos_url,omitempty"` + EventsUrl string `json:"events_url,omitempty"` + MembersUrl string `json:"members_url,omitempty"` + Description string `json:"description,omitempty"` +} diff --git a/model_group_detail.go b/model_group_detail.go new file mode 100644 index 0000000..e3a90bb --- /dev/null +++ b/model_group_detail.go @@ -0,0 +1,34 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 更新授权用户所管理的组织资料 +type GroupDetail struct { + Id int32 `json:"id,omitempty"` + Login string `json:"login,omitempty"` + Url string `json:"url,omitempty"` + AvatarUrl string `json:"avatar_url,omitempty"` + ReposUrl string `json:"repos_url,omitempty"` + EventsUrl string `json:"events_url,omitempty"` + MembersUrl string `json:"members_url,omitempty"` + Description string `json:"description,omitempty"` + Name string `json:"name,omitempty"` + CreatedAt string `json:"created_at,omitempty"` + Type_ string `json:"type,omitempty"` + Location string `json:"location,omitempty"` + Email string `json:"email,omitempty"` + HtmlUrl string `json:"html_url,omitempty"` + Public string `json:"public,omitempty"` + Enterprise string `json:"enterprise,omitempty"` + Members string `json:"members,omitempty"` + PublicRepos string `json:"public_repos,omitempty"` + PrivateRepos string `json:"private_repos,omitempty"` + Owner string `json:"owner,omitempty"` +} diff --git a/model_group_member.go b/model_group_member.go new file mode 100644 index 0000000..6801d6b --- /dev/null +++ b/model_group_member.go @@ -0,0 +1,21 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 增加或更新授权用户所管理组织的成员 +type GroupMember struct { + Url string `json:"url,omitempty"` + Active string `json:"active,omitempty"` + Remark string `json:"remark,omitempty"` + Role string `json:"role,omitempty"` + OrganizationUrl string `json:"organization_url,omitempty"` + Organization *Group `json:"organization,omitempty"` + User string `json:"user,omitempty"` +} diff --git a/model_hook.go b/model_hook.go new file mode 100644 index 0000000..20f5dd1 --- /dev/null +++ b/model_hook.go @@ -0,0 +1,26 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 更新一个仓库WebHook +type Hook struct { + Id string `json:"id,omitempty"` + Url string `json:"url,omitempty"` + CreatedAt string `json:"created_at,omitempty"` + Password string `json:"password,omitempty"` + ProjectId string `json:"project_id,omitempty"` + Result string `json:"result,omitempty"` + ResultCode string `json:"result_code,omitempty"` + PushEvents string `json:"push_events,omitempty"` + TagPushEvents string `json:"tag_push_events,omitempty"` + IssuesEvents string `json:"issues_events,omitempty"` + NoteEvents string `json:"note_events,omitempty"` + MergeRequestsEvents string `json:"merge_requests_events,omitempty"` +} diff --git a/model_issue.go b/model_issue.go new file mode 100644 index 0000000..50e3c4f --- /dev/null +++ b/model_issue.go @@ -0,0 +1,45 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +import ( + "time" +) + +// 搜索 Issues +type Issue struct { + Id int32 `json:"id,omitempty"` + Url string `json:"url,omitempty"` + RepositoryUrl string `json:"repository_url,omitempty"` + LabelsUrl string `json:"labels_url,omitempty"` + CommentsUrl string `json:"comments_url,omitempty"` + HtmlUrl string `json:"html_url,omitempty"` + ParentUrl string `json:"parent_url,omitempty"` + Number string `json:"number,omitempty"` + State string `json:"state,omitempty"` + Title string `json:"title,omitempty"` + Body string `json:"body,omitempty"` + BodyHtml string `json:"body_html,omitempty"` + User string `json:"user,omitempty"` + Labels *Label `json:"labels,omitempty"` + Assignee *UserBasic `json:"assignee,omitempty"` + Collaborators *UserBasic `json:"collaborators,omitempty"` + Repository string `json:"repository,omitempty"` + Milestone *Milestone `json:"milestone,omitempty"` + CreatedAt time.Time `json:"created_at,omitempty"` + UpdatedAt time.Time `json:"updated_at,omitempty"` + PlanStartedAt time.Time `json:"plan_started_at,omitempty"` + Deadline time.Time `json:"deadline,omitempty"` + FinishedAt time.Time `json:"finished_at,omitempty"` + ScheduledTime string `json:"scheduled_time,omitempty"` + Comments int32 `json:"comments,omitempty"` + IssueType string `json:"issue_type,omitempty"` + Program *ProgramBasic `json:"program,omitempty"` +} diff --git a/model_label.go b/model_label.go new file mode 100644 index 0000000..2689fa7 --- /dev/null +++ b/model_label.go @@ -0,0 +1,19 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 获取企业某个标签 +type Label struct { + Id int32 `json:"id,omitempty"` + Name string `json:"name,omitempty"` + Color string `json:"color,omitempty"` + RepositoryId int32 `json:"repository_id,omitempty"` + Url string `json:"url,omitempty"` +} diff --git a/model_milestone.go b/model_milestone.go new file mode 100644 index 0000000..41a37b8 --- /dev/null +++ b/model_milestone.go @@ -0,0 +1,30 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +import ( + "time" +) + +// 更新仓库里程碑 +type Milestone struct { + Url string `json:"url,omitempty"` + HtmlUrl string `json:"html_url,omitempty"` + Number int32 `json:"number,omitempty"` + RepositoryId int32 `json:"repository_id,omitempty"` + State string `json:"state,omitempty"` + Title string `json:"title,omitempty"` + Description string `json:"description,omitempty"` + UpdatedAt time.Time `json:"updated_at,omitempty"` + CreatedAt time.Time `json:"created_at,omitempty"` + OpenIssues int32 `json:"open_issues,omitempty"` + ClosedIssues int32 `json:"closed_issues,omitempty"` + DueOn time.Time `json:"due_on,omitempty"` +} diff --git a/model_namespace.go b/model_namespace.go new file mode 100644 index 0000000..b9d1c9c --- /dev/null +++ b/model_namespace.go @@ -0,0 +1,20 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 获取授权用户的一个 Namespace +type Namespace struct { + Id int32 `json:"id,omitempty"` + Type_ string `json:"type,omitempty"` + Name string `json:"name,omitempty"` + Path string `json:"path,omitempty"` + HtmlUrl string `json:"html_url,omitempty"` + Parent *NamespaceMini `json:"parent,omitempty"` +} diff --git a/model_namespace_mini.go b/model_namespace_mini.go new file mode 100644 index 0000000..c205e3d --- /dev/null +++ b/model_namespace_mini.go @@ -0,0 +1,18 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +type NamespaceMini struct { + Id int32 `json:"id,omitempty"` + Type_ string `json:"type,omitempty"` + Name string `json:"name,omitempty"` + Path string `json:"path,omitempty"` + HtmlUrl string `json:"html_url,omitempty"` +} diff --git a/model_note.go b/model_note.go new file mode 100644 index 0000000..fde2459 --- /dev/null +++ b/model_note.go @@ -0,0 +1,21 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 获取企业某个Issue所有评论 +type Note struct { + Id string `json:"id,omitempty"` + Body string `json:"body,omitempty"` + BodyHtml string `json:"body_html,omitempty"` + User string `json:"user,omitempty"` + Source string `json:"source,omitempty"` + CreatedAt string `json:"created_at,omitempty"` + Target string `json:"target,omitempty"` +} diff --git a/model_operate_log.go b/model_operate_log.go new file mode 100644 index 0000000..00233e1 --- /dev/null +++ b/model_operate_log.go @@ -0,0 +1,19 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 获取某个Pull Request的操作日志 +type OperateLog struct { + Id string `json:"id,omitempty"` + Icon string `json:"icon,omitempty"` + User string `json:"user,omitempty"` + Content string `json:"content,omitempty"` + CreatedAt string `json:"created_at,omitempty"` +} diff --git a/model_program_basic.go b/model_program_basic.go new file mode 100644 index 0000000..896c65e --- /dev/null +++ b/model_program_basic.go @@ -0,0 +1,18 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +type ProgramBasic struct { + Id string `json:"id,omitempty"` + Name string `json:"name,omitempty"` + Description string `json:"description,omitempty"` + Assignee string `json:"assignee,omitempty"` + Author string `json:"author,omitempty"` +} diff --git a/model_project.go b/model_project.go new file mode 100644 index 0000000..693459e --- /dev/null +++ b/model_project.go @@ -0,0 +1,72 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 搜索仓库 +type Project struct { + Id int32 `json:"id,omitempty"` + FullName string `json:"full_name,omitempty"` + HumanName string `json:"human_name,omitempty"` + Url string `json:"url,omitempty"` + Namespace *interface{} `json:"namespace,omitempty"` + Path string `json:"path,omitempty"` + Name string `json:"name,omitempty"` + Owner string `json:"owner,omitempty"` + Description string `json:"description,omitempty"` + Private string `json:"private,omitempty"` + Public string `json:"public,omitempty"` + Internal string `json:"internal,omitempty"` + Fork string `json:"fork,omitempty"` + HtmlUrl string `json:"html_url,omitempty"` + SshUrl string `json:"ssh_url,omitempty"` + ForksUrl string `json:"forks_url,omitempty"` + KeysUrl string `json:"keys_url,omitempty"` + CollaboratorsUrl string `json:"collaborators_url,omitempty"` + HooksUrl string `json:"hooks_url,omitempty"` + BranchesUrl string `json:"branches_url,omitempty"` + TagsUrl string `json:"tags_url,omitempty"` + BlobsUrl string `json:"blobs_url,omitempty"` + StargazersUrl string `json:"stargazers_url,omitempty"` + ContributorsUrl string `json:"contributors_url,omitempty"` + CommitsUrl string `json:"commits_url,omitempty"` + CommentsUrl string `json:"comments_url,omitempty"` + IssueCommentUrl string `json:"issue_comment_url,omitempty"` + IssuesUrl string `json:"issues_url,omitempty"` + PullsUrl string `json:"pulls_url,omitempty"` + MilestonesUrl string `json:"milestones_url,omitempty"` + NotificationsUrl string `json:"notifications_url,omitempty"` + LabelsUrl string `json:"labels_url,omitempty"` + ReleasesUrl string `json:"releases_url,omitempty"` + Recommend string `json:"recommend,omitempty"` + Homepage string `json:"homepage,omitempty"` + Language string `json:"language,omitempty"` + ForksCount string `json:"forks_count,omitempty"` + StargazersCount string `json:"stargazers_count,omitempty"` + WatchersCount string `json:"watchers_count,omitempty"` + DefaultBranch string `json:"default_branch,omitempty"` + OpenIssuesCount int32 `json:"open_issues_count,omitempty"` + HasIssues string `json:"has_issues,omitempty"` + HasWiki string `json:"has_wiki,omitempty"` + PullRequestsEnabled string `json:"pull_requests_enabled,omitempty"` + HasPage string `json:"has_page,omitempty"` + License string `json:"license,omitempty"` + Outsourced string `json:"outsourced,omitempty"` + ProjectCreator string `json:"project_creator,omitempty"` + Members string `json:"members,omitempty"` + PushedAt string `json:"pushed_at,omitempty"` + CreatedAt string `json:"created_at,omitempty"` + UpdatedAt string `json:"updated_at,omitempty"` + Parent *Project `json:"parent,omitempty"` + Paas string `json:"paas,omitempty"` + Stared string `json:"stared,omitempty"` + Watched string `json:"watched,omitempty"` + Permission string `json:"permission,omitempty"` + Relation string `json:"relation,omitempty"` +} diff --git a/model_project_basic.go b/model_project_basic.go new file mode 100644 index 0000000..aa36588 --- /dev/null +++ b/model_project_basic.go @@ -0,0 +1,28 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +type ProjectBasic struct { + Id int32 `json:"id,omitempty"` + FullName string `json:"full_name,omitempty"` + HumanName string `json:"human_name,omitempty"` + Url string `json:"url,omitempty"` + Namespace *interface{} `json:"namespace,omitempty"` + Path string `json:"path,omitempty"` + Name string `json:"name,omitempty"` + Owner string `json:"owner,omitempty"` + Description string `json:"description,omitempty"` + Private string `json:"private,omitempty"` + Public string `json:"public,omitempty"` + Internal string `json:"internal,omitempty"` + Fork string `json:"fork,omitempty"` + HtmlUrl string `json:"html_url,omitempty"` + SshUrl string `json:"ssh_url,omitempty"` +} diff --git a/model_project_member.go b/model_project_member.go new file mode 100644 index 0000000..71c0afb --- /dev/null +++ b/model_project_member.go @@ -0,0 +1,32 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 添加仓库成员 +type ProjectMember struct { + Id int32 `json:"id,omitempty"` + Login string `json:"login,omitempty"` + Name string `json:"name,omitempty"` + AvatarUrl string `json:"avatar_url,omitempty"` + Url string `json:"url,omitempty"` + HtmlUrl string `json:"html_url,omitempty"` + FollowersUrl string `json:"followers_url,omitempty"` + FollowingUrl string `json:"following_url,omitempty"` + GistsUrl string `json:"gists_url,omitempty"` + StarredUrl string `json:"starred_url,omitempty"` + SubscriptionsUrl string `json:"subscriptions_url,omitempty"` + OrganizationsUrl string `json:"organizations_url,omitempty"` + ReposUrl string `json:"repos_url,omitempty"` + EventsUrl string `json:"events_url,omitempty"` + ReceivedEventsUrl string `json:"received_events_url,omitempty"` + Type_ string `json:"type,omitempty"` + SiteAdmin string `json:"site_admin,omitempty"` + Permissions string `json:"permissions,omitempty"` +} diff --git a/model_project_member_permission.go b/model_project_member_permission.go new file mode 100644 index 0000000..9abc136 --- /dev/null +++ b/model_project_member_permission.go @@ -0,0 +1,32 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 查看仓库成员的权限 +type ProjectMemberPermission struct { + Id int32 `json:"id,omitempty"` + Login string `json:"login,omitempty"` + Name string `json:"name,omitempty"` + AvatarUrl string `json:"avatar_url,omitempty"` + Url string `json:"url,omitempty"` + HtmlUrl string `json:"html_url,omitempty"` + FollowersUrl string `json:"followers_url,omitempty"` + FollowingUrl string `json:"following_url,omitempty"` + GistsUrl string `json:"gists_url,omitempty"` + StarredUrl string `json:"starred_url,omitempty"` + SubscriptionsUrl string `json:"subscriptions_url,omitempty"` + OrganizationsUrl string `json:"organizations_url,omitempty"` + ReposUrl string `json:"repos_url,omitempty"` + EventsUrl string `json:"events_url,omitempty"` + ReceivedEventsUrl string `json:"received_events_url,omitempty"` + Type_ string `json:"type,omitempty"` + SiteAdmin string `json:"site_admin,omitempty"` + Permission string `json:"permission,omitempty"` +} diff --git a/model_pull_request.go b/model_pull_request.go new file mode 100644 index 0000000..bc8973e --- /dev/null +++ b/model_pull_request.go @@ -0,0 +1,44 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 取消用户测试 Pull Request +type PullRequest struct { + Id string `json:"id,omitempty"` + Url string `json:"url,omitempty"` + HtmlUrl string `json:"html_url,omitempty"` + DiffUrl string `json:"diff_url,omitempty"` + PatchUrl string `json:"patch_url,omitempty"` + IssueUrl string `json:"issue_url,omitempty"` + CommitsUrl string `json:"commits_url,omitempty"` + ReviewCommentsUrl string `json:"review_comments_url,omitempty"` + ReviewCommentUrl string `json:"review_comment_url,omitempty"` + CommentsUrl string `json:"comments_url,omitempty"` + StatusesUrl string `json:"statuses_url,omitempty"` + Number string `json:"number,omitempty"` + State string `json:"state,omitempty"` + Title string `json:"title,omitempty"` + Body string `json:"body,omitempty"` + BodyHtml string `json:"body_html,omitempty"` + Assignees []string `json:"assignees,omitempty"` + Testers []string `json:"testers,omitempty"` + Milestone *Milestone `json:"milestone,omitempty"` + Labels *Label `json:"labels,omitempty"` + Locked string `json:"locked,omitempty"` + CreatedAt string `json:"created_at,omitempty"` + UpdatedAt string `json:"updated_at,omitempty"` + ClosedAt string `json:"closed_at,omitempty"` + MergedAt string `json:"merged_at,omitempty"` + Mergeable string `json:"mergeable,omitempty"` + Head string `json:"head,omitempty"` + Base string `json:"base,omitempty"` + Links string `json:"_links,omitempty"` + User string `json:"user,omitempty"` +} diff --git a/model_pull_request_comments.go b/model_pull_request_comments.go new file mode 100644 index 0000000..56c68ce --- /dev/null +++ b/model_pull_request_comments.go @@ -0,0 +1,28 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 编辑评论 +type PullRequestComments struct { + Url string `json:"url,omitempty"` + Id string `json:"id,omitempty"` + Path string `json:"path,omitempty"` + Position string `json:"position,omitempty"` + OriginalPosition string `json:"original_position,omitempty"` + CommitId string `json:"commit_id,omitempty"` + OriginalCommitId string `json:"original_commit_id,omitempty"` + User string `json:"user,omitempty"` + Body string `json:"body,omitempty"` + CreatedAt string `json:"created_at,omitempty"` + UpdatedAt string `json:"updated_at,omitempty"` + HtmlUrl string `json:"html_url,omitempty"` + PullRequestUrl string `json:"pull_request_url,omitempty"` + Links string `json:"_links,omitempty"` +} diff --git a/model_pull_request_commits.go b/model_pull_request_commits.go new file mode 100644 index 0000000..d760607 --- /dev/null +++ b/model_pull_request_commits.go @@ -0,0 +1,22 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 获取某Pull Request的所有Commit信息。最多显示250条Commit +type PullRequestCommits struct { + Url string `json:"url,omitempty"` + Sha string `json:"sha,omitempty"` + HtmlUrl string `json:"html_url,omitempty"` + CommentsUrl string `json:"comments_url,omitempty"` + Commit string `json:"commit,omitempty"` + Author string `json:"author,omitempty"` + Committer string `json:"committer,omitempty"` + Parents string `json:"parents,omitempty"` +} diff --git a/model_pull_request_files.go b/model_pull_request_files.go new file mode 100644 index 0000000..b5c2464 --- /dev/null +++ b/model_pull_request_files.go @@ -0,0 +1,22 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// Pull Request Commit文件列表。最多显示300条diff +type PullRequestFiles struct { + Sha string `json:"sha,omitempty"` + Filename string `json:"filename,omitempty"` + Status string `json:"status,omitempty"` + Additions string `json:"additions,omitempty"` + Deletions string `json:"deletions,omitempty"` + BlobUrl string `json:"blob_url,omitempty"` + RawUrl string `json:"raw_url,omitempty"` + Patch string `json:"patch,omitempty"` +} diff --git a/model_release.go b/model_release.go new file mode 100644 index 0000000..ff507ad --- /dev/null +++ b/model_release.go @@ -0,0 +1,27 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +import ( + "time" +) + +// 更新仓库Release +type Release struct { + Id int32 `json:"id,omitempty"` + TagName string `json:"tag_name,omitempty"` + TargetCommitish string `json:"target_commitish,omitempty"` + Prerelease string `json:"prerelease,omitempty"` + Name string `json:"name,omitempty"` + Body string `json:"body,omitempty"` + Author string `json:"author,omitempty"` + CreatedAt time.Time `json:"created_at,omitempty"` + Assets string `json:"assets,omitempty"` +} diff --git a/model_repo_commit.go b/model_repo_commit.go new file mode 100644 index 0000000..540fc23 --- /dev/null +++ b/model_repo_commit.go @@ -0,0 +1,23 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 仓库的某个提交 +type RepoCommit struct { + Url string `json:"url,omitempty"` + Sha string `json:"sha,omitempty"` + HtmlUrl string `json:"html_url,omitempty"` + CommentsUrl string `json:"comments_url,omitempty"` + Commit string `json:"commit,omitempty"` + Author string `json:"author,omitempty"` + Committer string `json:"committer,omitempty"` + Parents string `json:"parents,omitempty"` + Stats string `json:"stats,omitempty"` +} diff --git a/model_ssh_key.go b/model_ssh_key.go new file mode 100644 index 0000000..b7bffb0 --- /dev/null +++ b/model_ssh_key.go @@ -0,0 +1,19 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 获取一个公钥 +type SshKey struct { + Id string `json:"id,omitempty"` + Key string `json:"key,omitempty"` + Url string `json:"url,omitempty"` + Title string `json:"title,omitempty"` + CreatedAt string `json:"created_at,omitempty"` +} diff --git a/model_ssh_key_basic.go b/model_ssh_key_basic.go new file mode 100644 index 0000000..c13ee6b --- /dev/null +++ b/model_ssh_key_basic.go @@ -0,0 +1,16 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 列出指定用户的所有公钥 +type SshKeyBasic struct { + Id string `json:"id,omitempty"` + Key string `json:"key,omitempty"` +} diff --git a/model_tag.go b/model_tag.go new file mode 100644 index 0000000..38374a6 --- /dev/null +++ b/model_tag.go @@ -0,0 +1,16 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 列出仓库所有的tags +type Tag struct { + Name string `json:"name,omitempty"` + Commit string `json:"commit,omitempty"` +} diff --git a/model_tree.go b/model_tree.go new file mode 100644 index 0000000..ca32000 --- /dev/null +++ b/model_tree.go @@ -0,0 +1,18 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 获取目录Tree +type Tree struct { + Sha string `json:"sha,omitempty"` + Url string `json:"url,omitempty"` + Tree string `json:"tree,omitempty"` + Truncated string `json:"truncated,omitempty"` +} diff --git a/model_user.go b/model_user.go new file mode 100644 index 0000000..0d3935a --- /dev/null +++ b/model_user.go @@ -0,0 +1,42 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 搜索用户 +type User struct { + Id int32 `json:"id,omitempty"` + Login string `json:"login,omitempty"` + Name string `json:"name,omitempty"` + AvatarUrl string `json:"avatar_url,omitempty"` + Url string `json:"url,omitempty"` + HtmlUrl string `json:"html_url,omitempty"` + FollowersUrl string `json:"followers_url,omitempty"` + FollowingUrl string `json:"following_url,omitempty"` + GistsUrl string `json:"gists_url,omitempty"` + StarredUrl string `json:"starred_url,omitempty"` + SubscriptionsUrl string `json:"subscriptions_url,omitempty"` + OrganizationsUrl string `json:"organizations_url,omitempty"` + ReposUrl string `json:"repos_url,omitempty"` + EventsUrl string `json:"events_url,omitempty"` + ReceivedEventsUrl string `json:"received_events_url,omitempty"` + Type_ string `json:"type,omitempty"` + SiteAdmin string `json:"site_admin,omitempty"` + Blog string `json:"blog,omitempty"` + Weibo string `json:"weibo,omitempty"` + Bio string `json:"bio,omitempty"` + PublicRepos string `json:"public_repos,omitempty"` + PublicGists string `json:"public_gists,omitempty"` + Followers string `json:"followers,omitempty"` + Following string `json:"following,omitempty"` + Stared string `json:"stared,omitempty"` + Watched string `json:"watched,omitempty"` + CreatedAt string `json:"created_at,omitempty"` + UpdatedAt string `json:"updated_at,omitempty"` +} diff --git a/model_user_basic.go b/model_user_basic.go new file mode 100644 index 0000000..f5b2de7 --- /dev/null +++ b/model_user_basic.go @@ -0,0 +1,31 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 列出一个组织的所有成员 +type UserBasic struct { + Id int32 `json:"id,omitempty"` + Login string `json:"login,omitempty"` + Name string `json:"name,omitempty"` + AvatarUrl string `json:"avatar_url,omitempty"` + Url string `json:"url,omitempty"` + HtmlUrl string `json:"html_url,omitempty"` + FollowersUrl string `json:"followers_url,omitempty"` + FollowingUrl string `json:"following_url,omitempty"` + GistsUrl string `json:"gists_url,omitempty"` + StarredUrl string `json:"starred_url,omitempty"` + SubscriptionsUrl string `json:"subscriptions_url,omitempty"` + OrganizationsUrl string `json:"organizations_url,omitempty"` + ReposUrl string `json:"repos_url,omitempty"` + EventsUrl string `json:"events_url,omitempty"` + ReceivedEventsUrl string `json:"received_events_url,omitempty"` + Type_ string `json:"type,omitempty"` + SiteAdmin string `json:"site_admin,omitempty"` +} diff --git a/model_user_message.go b/model_user_message.go new file mode 100644 index 0000000..6970690 --- /dev/null +++ b/model_user_message.go @@ -0,0 +1,22 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 获取一条私信 +type UserMessage struct { + Id int32 `json:"id,omitempty"` + // 发送者 + Sender *UserBasic `json:"sender,omitempty"` + Unread string `json:"unread,omitempty"` + Content string `json:"content,omitempty"` + UpdatedAt string `json:"updated_at,omitempty"` + Url string `json:"url,omitempty"` + HtmlUrl string `json:"html_url,omitempty"` +} diff --git a/model_user_message_list.go b/model_user_message_list.go new file mode 100644 index 0000000..88b3368 --- /dev/null +++ b/model_user_message_list.go @@ -0,0 +1,17 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 列出授权用户的所有私信 +type UserMessageList struct { + TotalCount int32 `json:"total_count,omitempty"` + // 私信列表 + List []UserMessage `json:"list,omitempty"` +} diff --git a/model_user_mini.go b/model_user_mini.go new file mode 100644 index 0000000..ba6c2b3 --- /dev/null +++ b/model_user_mini.go @@ -0,0 +1,19 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +type UserMini struct { + Id int32 `json:"id,omitempty"` + Login string `json:"login,omitempty"` + Name string `json:"name,omitempty"` + AvatarUrl string `json:"avatar_url,omitempty"` + Url string `json:"url,omitempty"` + HtmlUrl string `json:"html_url,omitempty"` +} diff --git a/model_user_notification.go b/model_user_notification.go new file mode 100644 index 0000000..e0fcc0e --- /dev/null +++ b/model_user_notification.go @@ -0,0 +1,29 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 获取一条通知 +type UserNotification struct { + Id int32 `json:"id,omitempty"` + Content string `json:"content,omitempty"` + Type_ string `json:"type,omitempty"` + Unread string `json:"unread,omitempty"` + Mute string `json:"mute,omitempty"` + UpdatedAt string `json:"updated_at,omitempty"` + Url string `json:"url,omitempty"` + HtmlUrl string `json:"html_url,omitempty"` + // 通知发送者 + Actor *UserBasic `json:"actor,omitempty"` + Repository *ProjectBasic `json:"repository,omitempty"` + // 通知直接关联对象 + Subject *UserNotificationSubject `json:"subject,omitempty"` + // 通知次级关联对象 + Namespaces []UserNotificationNamespace `json:"namespaces,omitempty"` +} diff --git a/model_user_notification_count.go b/model_user_notification_count.go new file mode 100644 index 0000000..8b98fbf --- /dev/null +++ b/model_user_notification_count.go @@ -0,0 +1,20 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 获取授权用户的通知数 +type UserNotificationCount struct { + // 通知总数 + TotalCount int32 `json:"total_count,omitempty"` + // 通知数量 + NotificationCount int32 `json:"notification_count,omitempty"` + // 私信数量 + MessageCount int32 `json:"message_count,omitempty"` +} diff --git a/model_user_notification_list.go b/model_user_notification_list.go new file mode 100644 index 0000000..f913dd4 --- /dev/null +++ b/model_user_notification_list.go @@ -0,0 +1,17 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 列出授权用户的所有通知 +type UserNotificationList struct { + TotalCount int32 `json:"total_count,omitempty"` + // 通知列表 + List []UserNotification `json:"list,omitempty"` +} diff --git a/model_user_notification_namespace.go b/model_user_notification_namespace.go new file mode 100644 index 0000000..e395e17 --- /dev/null +++ b/model_user_notification_namespace.go @@ -0,0 +1,16 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +type UserNotificationNamespace struct { + Name string `json:"name,omitempty"` + HtmlUrl string `json:"html_url,omitempty"` + Type_ string `json:"type,omitempty"` +} diff --git a/model_user_notification_subject.go b/model_user_notification_subject.go new file mode 100644 index 0000000..d9fedcf --- /dev/null +++ b/model_user_notification_subject.go @@ -0,0 +1,17 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +type UserNotificationSubject struct { + Title string `json:"title,omitempty"` + Url string `json:"url,omitempty"` + LatestCommentUrl string `json:"latest_comment_url,omitempty"` + Type_ string `json:"type,omitempty"` +} diff --git a/model_week_report.go b/model_week_report.go new file mode 100644 index 0000000..d97fd20 --- /dev/null +++ b/model_week_report.go @@ -0,0 +1,25 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +// 新建周报 +type WeekReport struct { + Id int32 `json:"id,omitempty"` + Content string `json:"content,omitempty"` + ContentHtml string `json:"content_html,omitempty"` + Year string `json:"year,omitempty"` + Month string `json:"month,omitempty"` + WeekIndex string `json:"week_index,omitempty"` + WeekBegin string `json:"week_begin,omitempty"` + WeekEnd string `json:"week_end,omitempty"` + CreatedAt string `json:"created_at,omitempty"` + UpdatedAt string `json:"updated_at,omitempty"` + User *UserMini `json:"user,omitempty"` +} diff --git a/response.go b/response.go new file mode 100644 index 0000000..c501f2a --- /dev/null +++ b/response.go @@ -0,0 +1,43 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +import ( + "net/http" +) + +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the swagger operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +}